:root{
  --blue-700:#1747A8; --blue-600:#1D5BD8; --blue-500:#2E6BE6; --blue-100:#DCE8FF; --blue-50:#EEF4FF;
  --navy-900:#0B1F3F; --navy-800:#0E2A5C; --navy-700:#143670;
  --ink:#0B1F3F; --slate:#5A6B87; --muted:#8A97AE;
  --line:#E3E9F4; --bg:#F4F7FC; --white:#FFFFFF;
  --green-600:#12925F; --green-50:#E9F8F1;
  --red-600:#D92D3A; --red-50:#FDEDEE;
  --amber-600:#B76E00; --amber-50:#FFF6E6;
  --r-card:16px; --r-ctl:10px;
  --shadow-sm:0 1px 2px rgba(11,31,63,.06);
  --shadow-md:0 8px 24px rgba(11,31,63,.08);
  --shadow-lg:0 24px 64px rgba(11,31,63,.18);
  --font-display:'Manrope',system-ui,sans-serif;
  --font-body:'Inter',system-ui,sans-serif;
  --font-mono:'JetBrains Mono',ui-monospace,monospace;
}
*{margin:0;padding:0;box-sizing:border-box}
html{scroll-behavior:smooth}
body{font-family:var(--font-body);background:var(--bg);color:var(--ink);font-size:14px;line-height:1.55}
h1,h2,h3,h4{font-family:var(--font-display);letter-spacing:-.01em}
button{font-family:inherit;cursor:pointer}
input,select{font-family:inherit}
a{color:inherit}
:focus-visible{outline:2px solid var(--blue-600);outline-offset:2px;border-radius:4px}
@media (prefers-reduced-motion: reduce){*{animation:none!important;transition:none!important}}

/* ---------- Shared controls ---------- */
.btn{display:inline-flex;align-items:center;gap:8px;border-radius:var(--r-ctl);font-weight:600;font-size:13.5px;padding:10px 18px;border:1px solid transparent;transition:background .15s,box-shadow .15s,border-color .15s}
.btn svg{flex:none}
.btn-primary{background:var(--blue-600);color:#fff;box-shadow:var(--shadow-sm)}
.btn-primary:hover{background:var(--blue-700)}
.btn-primary:disabled{background:var(--muted);cursor:not-allowed}
.btn-secondary{background:#fff;color:var(--ink);border-color:var(--line)}
.btn-secondary:hover{border-color:var(--blue-500);color:var(--blue-600)}
.btn-ghost{background:var(--blue-50);color:var(--blue-600)}
.btn-ghost:hover{background:var(--blue-100)}
.btn-danger{background:var(--red-600);color:#fff}
.btn-danger:hover{background:#B92430}
.btn-danger-soft{background:var(--red-50);color:var(--red-600)}
.btn-danger-soft:hover{background:#FADDE0}
.btn-lg{padding:13px 26px;font-size:14.5px;border-radius:12px}
.btn.is-submitting{filter:blur(1.5px);opacity:.6;pointer-events:none;cursor:not-allowed}
.btn-sm{padding:6px 12px;font-size:12.5px;border-radius:8px}
.field label{display:block;font-weight:600;font-size:13px;margin-bottom:7px;color:var(--ink)}
.field .hint{font-size:12px;color:var(--muted);margin-top:6px}
.field .err{font-size:12px;color:var(--red-600);margin-top:6px}
.input,.select{width:100%;border:1px solid var(--line);border-radius:var(--r-ctl);padding:11px 14px;font-size:14px;color:var(--ink);background:#fff;transition:border-color .15s,box-shadow .15s}
.input::placeholder{color:var(--muted)}
.input:focus,.select:focus{outline:none;border-color:var(--blue-500);box-shadow:0 0 0 3px var(--blue-50)}
.input.invalid{border-color:var(--red-600)}
.tag-box{display:flex;flex-wrap:wrap;gap:6px;align-items:center;width:100%;border:1px solid var(--line);border-radius:var(--r-ctl);padding:8px 10px;background:#fff;transition:border-color .15s,box-shadow .15s}
.tag-box:focus-within{border-color:var(--blue-500);box-shadow:0 0 0 3px var(--blue-50)}
.tag-box input{flex:1;min-width:140px;border:none;outline:none;padding:4px 2px;font-size:14px;color:var(--ink);background:transparent}
.tag-box input::placeholder{color:var(--muted)}
.tag-chip{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:600;padding:4px 8px 4px 10px;border-radius:999px;background:var(--blue-50);color:var(--blue-600);white-space:nowrap}
.tag-chip button{display:flex;align-items:center;justify-content:center;border:none;background:none;color:inherit;cursor:pointer;padding:0;font-size:15px;line-height:1;opacity:.65}
.tag-chip button:hover{opacity:1}
.select{appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235A6B87' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;padding-right:38px;cursor:pointer}
.search{position:relative}
.search .input{padding-left:38px}
.search svg{position:absolute;left:12px;top:50%;transform:translateY(-50%);color:var(--muted)}
.card{background:#fff;border:1px solid var(--line);border-radius:var(--r-card);box-shadow:var(--shadow-sm)}
.chip{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:600;padding:4px 10px;border-radius:999px}
.chip-blue{background:var(--blue-50);color:var(--blue-600)}
.chip-green{background:var(--green-50);color:var(--green-600)}
.chip-amber{background:var(--amber-50);color:var(--amber-600)}
.chip-red{background:var(--red-50);color:var(--red-600)}
.mono{font-family:var(--font-mono);font-size:12.5px}

/* ---------- Tables ---------- */
.table-wrap{overflow-x:auto;border-radius:0 0 var(--r-card) var(--r-card)}
table{width:100%;border-collapse:collapse;min-width:720px}
thead th{font-family:var(--font-display);font-size:11.5px;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--slate);text-align:left;padding:12px 16px;background:#F8FAFE;border-bottom:1px solid var(--line);white-space:nowrap}
tbody td{padding:13px 16px;border-bottom:1px solid var(--line);font-size:13.5px;white-space:nowrap}
tbody tr:last-child td{border-bottom:0}
tbody tr:hover td{background:#FAFCFF}
tbody tr.row-checked td{background:var(--green-50)}
tbody tr.row-checked:hover td{background:var(--green-50)}
.row-checkbox{accent-color:var(--green-600)}
.already-selected-dot{display:inline-block;width:10px;height:10px;border-radius:50%;background:var(--green-600)}
td.num{font-variant-numeric:tabular-nums}

/* ---------- Modals ---------- */
.overlay{position:fixed;inset:0;background:rgba(11,31,63,.45);backdrop-filter:blur(2px);display:none;align-items:center;justify-content:center;z-index:300;padding:20px}
.overlay.open{display:flex;animation:fadeIn .18s ease}
.modal{background:#fff;border-radius:20px;box-shadow:var(--shadow-lg);width:100%;max-width:480px;overflow:hidden;animation:pop .2s ease}
.modal-lg{max-width:560px}
.modal-xl{max-width:760px}
.modal-head{padding:22px 26px 0;display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.modal-head h3{font-size:17px;font-weight:700}
.modal-x{background:var(--bg);border:0;width:30px;height:30px;border-radius:8px;color:var(--slate);font-size:15px;line-height:1;flex:none}
.modal-x:hover{background:var(--line)}
.modal-body{padding:14px 26px 24px;color:var(--slate);font-size:14px}
.modal-foot{padding:16px 26px;background:#F8FAFE;border-top:1px solid var(--line);display:flex;justify-content:flex-end;gap:10px}

/* Filters modal (Results/Users/Selected Students): can grow tall as
   conditions are added, so it's capped to the viewport and only the body
   scrolls — the head and Apply button stay put and visible either way.
   .modal-body/.modal-foot are nested inside <form>, not direct children of
   .modal, so the <form> itself has to join the flex column too — otherwise
   it's just a plain block that grows to fit its content and the max-height
   on .modal never actually constrains anything inside it. min-height:0 on
   both the form and modal-body is required: a flex child otherwise defaults
   to min-height:auto (its own content size), which would let it grow past
   the parent's height instead of actually scrolling. */
#modal-filters .modal{max-height:88vh;display:flex;flex-direction:column}
#modal-filters .modal>form{display:flex;flex-direction:column;flex:1 1 auto;min-height:0}
#modal-filters .modal-body{flex:1 1 auto;min-height:0;overflow-y:auto}

#scoreFilterRows{display:flex;flex-direction:column;gap:8px}
/* flex-wrap + flexible bases so a row reflows onto more lines on a narrow
   modal instead of overflowing sideways, using whatever width is available
   rather than fixed pixel columns. */
.score-filter-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.score-filter-row .filter-junction{flex:0 0 78px;font-weight:700}
.score-filter-row .filter-field{flex:1 1 140px;min-width:120px}
.score-filter-row .filter-op{flex:1 1 120px;min-width:110px}
.score-filter-row .filter-value{flex:1 1 100px;min-width:90px}
.score-filter-row .filter-remove{flex:0 0 auto;margin-left:auto}
/* The first condition has nothing before it to combine with — its Junction
   dropdown is meaningless (see FilterState.Matches), so it's hidden rather
   than rendered as a confusing no-op control. Pure CSS :first-child means
   this adapts automatically as rows are added/removed in JS, no bookkeeping
   needed to track "which row is currently first". */
#scoreFilterRows .score-filter-row:first-child .filter-junction{display:none}
.warn-ico{width:44px;height:44px;border-radius:12px;background:var(--red-50);color:var(--red-600);display:flex;align-items:center;justify-content:center;flex:none}
.detail-grid{display:grid;grid-template-columns:150px 1fr;row-gap:12px;column-gap:16px;font-size:13.5px}
.detail-grid dt{color:var(--muted);font-weight:500}
.detail-grid dd{color:var(--ink);font-weight:500}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
@keyframes pop{from{opacity:0;transform:translateY(10px) scale(.98)}to{opacity:1;transform:none}}

/* =========================================================
   USER PORTAL
========================================================= */
.user-top{background:linear-gradient(135deg,var(--navy-800) 0%,var(--blue-700) 70%,var(--blue-600) 100%);color:#fff;position:relative;overflow:hidden}
.user-top::after{content:"";position:absolute;inset:0;background-image:radial-gradient(rgba(255,255,255,.14) 1px,transparent 1px);background-size:22px 22px;mask-image:linear-gradient(to bottom,rgba(0,0,0,.9),transparent)}
.user-top-inner{max-width:860px;margin:0 auto;padding:34px 24px 92px;position:relative;z-index:1}
.brand{display:flex;align-items:center;gap:10px;font-family:var(--font-display);font-weight:800;font-size:16px}
.brand-mark{width:32px;height:32px;border-radius:9px;background:#fff;color:var(--blue-600);display:flex;align-items:center;justify-content:center;font-size:15px;font-weight:800}
.brand .tag{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.1em;background:rgba(255,255,255,.16);padding:4px 10px;border-radius:999px;margin-left:6px}
.user-top h1{font-size:clamp(22px,4vw,30px);font-weight:800;margin-top:26px}
.user-top p{color:#C6D6F5;margin-top:6px;max-width:520px}
.user-main{max-width:860px;margin:-56px auto 0;padding:0 24px 40px;position:relative;z-index:2;display:flex;flex-direction:column;gap:20px}
.section-card{padding:26px 28px}
.section-head{display:flex;align-items:center;gap:12px;margin-bottom:20px}
.step-badge{width:34px;height:34px;border-radius:10px;background:var(--blue-50);color:var(--blue-600);font-family:var(--font-display);font-weight:800;font-size:14px;display:flex;align-items:center;justify-content:center;flex:none}
.section-head h2{font-size:16.5px;font-weight:700}
.section-head span{display:block;font-size:12.5px;color:var(--muted);font-weight:400;font-family:var(--font-body);margin-top:2px}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:18px}
@media(max-width:640px){.grid-2{grid-template-columns:1fr}}
.q-card{border:1px solid var(--line);border-radius:14px;padding:20px 22px;transition:border-color .15s}
.q-card:hover{border-color:#CBD9F2}
.q-card + .q-card{margin-top:14px}
.q-head{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.q-no{width:38px;height:38px;border-radius:11px;background:var(--navy-800);color:#fff;font-family:var(--font-mono);font-size:12px;display:flex;align-items:center;justify-content:center;flex:none}
.q-text{font-weight:600;font-size:14.5px;line-height:1.5;padding-top:2px}
.q-type{margin-left:auto;flex:none;align-self:flex-start}
/* qno/type/answer input all sit on one row now — cancel the base .q-type's
   right-alignment (built for a two-item header row) so it just follows the
   number in reading order, and let the input grow to fill the rest. */
.q-head .q-type{margin-left:0;align-self:center}
.q-head input.input{flex:1 1 auto}
.opt{display:flex;align-items:center;gap:12px;border:1px solid var(--line);border-radius:11px;padding:12px 14px;cursor:pointer;transition:border-color .15s,background .15s;font-size:13.5px}
#modal-review .modal{max-height:88vh;max-width:min(1400px,94vw);display:flex;flex-direction:column}
/* modal-foot must stay pinned and visible: modal-body needs to be the flexible,
   shrinkable member of the column (flex:1 1 auto + min-height:0) so it scrolls
   internally instead of growing past 88vh and pushing the footer/Submit button
   past .modal's overflow:hidden edge. Must be a direct-child selector, not
   :last-of-type — there's a second, unrelated .modal-body nested inside
   .modal-head (#reviewSummary) that :last-of-type matches instead, since
   it's trivially "last div" among its own one-sibling parent. */
#modal-review .modal > .modal-body{flex:1 1 auto;min-height:0;overflow-y:auto}
.review-list{height:100%;min-height:0;overflow-y:auto;display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:8px;align-content:start;margin-top:4px}
/* Always stacked (chip row, then answer row) regardless of question type —
   a single-line layout would wrap only for the wider "Fill in the blank"
   chip and not "MCQ", making the two types look inconsistent. */
.review-row{border:1px solid var(--line);border-radius:9px;padding:8px 12px;display:flex;flex-direction:column;gap:6px}
.review-row.unanswered{border-color:var(--red-600);background:var(--red-50)}
.review-row-left{display:flex;align-items:center;gap:8px}
.review-row .q-no{width:24px;height:24px;font-size:10px}
.review-answer{font-size:13.5px;font-weight:700;color:var(--ink);text-align:left}
.review-answer .review-answer-label{display:block;font-size:10px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.03em;margin-bottom:1px}
.review-answer.unanswered{color:var(--red-600)}
.opt + .opt{margin-top:9px}
.opt:hover{border-color:var(--blue-500)}
.opt input{accent-color:var(--blue-600);width:16px;height:16px;flex:none}
.opt:has(input:checked){border-color:var(--blue-600);background:var(--blue-50);font-weight:600}
.submit-bar{display:flex;justify-content:flex-end;align-items:center;gap:16px;padding:6px 4px 10px}
.submit-bar .note{font-size:12.5px;color:var(--muted)}
.reveal{display:none}
.reveal.show{display:block;animation:fadeIn .25s ease}

/* Success screen */
.success-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px;background:
  radial-gradient(600px 300px at 50% 0%,var(--blue-50),transparent),var(--bg)}
.success-card{background:#fff;border:1px solid var(--line);border-radius:24px;box-shadow:var(--shadow-md);padding:56px 48px;text-align:center;max-width:440px;width:100%}
.success-ico{width:76px;height:76px;border-radius:50%;background:var(--green-50);color:var(--green-600);display:flex;align-items:center;justify-content:center;margin:0 auto 22px;animation:pop .35s ease}
.success-card h2{font-size:22px;font-weight:800}
.success-card p{color:var(--slate);margin-top:8px}
.success-meta{margin-top:26px;padding-top:22px;border-top:1px dashed var(--line);display:flex;justify-content:center;gap:28px;font-size:12.5px;color:var(--muted)}
.success-meta b{display:block;color:var(--ink);font-size:13.5px;margin-top:2px}
.error-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px;background:var(--bg)}
.error-card{background:#fff;border:1px solid var(--line);border-radius:24px;box-shadow:var(--shadow-md);padding:56px 48px;text-align:center;max-width:440px;width:100%}
.error-ico{width:76px;height:76px;border-radius:50%;background:var(--red-50);color:var(--red-600);display:flex;align-items:center;justify-content:center;margin:0 auto 22px}

/* =========================================================
   ADMIN LOGIN
========================================================= */
.login-wrap{min-height:100vh;display:grid;grid-template-columns:1.05fr 1fr}
@media(max-width:880px){.login-wrap{grid-template-columns:1fr}.login-left{display:none}}
.login-left{background:linear-gradient(160deg,var(--navy-900),var(--navy-800) 55%,var(--blue-700));color:#fff;padding:48px;display:flex;flex-direction:column;justify-content:space-between;position:relative;overflow:hidden}
.login-left::after{content:"";position:absolute;inset:0;background-image:radial-gradient(rgba(255,255,255,.12) 1px,transparent 1px);background-size:24px 24px;mask-image:radial-gradient(circle at 20% 20%,#000,transparent 70%)}
.login-left h2{font-size:clamp(24px,3vw,34px);font-weight:800;line-height:1.25;max-width:420px;position:relative;z-index:1}
.login-points{position:relative;z-index:1;display:flex;flex-direction:column;gap:14px;color:#C6D6F5;font-size:13.5px}
.login-points div{display:flex;gap:10px;align-items:flex-start}
.login-points svg{flex:none;margin-top:2px;color:#7FA8F5}
.login-right{display:flex;align-items:center;justify-content:center;padding:32px;background:var(--bg)}
.login-card{width:100%;max-width:400px;background:#fff;border:1px solid var(--line);border-radius:20px;box-shadow:var(--shadow-md);padding:38px 36px}
.login-card h3{font-size:20px;font-weight:800}
.login-card>p{color:var(--slate);font-size:13.5px;margin:6px 0 26px}
.login-card .field + .field{margin-top:18px}
.login-card .alert{background:var(--red-50);color:var(--red-600);border-radius:10px;padding:10px 14px;font-size:13px;font-weight:600;margin-bottom:18px}

/* =========================================================
   ADMIN SHELL
========================================================= */
.admin{display:grid;grid-template-columns:248px 1fr;height:100vh;transition:grid-template-columns .15s}
.admin.nav-collapsed{grid-template-columns:68px 1fr}
.admin.nav-collapsed .sidebar{padding:22px 10px}
.admin.nav-collapsed .brand{display:flex;justify-content:center;padding:4px 0 22px}
.admin.nav-collapsed .nav-item{justify-content:center;padding:11px 0}
.admin.nav-collapsed .nav-label{display:none}
@media(max-width:880px){.admin,.admin.nav-collapsed{grid-template-columns:1fr}.admin.nav-collapsed .nav-label{display:inline}.admin.nav-collapsed .brand{justify-content:flex-start;padding:4px 10px 22px}.admin.nav-collapsed .nav-item{justify-content:flex-start;padding:11px 12px}.sidebar{position:fixed;inset:0 30% 0 0;z-index:150;transform:translateX(-100%);transition:transform .2s}.sidebar.open{transform:none}.hamburger{display:inline-flex!important}#navCollapseBtn{display:none}}
.sidebar{background:var(--navy-900);color:#fff;display:flex;flex-direction:column;padding:22px 14px;overflow-y:auto}
.sidebar .brand{padding:4px 10px 22px;border-bottom:1px solid rgba(255,255,255,.09);margin-bottom:16px}
.side-label{font-size:10.5px;text-transform:uppercase;letter-spacing:.12em;color:#6E80A3;font-weight:700;padding:0 12px;margin-bottom:8px}
.nav-item{display:flex;align-items:center;gap:12px;color:#B9C6DE;text-decoration:none;font-size:13.5px;font-weight:600;padding:11px 12px;border-radius:10px;border:0;background:transparent;width:100%;text-align:left;transition:background .15s,color .15s}
.nav-item:hover{background:rgba(255,255,255,.06);color:#fff}
.nav-item.active{background:var(--blue-600);color:#fff}
.nav-item svg{flex:none}
.sidebar .spacer{flex:1}
.nav-item.logout{color:#F2A9B0}
.nav-item.logout:hover{background:rgba(217,45,58,.15);color:#FFC9CE}
.admin-main{display:flex;flex-direction:column;min-width:0;height:100vh;overflow:hidden}
.topbar{background:#fff;border-bottom:1px solid var(--line);padding:14px 28px;display:flex;align-items:center;gap:14px;flex:none}
.hamburger{display:none;background:var(--bg);border:1px solid var(--line);border-radius:8px;width:34px;height:34px;align-items:center;justify-content:center}
.crumb{font-size:12.5px;color:var(--muted)}
.crumb b{color:var(--ink);font-weight:600}
.topbar .admin-user{margin-left:auto;display:flex;align-items:center;gap:10px;font-size:13px;font-weight:600}
.avatar{width:32px;height:32px;border-radius:50%;background:var(--blue-100);color:var(--blue-700);display:flex;align-items:center;justify-content:center;font-weight:800;font-size:12px}
.page{padding:28px;overflow-y:auto;flex:1;min-height:0}
.page-head{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:22px}
.page-head h1{font-size:22px;font-weight:800}
.page-head .sub{color:var(--slate);font-size:13px;margin-top:4px}
.controls{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.toolbar{display:flex;flex-wrap:wrap;gap:12px;align-items:center;padding:16px 18px;border-bottom:1px solid var(--line)}
.toolbar .search{flex:1;min-width:220px}
.stat-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px;margin-bottom:22px}
.stat{background:#fff;border:1px solid var(--line);border-radius:14px;padding:16px 18px}
.stat .k{font-size:12px;color:var(--muted);font-weight:600}
.stat .v{font-family:var(--font-display);font-size:22px;font-weight:800;margin-top:4px}
.stat .v small{font-size:12px;color:var(--green-600);font-weight:700;margin-left:6px}
.row-actions{display:flex;gap:8px}
.icon-btn{width:30px;height:30px;border-radius:8px;border:1px solid var(--line);background:#fff;color:var(--slate);display:inline-flex;align-items:center;justify-content:center}
.icon-btn:hover{border-color:var(--red-600);color:var(--red-600);background:var(--red-50)}
.empty{padding:64px 24px;text-align:center;color:var(--slate)}
.empty .ico{width:56px;height:56px;border-radius:16px;background:var(--blue-50);color:var(--blue-600);display:flex;align-items:center;justify-content:center;margin:0 auto 16px}
.empty h4{font-family:var(--font-display);font-size:16px;color:var(--ink);margin-bottom:6px}
.table-foot{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:10px;padding:13px 18px;font-size:12.5px;color:var(--muted);border-top:1px solid var(--line)}
.table-foot>span{flex:1 1 260px;min-width:0}
.pager{display:flex;gap:6px;flex:0 0 auto;max-width:100%;overflow-x:auto;padding-bottom:2px}
.pager button,.pager a{width:28px;height:28px;flex:none;border-radius:8px;border:1px solid var(--line);background:#fff;font-size:12px;font-weight:600;color:var(--slate);display:inline-flex;align-items:center;justify-content:center;text-decoration:none}
.pager .cur{background:var(--blue-600);border-color:var(--blue-600);color:#fff}

/* ---------- Dense list pages ----------
   Opted into per view with `ViewData["PageClass"] = "dense"` (see
   _AdminLayout's <main class="page …">). These pages have far more columns
   (section-wise scores, Gender/Department, filters) and default to showing
   EVERY row rather than a page of 30, so every element is shrunk to fit as
   many rows on screen as possible. Used by Results, User Configuration and
   Selected Students; other admin list pages keep the default sizing above. */
.page.dense{padding:14px 20px}
.page.dense .page-head{margin-bottom:10px;gap:8px}
.page.dense .page-head h1{font-size:16px}
.page.dense .page-head .sub{font-size:10.5px;margin-top:1px}
.page.dense .controls{gap:6px}
.page.dense .controls .btn{padding:5px 10px;font-size:11px;gap:5px}
.page.dense .controls .btn svg{width:12px;height:12px}
.page.dense .toolbar{padding:6px 10px;gap:6px}
.page.dense .toolbar .chip{font-size:9.5px;padding:2px 7px;gap:4px}
.page.dense .toolbar .btn-sm{padding:3px 8px;font-size:9.5px}
.page.dense .toolbar .input,.page.dense .toolbar .select{padding:5px 8px;font-size:11px}
.page.dense .toolbar .search .input{padding-left:30px}
.page.dense .toolbar .select{padding-right:28px;background-position:right 8px center}
.page.dense .table-wrap thead th{font-size:9px;padding:5px 8px;letter-spacing:.04em}
.page.dense .table-wrap tbody td{font-size:10.5px;padding:3px 8px;line-height:1.25}
.page.dense .table-foot{padding:5px 10px;font-size:10px}
.page.dense .table-foot .pager a{width:20px;height:20px;font-size:9.5px}
.page.dense .hint{font-size:10px!important}
/* With paging off by default the header would scroll out of sight — .page is
   the scrolling ancestor, so sticking to its top needs no extra markup. */
.page.dense .table-wrap thead th{position:sticky;top:0;z-index:1;background:#F8FAFE}

/* The prominent scope strip above a dense page's list card (question sets,
   department filter) — deliberately NOT shrunk by the rules above, so the
   thing that decides what the whole table means stays readable. */
.list-scope{display:flex;flex-wrap:wrap;align-items:center;gap:14px;background:#fff;border:1px solid var(--line);border-radius:var(--r-card);box-shadow:var(--shadow-sm);padding:12px 16px;margin-bottom:10px}
.list-scope .ls-label{font-size:13px;font-weight:700;color:var(--ink);white-space:nowrap}
.list-scope .ls-value{font-size:13.5px;color:var(--ink)}
.list-scope .ls-value.empty{color:var(--muted)}
.list-scope .ls-group{display:flex;flex-wrap:wrap;align-items:center;gap:8px;min-width:0}

/* Checkbox dropdown (multi-select departments / question sets) */
.checkdrop{position:relative}
.checkdrop-panel{display:none;position:absolute;top:calc(100% + 6px);left:0;z-index:200;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow-lg);padding:10px 12px;min-width:230px;max-height:260px;overflow-y:auto}
.checkdrop-panel.open{display:block}
.checkdrop-panel label{display:flex;align-items:center;gap:8px;font-size:12.5px;padding:4px 0;white-space:nowrap}
.checkdrop-panel .cd-foot{display:flex;justify-content:flex-end;gap:8px;margin-top:8px;padding-top:8px;border-top:1px solid var(--line)}

.modal .field + .field{margin-top:16px}
.grid-2m{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.grid-2m .field + .field{margin-top:0}
@media(max-width:520px){.grid-2m{grid-template-columns:1fr}}
.toast{position:fixed;top:18px;left:50%;transform:translateX(-50%);z-index:400;background:var(--navy-900);color:#fff;padding:12px 20px;border-radius:10px;font-size:13px;font-weight:600;box-shadow:var(--shadow-lg)}
