/* ══════════════════════════════════════════════════════════
   DESIGN TOKENS
══════════════════════════════════════════════════════════ */
:root {
    /* Maroon + Cream palette */
    --maroon-900: #4a0a0a;
    --maroon-800: #6b1010;
    --maroon-700: #881414;
    --maroon-600: #a01515;
    --maroon-500: #b91c1c;
    --maroon-400: #ef4444;
    --maroon-100: #fee2e2;
    --maroon-50:  #fff5f5;

    --gold: #d97706;
    --gold-light: #fef3c7;

    --green: #059669;
    --green-light: #d1fae5;
    --red: #dc2626;
    --red-light: #fee2e2;
    --amber: #b45309;
    --amber-light: #fef3c7;
    --gray: #6b7280;
    --gray-light: #f3f4f6;

    /* Light theme (default) */
    --bg-body:        #faf8f5;
    --bg-sidebar:     #4a0a0a;
    --bg-card:        #ffffff;
    --bg-card-hover:  #fdfcfb;
    --border:         #e5e0d8;
    --border-strong:  #c9c1b4;

    --text-primary:   #1a1412;
    --text-secondary: #5c534a;
    --text-muted:     #9c8f84;
    --text-on-dark:   #fff5f5;
    --text-sidebar:   rgba(255,245,245,0.8);
    --text-sidebar-active: #ffffff;

    --accent:         #a01515;
    --accent-hover:   #6b1010;

    --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.06);

    --sidebar-w: 240px;
    --topbar-h: 60px;
    --radius: 12px;
    --radius-sm: 8px;
    --font: 'Inter', system-ui, sans-serif;
}

[data-theme="dark"] {
    --bg-body:        #141010;
    --bg-sidebar:     #2a0505;
    --bg-card:        #1f1818;
    --bg-card-hover:  #261c1c;
    --border:         #3a2a2a;
    --border-strong:  #4a3030;

    --text-primary:   #f5ece9;
    --text-secondary: #c4a99f;
    --text-muted:     #7a5c56;
    --text-sidebar:   rgba(245,236,233,0.75);

    --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,.4);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.5);
}

/* ══════════════════════════════════════════════════════════
   RESET & BASE
══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
    transition: background .3s, color .3s;
}
a { text-decoration: none; color: inherit; }
input, select, button { font-family: var(--font); }
img { max-width: 100%; }
.hidden { display: none !important; }

/* ══════════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════════ */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    transition: transform .3s ease;
    overflow: hidden;
}

.sidebar__logo {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.5rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,245,245,.1);
}
.sidebar__logo-mark {
    width: 40px; height: 40px;
    background: rgba(255,255,255,.15);
    border-radius: var(--radius-sm);
    display: grid; place-items: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.sidebar__logo-title {
    font-size: .9rem;
    font-weight: 700;
    color: var(--text-on-dark);
    line-height: 1.2;
}
.sidebar__logo-sub {
    font-size: .7rem;
    color: var(--text-sidebar);
    line-height: 1;
}
.sidebar__logo-text { display: flex; flex-direction: column; }

.sidebar__nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem 1.25rem;
    font-size: .88rem;
    font-weight: 500;
    color: var(--text-sidebar);
    border-radius: 0;
    cursor: pointer;
    transition: background .15s, color .15s;
    border-left: 3px solid transparent;
    white-space: nowrap;
}
.nav-item:hover:not(.disabled) {
    background: rgba(255,255,255,.08);
    color: var(--text-on-dark);
}
.nav-item.active {
    background: rgba(255,255,255,.12);
    color: var(--text-on-dark);
    border-left-color: #f87171;
    font-weight: 600;
}
.nav-item.disabled {
    opacity: .45;
    cursor: not-allowed;
    pointer-events: none;
}
.nav-divider {
    height: 1px;
    background: rgba(255,245,245,.1);
    margin: .75rem 1rem;
}

.sidebar__footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,245,245,.1);
}
.btn-theme {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: rgba(255,255,255,.08);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-sidebar);
    font-size: .8rem;
    padding: .5rem .75rem;
    cursor: pointer;
    width: 100%;
    transition: background .15s;
}
.btn-theme:hover { background: rgba(255,255,255,.15); color: var(--text-on-dark); }

[data-theme="dark"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: none; }

/* ══════════════════════════════════════════════════════════
   MAIN LAYOUT
══════════════════════════════════════════════════════════ */
.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin .3s ease;
}

.topbar {
    height: var(--topbar-h);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.topbar__left { display: flex; align-items: center; gap: .75rem; }
.topbar__page-title { font-size: 1rem; font-weight: 600; }
.topbar__right { display: flex; align-items: center; gap: 1rem; }
.topbar__semester {
    font-size: .78rem;
    color: var(--text-secondary);
    background: var(--gray-light);
    padding: .25rem .6rem;
    border-radius: 99px;
}
.topbar__user {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .85rem;
    font-weight: 500;
    background: var(--maroon-50);
    color: var(--maroon-700);
    padding: .35rem .75rem;
    border-radius: 99px;
}
[data-theme="dark"] .topbar__user {
    background: var(--maroon-900);
    color: var(--maroon-400);
}
.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: .25rem;
    display: none;
    transition: color .15s;
}
.sidebar-toggle:hover { color: var(--text-primary); }

.page-content { flex: 1; padding: 2rem 1.75rem; max-width: 1200px; }

/* ══════════════════════════════════════════════════════════
   PAGES
══════════════════════════════════════════════════════════ */
.page { display: none; animation: fadeIn .3s ease; }
.page.active { display: block; }

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

.page-header { margin-bottom: 1.75rem; }
.page-header--row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}
.page-header h1 { font-size: 1.6rem; font-weight: 800; color: var(--text-primary); }
.page-desc { font-size: .9rem; color: var(--text-secondary); margin-top: .25rem; }

/* ══════════════════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════════════════ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: background .3s, border-color .3s;
}
.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}
.card-desc {
    font-size: .85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}
.card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1rem;
}

/* ══════════════════════════════════════════════════════════
   METRIC CARDS
══════════════════════════════════════════════════════════ */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.metric-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent);
    border-radius: var(--radius) 0 0 var(--radius);
}
.metric-card__label {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin-bottom: .4rem;
}
.metric-card__value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}
.metric-card__sub {
    font-size: .78rem;
    color: var(--text-secondary);
    margin-top: .35rem;
}

/* ══════════════════════════════════════════════════════════
   CHARTS
══════════════════════════════════════════════════════════ */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}
.chart-wrap { position: relative; width: 100%; max-height: 280px; }
.chart-wrap--sm { max-height: 220px; }
.chart-wrap canvas { max-height: 100%; }
.chart-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: .75rem;
    flex-wrap: wrap;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .82rem;
    color: var(--text-secondary);
}
.legend-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
}

/* ══════════════════════════════════════════════════════════
   TABLES
══════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }
.table-wrap table, table {
    width: 100%;
    border-collapse: collapse;
    font-size: .84rem;
}
th {
    text-align: left;
    padding: .65rem 1rem;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    background: var(--bg-body);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
td {
    padding: .7rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-body); }
.tr-clickable { cursor: pointer; }
.tr-clickable:hover td { background: var(--maroon-50); }
[data-theme="dark"] .tr-clickable:hover td { background: var(--maroon-900); }

/* ══════════════════════════════════════════════════════════
   BADGES
══════════════════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .65rem;
    border-radius: 99px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .03em;
}
.badge--pass { background: var(--green-light); color: var(--green); }
.badge--fail { background: var(--red-light); color: var(--red); }
.badge--absent { background: var(--amber-light); color: var(--amber); }

.grade-badge {
    display: inline-block;
    width: 32px; height: 32px;
    line-height: 32px;
    text-align: center;
    border-radius: var(--radius-sm);
    font-size: .82rem;
    font-weight: 800;
    background: var(--maroon-50);
    color: var(--maroon-700);
}
[data-theme="dark"] .grade-badge { background: var(--maroon-900); color: var(--maroon-400); }

/* ══════════════════════════════════════════════════════════
   SUBJECT CARDS GRID
══════════════════════════════════════════════════════════ */
.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}
.subject-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: box-shadow .2s, transform .2s, border-color .2s;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    position: relative;
    overflow: hidden;
}
.subject-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--maroon-600), var(--gold));
}
.subject-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--maroon-400);
}
.subject-card__code {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--accent);
    padding: .2rem .5rem;
    background: var(--maroon-50);
    border-radius: 4px;
    align-self: flex-start;
}
[data-theme="dark"] .subject-card__code { background: var(--maroon-900); color: var(--maroon-400); }
.subject-card__name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}
.subject-card__staff {
    font-size: .82rem;
    color: var(--text-secondary);
}
.subject-card__pass {
    margin-top: .5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.pass-bar-wrap {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
    margin-right: .75rem;
}
.pass-bar { height: 100%; border-radius: 99px; background: var(--green); }
.pass-label { font-size: .78rem; font-weight: 700; color: var(--green); }
.subject-card__btn {
    margin-top: .75rem;
    padding: .5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: .82rem;
    font-weight: 600;
    color: var(--accent);
    background: none;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    width: 100%;
}
.subject-card__btn:hover { background: var(--maroon-50); border-color: var(--accent); }
[data-theme="dark"] .subject-card__btn:hover { background: var(--maroon-900); }

/* ══════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: background .15s, border-color .15s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn--primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--outline {
    background: transparent;
    border-color: var(--border-strong);
    color: var(--text-primary);
}
.btn--outline:hover { border-color: var(--accent); color: var(--accent); }
.btn--lg { padding: .8rem 1.75rem; font-size: .92rem; }
.btn-icon {
    width: 32px; height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1rem;
    border-radius: 50%;
    display: grid; place-items: center;
    transition: background .15s, color .15s;
}
.btn-icon:hover { background: var(--border); color: var(--text-primary); }
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: .85rem;
    font-weight: 500;
    padding: 0;
    transition: color .15s;
}
.btn-back:hover { color: var(--accent); }

.action-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }

/* ══════════════════════════════════════════════════════════
   UPLOAD DROPZONES
══════════════════════════════════════════════════════════ */
.dropzone {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    position: relative;
}
.dropzone:hover, .dropzone.drag-over {
    border-color: var(--accent);
    background: var(--maroon-50);
}
[data-theme="dark"] .dropzone:hover, [data-theme="dark"] .dropzone.drag-over {
    background: var(--maroon-900);
}
.dropzone__icon { font-size: 2rem; margin-bottom: .5rem; }
.dropzone__text { font-size: .9rem; font-weight: 600; color: var(--text-primary); }
.dropzone__hint { font-size: .8rem; color: var(--text-muted); margin-top: .25rem; }
.dropzone__filename {
    margin-top: .75rem;
    font-size: .82rem;
    font-weight: 600;
    color: var(--accent);
}
.hidden-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-csv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }

/* ══════════════════════════════════════════════════════════
   MODE TOGGLE
══════════════════════════════════════════════════════════ */
.mode-toggle {
    display: inline-flex;
    gap: .25rem;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .25rem;
}
.mode-btn {
    padding: .5rem 1.25rem;
    border: none;
    border-radius: calc(var(--radius-sm) - 2px);
    background: transparent;
    color: var(--text-secondary);
    font-size: .85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.mode-btn.active {
    background: var(--accent);
    color: white;
    font-weight: 600;
}
.mode-btn:not(.active):hover { background: var(--border); color: var(--text-primary); }

/* ══════════════════════════════════════════════════════════
   FILTER TABS
══════════════════════════════════════════════════════════ */
.filter-tabs { display: flex; gap: .4rem; flex-wrap: wrap; }
.filter-tab {
    padding: .35rem .85rem;
    border: 1px solid var(--border);
    border-radius: 99px;
    font-size: .78rem;
    font-weight: 600;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.filter-tab.active { background: var(--accent); color: white; border-color: var(--accent); }
.filter-tab:not(.active):hover { border-color: var(--accent); color: var(--accent); }

/* ══════════════════════════════════════════════════════════
   SEARCH BOX
══════════════════════════════════════════════════════════ */
.search-box {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .5rem .85rem;
}
.search-box svg { color: var(--text-muted); flex-shrink: 0; }
.search-box input {
    border: none;
    background: none;
    color: var(--text-primary);
    font-size: .85rem;
    outline: none;
    width: 100%;
    min-width: 180px;
}

/* ══════════════════════════════════════════════════════════
   COLLAPSIBLE
══════════════════════════════════════════════════════════ */
.collapsible {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    font-size: .95rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: 0;
}
.chevron { transition: transform .25s; }
.collapsible.open .chevron { transform: rotate(180deg); }
.collapsible-content { margin-top: 1.25rem; }

/* ══════════════════════════════════════════════════════════
   PREVIEW
══════════════════════════════════════════════════════════ */
.preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.preview-heading { font-size: .85rem; font-weight: 700; color: var(--text-secondary); margin-bottom: .5rem; }

/* ══════════════════════════════════════════════════════════
   STUDENT DRAWER
══════════════════════════════════════════════════════════ */
.drawer-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 299;
    backdrop-filter: blur(3px);
}
.drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 340px;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    z-index: 300;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: slideInRight .25s ease;
}
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: none; } }
.drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
}
.drawer__body { flex: 1; overflow-y: auto; padding: 1.5rem; }
.drawer-field { margin-bottom: 1.25rem; }
.drawer-field__label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin-bottom: .3rem;
}
.drawer-field__value { font-size: 1.1rem; font-weight: 600; }
.drawer-grade-display {
    font-size: 3rem;
    font-weight: 900;
    color: var(--accent);
    line-height: 1;
    margin: 1.5rem 0 1rem;
}

/* ══════════════════════════════════════════════════════════
   REPORTS
══════════════════════════════════════════════════════════ */
.report-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
}
.report-card__info { flex: 1; }
.report-card__title { font-size: .95rem; font-weight: 700; }
.report-card__sub { font-size: .8rem; color: var(--text-secondary); margin-top: .15rem; }
.report-card__actions { display: flex; gap: .6rem; }

/* ══════════════════════════════════════════════════════════
   TOPPERS TABLE
══════════════════════════════════════════════════════════ */
.rank-badge {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: inline-grid; place-items: center;
    font-size: .8rem; font-weight: 800;
    color: white;
}
.rank-badge.rank-1 { background: var(--gold); }
.rank-badge.rank-2 { background: var(--gray); }
.rank-badge.rank-3 { background: #cd7f32; }
.rank-badge.rank-n { background: var(--maroon-600); }

/* ══════════════════════════════════════════════════════════
   CGPA CALCULATOR
══════════════════════════════════════════════════════════ */
.cgpa-input {
    width: 100%;
    padding: .4rem .6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: .84rem;
    font-family: var(--font);
    transition: border-color .15s;
}
.cgpa-input:focus { outline: none; border-color: var(--accent); }

.cgpa-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 1rem;
}
.cgpa-result-display { text-align: right; }
.cgpa-result-label { font-size: .78rem; color: var(--text-muted); display: block; }
.cgpa-result-value {
    font-size: 3rem;
    font-weight: 900;
    color: var(--accent);
    line-height: 1;
}
.cgpa-result-grade {
    display: block;
    font-size: .85rem;
    color: var(--text-secondary);
    margin-top: .2rem;
}

/* ══════════════════════════════════════════════════════════
   ERROR
══════════════════════════════════════════════════════════ */
.error-list { list-style: none; }
.error-list li {
    padding: .4rem 0;
    font-size: .85rem;
    color: var(--red);
    display: flex;
    align-items: flex-start;
    gap: .5rem;
}
.error-list li::before { content: '✕'; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 400px;
    margin: 0 auto;
}
.empty-state__icon { font-size: 3.5rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: .5rem; }
.empty-state p { color: var(--text-secondary); font-size: .9rem; margin-bottom: 1.5rem; }

/* ══════════════════════════════════════════════════════════
   LOADER
══════════════════════════════════════════════════════════ */
.loader-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}
.loader-spinner {
    width: 48px; height: 48px;
    border: 4px solid rgba(255,255,255,.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { color: white; font-weight: 600; font-size: .9rem; }

/* ══════════════════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
}
.modal-overlay.hidden { display: none; }
.modal {
    background: var(--bg-card);
    width: 90%; max-width: 1000px; height: 85vh;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column;
    overflow: hidden;
}
.modal__header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}
.modal__header h3 { margin: 0; font-size: 1.1rem; }
.modal__actions { display: flex; align-items: center; gap: 1rem; }
.modal__body { flex: 1; background: #e5e7eb; }
.modal__body iframe { width: 100%; height: 100%; display: block; }


/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .charts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: none;
    }
    .main { margin-left: 0; }
    .sidebar-toggle { display: flex; }
    .page-content { padding: 1.25rem 1rem; }
    .preview-grid { grid-template-columns: 1fr; }
    .upload-csv-grid { grid-template-columns: 1fr; }
    .page-header--row { flex-direction: column; align-items: flex-start; }
    .subject-grid { grid-template-columns: 1fr; }
    .drawer { width: 100%; }
    .charts-grid { grid-template-columns: 1fr; }
}

/* Drag and drop validation styles */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.dropzone.success {
    border-color: #059669;
    background: rgba(5, 150, 105, 0.05);
}

.dropzone.success .dropzone__icon {
    color: #059669;
}

.dropzone.error {
    border-color: #dc2626;
    background: rgba(220, 38, 38, 0.05);
}

.dropzone.animate-shake {
    animation: shake 0.4s ease-in-out;
}

.dropzone.error .dropzone__icon {
    color: #dc2626;
}

.dropzone-error-text {
    color: #dc2626;
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.5rem;
    display: none;
}

.dropzone.error .dropzone-error-text {
    display: block;
}
