/* ============================================================
   MCZ Finance System — Unified Stylesheet
   Brand: #C63E1B (MCZ Red)
   Fonts: Space Grotesk (headings/body) + JetBrains Mono (numbers)
   Load these in your <head> before this stylesheet:
     <link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
     <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" rel="stylesheet">
   ============================================================ */

/* ── CSS Variables ── */
:root {
    /* Brand */
    --brand:        #C63E1B;
    --brand-dark:   #a52a15;
    --brand-light:  #f9ede9;
    --brand-glow:   rgba(198,62,27,0.12);
    --brand-subtle: rgba(198,62,27,0.06);

    /* Semantic */
    --success:      #059669;
    --success-light:#d1fae5;
    --success-border:#6ee7b7;
    --danger:       #dc2626;
    --danger-light: #fee2e2;
    --danger-border:#fca5a5;
    --warning:      #d97706;
    --warning-light:#fef3c7;
    --warning-border:#fcd34d;
    --info:         #2563eb;
    --info-light:   #dbeafe;
    --info-border:  #93c5fd;

    /* Layout */
    --sidebar-w:    230px;
    --header-h:     68px;

    /* Neutrals */
    --gray-1:       #f5f6fa;
    --gray-2:       #e8e9ed;
    --gray-3:       #b0b3c0;
    --gray-4:       #6b7280;
    --gray-5:       #9ca3af;
    --text:         #1f2937;
    --text-light:   #6b7280;
    --text-muted:   #9ca3af;
    --white:        #ffffff;

    /* Effects */
    --shadow-xs:    0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm:    0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:    0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg:    0 10px 30px rgba(0,0,0,0.10);
    --shadow-brand: 0 4px 14px rgba(198,62,27,0.18);

    /* Shape */
    --radius:       10px;
    --radius-sm:    6px;
    --radius-lg:    14px;
    --transition:   0.22s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Space Grotesk', 'Segoe UI', Arial, sans-serif;
    background: var(--gray-1);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--brand-dark); }

img { max-width: 100%; display: block; }

/* ── Typography ── */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.3; }
.mono { font-family: 'JetBrains Mono', monospace; }

/* ── HEADER ── */
header {
    background: var(--brand);
    color: var(--white);
    height: var(--header-h);
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

.header-logo {
    height: 44px; width: 44px;
    object-fit: contain;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    padding: 3px;
    flex-shrink: 0;
}

.header-title {
    flex: 1;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

header nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: flex-end;
}

header nav ul li a {
    color: rgba(255,255,255,0.9);
    font-size: 13px;
    font-weight: 600;
    padding: 7px 11px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
    white-space: nowrap;
    display: block;
}

header nav ul li a:hover {
    background: rgba(255,255,255,0.18);
    text-decoration: none;
    color: var(--white);
}

/* Hamburger — desktop: hidden, mobile: shown */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 6px;
    margin-left: auto;
    order: 10;
    flex-shrink: 0;
    z-index: 1001;
}
.hamburger span {
    display: block;
    width: 24px; height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: var(--transition);
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ── SIDEBAR ── */
aside {
    width: var(--sidebar-w);
    height: 100vh;
    position: fixed;
    top: var(--header-h);
    left: 0;
    background: var(--white);
    border-right: 1px solid var(--gray-2);
    overflow-y: auto;
    z-index: 900;
    padding: 20px 12px 80px;
    transition: transform var(--transition);
    /* Hidden on desktop by default */
    display: none;
}

aside h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-3);
    padding: 0 8px;
    margin-bottom: 10px;
}

aside ul { list-style: none; }
aside ul li { margin: 2px 0; }

aside ul li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
    text-decoration: none;
}

aside ul li a:hover,
aside ul li a.active {
    background: var(--brand-light);
    color: var(--brand);
    text-decoration: none;
}

aside hr {
    border: none;
    border-top: 1px solid var(--gray-2);
    margin: 10px 0;
}

/* ── MAIN CONTENT ── */
.page-container {
    margin-left: 0; /* No sidebar on desktop */
    margin-top: var(--header-h);
    padding: 28px 28px 80px;
    min-height: calc(100vh - var(--header-h));
}

.page-container h2 {
    color: var(--brand);
    font-size: 22px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gray-2);
}

/* ── LEGACY CARDS (kept for other pages) ── */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 22px 20px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--brand);
    text-align: center;
    transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.card h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.card p {
    font-size: 26px;
    font-weight: 700;
    color: var(--brand);
    font-family: 'JetBrains Mono', monospace;
}

/* ══════════════════════════════════════════
   DASHBOARD WIDGETS
   ══════════════════════════════════════════ */

/* ── Welcome ── */
.welcome { margin-bottom: 28px; }
.welcome h1 {
    font-size: 1.85rem; font-weight: 700;
    color: var(--text); letter-spacing: -0.3px;
}
.welcome p { color: var(--text-light); font-size: .92rem; margin-top: 3px; }
.welcome .badges { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Pills / Badges ── */
.pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 13px; border-radius: 20px;
    font-size: .74rem; font-weight: 600; border: 1px solid;
}
.pill-brand  { background: var(--brand-light); color: var(--brand); border-color: var(--brand-glow); }
.pill-info   { background: var(--info-light); color: var(--info); border-color: var(--info-border); }
.pill-success{ background: var(--success-light); color: var(--success); border-color: var(--success-border); }
.pill-warning{ background: var(--warning-light); color: var(--warning); border-color: var(--warning-border); }
.pill-danger { background: var(--danger-light); color: var(--danger); border-color: var(--danger-border); }

/* ── Currency Tags ── */
.curr-tag {
    font-size: .64rem; padding: 2px 8px; border-radius: 4px;
    font-weight: 700; letter-spacing: .3px;
}
.tag-usd  { background: var(--info-light); color: var(--info); }
.tag-rtgs { background: var(--warning-light); color: var(--warning); }

/* ── Stat Cards ── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px; margin-bottom: 28px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--gray-2);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    animation: fadeUp .5s ease both;
    position: relative;
    overflow: hidden;
}
.stat-card:nth-child(1){animation-delay:.04s}
.stat-card:nth-child(2){animation-delay:.08s}
.stat-card:nth-child(3){animation-delay:.12s}
.stat-card:nth-child(4){animation-delay:.16s}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--gray-3);
    transform: translateY(-2px);
}

/* Card glow accent (top-right decorative circle) */
.stat-card .sc-glow {
    position: absolute; top: -25px; right: -25px;
    width: 90px; height: 90px; border-radius: 50%;
    filter: blur(35px); opacity: .18; pointer-events: none;
}

.stat-card .sc-icon {
    width: 42px; height: 42px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; margin-bottom: 14px;
}

.stat-card .sc-label {
    font-size: .76rem; color: var(--text-muted); font-weight: 600;
    text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px;
}

.stat-card .sc-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.45rem; font-weight: 700; color: var(--text);
}

.stat-card .sc-sub {
    font-size: .75rem; color: var(--text-light); margin-top: 6px;
    display: flex; align-items: center; gap: 6px;
}

/* Stat card color variants */
.sc-brand .sc-glow { background: var(--brand); }
.sc-brand .sc-icon { background: var(--brand-light); color: var(--brand); }
.sc-brand .sc-val  { color: var(--brand); }

.sc-success .sc-glow { background: var(--success); }
.sc-success .sc-icon { background: var(--success-light); color: var(--success); }
.sc-success .sc-val  { color: var(--success); }

.sc-danger .sc-glow { background: var(--danger); }
.sc-danger .sc-icon { background: var(--danger-light); color: var(--danger); }
.sc-danger .sc-val  { color: var(--danger); }

.sc-warning .sc-glow { background: var(--warning); }
.sc-warning .sc-icon { background: var(--warning-light); color: var(--warning); }
.sc-warning .sc-val  { color: var(--warning); }

.sc-info .sc-glow { background: var(--info); }
.sc-info .sc-icon { background: var(--info-light); color: var(--info); }
.sc-info .sc-val  { color: var(--info); }

.bal-pos { color: var(--success) !important; }
.bal-neg { color: var(--danger) !important; }

/* ── Section Headings ── */
.sec-hd {
    font-size: 1rem; font-weight: 600; color: var(--text);
    margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.sec-hd::before {
    content: ''; width: 3px; height: 16px;
    background: var(--brand); border-radius: 2px;
}

/* ── Quick Links ── */
.ql-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px; margin-bottom: 32px;
}

.ql-item {
    display: flex; align-items: center; gap: 11px;
    padding: 13px 15px; border-radius: var(--radius);
    background: var(--white); border: 1px solid var(--gray-2);
    text-decoration: none; color: var(--text);
    box-shadow: var(--shadow-xs);
    transition: all var(--transition);
    animation: fadeUp .4s ease both;
}
.ql-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.ql-item .ql-ico {
    width: 36px; height: 36px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: .85rem; flex-shrink: 0;
}

.ql-item .ql-txt { font-size: .82rem; font-weight: 500; }

.ql-brand .ql-ico   { background: var(--brand-light); color: var(--brand); }
.ql-brand:hover      { border-color: var(--brand-glow); }
.ql-success .ql-ico  { background: var(--success-light); color: var(--success); }
.ql-success:hover     { border-color: var(--success-border); }
.ql-danger .ql-ico   { background: var(--danger-light); color: var(--danger); }
.ql-danger:hover      { border-color: var(--danger-border); }
.ql-warning .ql-ico  { background: var(--warning-light); color: var(--warning); }
.ql-warning:hover     { border-color: var(--warning-border); }
.ql-info .ql-ico     { background: var(--info-light); color: var(--info); }
.ql-info:hover        { border-color: var(--info-border); }

/* ── Chart Cards ── */
.chart-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 16px; margin-bottom: 16px;
}

.chart-card {
    background: var(--white); border: 1px solid var(--gray-2);
    border-radius: var(--radius-lg); padding: 20px;
    box-shadow: var(--shadow-sm);
    animation: fadeUp .5s ease .2s both;
}

.chart-card h3 {
    font-size: .86rem; font-weight: 600; color: var(--text-light);
    margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.chart-card h3 i { font-size: .9rem; }
.chart-card h3 .cpill {
    margin-left: auto; font-size: .63rem; padding: 2px 9px;
    border-radius: 4px; font-weight: 700; text-transform: uppercase;
}
.chart-card canvas { width: 100% !important; max-height: 250px; }

.chart-empty {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; height: 190px;
    color: var(--text-muted); font-size: .87rem;
}
.chart-empty i { font-size: 1.8rem; margin-bottom: 8px; opacity: .3; }

/* ── Activity Table (dashboard) ── */
.activity-card {
    background: var(--white); border: 1px solid var(--gray-2);
    border-radius: var(--radius-lg); overflow: hidden;
    box-shadow: var(--shadow-sm);
    animation: fadeUp .5s ease .25s both;
}
.activity-card .act-hd { padding: 16px 20px 0; }
.at-wrap { overflow-x: auto; }

.act-tbl {
    width: 100%; border-collapse: collapse; font-size: .84rem;
}

.act-tbl thead th {
    text-align: left; padding: 10px 20px;
    font-size: .7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .4px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--gray-2);
    background: var(--gray-1);
}

.act-tbl tbody tr {
    border-bottom: 1px solid var(--gray-2);
    transition: background var(--transition);
}
.act-tbl tbody tr:last-child { border-bottom: none; }
.act-tbl tbody tr:hover { background: var(--gray-1); }

.act-tbl td { padding: 11px 20px; color: var(--text-light); }
.act-tbl td:first-child { color: var(--text); font-weight: 500; }
.act-tbl .time-c {
    font-family: 'JetBrains Mono', monospace;
    font-size: .74rem; color: var(--text-muted); white-space: nowrap;
}

/* Action badges */
.act-badge {
    display: inline-block; padding: 2px 9px; border-radius: 5px;
    font-size: .71rem; font-weight: 600; text-transform: capitalize;
}
.ab-success { background: var(--success-light); color: var(--success); }
.ab-danger  { background: var(--danger-light); color: var(--danger); }
.ab-info    { background: var(--info-light); color: var(--info); }
.ab-warning { background: var(--warning-light); color: var(--warning); }
.ab-brand   { background: var(--brand-light); color: var(--brand); }

/* Empty state */
.empty-state {
    text-align: center; padding: 42px 20px; color: var(--text-muted);
}
.empty-state i { font-size: 2.2rem; opacity: .2; margin-bottom: 10px; display: block; }
.empty-state p { font-size: .87rem; }

/* Error banner */
.err-banner {
    background: var(--danger-light); border: 1px solid var(--danger-border);
    color: var(--danger); padding: 13px 18px; border-radius: var(--radius);
    margin-bottom: 22px; font-size: .87rem;
}

/* ══════════════════════════════════════════
   SHARED COMPONENTS
   ══════════════════════════════════════════ */

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--brand); color: var(--white);
    padding: 10px 18px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 14px;
    transition: all var(--transition);
    text-decoration: none; border: none; cursor: pointer;
    box-shadow: var(--shadow-xs);
}
.btn:hover {
    background: var(--brand-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-brand);
    text-decoration: none; color: var(--white);
}

.btn-secondary {
    background: var(--gray-2); color: var(--text);
    box-shadow: none;
}
.btn-secondary:hover { background: var(--gray-3); color: var(--text); box-shadow: var(--shadow-sm); }

.btn-success { background: var(--success); }
.btn-success:hover { background: #047857; box-shadow: 0 4px 14px rgba(5,150,105,0.25); }

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; box-shadow: 0 4px 14px rgba(220,38,38,0.25); }

.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ── Quick Links (legacy, for non-dashboard pages) ── */
.quick-links {
    display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px;
}
.quick-links .btn { display: inline-flex; }

/* ── Tables ── */
.table-container {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    margin-top: 20px;
}

table {
    width: 100%; border-collapse: collapse; font-size: 14px;
}

table th {
    background: var(--brand);
    color: var(--white);
    padding: 11px 14px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    font-size: 13px;
}

table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-2);
    vertical-align: middle;
}

table tr:last-child td { border-bottom: none; }
table tr:hover td { background: var(--gray-1); }
table tr:nth-child(even) td { background: #fafbfc; }
table tr:nth-child(even):hover td { background: var(--gray-1); }

/* ── Forms ── */
.form-container {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 28px 30px;
    max-width: 640px;
}
.form-container h2 { color: var(--brand); margin-bottom: 18px; }

label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-light);
    margin-top: 14px; margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-2);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: var(--white);
    transition: border var(--transition), box-shadow var(--transition);
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

textarea { resize: vertical; min-height: 80px; }

.form-container button,
button[type="submit"] {
    margin-top: 20px;
    padding: 11px 24px;
    background: var(--brand);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px; font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
}
.form-container button:hover,
button[type="submit"]:hover {
    background: var(--brand-dark);
    box-shadow: var(--shadow-brand);
    transform: translateY(-1px);
}

/* ── Alerts ── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin: 12px 0;
    font-weight: 600; font-size: 14px;
    display: flex; align-items: center; gap: 8px;
}
.alert i { font-size: 1rem; }
.alert-success { background: #d4edda; color: #155724; border-left: 4px solid #28a745; }
.alert-error   { background: #f8d7da; color: #721c24; border-left: 4px solid #dc3545; }
.alert-warning { background: #fff3cd; color: #856404; border-left: 4px solid #ffc107; }

/* ── Report Container ── */
.report-container {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-top: 20px;
}
.report-container h2 { color: var(--brand); margin-bottom: 16px; }

/* ── FOOTER ── */
footer {
    position: fixed;
    bottom: 0;
    left: 0; /* No sidebar on desktop */
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--gray-2);
    text-align: center;
    padding: 10px;
    font-size: 12px;
    color: var(--text-muted);
    z-index: 800;
}

/* ── AUTH PAGES ── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand) 0%, #8b1a08 100%);
    padding: 20px;
}

.auth-container {
    background: var(--white);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
    animation: fadeUp .4s ease both;
}

.auth-logo {
    display: block;
    margin: 0 auto 16px;
    height: 80px; width: 80px;
    object-fit: contain;
}

.auth-container h2 {
    text-align: center;
    color: var(--brand);
    font-size: 22px;
    margin-bottom: 6px;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
    margin-bottom: 24px;
}

.auth-container label { text-transform: uppercase; }

.auth-container input[type="email"],
.auth-container input[type="password"],
.auth-container input[type="text"] {
    margin-bottom: 4px;
}

.auth-container button {
    width: 100%;
    margin-top: 20px; padding: 12px;
    background: var(--brand); color: var(--white);
    border: none; border-radius: var(--radius-sm);
    font-size: 15px; font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
}
.auth-container button:hover {
    background: var(--brand-dark);
    box-shadow: var(--shadow-brand);
    transform: translateY(-1px);
}

.login-links {
    display: flex;
    justify-content: space-between;
    margin-top: 16px; font-size: 13px;
}
.login-links a { color: var(--brand); font-weight: 600; }
.login-links a:hover { text-decoration: underline; }

.auth-footer-link {
    text-align: center;
    margin-top: 18px; font-size: 13px; color: var(--text-light);
}
.auth-footer-link a { color: var(--brand); font-weight: 600; }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */

/* Tablet */
@media (max-width: 1024px) {
    :root { --sidebar-w: 200px; }
    .page-container { padding: 22px 20px 80px; }
    header nav ul li a { font-size: 12px; padding: 5px 8px; }
}

/* Mobile */
@media (max-width: 768px) {
    :root { --header-h: 58px; }

    .hamburger { display: flex; }
    header nav { display: none; }
    header nav.open {
        display: block;
        position: absolute;
        top: var(--header-h);
        left: 0; right: 0;
        background: var(--brand);
        padding: 10px 16px 16px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    }
    header nav.open ul { flex-direction: column; gap: 4px; }
    header nav.open ul li a { font-size: 15px; padding: 10px 12px; }

    /* Show sidebar on mobile only when toggled */
    aside {
        display: block;
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
        z-index: 950;
    }
    aside.open { transform: translateX(0); }

    .page-container {
        margin-left: 0;
        padding: 18px 14px 80px;
    }

    footer { left: 0; }
    .cards { grid-template-columns: 1fr 1fr; }
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 16px; }
    .stat-card .sc-val { font-size: 1.15rem; }
    .chart-grid { grid-template-columns: 1fr; }
    .ql-grid { grid-template-columns: 1fr 1fr; }
    .form-container { padding: 20px 16px; }
    .welcome h1 { font-size: 1.4rem; }
    .act-tbl td, .act-tbl th { padding: 9px 12px; }

    .sidebar-overlay {
        display: none;
        position: fixed; inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 940;
    }
    .sidebar-overlay.open { display: block; }
}

/* Small mobile */
@media (max-width: 480px) {
    .cards { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr; }
    .ql-grid { grid-template-columns: 1fr; }
    .quick-links { flex-direction: column; }
    .quick-links .btn { text-align: center; justify-content: center; }
    .auth-container { padding: 28px 20px; }
    .header-title { font-size: 15px; }
    table th, table td { padding: 8px 10px; font-size: 13px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}