/* Accounting With Faizan Jiffry · Operations Hub
   Visual system from "Moodle Ops Hub Essentials": navy rail, gold primary
   action, dense white panels on a soft grey page, IBM Plex Sans / Mono. */

:root {
  --navy: #0B1628;
  --navy-raised: #16243B;
  --navy-line: #1D2B44;
  --navy-text: #C6CEDB;
  --navy-muted: #8C98AD;
  --gold: #D9A520;
  --gold-hover: #C8951A;
  --gold-bright: #E8B931;
  --gold-ink: #8A6206;
  --page: #F4F5F7;
  --panel: #FFFFFF;
  --well: #F7F8FA;
  --line: #E3E6EB;
  --line-soft: #EEF0F3;
  --line-control: #8B95A7;
  --ink: #0F172A;
  --ink-2: #4A5565;
  --muted: #5F6A7D;
  --ok-bg: #E6F4EA;    --ok-ink: #17663A;
  --warn-bg: #FDF3DC;  --warn-ink: #8A5A00;
  --bad-bg: #FCE9E7;   --bad-ink: #B42318;
  --info-bg: #E8EEF9;  --info-ink: #2A4A8A;
  --idle-bg: #EEF1F5;  --idle-ink: #4A5565;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --t-micro: 11.5px; --t-small: 12.5px; --t-body: 13.5px; --t-title: 15px; --t-head: 17px; --t-page: 22px;
  --r-control: 7px; --r-panel: 10px; --r-dialog: 14px;
  --control: 34px;
  --rail: 236px;
  --bar: 58px;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --shadow-pop: 0 12px 32px rgba(11, 22, 40, .14);
  --shadow-dialog: 0 24px 60px rgba(11, 22, 40, .3);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 var(--t-body)/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h2, h3 { font-size: inherit; }
a { color: var(--gold-ink); text-decoration: none; }
a:hover { color: var(--navy); text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
table { border-collapse: collapse; width: 100%; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.rail :focus-visible, .bulk :focus-visible, .tabbar :focus-visible, .login-brand :focus-visible { outline-color: var(--gold-bright); }

.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: var(--t-small); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: var(--s2); z-index: 100; background: var(--panel); padding: var(--s2) var(--s3); border-radius: var(--r-control); font-weight: 600; }
.skip-link:focus { left: var(--s2); }
.spacer { flex: 1; }

/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none; height: var(--control); padding: 0 var(--s3); border: 1px solid #C3CAD5; border-radius: var(--r-control); background: var(--panel); color: var(--ink); font-size: 13px; font-weight: 500; white-space: nowrap; transition: background .12s ease, border-color .12s ease; }
.btn:hover:not(:disabled) { background: var(--page); text-decoration: none; color: var(--ink); }
.btn-primary { background: var(--gold); border-color: var(--gold); color: var(--navy); font-weight: 600; padding: 0 14px; }
.btn-primary:hover:not(:disabled) { background: var(--gold-hover); border-color: var(--gold-hover); color: var(--navy); }
.btn-danger { border-color: #E9A8A1; color: var(--bad-ink); }
.btn-danger:hover:not(:disabled) { background: #FEF6F5; color: var(--bad-ink); }
.btn-danger-solid { background: var(--bad-ink); border-color: var(--bad-ink); color: #fff; font-weight: 600; }
.btn-danger-solid:hover:not(:disabled) { background: #99200F; color: #fff; }
.btn-ghost { border-color: transparent; background: none; color: var(--gold-ink); }
.btn-sm { height: 28px; padding: 0 10px; border-radius: 6px; font-size: 12.5px; }
.btn-lg { height: 36px; }
.btn-icon { width: var(--control); padding: 0; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > span, .field-label { font-size: var(--t-small); font-weight: 500; }
.field small { font-size: 12px; color: var(--muted); line-height: 1.4; }
.field .field-error { color: var(--bad-ink); font-weight: 500; }
.input, .select, .textarea { width: 100%; height: 36px; border: 1px solid var(--line-control); border-radius: var(--r-control); background: var(--panel); padding: 0 10px; font-size: 13px; }
.select { padding: 0 8px; }
.textarea { height: auto; min-height: 68px; padding: 9px 10px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid rgba(217, 165, 32, .55); outline-offset: 0; border-color: var(--gold); }
.input[aria-invalid="true"] { border-color: var(--bad-ink); }
.input-readonly { display: flex; align-items: center; height: 36px; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--well); padding: 0 10px; font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); }
input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--gold); cursor: pointer; }

.pill { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: var(--t-micro); font-weight: 500; white-space: nowrap; background: var(--idle-bg); color: var(--idle-ink); }
.pill-ok { background: var(--ok-bg); color: var(--ok-ink); }
.pill-warn { background: var(--warn-bg); color: var(--warn-ink); }
.pill-bad { background: var(--bad-bg); color: var(--bad-ink); }
.pill-info { background: var(--info-bg); color: var(--info-ink); }
.flag { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 11px; font-weight: 500; background: var(--warn-bg); color: #9A4A06; }
.flag-bad { background: var(--bad-bg); color: var(--bad-ink); }

.avatar { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: #E7EAF0; color: var(--navy); font-size: var(--t-micro); font-weight: 600; }
.avatar-navy { background: var(--navy); color: var(--gold-bright); }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; box-shadow: 0 0 0 3px var(--panel), 0 0 0 4px var(--gold); }
.mark { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 7px; background: var(--gold); color: var(--navy); font-weight: 700; font-size: 13px; }

progress { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 6px; border: 0; border-radius: 3px; background: var(--line-soft); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--line-soft); }
progress::-webkit-progress-value { background: var(--navy); border-radius: 3px; }
progress::-moz-progress-bar { background: var(--navy); border-radius: 3px; }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.rail { position: sticky; top: 0; flex: none; display: flex; flex-direction: column; width: var(--rail); height: 100vh; padding: 18px var(--s3) 14px; overflow-y: auto; background: var(--navy); color: var(--navy-text); }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px var(--s2) 18px; color: inherit; line-height: 1.15; }
.brand:hover { text-decoration: none; color: inherit; }
.brand strong { display: block; color: #fff; font-weight: 600; font-size: 14px; }
.brand span span { font-size: var(--t-micro); color: var(--navy-muted); }
.nav-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: var(--s4); }
.nav-label { padding: 0 10px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--navy-muted); }
.nav-item { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: var(--r-control); color: var(--navy-text); font-size: 13px; font-weight: 500; white-space: nowrap; transition: background .12s ease; }
.nav-item svg { flex: none; color: #7F8BA1; }
.nav-item:hover { background: var(--navy-raised); color: #fff; text-decoration: none; }
.nav-item[aria-current="page"] { background: rgba(217, 165, 32, .13); color: #fff; }
.nav-item[aria-current="page"] svg { color: var(--gold-bright); }
.nav-item .count { margin-left: auto; padding: 1px 7px; border-radius: 10px; background: rgba(217, 165, 32, .16); color: var(--gold-bright); font-size: 11px; font-weight: 600; }
.conn { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding: 11px var(--s3); border: 1px solid var(--navy-line); border-radius: 9px; font-size: var(--t-micro); color: var(--navy-muted); }
.conn-state { display: flex; align-items: center; gap: 7px; color: #E6EAF1; font-weight: 500; }
.dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #3FBF7A; }
.dot-off { background: #F0857B; }
.conn .mono { font-size: 11px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: var(--s3); height: var(--bar); padding: 0 clamp(12px, 3vw, 28px); background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .mark { display: none; background: var(--navy); color: var(--gold-bright); font-size: 12px; }
.search { position: relative; flex: 1; max-width: 440px; min-width: 0; }
.search > svg { position: absolute; left: 11px; top: 10.5px; color: var(--muted); pointer-events: none; }
.search .input { background: var(--well); padding: 0 40px 0 33px; border-color: #C3CAD5; border-radius: 8px; }
.search kbd { position: absolute; right: 9px; top: 9px; padding: 0 5px; border: 1px solid #C3CAD5; border-radius: 4px; background: var(--panel); font: 11px var(--mono); color: var(--muted); }
.search-pop { position: absolute; top: 42px; left: 0; right: 0; z-index: 50; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--shadow-pop); }
.search-head { padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line-soft); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.search-row { display: flex; align-items: center; gap: 10px; padding: 9px var(--s3); color: var(--ink); cursor: pointer; }
.search-row:hover, .search-row[aria-selected="true"] { background: var(--well); text-decoration: none; color: var(--ink); }
.search-row .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.search-row .who b { font-weight: 500; }
.search-row .who span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-none { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); padding: var(--s4) 14px; }
.search-none b { font-weight: 500; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.divider { width: 1px; height: 24px; background: var(--line); }
.me { display: flex; align-items: center; gap: 9px; line-height: 1.2; }
.me b { display: block; font-weight: 500; font-size: 13px; }
.me span span { font-size: var(--t-micro); color: var(--muted); }

.content { width: 100%; max-width: 1440px; padding: var(--s5) clamp(14px, 3vw, 28px) 96px; }
.page { display: flex; flex-direction: column; gap: var(--s4); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s3); }
.page-head > div:first-child { flex: 1; min-width: 240px; }
.page-head h1 { font-size: var(--t-page); font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
.page-head p { margin-top: var(--s1); color: var(--muted); }
.head-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; }
.panel-pad { padding: var(--s4) 18px; }
.panel-title { font-weight: 600; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); padding: 14px var(--s4); border-bottom: 1px solid var(--line-soft); }
.scroll-x { overflow-x: auto; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 var(--s3); border: 1px solid #C3CAD5; border-radius: 15px; background: var(--panel); color: var(--ink); font-size: 13px; font-weight: 500; white-space: nowrap; transition: background .12s ease; }
.chip:hover { background: var(--page); }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip span { font-size: var(--t-micro); opacity: .75; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); padding: var(--s3); border-bottom: 1px solid var(--line-soft); }
.toolbar .input { flex: 1; min-width: 180px; max-width: 300px; height: var(--control); }
.toolbar .select { width: auto; max-width: 100%; height: var(--control); }
.bulk { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); padding: 9px var(--s3); background: var(--navy); color: #fff; }
.bulk b { padding: 0 6px 0 4px; font-weight: 600; }
.bulk .btn { height: 30px; padding: 0 11px; border-radius: 6px; background: #1A2A44; border-color: #2A3B58; color: #fff; }
.bulk .btn:hover:not(:disabled) { background: #22365A; color: #fff; }
.bulk .btn-primary { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.bulk .btn-primary:hover:not(:disabled) { background: var(--gold-hover); color: var(--navy); }
.bulk .btn-danger { color: #FFB4AB; border-color: #5A2A30; }
.bulk .btn-danger:hover:not(:disabled) { background: #2A1F2E; color: #FFB4AB; }
.bulk .btn-ghost { background: none; border-color: transparent; color: var(--navy-text); }

.table th { padding: 10px var(--s2); background: #F9FAFB; text-align: left; font-size: var(--t-micro); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.table td { padding: 10px var(--s2); border-top: 1px solid #F1F2F5; vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: var(--s4); }
.table th:last-child, .table td:last-child { padding-right: var(--s4); }
.table .check { width: 40px; padding-left: var(--s3); }
.table td.dim, .table .dim { color: var(--ink-2); }
.table td.nowrap { white-space: nowrap; }
.table td.actions { text-align: right; white-space: nowrap; }
.table td.actions .btn + .btn { margin-left: 6px; }
.rows-link tbody tr { cursor: pointer; transition: background .12s ease; }
.rows-link tbody tr:hover { background: #FAFAF7; }
.rows-link tbody tr.is-selected { background: #FFFBF0; }
.chev { color: var(--muted); font-size: 16px; text-align: right; }
.cell-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-person > span:not(.avatar) { display: flex; flex-direction: column; min-width: 0; }
.cell-person a { color: var(--ink); font-weight: 500; }
.cell-person small, .two-line small { font-size: 12px; color: var(--muted); }
.two-line { display: flex; flex-direction: column; }
.two-line b { font-weight: 500; }
.two-line a { color: var(--ink); }
.two-line .mono { font-size: var(--t-micro); color: var(--muted); }
.cell-courses { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.only-mobile { display: none; }
.bar-cell { display: flex; align-items: center; gap: var(--s2); }
.bar-cell progress { width: 90px; }
.bar-cell span { font-size: 12px; color: var(--ink-2); }

.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 44px 20px; text-align: center; }
.empty h2 { font-size: var(--t-title); font-weight: 600; }
.empty p { max-width: 440px; color: var(--muted); line-height: 1.5; }
.empty .row { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2); margin-top: var(--s1); }
.empty-inline { padding: 14px 0; color: var(--muted); line-height: 1.5; }
.empty-dashed { padding: 22px; border: 1px dashed #C3CAD5; border-radius: var(--r-panel); color: var(--muted); line-height: 1.5; text-align: center; }

.notice { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); padding: 10px 14px; border: 1px solid #F1DDA6; border-radius: 9px; background: #FFF8E6; color: #5C3D00; }
.notice > span { flex: 1; min-width: 200px; }
.notice b { font-weight: 600; }
.notice .btn { height: 30px; border-color: #E5C77A; }
.notice-bad { border-color: #F1C6C2; background: #FEF3F2; color: #7A1A10; }
.notice-bad .btn { border-color: #E9A8A1; }
.notice-info { border-color: #C9D6EE; background: #F2F6FD; color: #1F3A6E; }
.notice-info .btn { border-color: #B1C3E6; }

.skeleton td { padding: 14px var(--s2); }
.skel { display: block; height: 10px; border-radius: 5px; background: linear-gradient(90deg, #EEF0F3 25%, #F7F8FA 37%, #EEF0F3 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.skel-block { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s5) 18px; }
@keyframes shimmer { from { background-position: 100% 50%; } to { background-position: 0 50%; } }

/* Student profile */
.back { width: max-content; font-size: 13px; color: var(--ink-2); }
.profile-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4); padding: 18px 20px; overflow: visible; }
.profile-id { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 5px; }
.profile-id > div { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.profile-id h1 { font-size: 21px; font-weight: 600; line-height: 1.2; }
.profile-id p { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { flex: none; height: 40px; margin-bottom: -1px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-weight: 500; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { border-bottom-color: var(--gold); color: var(--ink); }
.tab span { margin-left: 6px; font-size: var(--t-micro); color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: var(--s4); align-items: start; }
.kv { display: flex; justify-content: space-between; gap: var(--s3); padding: 7px 0; border-bottom: 1px dashed #ECEEF2; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; text-align: right; overflow-wrap: anywhere; }
dl { margin: 10px 0 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.access { display: flex; flex-direction: column; gap: 6px; padding: 9px 0; border-bottom: 1px solid #F1F2F5; }
.access > div { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.access b { font-weight: 500; }
.access .meter { gap: 10px; }
.access .meter span { flex: none; min-width: 120px; font-size: 12px; color: var(--muted); text-align: right; }
.timeline { padding: var(--s2) 18px; }
.event { display: flex; gap: 14px; padding: 11px 0; border-bottom: 1px solid #F1F2F5; }
.event:last-child, .access:last-child, .kv:last-child { border-bottom: 0; }
.event i { flex: none; width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: var(--navy); }
.event i.console { background: var(--gold); }
.event > span { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.event small, .event time { font-size: 12px; color: var(--muted); }
.event time { white-space: nowrap; }
.notes { display: flex; flex-direction: column; gap: var(--s3); max-width: 760px; }
.note-form { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.note-form .btn { align-self: flex-end; }
.note { display: flex; flex-direction: column; gap: var(--s1); padding: var(--s3) 14px; }
.note p { line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.note small { font-size: 12px; color: var(--muted); }

/* Courses */
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: var(--s4); align-items: start; }
.table td.selectable { border-left: 3px solid transparent; }
.table tr.is-selected td.selectable { border-left-color: var(--gold); }
.detail { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4) 18px; }
.detail-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: var(--s2); }
.detail-head h2 { font-size: var(--t-title); font-weight: 600; }
.detail-head p { margin-top: 2px; font-size: var(--t-small); color: var(--muted); }
.well { display: flex; flex-direction: column; gap: 3px; padding: 10px var(--s3); border-radius: 8px; background: var(--well); line-height: 1.45; }
.caps { font-size: var(--t-micro); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.roster { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: var(--s2) 0; border-bottom: 1px solid #F1F2F5; }
.roster a { flex: 1; min-width: 140px; color: var(--ink); font-weight: 500; }
.roster > span:not(.pill) { font-size: 12px; color: var(--muted); }

/* Recordings */
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.settings .field { padding: 14px var(--s4); border-right: 1px solid #F1F2F5; }
.settings .field:last-child { border-right: 0; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.filters .select { width: auto; height: 30px; max-width: 260px; }

/* Layers */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(11, 22, 40, .5); animation: fade .14s ease; }
.dialog { position: fixed; z-index: 61; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; width: min(580px, calc(100% - 24px)); max-height: calc(100vh - 40px); background: var(--panel); border-radius: var(--r-dialog); box-shadow: var(--shadow-dialog); animation: rise .16s ease; }
.dialog-head { display: flex; flex-direction: column; gap: 6px; padding: 18px 22px 14px; border-bottom: 1px solid var(--line-soft); }
.dialog-head .tag { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-ink); }
.dialog-head .tag.danger { color: var(--bad-ink); }
.dialog-head h2 { font-size: 18px; font-weight: 600; line-height: 1.25; }
.dialog-body { display: flex; flex-direction: column; gap: var(--s4); padding: var(--s4) 22px; overflow-y: auto; }
.dialog-body section { display: flex; flex-direction: column; gap: 6px; }
.dialog-foot, .drawer-foot { display: flex; justify-content: flex-end; gap: var(--s2); padding: 14px 22px; border-top: 1px solid var(--line-soft); background: #FAFBFC; border-radius: 0 0 var(--r-dialog) var(--r-dialog); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { padding: 3px var(--s2); border-radius: 6px; background: #F1F3F6; font-size: var(--t-small); }
.effects { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--s1); }
.effects li { display: flex; gap: var(--s2); line-height: 1.45; }
.effects li::before { content: '•'; flex: none; color: var(--gold-ink); }
.danger-list li::before { color: var(--bad-ink); }
.api { display: flex; flex-direction: column; gap: 6px; padding: var(--s3) 14px; border-radius: 9px; background: var(--navy); }
.api .caps { font-size: 11px; color: var(--navy-muted); letter-spacing: .06em; }
.api code { font: 12px/1.5 var(--mono); color: var(--gold-bright); }
.api span { font: 12px/1.5 var(--mono); color: #AEB8C8; }
.outcome { display: flex; flex-direction: column; }
.outcome li { display: flex; justify-content: space-between; gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px solid #F1F2F5; }
.outcome { margin: 0; padding: 0; list-style: none; }
.outcome li span:last-child { color: var(--muted); text-align: right; }
.outcome li.failed span:last-child { color: var(--bad-ink); font-weight: 500; }

.drawer { position: fixed; z-index: 61; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; width: min(440px, 100%); background: var(--panel); box-shadow: -12px 0 40px rgba(11, 22, 40, .2); animation: slide .18s ease; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); }
.drawer-head h2 { font-size: var(--t-head); font-weight: 600; }
.drawer-head .close { width: 32px; height: 32px; border: 0; border-radius: var(--r-control); background: none; font-size: 20px; line-height: 1; color: var(--muted); }
.drawer-head .close:hover { background: var(--page); color: var(--ink); }
.drawer-body { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 18px 22px; overflow-y: auto; }
.drawer-foot { border-radius: 0; background: var(--panel); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.infobox { display: flex; flex-direction: column; gap: var(--s1); padding: var(--s3) 14px; border-radius: 9px; background: var(--well); font-size: var(--t-small); color: var(--ink-2); line-height: 1.45; }
.infobox b { font-size: var(--t-body); font-weight: 600; color: var(--ink); }
.form-error { padding: 10px var(--s3); border-left: 3px solid var(--bad-ink); border-radius: 4px; background: #FEF3F2; color: #7A1A10; line-height: 1.45; }

.toasts { position: fixed; z-index: 70; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: var(--s2); width: max-content; max-width: calc(100% - 24px); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px var(--s4); border-radius: var(--r-panel); background: var(--navy); color: #fff; box-shadow: 0 12px 30px rgba(11, 22, 40, .3); animation: rise-toast .18s ease; }
.toast .dot { width: 8px; height: 8px; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translate(-50%, calc(-50% + 8px)); } }
@keyframes rise-toast { from { opacity: 0; transform: translateY(8px); } }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }

.tabbar { display: none; }

/* Sign-in */
.login { display: grid; grid-template-columns: minmax(280px, 5fr) minmax(320px, 6fr); min-height: 100vh; background: var(--panel); }
.login-brand { display: flex; flex-direction: column; justify-content: space-between; gap: var(--s6); padding: clamp(24px, 5vw, 56px); background: var(--navy); color: var(--navy-text); }
.login-brand .brand { padding: 0; }
.login-brand h1 { max-width: 14ch; color: #fff; font-size: clamp(28px, 3.4vw, 40px); font-weight: 600; letter-spacing: -.02em; line-height: 1.12; }
.login-brand h1 em { font-style: normal; color: var(--gold-bright); }
.login-brand p { max-width: 38ch; margin-top: var(--s4); font-size: 14.5px; line-height: 1.55; }
.login-brand ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--s2); font-size: var(--t-small); color: var(--navy-muted); }
.login-brand li { display: flex; align-items: center; gap: var(--s2); }
.login-form { display: flex; flex-direction: column; justify-content: center; gap: var(--s4); width: 100%; max-width: 400px; margin: 0 auto; padding: var(--s6) var(--s5); }
.login-form h2 { font-size: var(--t-page); font-weight: 600; letter-spacing: -.01em; }
.login-form form { display: flex; flex-direction: column; gap: 14px; margin-top: var(--s2); }
.login-form .input, .login-form .btn { height: 42px; font-size: 14px; }

/* Small screens: the rail becomes a bottom tab bar and tables become lists. */
@media (max-width: 759px) {
  :root { --control: 40px; }
  .rail, .topbar-actions .wide, .topbar .spacer { display: none; }
  .search { max-width: none; }
  .topbar .mark { display: grid; }
  .input, .select, .textarea { font-size: 16px; }
  .input, .select, .btn-lg { height: 42px; }
  .btn-sm { height: 34px; }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--navy); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 52px; color: #AEB8C8; font-size: 11px; font-weight: 500; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a[aria-current="page"] { color: var(--gold-bright); }
  .toasts { bottom: 84px; }
  .content { padding-bottom: 112px; }

  .cards thead, .cards .hide-mobile { display: none; }
  .cards, .cards tbody { display: block; }
  .cards tr { display: flex; align-items: center; gap: var(--s3); min-height: 64px; padding: var(--s3) 14px; border-top: 1px solid #F1F2F5; }
  .cards td { display: block; padding: 0; border: 0; }
  .cards td:first-child, .cards td:last-child { padding: 0; }
  .cards td.grow { flex: 1; min-width: 0; }
  .cards .avatar { width: 38px; height: 38px; font-size: 12px; }
  .only-mobile { display: block; }
  .cards .cell-person small.email { display: none; }

  .login { grid-template-columns: 1fr; }
  .login-brand { gap: var(--s5); padding: var(--s5); }
  .login-brand ul { display: none; }
  .login-form { justify-content: flex-start; padding: var(--s5); }
  .pair { grid-template-columns: 1fr; }
  .profile-head .head-actions { width: 100%; }
  .profile-head .head-actions .btn { flex: 1; }
  .settings .field { border-right: 0; border-bottom: 1px solid #F1F2F5; }
  .dialog-foot .btn, .drawer-foot .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Course checklists */
.checks { display: flex; flex-direction: column; gap: 2px; min-width: 0; margin: 0; padding: 0; border: 0; }
.checks legend { padding: 0 0 6px; font-size: var(--t-small); font-weight: 500; }
.dialog .checks legend { font-size: var(--t-micro); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.checks label { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-control); cursor: pointer; }
.checks label + label { margin-top: 4px; }
.checks label:hover { background: var(--well); }
.checks label:has(input:checked) { border-color: var(--gold); background: #FFFBF0; }
.checks input { margin-top: 2px; flex: none; }
.checks label span { display: flex; flex-direction: column; min-width: 0; font-weight: 500; }
.checks small { font-size: 12px; font-weight: 400; color: var(--muted); }
.checks > small { margin-top: 6px; line-height: 1.4; }
.inline-check { display: inline-flex; align-items: center; gap: var(--s2); cursor: pointer; }

/* Import */
.steps { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); margin: 0; padding: 0; list-style: none; }
.steps li { display: flex; align-items: center; gap: var(--s2); color: var(--muted); font-weight: 500; }
.steps li span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--idle-bg); color: var(--muted); font-size: var(--t-micro); font-weight: 600; }
.steps li.current { color: var(--ink); }
.steps li.current span { background: var(--gold); color: var(--navy); }
.steps li.done { color: var(--ink); }
.steps li.done span { background: var(--navy); color: var(--gold-bright); }
.drop { display: flex; flex-direction: column; align-items: center; gap: var(--s2); margin: var(--s4); padding: var(--s6) var(--s4); border: 1.5px dashed var(--line-control); border-radius: var(--r-panel); background: var(--well); text-align: center; cursor: pointer; transition: background .12s ease, border-color .12s ease; }
.drop:hover, .drop.over { border-color: var(--gold); background: #FFFBF0; }
.drop:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
.drop b { font-size: var(--t-title); font-weight: 600; }
.drop > span:not(.btn) { max-width: 520px; color: var(--muted); line-height: 1.5; }
.drop .btn { margin-top: var(--s2); }
.drop-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); padding: 0 var(--s4) var(--s4); font-size: var(--t-small); }
.paste { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; padding: var(--s4); border-top: 1px solid var(--line-soft); }
.paste .field { width: 100%; }
.cell { height: 30px; min-width: 120px; padding: 0 8px; font-size: 13px; }
select.cell { width: auto; max-width: 240px; padding: 0 6px; }
.cell.bad { border-color: var(--bad-ink); background: #FEF6F5; }
.cell[data-field="email"] { min-width: 210px; }
.import-table td { vertical-align: top; padding-top: 10px; padding-bottom: 10px; }
.import-table tr.needs-fix { background: #FFFAF9; }
.import-table tr.needs-fix td:first-child { box-shadow: inset 3px 0 0 var(--bad-ink); }
.import-table tr.skipped td:not(.actions) { opacity: .55; }
.import-table .result { gap: 3px; align-items: flex-start; max-width: 300px; }
.import-table .result small { line-height: 1.4; }
.import-table tr.needs-fix .result small { color: var(--bad-ink); font-weight: 500; }
.course-tags { align-items: center; }
.course-tags > span { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 12px; }
.course-tags .all-rows { background: none; border: 1px dashed #C3CAD5; color: var(--muted); }
.course-tags .none { background: none; padding: 0; font-family: var(--sans); }
.course-tags button { width: 16px; height: 16px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 14px; line-height: 1; }
.course-tags button:hover { background: #D9DEE6; color: var(--ink); }
.import-foot { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); padding: 14px var(--s4); border-top: 1px solid var(--line); background: #FAFBFC; border-radius: 0 0 var(--r-panel) var(--r-panel); }
.import-foot > div { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 2px; }
.import-foot b { font-weight: 600; }
.import-foot span { font-size: var(--t-small); line-height: 1.45; }
.panel > .drawer-foot { flex-wrap: wrap; background: #FAFBFC; border-radius: 0 0 var(--r-panel) var(--r-panel); }
.panel:has(.import-foot) { overflow: visible; }
.progress-card { display: flex; flex-direction: column; gap: var(--s3); }
.progress-card progress { height: 8px; }
.result-head { display: flex; flex-direction: column; gap: var(--s1); }
.result-head h2 { font-size: var(--t-head); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s3); margin-top: var(--s3); }
.stats div { padding: var(--s3) 14px; border-radius: 8px; background: var(--well); }
.stats dt { font-size: var(--t-small); color: var(--muted); }
.stats dd { margin: 2px 0 0; font-size: var(--t-page); font-weight: 600; }
.stats dd.bad, .bad-text { color: var(--bad-ink); }
.notice.flat { border-width: 1px 0; border-radius: 0; }
@media (max-width: 759px) { .import-foot { position: static; } .import-foot .btn { flex: 1; } .drop { margin: var(--s3); } }

/* Overview */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--s3); margin-bottom: var(--s4); }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 14px var(--s4); border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--panel); color: var(--ink); transition: border-color .12s ease, box-shadow .12s ease; }
.tile:hover { border-color: var(--gold); box-shadow: 0 2px 10px rgba(11, 22, 40, .06); text-decoration: none; color: var(--ink); }
.tile span { font-size: var(--t-small); color: var(--muted); }
.tile b { font-size: 26px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
.tile small { font-size: 12px; color: var(--muted); }
.tile.warn b { color: var(--warn-ink); }
.tile.bad b { color: var(--bad-ink); }
.overview-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.attention { margin: 0; padding: 0 var(--s4); list-style: none; }
.attention li { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid #F1F2F5; }
.attention li:last-child { border-bottom: 0; }
.attention i { flex: none; width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: var(--line-control); }
.attention i.bad { background: var(--bad-ink); }
.attention i.warn { background: var(--gold); }
.attention li > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.attention b { font-weight: 500; }
.attention small { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.detail-head .head-actions { flex: none; }

/* Utilities referenced from markup (no inline styles: the CSP forbids them). */
.w-540 { min-width: 540px; } .w-760 { min-width: 760px; } .w-780 { min-width: 780px; } .w-900 { min-width: 900px; }
.medium { font-weight: 500; }
.meter progress { flex: 1; }
.narrow-only { display: none; }
@media (max-width: 759px) { .narrow-only { display: inline-flex; } .cards.w-540 { min-width: 0; } }

/* Give access: a long course list scrolls instead of pushing the email box off screen */
.acc-form .checks { max-height: 260px; overflow-y: auto; }
.acc-nav { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s2); margin-top: var(--s4); }
.paste .acc-nav { width: 100%; margin-top: 0; }
.dup-list { margin: var(--s2) 0; padding-left: 18px; font-size: var(--t-small); line-height: 1.5; }
.dup-list li { margin-bottom: 4px; }

/* Result popups */
.dialog-head.with-icon { flex-direction: row; align-items: center; gap: var(--s3); }
.dialog-head.with-icon > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dialog-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ok-bg); color: var(--ok-ink); animation: pop .28s cubic-bezier(.2, 1.4, .5, 1); }
.login-card { border: 1px solid var(--line); border-radius: 10px; background: var(--well); }
.login-row { display: flex; align-items: center; gap: var(--s3); padding: 11px 14px; border-bottom: 1px solid var(--line-soft); }
.login-row:last-child { border-bottom: 0; }
.login-row > span { flex: none; width: 84px; font-size: var(--t-small); color: var(--muted); }
.login-row > b { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.login-row > b.mono { font-size: 14.5px; }
.outcome .mono { font-size: 13.5px; }
.toast { transition: opacity .2s ease, transform .2s ease; }
.toast.leaving { opacity: 0; transform: translateY(6px); }
.btn { transition: background .12s ease, border-color .12s ease, box-shadow .12s ease, transform .06s ease; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.panel, .tile { transition: border-color .15s ease, box-shadow .15s ease; }
.page { animation: page-in .18s ease; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } }
