/* Premium Corporate Theme - GoldenIK */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

html[data-bs-theme="dark"] {
    --secondary-color: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --border-color: #334155;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.5);
    --shadow-hover: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -2px rgba(0,0,0,0.3);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .navbar-brand {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Cards & Containers */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Buttons */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all 0.2s;
    letter-spacing: 0.01em;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* Base Form Inputs */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.1);
}

.input-group-text {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    background-color: var(--secondary-color);
}

/* Tables */
.table {
    vertical-align: middle;
}
.table thead th {
    border-bottom-width: 1px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding-top: 1rem;
    padding-bottom: 1rem;
}
.table tbody tr {
    transition: background-color 0.15s;
}
.table tbody tr:hover {
    background-color: var(--secondary-color);
}

/* Badges */
.badge {
    padding: 0.4em 0.8em;
    border-radius: 6px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Layout Specific */
.page {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 10;
}

main {
    flex-grow: 1;
    margin-left: 260px;
}

.top-bar {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 2rem;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 5;
}

.content {
    padding: 2rem;
}

/* Nav Menu Styling */
.nav-link {
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.8rem 1rem;
    margin: 0.25rem 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.nav-link i {
    font-size: 1.25rem;
    margin-right: 0.75rem;
    transition: transform 0.2s;
}

.nav-link:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

.nav-link:hover i {
    transform: scale(1.1);
}

.nav-link.active {
    background-color: rgba(37, 99, 235, 0.08) !important;
    color: var(--primary-color) !important;
    font-weight: 600;
}

/* Responsive Mobile Handling */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }
    
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 15px rgba(0,0,0,0.2);
    }
    
    main {
        margin-left: 0;
    }
    
    .content {
        padding: 1rem;
    }
}

/* ====== DYNAMIC THEME OVERRIDES ====== */
html[data-bs-theme="light"] .bg-dark {
    background-color: #f8f9fa !important;
}
html[data-bs-theme="light"] .bg-secondary {
    background-color: #e9ecef !important;
}
html[data-bs-theme="light"] .text-white, 
html[data-bs-theme="light"] .text-light {
    color: #212529 !important;
}
html[data-bs-theme="light"] .border-secondary {
    border-color: #dee2e6 !important;
}
html[data-bs-theme="light"] .table-dark {
    --bs-table-bg: #ffffff;
    --bs-table-color: #212529;
    --bs-table-border-color: #dee2e6;
    --bs-table-striped-bg: #f8f9fa;
    --bs-table-hover-bg: #e9ecef;
    color: #212529;
    border-color: #dee2e6;
}
html[data-bs-theme="light"] .table-dark th {
    color: #495057;
}
html[data-bs-theme="light"] .card {
    background-color: #ffffff !important;
}
html[data-bs-theme="light"] .sidebar {
    background-color: #ffffff !important;
}
html[data-bs-theme="light"] main .top-row,
html[data-bs-theme="light"] article.content {
    background-color: #f1f5f9 !important;
    color: #212529 !important;
}
html[data-bs-theme="light"] .modal-content {
    background-color: #ffffff !important;
    color: #212529 !important;
}
html[data-bs-theme="light"] input.bg-secondary, 
html[data-bs-theme="light"] select.bg-secondary, 
html[data-bs-theme="light"] textarea.bg-secondary {
    background-color: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #ced4da !important;
}

html[data-bs-theme="dark"] .table {
    --bs-table-color: #e2e8f0;
    --bs-table-bg: transparent;
}
html[data-bs-theme="dark"] .table-dark tbody tr {
    background-color: transparent;
}
html[data-bs-theme="dark"] .table-dark tbody tr td, 
html[data-bs-theme="dark"] .table-dark tbody tr th {
    background-color: transparent;
    color: #f8f9fa;
}
html[data-bs-theme="dark"] .table-active {
    --bs-table-accent-bg: rgba(255, 255, 255, 0.1) !important;
}