/* JEE/NEET Class Reporting Portal — shared stylesheet.
   No external framework dependency (no Bootstrap vendoring) — everything
   here is plain CSS with flexbox/grid, kept in one file so every page in
   Admin/DPO/HM looks consistent by construction rather than by copy-paste. */

:root {
    /* BSEB brand maroon — matches the board's actual site (header bar,
       primary buttons) and the STET Refund Portal built earlier this
       session. --navy/--navy-dark drive chrome (topbar, headings);
       --accent/--accent-dark are for actionable buttons (Save, Watch Now,
       Submit) — a warmer shade of the same maroon family rather than an
       unrelated color, since the reference site uses one brand color
       throughout instead of a two-hue scheme. Token names kept as-is
       (--navy) to avoid touching every rule that references them. */
    --navy: #7a1620;
    --navy-dark: #5c0f18;
    --accent: #9c1b22;
    --accent-dark: #7a151b;
    --ink: #1c2530;
    --ink-soft: #5a6472;
    --line: #d8dee6;
    --bg: #f2f4f7;
    --surface: #ffffff;
    --danger: #FF0000;
    --danger-bg: #fbe9e7;
    --warn: #92600a;
    --warn-bg: #fdf1d9;
    --ok: #00B050;
    --ok-bg: #e3f3ea;
    --radius: 10px;

    /* Stat-card accents (Admin/Dashboard.aspx, DPO/Dashboard.aspx) — three
       distinct hues so the top summary cards read at a glance instead of
       all sharing one muted tint. */
    --stat-blue: #2c4ea3;
    --stat-blue-bg: #e8ecf9;
    --stat-teal: #0f8f74;
    --stat-teal-bg: #e2f5ef;
    --stat-amber: #b9720f;
    --stat-amber-bg: #fbeed9;
    --stat-purple: #6a3fa0;
    --stat-purple-bg: #efe7f7;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    /* Sticky footer: min-height (not height) so a page with enough content
       to scroll still grows past one viewport normally — only a short page
       (e.g. "no classes scheduled today") gets .page-shell stretched to
       fill the leftover space below, pushing the footer flush to the
       bottom of the viewport instead of leaving an inconsistent gap. */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

form { display: flex; flex-direction: column; flex: 1 0 auto; }

a { color: var(--navy); }

/* ---------- topbar ---------- */

.topbar {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
    color: #fff;
}

.topbar-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    font-weight: 600;
    margin-right: auto;
}

.brand-logo {
    height: 40px;
    width: auto;
    display: block;
    background: #fff;
    padding: 4px;
    border-radius: 6px;
}

.nav-links { display: flex; gap: 6px; flex-wrap: wrap; }

.nav-link {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 6px;
}

.nav-link:hover { background: rgba(255,255,255,0.12); color: #fff; }

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    box-shadow: 0 1px 2px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.06);
    padding: 6px 14px 6px 6px;
    border-radius: 24px;
}

.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.14);
    color: #ffd873;
}

.user-role {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    font-size: 11.5px;
    color: #ffd873;
}

/* The trigger is just avatar + role badge — mobile number and the
   DPO-district/HM-school detail line used to sit here always-visible,
   cluttering the topbar on every page. They now live in .user-popover
   below, revealed on hover/focus of this trigger instead — the chip stays
   compact by default and the details are one hover away, not permanent. */
.user-trigger {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    outline: none;
    padding: 3px 8px 3px 3px;
    border-radius: 16px;
    transition: background-color 0.15s ease;
}

.user-trigger:hover,
.user-trigger:focus-within {
    background: rgba(255,255,255,0.10);
}

.user-trigger:hover .user-avatar,
.user-trigger:focus-within .user-avatar {
    transform: scale(1.08);
    box-shadow: 0 0 0 3px rgba(255,216,115,0.28);
}

.user-avatar { transition: transform 0.15s ease, box-shadow 0.15s ease; }

.user-popover {
    position: absolute;
    top: calc(100% + 14px);
    /* Right-anchored, not left — the trigger sits at the far right of the
       topbar, so a left:0 popover wider than the trigger (min-width here
       is 240px) pushed its right edge past the viewport edge. Since it's
       position:absolute, that overflow still counted toward the page's
       scrollable width, which is what put a horizontal scrollbar on every
       page regardless of actual content. */
    right: 0;
    min-width: 240px;
    background: #fff;
    color: var(--ink);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(15, 37, 66, 0.26);
    text-align: left;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px) scale(0.96);
    transform-origin: top right;
    transition: opacity 0.16s ease, transform 0.2s cubic-bezier(.34,1.4,.4,1), visibility 0.16s;
    z-index: 60;
}

/* Small arrow connecting the popover back to the trigger it belongs to —
   without it, a floating white card appearing out of nowhere below the
   topbar reads as disconnected from whatever opened it. Positioned from
   the right to match the popover's own right-anchoring above. Colored to
   match the header it touches (not plain white) — and .user-popover no
   longer clips with overflow:hidden, which previously cut this arrow off
   entirely since it sits outside the box via a negative top offset; the
   header/body below round their own corners instead. */
.user-popover::before {
    content: "";
    position: absolute;
    top: -5px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: var(--navy);
    transform: rotate(45deg);
    border-radius: 2px 0 0 0;
}

.user-trigger:hover .user-popover,
.user-trigger:focus-within .user-popover,
.user-trigger:focus .user-popover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.user-popover-header {
    background: linear-gradient(135deg, var(--navy), var(--accent));
    color: #ffd873;
    padding: 10px 16px;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    position: relative;
    border-radius: 12px 12px 0 0;
}

.user-popover-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 12px 16px 14px;
    border-radius: 0 0 12px 67px;
}

/* First row — the person's own name, given the most emphasis of the three
   (largest/darkest text) since it's the most identifying piece of info. */
.user-popover .user-name {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-weight: 700;
    font-size: 13.5px;
}

.user-popover .user-name svg { flex-shrink: 0; color: var(--accent); }

.user-popover .user-mobile {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-weight: 600;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.user-popover .user-mobile svg { flex-shrink: 0; color: var(--ink-soft); }

/* Role-specific supporting detail — a DPO's district, or an HM's name and
   school. */
.user-popover .user-detail {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--ink-soft);
}

.user-detail svg { flex-shrink: 0; margin-top: 2px; }

.btn-logout {
    background: rgba(255,255,255,0.14);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.18);
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.btn-logout:hover { background: rgba(255,255,255,0.26); }

/* ---------- shell / cards ---------- */

.page-shell {
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px 64px;
    flex: 1 0 auto;
}

.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 1.5rem; color: var(--navy); margin: 0 0 4px; }
/* No max-width here on purpose: every card/table below a page-header spans
   the full page-shell width, so capping just this short subtitle to a
   readable-prose line length made it look narrower than everything else
   on the page instead of more readable — it's 1-3 lines, not a paragraph
   of running text, so the readability concern that width cap solves
   doesn't really apply here. */
.page-header p { color: var(--ink-soft); margin: 0; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(15, 37, 66, 0.04), 0 6px 20px rgba(15, 37, 66, 0.06);
    padding: 24px 28px;
    margin-bottom: 24px;
}

.card h2 {
    font-size: 1.05rem;
    color: var(--navy);
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

/* ---------- forms ---------- */

.form-row { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.form-group { flex: 1 1 220px; min-width: 0; }
.form-group.full { flex-basis: 100%; }

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: var(--ink-soft);
    margin-bottom: 6px;
}

.form-control,
input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="time"], input[type="tel"], select, textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #c7cfd9;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--ink);
}

.form-control:focus, input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(22, 52, 92, 0.12);
}

.field-error { color: var(--danger); font-size: 12.5px; display: block; margin-top: 5px; }
.field-hint { color: var(--ink-soft); font-size: 12px; display: block; margin-top: 5px; }

/* Segmented Yes/No toggle (HM/SubmitReport.aspx "Was Class N held?") —
   the underlying <input type="radio"> stays real and keyboard/screen-reader
   accessible, just visually hidden; its <label> becomes the clickable
   pill. Pure CSS, no JS — :checked + label is enough to react instantly
   to a click before the AutoPostBack round trip even completes. */
.radio-group {
    display: inline-flex;
    margin-top: 6px;
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid #c7cfd9;
}

.radio-group input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Qualified as .form-group .radio-group label (not just .radio-group
   label) purely for CSS specificity: the site-wide ".form-group label"
   rule (display:block, for ordinary field labels) has the same
   specificity as a bare ".radio-group label" would, so which one wins
   would depend on source order alone — fragile. The extra ".form-group"
   qualifier gives this rule strictly higher specificity so it always wins
   regardless of where either rule sits in the file. */
.form-group .radio-group label {
    display: inline-block;
    margin: 0;
    padding: 9px 26px;
    font-weight: 600;
    font-size: 13.5px;
    color: var(--ink-soft);
    background: #fff;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    user-select: none;
}

.form-group .radio-group label:not(:first-of-type) { border-left: 1px solid #c7cfd9; }

.form-group .radio-group input[type="radio"]:checked + label {
    background: var(--accent);
    color: #fff;
}

.form-group .radio-group label:hover { background: #f4f1ee; }
.form-group .radio-group input[type="radio"]:checked + label:hover { background: var(--accent-dark); }

.form-group .radio-group input[type="radio"]:focus-visible + label { box-shadow: inset 0 0 0 2px var(--navy); }

/* Groups each class's held/not-held question + its follow-up fields into
   one visually distinct block, instead of a bare heading with nothing
   separating it from the page background. */
.class-block {
    background: #fbfbfa;
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    padding: 18px 20px;
    margin-bottom: 20px;
}

.class-block .form-row:last-child { margin-bottom: 0; }

.btn {
    display: inline-block;
    border: none;
    border-radius: 6px;
    padding: 11px 22px;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); color: #fff; }

.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); color: #fff; }

.btn-secondary { background: #eef1f5; color: var(--ink); }
.btn-secondary:hover { background: #e2e7ee; }

.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* Compact action link for table cells — e.g. HM/VideoArchive.aspx's per-subject "Watch" cells. */
.btn-view {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}
.btn-view:hover { background: var(--accent-dark); color: #fff; }

/* HM/VideoArchive.aspx: a cell the school has already clicked reads as
   confirmed-done rather than another identical call to action. */
.btn-view-watched {
    background: transparent;
    color: var(--ok);
    border: 1.5px solid var(--ok);
    padding: 2.5px 12px;
}
.btn-view-watched:hover { background: var(--ok); color: #fff; }

.today-row td:first-child {
    border-left: 3px solid var(--accent);
    font-weight: 700;
}
.today-badge {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: 8px;
    vertical-align: middle;
}

/* ---------- alerts ---------- */

/* display:block matters here: asp:Label (used for every .alert message
   site-wide) renders as an inline <span> by default, and padding on an
   inline element with wrapped text doesn't reserve vertical space in the
   page's flow — the background bleeds over the surrounding lines instead
   of pushing them apart. Forcing block layout fixes every .alert usage
   at once, regardless of which control renders it. */
.alert { display: block; border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px; font-size: 14px; }
.alert-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid #f1c6c1; }
.alert-warn { background: var(--warn-bg); color: var(--warn); border: 1px solid #f3dfa4; }
.alert-ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #b9e0c8; }

/* ---------- tables ---------- */

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

table.grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    min-width: 560px;
}

table.grid th {
    text-align: left;
    background: #eef2f7;
    color: var(--navy);
    padding: 10px 14px;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--line);
}

table.grid td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

table.grid tbody tr:hover { background: #f7f9fb; }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-yes { background: var(--ok-bg); color: var(--ok); }
.badge-no { background: var(--danger-bg); color: var(--danger); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }

/* ---------- per-subject click rows (DPO dashboard) ---------- */

.subject-click-row {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.subject-click-row + .subject-click-row { margin-top: 4px; }

.subject-click-label {
    display: inline-block;
    min-width: 78px;
    text-align: right;
    color: var(--text-muted, #667085);
    font-size: 13px;
}

/* ---------- HM/Dashboard.aspx: report status call-to-action banner ---------- */

.cta-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 22px;
    border-radius: var(--radius);
    border-left: 4px solid transparent;
    box-shadow: 0 1px 2px rgba(15, 37, 66, 0.04), 0 6px 16px rgba(15, 37, 66, 0.05);
    margin-bottom: 24px;
}

.cta-banner-ok { background: var(--ok-bg); border-left-color: var(--ok); }
.cta-banner-warn { background: var(--warn-bg); border-left-color: var(--warn); }

.cta-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 700;
    flex-shrink: 0;
    font-size: 14px;
}

.cta-banner-ok .cta-icon { background: var(--ok); color: #fff; box-shadow: 0 0 0 4px rgba(20, 108, 67, 0.14); }
.cta-banner-warn .cta-icon { background: var(--warn); color: #fff; box-shadow: 0 0 0 4px rgba(146, 96, 10, 0.14); }

.cta-text { flex: 1 1 auto; font-weight: 600; color: var(--ink); }

.cta-btn {
    flex-shrink: 0;
    padding: 9px 18px;
    border-radius: 7px;
    font-weight: 700;
    font-size: 13.5px;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(15, 37, 66, 0.1);
    transition: filter 0.15s ease, transform 0.15s ease;
}

.cta-btn:hover { filter: brightness(0.92); transform: translateY(-1px); }
.cta-btn-ok { background: var(--ok); color: #fff; }
.cta-btn-warn { background: var(--warn); color: #fff; }

.watched-summary-pill {
    display: inline-block;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--navy);
    background: rgba(122, 22, 32, 0.07);
    border: 1px solid rgba(122, 22, 32, 0.14);
    padding: 5px 12px;
    border-radius: 20px;
}

/* ---------- video link tiles (HM dashboard) ---------- */

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

.video-tile {
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    background: linear-gradient(180deg, #fff 0%, #fbfcfd 100%);
    box-shadow: 0 1px 2px rgba(15, 37, 66, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.video-tile:hover {
    transform: translateY(-3px);
    border-color: #cfd8e3;
    box-shadow: 0 10px 22px rgba(15, 37, 66, 0.12);
}

.video-tile.watched { background: var(--ok-bg); border-color: #bcdfc9; }

.video-tile-badge { position: absolute; top: 14px; right: 14px; }

.video-tile .class-tag {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--navy);
    background: rgba(122, 22, 32, 0.08);
    padding: 3px 9px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.video-tile.watched .class-tag { color: var(--ok); background: rgba(20, 108, 67, 0.1); }

.video-tile .subject {
    font-weight: 700;
    font-size: 1.02rem;
    color: var(--navy);
    margin-bottom: 12px;
    display: block;
}

.video-tile-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.video-tile .watch-link {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 8px 16px;
    border-radius: 7px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(156, 27, 34, 0.25);
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.video-tile .watch-link:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 4px 10px rgba(156, 27, 34, 0.3); }

.video-tile.watched .watch-link {
    background: transparent;
    border: 1.5px solid var(--ok);
    color: var(--ok);
    padding: 6.5px 16px;
    box-shadow: none;
}

.copy-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1.5px solid var(--line);
    color: var(--ink-soft);
    padding: 6.5px 12px;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.copy-link-btn:hover { border-color: var(--navy); color: var(--navy); }

.copy-link-btn:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

.copy-link-btn.copied { border-color: var(--ok); color: var(--ok); background: var(--ok-bg); }

.video-tile.watched .watch-link:hover { background: var(--ok); color: #fff; box-shadow: 0 4px 10px rgba(20, 108, 67, 0.25); }

.video-tile.no-link { color: var(--ink-soft); font-size: 13.5px; }

/* ---------- login ---------- */

.login-shell {
    min-height: calc(100vh - 130px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--line);
    box-shadow: 0 10px 30px rgba(15, 37, 66, 0.08);
    padding: 34px 36px;
}

.login-card h1 { font-size: 1.2rem; color: var(--navy); margin: 0 0 22px; text-align: center; }
.login-card .subtitle { text-align: center; color: var(--ink-soft); font-size: 13px; margin-bottom: 26px; }
.login-card .form-group.full { margin-bottom: 20px; }
.login-card .btn-arrow { margin-top: 2px; }

/* Role switcher — three tabs, two of them cross a page boundary (HM's OTP
   flow and Admin/DPO's password flow are genuinely different code paths,
   not just a style choice) but read as one login experience. */
.auth-tabs {
    display: flex;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 28px;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 11px 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    color: var(--navy);
    background: var(--surface);
    border-right: 1px solid var(--line);
}

.auth-tab:last-child { border-right: none; }
.auth-tab:hover { background: #f4f1ee; }

.auth-tab.active {
    background: var(--navy);
    color: #fff;
}

/* Icon-adorned inputs */
.input-icon-wrap { position: relative; }

.input-icon-wrap .field-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-soft);
    pointer-events: none;
    display: flex;
}

.input-icon-wrap input,
.input-icon-wrap .form-control {
    padding-left: 40px;
}

.input-icon-wrap .password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--ink-soft);
    cursor: pointer;
    padding: 4px;
    display: flex;
}

.input-icon-wrap .password-toggle:hover { color: var(--ink); }

.forgot-hint { color: var(--ink-soft); text-align: center; font-size: 12.5px; margin-top: 16px; }

/* Submit button with a leading arrow icon */
.btn-arrow { display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-arrow svg { flex-shrink: 0; }

.site-footer {
    text-align: center;
    color: var(--ink-soft);
    font-size: 12.5px;
    padding: 20px;
    border-top: 1px solid var(--line);
}

@media (max-width: 720px) {
    .topbar-inner { flex-direction: column; align-items: stretch; }
    .nav-links { justify-content: center; }
    .user-chip { justify-content: center; }
    .page-shell { padding: 22px 16px 48px; }
    .card { padding: 18px 18px; }
}

/* ---------- Admin/Dashboard.aspx: summary cards ---------- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 2px 10px rgba(15, 37, 66, 0.05);
    padding: 18px 20px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--stat-accent, var(--line));
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(15, 37, 66, 0.12);
}

.stat-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--stat-accent-bg, var(--ok-bg));
    color: var(--stat-accent, var(--navy));
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg { width: 22px; height: 22px; }

.stat-value { font-size: 1.9rem; font-weight: 700; color: var(--stat-accent, var(--navy)); line-height: 1.1; }
.stat-label { font-weight: 600; font-size: 13px; color: var(--ink); margin-top: 4px; }
.stat-sub { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

/* Three accent variants — set the two custom properties above per card,
   everything else (border, icon circle, big number) follows automatically. */
.stat-card-blue { --stat-accent: var(--stat-blue); --stat-accent-bg: var(--stat-blue-bg); }
.stat-card-teal { --stat-accent: var(--stat-teal); --stat-accent-bg: var(--stat-teal-bg); }
.stat-card-amber { --stat-accent: var(--stat-amber); --stat-accent-bg: var(--stat-amber-bg); }

/* ---------- Daily Reporting Status / Attendance Overview mini-cards ---------- */

.mini-stat-row { display: flex; gap: 16px; margin: 12px 0; }
.mini-stat { flex: 1; padding: 14px 16px; border-radius: var(--radius); }
.mini-stat-ok { background: var(--ok-bg); }
.mini-stat-warn { background: var(--warn-bg); }
.mini-stat-blue { background: var(--stat-blue-bg); }
.mini-stat-amber { background: var(--stat-amber-bg); }
.mini-stat-purple { background: var(--stat-purple-bg); }
.mini-stat-value { font-size: 1.6rem; font-weight: 700; color: var(--ink); }
.mini-stat-blue .mini-stat-value { color: var(--stat-blue); }
.mini-stat-amber .mini-stat-value { color: var(--stat-amber); }
.mini-stat-purple .mini-stat-value { color: var(--stat-purple); }

.progress-row { display: flex; justify-content: space-between; margin-top: 6px; margin-bottom: 6px; }

.progress-bar {
    background: #e9edf2;
    border-radius: 20px;
    height: 8px;
    overflow: hidden;
}

.progress-fill {
    background: var(--accent);
    height: 100%;
    border-radius: 20px;
    transition: width 0.3s ease;
}

/* ---------- District Reporting Performance (CSS bar chart) ---------- */

/* The chart is a fixed 0-100% scale on purpose — this is a compliance
   dashboard, so a bar's height must mean the same thing every time you
   look at it, even on a day when every district happens to be low (e.g.
   early morning before HMs have submitted). The axis column exists so
   that a mostly-empty chart on a slow-reporting day reads as "scale
   showing genuinely low numbers" instead of "something is broken." */
.bar-chart-outer { display: flex; gap: 8px; }

.bar-chart-axis {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    height: 160px;
    padding: 10px 0 1px;
    font-size: 10px;
    color: var(--ink-soft);
}

.bar-chart-wrap {
    flex: 1 1 auto;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    overflow-x: auto;
    padding-top: 10px;
    /* Reserves room for the horizontal scrollbar itself (~14-18px
       depending on OS/browser) below the tallest label — without this, the
       scrollbar draws flush against the content's bottom edge and visually
       cuts across whichever district name is longest (e.g. "PASHCHIM
       CHAMPARAN"), since that's the one label tall enough to actually
       reach down into where the scrollbar sits. */
    padding-bottom: 18px;
    /* Gridlines sized+pinned to exactly the 160px plot height (matching
       .bar-chart-plot below), not the wrap's own height — the wrap's
       height is now auto (plot + label), and letting the gridline
       background repeat across that full auto height would draw stray
       lines down into the label row. The gridline pattern's own bottom
       edge (from its "to top" direction) lands exactly at the 160px mark,
       which is what used to be a separate border-bottom — one less thing
       that could fall out of sync with the plot height. */
    background-image: repeating-linear-gradient(to top, var(--line) 0, var(--line) 1px, transparent 1px, transparent 25%);
    background-size: 100% 160px;
    background-repeat: no-repeat;
    background-position: top left;
}

/* Rendered as an <a> (LinkButton) on Admin's District chart, a plain <div>
   on DPO's Block chart — either way this is just the outer column now; the
   fixed-height plot box that used to live directly on this element moved
   to .bar-chart-plot below. That split is the actual fix for labels
   overlapping the plot area: previously the bar AND the label shared one
   160px box (via height:100% + justify-content:flex-end), so a long block
   name (e.g. "BAGAHA-II (SIDHAW)") needing more than 160px total pushed
   the whole group upward — with overflow-x:auto forcing overflow-y to
   clip too, the label ended up appearing to float mid-chart instead of
   sitting below the 0% line. Now the plot is its own fixed 160px box
   (always correctly baseline-aligned regardless of label length) and the
   label is a normal-flow sibling that simply renders after it. */
.bar-chart-col {
    /* grow to fill spare width when there are few columns (e.g. a district
       with only 9 blocks) instead of leaving a bare gap on the right, but
       never shrink below 26px — a district with 30+ blocks still falls
       back to the wrap's overflow-x:auto and scrolls rather than squeezing
       bars down to illegibility. */
    flex: 1 0 26px;
    max-width: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
}

.bar-chart-plot {
    width: 100%;
    height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

.bar-chart-col:hover .bar-chart-bar { background: var(--navy) !important; }
.bar-chart-col:hover .bar-chart-label { color: var(--navy); font-weight: 700; }
.bar-chart-col:hover .bar-chart-value { color: var(--navy); font-weight: 700; }

.bar-chart-bar {
    display: block;
    width: 14px;
    min-height: 3px;
    background: var(--accent);
    border-radius: 3px 3px 0 0;
}

/* Same red/amber/green tiers as the reporting-% badges elsewhere on this
   dashboard, so a bar's color alone says roughly where it stands even
   before reading its value label. */
.bar-chart-bar.bar-good { background: var(--ok); }
.bar-chart-bar.bar-warn { background: var(--warn); }
.bar-chart-bar.bar-bad { background: var(--danger); }

.bar-chart-value {
    display: block;
    font-size: 9.5px;
    font-weight: 700;
    color: var(--ink-soft);
    margin-bottom: 3px;
    white-space: nowrap;
}

/* Reverted from a 45° angle back to fully vertical — at a 45° slant, each
   rotated label's diagonal footprint spilled into the neighboring 26px
   column and got covered by it (only the last few characters stayed
   visible, e.g. "BAGAHA-I" read as "A-I"). Columns would need to be much
   wider apart to fit angled text without overlapping, which isn't worth
   it here — vertical is fully readable and doesn't have that problem. */
.bar-chart-label {
    display: block;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 9.5px;
    color: var(--ink-soft);
    margin-top: 6px;
    white-space: nowrap;
}

/* ---------- Subject-wise Sessions (CSS conic-gradient donut) ---------- */

.donut-wrap { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }

.donut {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}

.donut::after {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: 84px; height: 84px;
    background: var(--surface);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.donut-legend { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.donut-legend li { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex-shrink: 0; }

/* ---------- Data tabs (Admin/Dashboard.aspx) ---------- */

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 18px;
}

.tab-btn {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 10px 16px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-soft);
    cursor: pointer;
    font-family: inherit;
}

.tab-btn:hover { color: var(--navy); }

.tab-btn.active {
    color: var(--navy);
    border-bottom-color: var(--accent);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Admin/Dashboard.aspx: table pager ---------- */

.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
}

.pager .btn { min-width: 90px; text-align: center; }

/* A disabled LinkButton renders as plain text, not a link — style it to
   look like a real (greyed-out) button anyway so Prev/Next don't visually
   collapse to bare text at the ends of the result set. */
.pager span.btn { display: inline-block; opacity: 0.45; cursor: default; }

/* ---------- numbered pagination bar (School Status / Not Reported) ---------- */

.pager-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
}

.pager-size {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--ink-soft);
}

.pager-size select {
    width: auto;
    padding: 5px 26px 5px 10px;
    font-size: 13px;
}

.pager-results {
    font-style: italic;
    color: var(--ink-soft);
    font-size: 13px;
}

.pager-numbers {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pager-numbers .page-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #c7cfd9;
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
}

.pager-numbers .page-btn:hover:not(.active) { background: #f4f1ee; }
.pager-numbers .page-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); cursor: default; }

/* Prev/Next arrows reuse .page-btn's box but read distinctly — a disabled
   LinkButton renders as a plain <span>, same greyed-out treatment as the
   older text-based pager above. */
.pager-numbers span.page-arrow { opacity: 0.4; cursor: default; }

.pager-numbers .page-ellipsis {
    padding: 0 4px;
    color: var(--ink-soft);
}

/* ---------- Admin/Dashboard.aspx: AJAX loading overlay ---------- */

.dashboard-loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    background: var(--navy);
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.dashboard-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: dashboard-spin 0.7s linear infinite;
}

@keyframes dashboard-spin {
    to { transform: rotate(360deg); }
}

.donut-total {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}

.donut-total .donut-total-value { font-size: 1.3rem; font-weight: 700; color: var(--navy); line-height: 1; }
.donut-total .donut-total-label { font-size: 10px; color: var(--ink-soft); }

/* ---------- print ---------- */

/* Print-only content (e.g. DPO Dashboard's full unfiltered Schools table)
   — hidden on screen, revealed only inside @media print below. Opposite
   number of .no-print. */
.print-only { display: none; }

@media print {
    @page { size: landscape; margin: 12mm; }

    .no-print, .topbar, .site-footer, .tabs { display: none !important; }
    .print-only { display: block !important; }
    .card { box-shadow: none; border: 1px solid #999; break-inside: avoid; }

    /* .table-wrap's overflow-x:auto and table.grid's min-width are both
       built for an on-screen scrollbar — there's no scrollbar on paper, so
       a wide table (e.g. DPO Dashboard's 7+ column Schools grid) was just
       getting clipped at the page edge instead of shrinking to fit it.
       Letting both go back to their natural width, plus a smaller font and
       tighter padding, is what actually gets every column onto the page. */
    .table-wrap { overflow: visible; }
    table.grid { min-width: 0; width: 100%; table-layout: fixed; font-size: 10.5px; }
    table.grid th, table.grid td { padding: 5px 6px; overflow-wrap: break-word; }
    table.grid th { white-space: normal; }
}

/* ---------- mobile: components added after the original 720px block ----------
   The original breakpoint (near the top of this file) covers the topbar/nav
   shell. Everything below targets components that didn't exist yet when that
   was written — dashboards, tabs, the segmented Yes/No toggle, banners — and
   were never actually verified on a real phone screen, just on desktop
   browser widths. Written defensively (stack instead of overflow, bigger
   touch targets); still worth confirming on an actual device. */
@media (max-width: 600px) {
    .stat-grid { grid-template-columns: 1fr; }

    .form-row { gap: 12px; }
    .form-row .form-group { flex-basis: 100% !important; max-width: none !important; }

    .mini-stat-row { flex-direction: column; }

    .cta-banner { flex-wrap: wrap; }
    .cta-btn { flex-basis: 100%; text-align: center; }

    .radio-group { width: 100%; }
    .radio-group label { flex: 1; text-align: center; }

    .donut-wrap { justify-content: center; text-align: center; }

    .pager { flex-wrap: wrap; gap: 10px; }
    .pager .btn { min-width: 0; flex: 1 1 40%; }

    .tab-btn { padding: 9px 12px; font-size: 12.5px; }

    table.grid { font-size: 12.5px; }
    table.grid th, table.grid td { padding: 8px 10px; }

    /* Buttons and links used as tap targets shouldn't be smaller than the
       ~44px minimum comfortable touch size on a phone. */
    .btn, .btn-view, .cta-btn { min-height: 40px; }

    .class-block { padding: 14px 14px; }
}
