/* ========== CSS DESIGN SYSTEM — "Midnight Emerald" ========== */
:root {
    --primary: #0D9488;
    --primary-light: #2DD4BF;
    --primary-dark: #0F766E;
    --primary-bg: #F0FDFA;
    --success: #16A34A;
    --success-light: #DCFCE7;
    --success-dark: #166534;
    --warning: #D97706;
    --warning-light: #FEF3C7;
    --warning-dark: #92400E;
    --danger: #DC2626;
    --danger-light: #FEE2E2;
    --danger-dark: #991B1B;
    --info: #2563EB;
    --info-light: #DBEAFE;
    --bg: #F3F4F6;
    --surface: #FFFFFF;
    --surface-alt: #F9FAFB;
    --text-primary: #111827;
    --text-secondary: #4B5563;
    --text-muted: #9CA3AF;
    --border: #E5E7EB;
    --border-light: #F3F4F6;

    /* Sidebar (dark) */
    --sidebar-bg: linear-gradient(195deg, #0B1220 0%, #111C2E 100%);
    --sidebar-text: #CBD5E1;
    --sidebar-text-muted: #64748B;
    --sidebar-border: rgba(255,255,255,0.07);
    --sidebar-hover-bg: rgba(255,255,255,0.06);
    --sidebar-active: linear-gradient(135deg, #14B8A6 0%, #0D9488 100%);

    --shadow-sm: 0 1px 2px rgba(15,23,42,0.05);
    --shadow: 0 1px 3px rgba(15,23,42,0.08), 0 1px 2px rgba(15,23,42,0.05);
    --shadow-md: 0 6px 16px -4px rgba(15,23,42,0.12), 0 3px 6px -3px rgba(15,23,42,0.08);
    --shadow-lg: 0 20px 32px -8px rgba(15,23,42,0.16), 0 6px 12px -6px rgba(15,23,42,0.1);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --sidebar-w: 264px;
    --topbar-h: 68px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

html { scroll-behavior: smooth; }

::selection { background: var(--primary-light); color: #06342F; }

/* Slim, pro-feeling scrollbars (WebKit) */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.4); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.65); }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "tnum" 1, "cv11" 1;
}

a { color: inherit; }

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ========== SIDEBAR LAYOUT ========== */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
}

.sidebar-brand {
    padding: 24px;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand img { width: 42px; height: 42px; border-radius: var(--radius); object-fit: contain; background: #fff; padding: 3px; }

.sidebar-brand-text h2 { font-size: 16px; color: #fff; font-weight: 700; letter-spacing: -0.2px; }
.sidebar-brand-text span { font-size: 12px; color: var(--sidebar-text-muted); }

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }

.sidebar-nav .nav-section { font-size: 11px; font-weight: 600; color: var(--sidebar-text-muted); text-transform: uppercase; letter-spacing: 1px; padding: 16px 12px 8px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 2px;
}

.nav-item:hover { background: var(--sidebar-hover-bg); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; box-shadow: 0 4px 12px rgba(13,148,136,0.35); }
.nav-item i { width: 20px; text-align: center; font-size: 16px; }
.nav-item .nav-badge { margin-left: auto; background: var(--primary-light); color: #06342F; font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 700; }
.nav-item.active .nav-badge { background: rgba(255,255,255,0.3); color: #fff; }

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--sidebar-border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius);
    text-decoration: none;
}

.sidebar-user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--sidebar-active);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info strong { display: block; font-size: 13px; color: #fff; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-info span { font-size: 11px; color: var(--sidebar-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

.sidebar-user .btn-ghost { color: var(--sidebar-text); }
.sidebar-user .btn-ghost:hover { background: var(--sidebar-hover-bg); color: #fff; }

/* ========== MAIN CONTENT ========== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-h);
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-left h1 { font-size: 20px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.3px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
}

.content-area {
    flex: 1;
    padding: 28px;
    max-width: 1400px;
    width: 100%;
}

/* ========== PAGE HEADER ========== */
.page-header {
    margin-bottom: 28px;
}

.page-header h2 {
    font-size: clamp(20px, 2.4vw, 24px);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}

.page-header p { color: var(--text-muted); font-size: 14px; }

/* ========== CARDS ========== */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 24px;
    transition: all var(--transition);
}

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

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

.card-header h3 { font-size: 16px; font-weight: 600; color: var(--text-primary); }

/* Stat Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

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

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

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

.stat-icon.primary { background: linear-gradient(135deg, var(--primary-bg), #CCFBF1); color: var(--primary-dark); }
.stat-icon.success { background: linear-gradient(135deg, var(--success-light), #BBF7D0); color: var(--success-dark); }
.stat-icon.warning { background: linear-gradient(135deg, var(--warning-light), #FDE68A); color: var(--warning-dark); }
.stat-icon.danger { background: linear-gradient(135deg, var(--danger-light), #FECACA); color: var(--danger-dark); }
.stat-icon.info { background: linear-gradient(135deg, var(--info-light), #BFDBFE); color: #1E3A8A; }

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

.stat-label { font-size: 13px; color: var(--text-muted); font-weight: 500; margin-bottom: 4px; }

.stat-value { font-size: clamp(22px, 2.6vw, 28px); font-weight: 700; color: var(--text-primary); line-height: 1.2; letter-spacing: -0.3px; font-variant-numeric: tabular-nums; }

.stat-change { font-size: 12px; margin-top: 4px; font-weight: 500; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

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

/* ========== ALERTS ========== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    border-left: 4px solid transparent;
    animation: alertIn 0.25s ease-out;
}

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

.alert-error { background: var(--danger-light); color: var(--danger-dark); border-left-color: var(--danger); }
.alert-success { background: var(--success-light); color: var(--success-dark); border-left-color: var(--success); }
.alert-info { background: var(--info-light); color: #1E40AF; border-left-color: var(--info); }
.alert-warning { background: var(--warning-light); color: var(--warning-dark); border-left-color: var(--warning); }

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
    font-family: inherit;
}

.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(13,148,136,0.35); }

.btn-success { background: linear-gradient(135deg, var(--success), var(--success-dark)); color: #fff; }
.btn-success:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(22,163,74,0.35); }

.btn-danger { background: linear-gradient(135deg, var(--danger), var(--danger-dark)); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(220,38,38,0.35); }

.btn-warning { background: linear-gradient(135deg, var(--warning), var(--warning-dark)); color: #fff; }
.btn-warning:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(217,119,6,0.35); }

.btn-outline {
    background: transparent; color: var(--primary); border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg); color: var(--text-primary); }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 50%; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn:active { transform: translateY(0) scale(0.98); }

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

/* ========== FORMS ========== */
.form-group { margin-bottom: 20px; }

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

.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--surface);
    transition: all var(--transition);
    font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13,148,136,0.12);
}

.form-input::placeholder { color: var(--text-muted); }
.form-input.error { border-color: var(--danger); }

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

.form-select { 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='%234B5563' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 560px;
    box-shadow: var(--shadow);
}

/* ========== FILTER BAR ========== */
.filter-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
}

.filter-bar .form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }

.filter-field { display: flex; flex-direction: column; gap: 4px; }
.filter-field label { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.filter-field input, .filter-field select { padding: 8px 12px; font-size: 13px; }

.filter-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
}

/* ========== TABLES ========== */
.table-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
    flex-wrap: wrap;
}

.table-search {
    position: relative;
    max-width: 300px;
}

.table-search input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    transition: all var(--transition);
}

.table-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,148,136,0.12); }

.table-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 14px; }

.table-responsive { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead { background: var(--surface-alt); }
.data-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table tbody td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
}

.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: var(--surface-alt); }
.data-table tbody tr:last-child td { border-bottom: none; }

.data-table .text-right { text-align: right; }
.data-table .text-center { text-align: center; }

.data-table .month-header td {
    background: var(--primary-bg);
    font-weight: 700;
    color: var(--primary-dark);
    padding: 12px 16px;
    font-size: 13px;
    border-top: 2px solid var(--primary-light);
}

.data-table .amount { font-weight: 600; font-variant-numeric: tabular-nums; }
.data-table .amount.credit { color: var(--success); }
.data-table .amount.debit { color: var(--danger); }

.data-table .total-row td {
    font-weight: 700;
    background: var(--surface-alt);
    border-top: 2px solid var(--border);
}

.data-table .grand-total td {
    font-weight: 700;
    color: #fff;
    border-top: 2px solid var(--border);
}

/* ========== BADGES ========== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: var(--success-light); color: var(--success-dark); }
.badge-danger { background: var(--danger-light); color: var(--danger-dark); }
.badge-warning { background: var(--warning-light); color: var(--warning-dark); }
.badge-info { background: var(--info-light); color: #1E40AF; }
.badge-primary { background: var(--primary-bg); color: var(--primary-dark); }
.badge-neutral { background: var(--border-light); color: var(--text-secondary); }

/* ========== PAGINATION ========== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 16px;
    border-top: 1px solid var(--border);
}

.pagination .page-btn {
    width: 36px; height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.pagination .page-btn:hover { background: var(--primary-bg); color: var(--primary-dark); border-color: var(--primary); }
.pagination .page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-bg), var(--border-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    color: var(--primary-light);
}

.empty-state h3 { font-size: 18px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 14px; margin-bottom: 20px; }

/* ========== MODAL ========== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(11,18,32,0.65);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-overlay.show { display: flex; }

.modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 40px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-icon {
    width: 72px; height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
    color: #fff;
    animation: scaleIn 0.4s ease-out 0.15s backwards;
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.modal-icon.success { background: linear-gradient(135deg, var(--success), var(--success-dark)); }
.modal-icon.danger { background: linear-gradient(135deg, var(--danger), var(--danger-dark)); }
.modal-icon.warning { background: linear-gradient(135deg, var(--warning), var(--warning-dark)); }

.modal h3 { font-size: 22px; color: var(--text-primary); margin-bottom: 8px; }
.modal p { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; }
.modal .amount-display { font-size: 36px; font-weight: 700; margin-bottom: 28px; font-variant-numeric: tabular-nums; }

.modal-actions { display: flex; gap: 12px; }
.modal-actions .btn { flex: 1; }

/* ========== TABS ========== */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.tab-btn {
    flex: 1;
    padding: 14px 20px;
    background: var(--surface);
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    border-right: 1px solid var(--border);
}

.tab-btn:last-child { border-right: none; }
.tab-btn:hover { background: var(--surface-alt); color: var(--text-primary); }
.tab-btn.active { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; }

.tab-content { display: none; animation: fadeSlideIn 0.3s ease; }
.tab-content.active { display: block; }

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

/* ========== AUTH PAGES ========== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #0B1220 0%, #0F766E 55%, #14B8A6 100%);
    position: relative;
    overflow: hidden;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.07) 0%, transparent 70%);
    animation: bgPulse 8s ease-in-out infinite;
}

@keyframes bgPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.auth-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.35);
    width: 100%;
    max-width: 420px;
    padding: 44px 40px;
    position: relative;
    z-index: 1;
}

.auth-header { text-align: center; margin-bottom: 32px; }

.auth-icon {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, var(--primary-bg), #CCFBF1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
    color: var(--primary-dark);
}

.auth-header h1 { font-size: 24px; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.3px; }
.auth-header p { font-size: 14px; color: var(--text-muted); }

.auth-form .form-group { margin-bottom: 18px; }

.auth-form .btn-submit {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.auth-form .btn-submit:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(13,148,136,0.4);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-footer a { color: var(--primary-dark); font-weight: 600; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

/* ========== PROTECTED PAGE LAYOUT (no sidebar) ========== */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px;
    min-height: 100vh;
}

.page-topbar {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .main-content { margin-left: 0; }
    .mobile-menu-btn { display: block; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .content-area { padding: 20px; }
}

@media (max-width: 768px) {
    .stats-grid { grid-template-columns: 1fr; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .content-area { padding: 16px; }
    .page-container { padding: 16px; }
    .form-card { max-width: 100%; }
    .tabs { flex-direction: column; }
    .tab-btn { border-right: none; border-bottom: 1px solid var(--border); }
    .tab-btn:last-child { border-bottom: none; }
    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: 10px 12px; }
    .topbar { padding: 0 16px; }
    .topbar-left h1 { font-size: 16px; }
    .btn-group { flex-direction: column; }
    .btn-group .btn { width: 100%; }
    .auth-card { padding: 32px 24px; }
}

@media (max-width: 480px) {
    .stat-card { padding: 16px; }
    .auth-card { margin: 0 12px; padding: 28px 20px; }
    .modal { padding: 28px 20px; }
}

/* ========== UTILITIES ========== */
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

/* ========== SKELETON LOADER ========== */
.skeleton {
    background: linear-gradient(90deg, var(--border) 25%, var(--border-light) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text { height: 16px; width: 80%; margin-bottom: 8px; }
.skeleton-title { height: 24px; width: 60%; margin-bottom: 12px; }
.skeleton-card { height: 100px; }

/* ========== TOAST ========== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.3s ease-out;
    min-width: 300px;
    max-width: 420px;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--info); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

/* ========== SIDEBAR OVERLAY ========== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(11,18,32,0.5);
    z-index: 99;
}

.sidebar-overlay.show { display: block; }
