/*
 * LOFZ ERP — Design System
 * 
 * Palette derived from logo: Blue #3B82F6 → Purple #6366F1
 * Mobile-first, dark mode ready, accessible.
 * Self-hosted fonts (Inter via Google Fonts downloaded locally).
 */

/* ─── CSS Custom Properties ───────────────────────────────────────── */
:root {
    /* Primary palette (from logo) */
    --primary-50:  #EFF6FF;
    --primary-100: #DBEAFE;
    --primary-200: #BFDBFE;
    --primary-300: #93C5FD;
    --primary-400: #60A5FA;
    --primary-500: #3B82F6;
    --primary-600: #2563EB;
    --primary-700: #1D4ED8;
    --primary-800: #1E40AF;
    --primary-900: #1E3A8A;

    /* Accent (purple from logo) */
    --accent-400: #818CF8;
    --accent-500: #6366F1;
    --accent-600: #4F46E5;
    --accent-700: #4338CA;

    /* Neutrals */
    --gray-50:  #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    /* Semantic */
    --success-500: #22C55E;
    --success-100: #DCFCE7;
    --warning-500: #F59E0B;
    --warning-100: #FEF3C7;
    --danger-500:  #EF4444;
    --danger-100:  #FEE2E2;
    --info-500:    #06B6D4;
    --info-100:    #CFFAFE;

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --header-height: 64px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration: 200ms;

    /* Light mode defaults */
    --bg-body: #F0F2F5;
    --bg-surface: #FFFFFF;
    --bg-surface-hover: #F9FAFB;
    --bg-sidebar: #FFFFFF;
    --bg-header: rgba(255,255,255,0.85);
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;
    --border-color: #E5E7EB;
    --border-light: #F3F4F6;
}

/* ─── Dark Mode ──────────────────────────────────────────────────── */
[data-theme="dark"] {
    --bg-body: #0F1117;
    --bg-surface: #1A1D27;
    --bg-surface-hover: #242736;
    --bg-sidebar: #151821;
    --bg-header: rgba(21,24,33,0.9);
    --text-primary: #F3F4F6;
    --text-secondary: #9CA3AF;
    --text-tertiary: #6B7280;
    --border-color: #2D3348;
    --border-light: #1F2335;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.35);
}

/* ─── Reset & Base ───────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary-500);
    text-decoration: none;
    transition: color var(--duration) var(--ease);
}
a:hover { color: var(--primary-600); }

img { max-width: 100%; height: auto; display: block; }

/* ─── Typography ─────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.15rem; }
.text-muted { color: var(--text-secondary); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* ─── App Layout ─────────────────────────────────────────────────── */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s var(--ease), width 0.3s var(--ease);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    min-height: var(--header-height);
}

.sidebar-brand img {
    height: 36px;
    width: auto;
    border-radius: var(--radius-sm);
}

.sidebar-brand .brand-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-brand .brand-sub {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    display: block;
    margin-top: -2px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
}

.nav-section-title {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    padding: 16px 20px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 0;
    margin: 1px 0;
    transition: all var(--duration) var(--ease);
    cursor: pointer;
    position: relative;
}

.nav-item:hover {
    background: var(--primary-50);
    color: var(--primary-600);
}

[data-theme="dark"] .nav-item:hover {
    background: rgba(59,130,246,0.08);
    color: var(--primary-400);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
    color: #fff;
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background: #fff;
    border-radius: 0 3px 3px 0;
}

.nav-item .nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-item.active .nav-icon {
    opacity: 1;
}

.nav-badge {
    margin-left: auto;
    background: var(--danger-500);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 99px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    font-size: 0.72rem;
    color: var(--text-tertiary);
}

.sidebar-footer a {
    color: var(--text-tertiary);
}
.sidebar-footer a:hover {
    color: var(--primary-500);
}

/* ─── Main Content ───────────────────────────────────────────────── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s var(--ease);
}

/* ─── Header ─────────────────────────────────────────────────────── */
.header {
    height: var(--header-height);
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-title {
    font-size: 1.15rem;
    font-weight: 600;
}

.btn-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}
.btn-menu-toggle:hover {
    background: var(--gray-100);
}

/* ─── Page Content ───────────────────────────────────────────────── */
.page-content {
    flex: 1;
    padding: 24px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.breadcrumb a { color: var(--text-tertiary); }
.breadcrumb a:hover { color: var(--primary-500); }
.breadcrumb .sep { opacity: 0.5; }

/* ─── Cards ──────────────────────────────────────────────────────── */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow var(--duration) var(--ease);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-surface-hover);
}

/* ─── Stat Cards ─────────────────────────────────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all var(--duration) var(--ease);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    opacity: 0.06;
    transform: translate(20px, -20px);
}

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

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-card .stat-icon.blue {
    background: var(--primary-100);
    color: var(--primary-600);
}
[data-theme="dark"] .stat-card .stat-icon.blue {
    background: rgba(59,130,246,0.15);
    color: var(--primary-400);
}
.stat-card::after { background: var(--primary-500); }

.stat-card .stat-icon.green {
    background: var(--success-100);
    color: var(--success-500);
}
.stat-card .stat-icon.orange {
    background: var(--warning-100);
    color: var(--warning-500);
}
.stat-card .stat-icon.purple {
    background: rgba(99,102,241,0.1);
    color: var(--accent-500);
}
.stat-card .stat-icon.red {
    background: var(--danger-100);
    color: var(--danger-500);
}
.stat-card .stat-icon.cyan {
    background: var(--info-100);
    color: var(--info-500);
}

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-sub {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.stat-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border-light);
}
.stat-progress-bar {
    height: 100%;
    border-radius: 0 3px 0 0;
    transition: width 1s var(--ease);
}

/* ─── Grid Layouts ───────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ─── Tables ─────────────────────────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

table th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    background: var(--bg-surface-hover);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

table tbody tr:hover {
    background: var(--bg-surface-hover);
}

/* ─── Buttons ────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
    color: #fff;
    box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}
.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(59,130,246,0.4);
    transform: translateY(-1px);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: var(--bg-surface-hover);
    border-color: var(--primary-300);
}

.btn-danger {
    background: var(--danger-500);
    color: #fff;
}

.btn-success {
    background: var(--success-500);
    color: #fff;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn-group {
    display: flex;
    gap: 8px;
}

/* ─── Forms ──────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--duration) var(--ease);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

.form-control::placeholder {
    color: var(--text-tertiary);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-text {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.form-error {
    font-size: 0.78rem;
    color: var(--danger-500);
    margin-top: 4px;
}

/* ─── Badges ─────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 99px;
    white-space: nowrap;
}

.badge-primary { background: var(--primary-100); color: var(--primary-700); }
.badge-success { background: var(--success-100); color: #166534; }
.badge-warning { background: var(--warning-100); color: #92400E; }
.badge-danger  { background: var(--danger-100);  color: #991B1B; }
.badge-info    { background: var(--info-100);    color: #0E7490; }
.badge-gray    { background: var(--gray-100);    color: var(--gray-600); }

/* ─── Alerts ─────────────────────────────────────────────────────── */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: slideDown 0.3s var(--ease);
}

.alert-success { background: var(--success-100); color: #166534; border-left: 4px solid var(--success-500); }
.alert-error   { background: var(--danger-100);  color: #991B1B; border-left: 4px solid var(--danger-500); }
.alert-warning { background: var(--warning-100); color: #92400E; border-left: 4px solid var(--warning-500); }
.alert-info    { background: var(--info-100);    color: #0E7490; border-left: 4px solid var(--info-500); }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Avatar ─────────────────────────────────────────────────────── */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary-400), var(--accent-500));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.avatar-sm { width: 28px; height: 28px; font-size: 0.72rem; }
.avatar-lg { width: 48px; height: 48px; font-size: 1.1rem; }
.avatar-xl { width: 64px; height: 64px; font-size: 1.3rem; }

/* ─── Notice / Event List ────────────────────────────────────────── */
.notice-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}
.notice-item:last-child { border-bottom: none; }

.notice-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}
.notice-dot.general { background: var(--primary-500); }
.notice-dot.urgent  { background: var(--danger-500); }
.notice-dot.event   { background: var(--success-500); }
.notice-dot.holiday { background: var(--warning-500); }
.notice-dot.exam    { background: var(--accent-500); }

.notice-title {
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 2px;
}
.notice-meta {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ─── Payment Row ────────────────────────────────────────────────── */
.payment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}
.payment-item:last-child { border-bottom: none; }

.payment-amount {
    font-weight: 700;
    color: var(--success-500);
}

/* ─── Empty State ────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
}
.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.5;
}
.empty-state-text {
    font-size: 0.9rem;
}

/* ─── Dropdown ───────────────────────────────────────────────────── */
.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    padding: 6px 0;
    z-index: 200;
    display: none;
    animation: fadeIn 0.15s var(--ease);
}
.dropdown.open .dropdown-menu { display: block; }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
}
.dropdown-item:hover {
    background: var(--bg-surface-hover);
}
.dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 0;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Modal ──────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideUp 0.3s var(--ease);
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ─── Tooltip ────────────────────────────────────────────────────── */
[data-tooltip] {
    position: relative;
}
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-800);
    color: #fff;
    font-size: 0.72rem;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}
[data-tooltip]:hover::after {
    opacity: 1;
}

/* ─── Scrollbar ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: var(--gray-600); }

/* ─── Login Page ─────────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #0F172A 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(59,130,246,0.12) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(99,102,241,0.08) 0%, transparent 50%);
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-5%, 5%); }
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-xl);
    padding: 40px;
    position: relative;
    z-index: 1;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo img {
    height: 48px;
    margin: 0 auto 12px;
}

.login-logo h1 {
    font-size: 1.4rem;
    color: #fff;
    font-weight: 700;
}

.login-logo p {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    margin-top: 4px;
}

.login-card .form-control {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.12);
    color: #fff;
}

.login-card .form-control:focus {
    border-color: var(--primary-400);
    background: rgba(255,255,255,0.1);
}

.login-card .form-control::placeholder {
    color: rgba(255,255,255,0.35);
}

.login-card .form-label {
    color: rgba(255,255,255,0.7);
}

.login-card .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.3);
}

.login-footer a {
    color: var(--primary-400);
}

/* ─── Utility ────────────────────────────────────────────────────── */
.d-flex { display: flex; }
.d-grid { display: grid; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.p-0 { padding: 0; }
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .btn-menu-toggle {
        display: flex;
    }

    .stat-grid {
        grid-template-columns: 1fr 1fr;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .page-content {
        padding: 16px;
    }

    .header {
        padding: 0 16px;
    }

    .login-card {
        margin: 16px;
        padding: 28px;
    }
}

@media (max-width: 480px) {
    .stat-grid {
        grid-template-columns: 1fr;
    }
    html {
        font-size: 14px;
    }
}

/* ─── Print ──────────────────────────────────────────────────────── */
@media print {
    .sidebar, .header, .btn-menu-toggle { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .page-content { padding: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}
