/* ==========================================================
   TechStep ERP — Design System
   Brand: maroon #6e0101 / gold #fcb31a
   ========================================================== */

:root {
    --maroon-900: #4a0000;
    --maroon-800: #5c0101;
    --maroon-700: #6e0101;   /* brand primary */
    --maroon-600: #8a1414;
    --gold-500:   #fcb31a;   /* brand accent */
    --gold-400:   #ffc84d;
    --gold-100:   #fff4dd;

    --ink-900: #1c1917;
    --ink-700: #423f3d;
    --ink-500: #756f6c;
    --ink-300: #a8a29d;

    --surface-0: #ffffff;
    --surface-50: #faf8f6;
    --surface-100: #f3efe9;
    --line: #e8e2d9;

    --success: #1a7f4e;
    --warning: #b56b00;
    --danger: #c62828;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;

    --shadow-sm: 0 1px 2px rgba(28,25,23,.06), 0 1px 1px rgba(28,25,23,.04);
    --shadow-md: 0 8px 24px rgba(78,10,10,.10), 0 2px 6px rgba(78,10,10,.06);
    --shadow-lg: 0 20px 45px rgba(78,10,10,.16), 0 6px 12px rgba(78,10,10,.08);

    --sidebar-w: 264px;
    --topbar-h: 72px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--surface-50);
    color: var(--ink-900);
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--maroon-600); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ==========================================================
   LOGIN PAGE
   ========================================================== */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    background: var(--surface-50);
}
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; } }

.auth-visual {
    position: relative;
    background:
        radial-gradient(circle at 20% 20%, rgba(252,179,26,.18), transparent 45%),
        linear-gradient(155deg, var(--maroon-900) 0%, var(--maroon-700) 55%, var(--maroon-600) 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 56px;
    color: #fff;
    overflow: hidden;
}
.auth-grid-pattern {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: 42px 42px;
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 30% 30%, #000 40%, transparent 85%);
    mask-image: radial-gradient(ellipse 90% 70% at 30% 30%, #000 40%, transparent 85%);
    pointer-events: none;
}
.auth-visual::after {
    content: "";
    position: absolute;
    inset: auto -20% -30% auto;
    width: 480px; height: 480px;
    background: radial-gradient(circle, rgba(252,179,26,.20), transparent 70%);
    border-radius: 50%;
}
@media (max-width: 900px) { .auth-visual { display: none; } }

.auth-visual .brand-mark { position: relative; display: inline-flex; }
.auth-visual .brand-mark img {
    height: 92px; display: block;
    background: rgba(255,255,255,.97); border-radius: 16px; padding: 16px 24px;
    box-shadow: 0 12px 34px rgba(0,0,0,.28);
}

.trust-badge {
    position: relative;
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
    padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 700;
    letter-spacing: .03em; margin-bottom: 18px; backdrop-filter: blur(4px);
}

.auth-visual .headline { position: relative; font-size: 34px; font-weight: 800; line-height: 1.25; max-width: 420px; }
.auth-visual .headline em { font-style: normal; color: var(--gold-400); }
.auth-visual .sub { position: relative; margin-top: 14px; color: rgba(255,255,255,.75); max-width: 380px; line-height: 1.6; }

.auth-visual .foot-info { position: relative; font-size: 13px; color: rgba(255,255,255,.65); line-height: 1.8; }

.auth-panel {
    display: flex; align-items: center; justify-content: center; padding: 40px;
}
.auth-card-outer { width: 100%; max-width: 400px; }
.auth-card {
    width: 100%; background: var(--surface-0); border: 1px solid var(--line);
    border-radius: var(--radius-lg); padding: 38px 36px; box-shadow: var(--shadow-lg);
}
.auth-card-outer .mobile-logo {
    display: none;
    background: rgba(255,255,255,.97); border-radius: 12px; padding: 10px 16px;
    box-shadow: 0 6px 18px rgba(0,0,0,.1);
}
@media (max-width: 900px) { .auth-card-outer .mobile-logo { display: block; height: 62px; margin: 0 auto 24px; } }

.auth-card h1 { font-size: 24px; font-weight: 800; margin: 0 0 6px; color: var(--maroon-700); }
.auth-card p.lead { color: var(--ink-500); margin: 0 0 32px; font-size: 14px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-700); margin-bottom: 7px; }
.input-icon-wrap { position: relative; }
.input-icon-wrap svg {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    width: 17px; height: 17px; color: var(--ink-300); pointer-events: none;
    transition: color .15s ease;
}
.input-icon-wrap:focus-within svg { color: var(--maroon-700); }
.field input {
    width: 100%; padding: 13px 15px 13px 42px; border-radius: var(--radius-sm);
    border: 1.5px solid var(--line); font-size: 14px; background: var(--surface-0);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus {
    outline: none; border-color: var(--maroon-700);
    box-shadow: 0 0 0 4px rgba(110,1,1,.08);
}

.btn-primary {
    width: 100%; padding: 13px 18px; border: none; border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--maroon-700), var(--maroon-800));
    color: #fff; font-weight: 700; font-size: 14.5px;
    cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
    box-shadow: var(--shadow-sm);
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-primary:hover svg { transform: translateX(2px); }
.btn-primary svg { transition: transform .15s ease; }
.btn-primary:active { transform: translateY(0); }

.auth-error {
    background: #fdecec; border: 1px solid #f3b9b9; color: var(--danger);
    padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 18px;
}
.auth-hint { margin-top: 22px; font-size: 12.5px; color: var(--ink-300); text-align: center; }

/* ==========================================================
   APP SHELL (sidebar + topbar)
   ========================================================== */
.app-shell { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(190deg, var(--maroon-900) 0%, var(--maroon-700) 100%);
    color: #fff;
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0;
    z-index: 40;
    transition: transform .2s ease;
}
.sidebar .brand {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 20px 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar .brand img.brand-logo-full {
    width: 100%; max-width: 220px; height: auto; object-fit: contain;
    background: rgba(255,255,255,.96); border-radius: 12px; padding: 12px 14px;
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.sidebar .brand .sub { font-size: 10.5px; color: var(--gold-400); letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }

.sidebar nav { flex: 1; overflow-y: auto; padding: 16px 12px; }
.nav-section-label {
    font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em;
    color: rgba(255,255,255,.4); padding: 14px 12px 6px;
    font-weight: 700;
}
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-radius: var(--radius-sm);
    color: rgba(255,255,255,.82); font-size: 14px; font-weight: 500;
    margin-bottom: 3px; position: relative;
    transition: background .15s ease, color .15s ease, padding-left .15s ease;
}
.nav-item .ic { width: 19px; height: 19px; flex-shrink: 0; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; padding-left: 18px; }
.nav-item.active {
    background: rgba(252,179,26,.14); color: #fff;
    box-shadow: inset 3px 0 0 var(--gold-500);
}
.nav-item.active .ic { opacity: 1; filter: drop-shadow(0 0 6px rgba(252,179,26,.5)); }
.nav-item .badge {
    margin-left: auto; background: var(--gold-500); color: var(--maroon-900);
    font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 20px;
}

.sidebar .sidebar-foot {
    padding: 16px 20px 20px; border-top: 1px solid rgba(255,255,255,.08);
    font-size: 11px; color: rgba(255,255,255,.45); line-height: 1.7;
}

/* ---------- Main area ---------- */
.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex; flex-direction: column;
    min-width: 0;
}

.topbar {
    height: var(--topbar-h);
    background: var(--surface-0);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 28px;
    position: sticky; top: 0; z-index: 30;
}
.topbar .page-title { font-size: 19px; font-weight: 800; color: var(--ink-900); }
.topbar .page-crumb { font-size: 12.5px; color: var(--ink-500); margin-top: 2px; }

.search-box {
    display: flex; align-items: center; gap: 9px;
    background: var(--surface-100); border-radius: 999px;
    padding: 9px 16px; width: 280px; border: 1px solid transparent;
    transition: border-color .15s ease, background .15s ease;
}
.search-box:focus-within { border-color: var(--maroon-700); background: var(--surface-0); }
.search-box input { border: none; background: transparent; outline: none; font-size: 13.5px; width: 100%; }
.search-box svg { width: 15px; height: 15px; color: var(--ink-500); flex-shrink: 0; }

.topbar-right { display: flex; align-items: center; gap: 18px; }
.icon-btn {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-100); cursor: pointer; position: relative;
    transition: background .15s ease, transform .15s ease;
}
.icon-btn:hover { background: var(--gold-100); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; color: var(--maroon-700); }
.icon-btn .dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 2px solid #fff; }

.user-chip { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 6px 10px 6px 6px; border-radius: 999px; transition: background .15s ease; }
.user-chip:hover { background: var(--surface-100); }
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-500), var(--maroon-700));
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 13.5px;
}
.user-chip .u-name { font-size: 13.5px; font-weight: 700; line-height: 1.2; }
.user-chip .u-role { font-size: 11px; color: var(--ink-500); }

.content { padding: 28px; flex: 1; }

/* ==========================================================
   DASHBOARD COMPONENTS
   ========================================================== */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 26px; }
@media (max-width: 1200px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .kpi-grid { grid-template-columns: 1fr; } }

.kpi-card {
    background: var(--surface-0);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 22px;
    position: relative;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.kpi-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.kpi-card::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
    background: linear-gradient(90deg, var(--maroon-700), var(--gold-500));
    transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.kpi-card:hover::before { transform: scaleX(1); }

.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.kpi-icon {
    width: 42px; height: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: var(--gold-100); color: var(--maroon-700);
}
.kpi-icon svg { width: 21px; height: 21px; }
.kpi-trend { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.kpi-trend.up { color: var(--success); background: #e8f6ee; }
.kpi-trend.down { color: var(--danger); background: #fdecec; }
.kpi-trend.flat { color: var(--ink-500); background: var(--surface-100); }

.kpi-value { font-size: 27px; font-weight: 800; color: var(--ink-900); line-height: 1.15; }
.kpi-label { font-size: 13px; color: var(--ink-500); margin-top: 4px; }

.panel-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 1100px) { .panel-grid { grid-template-columns: 1fr; } }

.chart-wrap { position: relative; width: 100%; height: 280px; }
.chart-wrap.sm { height: 230px; }
.chart-wrap.donut { height: 240px; }
.chart-wrap.tall { height: 340px; }

.report-back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--maroon-700); font-weight: 700; font-size: 13px; text-decoration: none; margin-bottom: 16px; }
.report-back-link:hover { color: var(--gold-500); }

.panel {
    background: var(--surface-0); border: 1px solid var(--line);
    border-radius: var(--radius-md); padding: 22px 24px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.panel-head h3 { font-size: 15.5px; font-weight: 800; margin: 0; }
.panel-head .link { font-size: 12.5px; font-weight: 700; color: var(--maroon-700); cursor: pointer; }
.panel-head .link:hover { color: var(--gold-500); }

/* simple bar chart, no JS library needed */
.bar-chart { display: flex; align-items: flex-end; gap: 14px; height: 190px; padding-top: 10px; }
.bar-chart .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar-chart .bar {
    width: 100%; max-width: 30px; border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, var(--gold-500), var(--maroon-700));
    transition: opacity .15s ease, transform .15s ease;
}
.bar-chart .bar-col:hover .bar { opacity: .85; transform: scaleY(1.02); }
.bar-chart .bar-label { font-size: 11px; color: var(--ink-500); margin-top: 8px; font-weight: 600; }

.activity-list { display: flex; flex-direction: column; gap: 4px; }
.activity-item {
    display: flex; align-items: center; gap: 12px; padding: 11px 8px; border-radius: var(--radius-sm);
    transition: background .15s ease;
}
.activity-item:hover { background: var(--surface-50); }
.act-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.act-dot.pay { background: var(--success); }
.act-dot.adm { background: var(--maroon-700); }
.act-dot.att { background: var(--gold-500); }
.activity-item .a-title { font-size: 13px; font-weight: 600; color: var(--ink-900); }
.activity-item .a-time { font-size: 11.5px; color: var(--ink-300); margin-left: auto; white-space: nowrap; }

.table-wrap { background: var(--surface-0); border: 1px solid var(--line); border-radius: var(--radius-md); overflow-x: auto; overflow-y: hidden; }
.table-wrap table.data-table { min-width: max-content; }
table.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
    text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--ink-500); padding: 14px 20px; background: var(--surface-50); border-bottom: 1px solid var(--line);
}
.data-table tbody td { padding: 15px 20px; font-size: 13.5px; border-bottom: 1px solid var(--line); color: var(--ink-700); }
.data-table tbody tr { transition: background .15s ease; }
.data-table tbody tr:hover { background: var(--surface-50); }
.data-table tbody tr:last-child td { border-bottom: none; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.pill.active { background: #e8f6ee; color: var(--success); }
.pill.pending { background: #fff4e0; color: var(--warning); }
.pill.dropped { background: #fdecec; color: var(--danger); }

.btn-sm {
    padding: 8px 14px; border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 700;
    border: 1.5px solid var(--maroon-700); color: var(--maroon-700); background: transparent;
    cursor: pointer; transition: all .15s ease;
}
.btn-sm:hover { background: var(--maroon-700); color: #fff; }
.btn-sm.solid { background: var(--maroon-700); color: #fff; }
.btn-sm.solid:hover { background: var(--maroon-800); box-shadow: var(--shadow-sm); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-500); }
.empty-state svg { width: 56px; height: 56px; color: var(--ink-300); margin-bottom: 14px; }
.empty-state h4 { color: var(--ink-900); margin: 0 0 6px; }
.empty-state p { font-size: 13.5px; margin: 0 0 18px; }

/* ---------- Flash messages ---------- */
.flash-success, .flash-error {
    padding: 13px 18px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600;
    margin-bottom: 18px; display: flex; align-items: center; gap: 10px;
}
.flash-success { background: #e8f6ee; color: var(--success); border: 1px solid #b9e6cd; }
.flash-error { background: #fdecec; color: var(--danger); border: 1px solid #f3b9b9; }

/* ---------- Forms (for pages beyond login) ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 24px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 800px) { .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; } }
.form-field { margin-bottom: 4px; }
.form-field.span-2 { grid-column: span 2; }
@media (max-width: 800px) { .form-field.span-2 { grid-column: span 1; } }
.form-field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-700); margin-bottom: 7px; }
.form-field .hint { font-size: 11.5px; color: var(--ink-300); margin-top: 5px; }
.form-field input[type=text], .form-field input[type=number], .form-field input[type=date],
.form-field input[type=email], .form-field input[type=tel], .form-field input[type=time],
.form-field select, .form-field textarea {
    width: 100%; padding: 11px 14px; border-radius: var(--radius-sm);
    border: 1.5px solid var(--line); font-size: 13.5px; background: var(--surface-0);
    font-family: inherit; transition: border-color .15s ease, box-shadow .15s ease;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
    outline: none; border-color: var(--maroon-700); box-shadow: 0 0 0 4px rgba(110,1,1,.08);
}
.form-field textarea { resize: vertical; min-height: 90px; }
.form-actions { display: flex; gap: 12px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }

.btn {
    padding: 11px 22px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 700;
    border: 1.5px solid var(--maroon-700); color: var(--maroon-700); background: transparent;
    cursor: pointer; transition: all .15s ease; display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { background: var(--maroon-700); color: #fff; }
.btn.solid { background: var(--maroon-700); color: #fff; }
.btn.solid:hover { background: var(--maroon-800); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn.ghost { border-color: var(--line); color: var(--ink-700); }
.btn.ghost:hover { background: var(--surface-100); color: var(--ink-900); }

.checkbox-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.checkbox-pill { position: relative; }
.checkbox-pill input { position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.checkbox-pill span {
    display: inline-block; padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--line);
    font-size: 13px; font-weight: 600; color: var(--ink-700); transition: all .15s ease;
}
.checkbox-pill input:checked + span { background: var(--maroon-700); border-color: var(--maroon-700); color: #fff; }
.checkbox-pill:hover span { border-color: var(--maroon-700); }

.radio-row { display: flex; gap: 18px; }
.radio-row label { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 500; cursor: pointer; }

.section-divider { display: flex; align-items: center; gap: 12px; margin: 8px 0 20px; }
.section-divider .num {
    width: 26px; height: 26px; border-radius: 50%; background: var(--maroon-700); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 800; flex-shrink: 0;
}
.section-divider h4 { font-size: 14.5px; font-weight: 800; margin: 0; }

.search-hero {
    background: var(--surface-0); border: 1px solid var(--line); border-radius: var(--radius-md);
    padding: 34px; text-align: center; margin-bottom: 20px;
}
.search-hero input[type=text] {
    width: 100%; max-width: 460px; padding: 14px 20px; border-radius: 999px;
    border: 1.5px solid var(--line); font-size: 14px; text-align: center;
}
.search-hero input[type=text]:focus { outline: none; border-color: var(--maroon-700); box-shadow: 0 0 0 4px rgba(110,1,1,.08); }

.student-card {
    display: flex; align-items: center; gap: 16px; padding: 16px 20px;
    border: 1.5px solid var(--line); border-radius: var(--radius-md); margin-bottom: 10px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.student-card:hover { border-color: var(--maroon-700); box-shadow: var(--shadow-sm); }
.student-avatar-lg {
    width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--gold-500), var(--maroon-700)); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px;
}
.tab-row { display: flex; gap: 6px; border-bottom: 1.5px solid var(--line); margin-bottom: 22px; }
.tab-item {
    padding: 11px 18px; font-size: 13.5px; font-weight: 700; color: var(--ink-500);
    border-bottom: 2.5px solid transparent; margin-bottom: -1.5px; cursor: pointer; transition: all .15s ease;
}
.tab-item:hover { color: var(--maroon-700); }
.tab-item.active { color: var(--maroon-700); border-color: var(--maroon-700); }

.stat-strip { display: flex; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.stat-chip {
    flex: 1; min-width: 140px; background: var(--surface-0); border: 1px solid var(--line);
    border-radius: var(--radius-sm); padding: 14px 18px;
}
.stat-chip .v { font-size: 20px; font-weight: 800; }
.stat-chip .l { font-size: 12px; color: var(--ink-500); margin-top: 2px; }

/* ---------- Keyboard shortcuts overlay ---------- */
.shortcuts-overlay {
    display: none; position: fixed; inset: 0; background: rgba(28,25,23,.55);
    z-index: 200; align-items: center; justify-content: center; padding: 20px;
    backdrop-filter: blur(2px);
}
.shortcuts-overlay.open { display: flex; }
.shortcuts-modal {
    background: var(--surface-0); border-radius: var(--radius-lg); width: 100%; max-width: 520px;
    max-height: 82vh; overflow-y: auto; box-shadow: var(--shadow-lg);
}
.shortcuts-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface-0);
}
.shortcuts-modal-head h3 { margin: 0; font-size: 16px; font-weight: 800; }
.shortcuts-close {
    border: none; background: var(--surface-100); width: 30px; height: 30px; border-radius: 50%;
    font-size: 18px; line-height: 1; cursor: pointer; color: var(--ink-500);
}
.shortcuts-close:hover { background: var(--gold-100); color: var(--maroon-700); }
.shortcuts-modal-body { padding: 10px 24px 24px; }
.shortcuts-group { margin-top: 18px; }
.shortcuts-group-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-300); font-weight: 700; margin-bottom: 8px; }
.shortcuts-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; font-size: 13.5px; border-bottom: 1px solid var(--surface-100); }
.shortcuts-row:last-child { border-bottom: none; }
.shortcuts-then { font-size: 11px; color: var(--ink-300); }
kbd {
    display: inline-block; min-width: 22px; text-align: center; padding: 3px 7px;
    background: var(--surface-100); border: 1px solid var(--line); border-bottom-width: 2px;
    border-radius: 6px; font-family: inherit; font-size: 12px; font-weight: 700; color: var(--ink-700);
}

/* ---------- Password show/hide toggle ---------- */
.password-field-wrap { position: relative; }
.password-field-wrap input[type="password"], .password-field-wrap input[type="text"] {
    padding-right: 42px !important;
}
.password-toggle-btn {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px; border: none; background: transparent; cursor: pointer;
    display: flex; align-items: center; justify-content: center; border-radius: 8px;
    color: var(--ink-300); transition: color .15s ease, background .15s ease;
}
.password-toggle-btn:hover { color: var(--maroon-700); background: var(--surface-100); }
.password-toggle-btn svg { width: 18px; height: 18px; }
.password-toggle-btn .icon-eye-off { display: none; }
.password-toggle-btn.showing .icon-eye { display: none; }
.password-toggle-btn.showing .icon-eye-off { display: block; }

/* ---------- Finance ---------- */
.fee-breakdown { display: flex; flex-direction: column; gap: 10px; }
.fee-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 4px 0; }
.fee-row.total { border-top: 1.5px solid var(--line); margin-top: 6px; padding-top: 14px; font-weight: 800; font-size: 16px; }
.fee-row .neg { color: var(--danger); }

.balance-bar { height: 8px; border-radius: 999px; background: var(--surface-100); overflow: hidden; margin: 10px 0; }
.balance-bar .fill { height: 100%; background: linear-gradient(90deg, var(--gold-500), var(--maroon-700)); border-radius: 999px; transition: width .3s ease; }

.installment-card {
    display: flex; align-items: center; gap: 16px; padding: 16px 18px;
    border: 1.5px solid var(--line); border-radius: var(--radius-md); margin-bottom: 10px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.installment-card:hover { border-color: var(--maroon-700); box-shadow: var(--shadow-sm); }
.installment-card .inst-num {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    background: var(--surface-100); color: var(--maroon-700); font-weight: 800; font-size: 13px;
    display: flex; align-items: center; justify-content: center;
}
.installment-card.paid .inst-num { background: #e8f6ee; color: var(--success); }

.payment-method-badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 700; background: var(--surface-100); color: var(--ink-700);
}

/* ---------- Printable Invoice ---------- */
.invoice-sheet {
    background: #fff; max-width: 900px; margin: 0 auto; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden;
}
.invoice-copy { padding: 34px 38px; }
.invoice-copy + .invoice-copy { border-top: 2px dashed var(--line); }
.invoice-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; }
.invoice-head .org img { height: 44px; margin-bottom: 8px; }
.invoice-head .org .org-name { font-weight: 800; font-size: 15px; color: var(--maroon-700); }
.invoice-head .org .org-meta { font-size: 11px; color: var(--ink-500); line-height: 1.6; margin-top: 4px; }
.invoice-head .meta { text-align: right; }
.invoice-head .copy-label {
    display: inline-block; background: var(--gold-100); color: var(--maroon-700); font-weight: 800;
    font-size: 11px; padding: 4px 12px; border-radius: 999px; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .04em;
}
.invoice-head .inv-num { font-size: 13px; font-weight: 700; }
.invoice-head .inv-date { font-size: 12px; color: var(--ink-500); }
.invoice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px; margin-bottom: 20px; font-size: 13px; }
.invoice-grid .lbl { color: var(--ink-500); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
.invoice-table { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
.invoice-table th { text-align: left; font-size: 11px; text-transform: uppercase; color: var(--ink-500); border-bottom: 1.5px solid var(--line); padding: 8px 6px; }
.invoice-table td { padding: 9px 6px; font-size: 13px; border-bottom: 1px solid var(--line); }
.invoice-table tr.total td { font-weight: 800; font-size: 14.5px; border-bottom: none; border-top: 1.5px solid var(--ink-900); padding-top: 12px; }
.invoice-sign { display: flex; justify-content: space-between; margin-top: 40px; }
.invoice-sign .line { border-top: 1px solid var(--ink-300); width: 180px; padding-top: 6px; font-size: 11px; color: var(--ink-500); text-align: center; }

@media print {
    @page { size: A4; margin: 8mm; }
    .sidebar, .topbar, .no-print { display: none !important; }
    .main { margin-left: 0 !important; }
    .content { padding: 0 !important; }
    .invoice-sheet { border: none; max-width: 100%; }
    body { background: #fff; font-size: 12px; }

    /* Compact both copies so they fit on a single printed page */
    .invoice-copy { padding: 10px 22px !important; }
    .invoice-head { margin-bottom: 10px !important; }
    .invoice-head .org img { height: 34px !important; margin-bottom: 4px !important; }
    .invoice-head .org .org-meta { font-size: 9.5px !important; line-height: 1.35 !important; }
    .invoice-head .copy-label { padding: 2px 10px !important; margin-bottom: 4px !important; font-size: 9.5px !important; }
    .invoice-head .inv-num { font-size: 11.5px !important; }
    .invoice-head .inv-date { font-size: 10.5px !important; }
    .invoice-grid { gap: 4px 20px !important; margin-bottom: 10px !important; font-size: 11.5px !important; }
    .invoice-grid .lbl { font-size: 9.5px !important; }
    .invoice-table { margin-bottom: 8px !important; }
    .invoice-table th { padding: 4px 6px !important; font-size: 9.5px !important; }
    .invoice-table td { padding: 4px 6px !important; font-size: 11px !important; }
    .invoice-table tr.total td { font-size: 12px !important; padding-top: 6px !important; }
    .invoice-sign { margin-top: 16px !important; }
    .invoice-sign .line { padding-top: 4px !important; font-size: 9.5px !important; }
}

/* ---------- Attendance ---------- */
.date-nav {
    display: flex; align-items: center; gap: 14px; background: var(--surface-0);
    border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px 20px; margin-bottom: 20px;
}
.date-nav .day-label { font-weight: 800; font-size: 15px; }
.date-nav .day-sub { font-size: 12px; color: var(--ink-500); }
.date-nav a.nav-arrow {
    width: 34px; height: 34px; border-radius: 50%; background: var(--surface-100);
    display: flex; align-items: center; justify-content: center; color: var(--maroon-700); flex-shrink: 0;
    transition: background .15s ease;
}
.date-nav a.nav-arrow:hover { background: var(--gold-100); }
.date-nav input[type=date] { padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); font-size: 13px; }

.attendance-row {
    display: flex; align-items: center; gap: 16px; padding: 14px 18px;
    border: 1.5px solid var(--line); border-radius: var(--radius-md); margin-bottom: 10px; flex-wrap: wrap;
}
.status-toggle { display: flex; gap: 6px; }
.status-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.status-toggle label {
    padding: 7px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 700; cursor: pointer;
    border: 1.5px solid var(--line); color: var(--ink-500); transition: all .15s ease;
}
.status-toggle input:checked + label.present { background: #e8f6ee; border-color: var(--success); color: var(--success); }
.status-toggle input:checked + label.absent { background: #fdecec; border-color: var(--danger); color: var(--danger); }
.status-toggle input:checked + label.leave { background: #fff4e0; border-color: var(--warning); color: var(--warning); }
.status-toggle label:hover { border-color: var(--maroon-700); }
.attendance-row input[name^="remarks"] {
    flex: 1; min-width: 140px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); font-size: 12.5px;
}
.att-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.att-pill.Present { background: #e8f6ee; color: var(--success); }
.att-pill.Absent { background: #fdecec; color: var(--danger); }
.att-pill.Leave { background: #fff4e0; color: var(--warning); }

/* ---------- Payroll ---------- */
.employee-card {
    display: flex; align-items: center; gap: 16px; padding: 16px 20px;
    border: 1.5px solid var(--line); border-radius: var(--radius-md); margin-bottom: 10px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.employee-card:hover { border-color: var(--maroon-700); box-shadow: var(--shadow-sm); }
.salary-breakdown-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.salary-breakdown-row:last-child { border-bottom: none; }
/* ---------- Printable Admission Form (reuses .invoice-sheet/.invoice-copy/.invoice-grid/.invoice-sign) ---------- */
.admission-photo-frame {
    width: 108px; height: 128px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    overflow: hidden; display: flex; align-items: center; justify-content: center;
    background: var(--surface-50); flex-shrink: 0;
}
.admission-photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.admission-photo-frame .empty-label { font-size: 9.5px; color: var(--ink-500); text-align: center; padding: 6px; }

@media print {
    .admission-photo-frame { width: 90px !important; height: 106px !important; }
}
.salary-breakdown-row .lbl { color: var(--ink-500); }
.salary-breakdown-row.total { font-weight: 800; font-size: 15.5px; border-top: 1.5px solid var(--ink-900); border-bottom: none; padding-top: 14px; margin-top: 6px; }

/* ---------- Mobile sidebar toggle ---------- */
.menu-toggle { display: none; }
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .menu-toggle { display: flex; }
}
