/* Look and layout from the design prototype (Main.dc.html). Fonts are self-hosted (SIL OFL, see fonts/). */
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-latin-400-normal.77bc02670657.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-sans-latin-500-normal.f7016cd446d2.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-sans-latin-600-normal.196e3cbc5fee.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 600; font-display: swap; src: url("fonts/source-serif-4-latin-600-normal.beb0c8d8bee8.woff2") format("woff2"); }

:root {
  --paper: #F4F1EA; --ink: #1D2530; --ink-2: #333D4A; --muted: #4A5563; --muted-2: #5B6572;
  --slate: #1D2530; --slate-hi: #2F3B4A; --nav: #D5DAE0; --nav-2: #C5CCD4; --nav-label: #9AA4B0; --nav-strong: #E9ECEF;
  --teal: #0E5A5F; --teal-dark: #093E42; --teal-tint: #E3F0EF;
  --line: #DDD8CC; --line-2: #EEEAE0; --head: #F8F6F1; --fold: #FBFAF7; --track: #E6E1D6;
  --field: #C9CED4; --field-2: #B9BFC7;
  --amber: #B45309; --note: #8A4B0B;
  --ok-bg: #DDEFEC; --ok: #093E42; --pend-bg: #FDF1E3; --pend: #7A3E08; --draft-bg: #ECEEF1; --draft: #3E4855;
  --bad-bg: #FBE7E4; --bad: #9B2C1F;
  --serif: "Source Serif 4", Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "IBM Plex Sans", system-ui, sans-serif; background: var(--paper); color: var(--ink); font-size: 14px; line-height: 1.45; }
a { color: var(--teal); }
a:hover { color: var(--teal-dark); }
button, input, select { font-family: inherit; font-size: 14px; }
h1 { margin: 0; font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1.2; }
h2 { font-family: var(--serif); font-size: 20px; font-weight: 600; margin: 8px 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
[hidden] { display: none !important; }

/* ---------- app shell: slate sidebar + white header ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 300px; flex-shrink: 0; background: var(--slate); color: var(--nav-strong); padding: 24px 16px;
  display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font-family: var(--serif); font-size: 22px; font-weight: 600; color: #fff; padding: 0 12px 16px; text-decoration: none; }
.brand:hover { color: #fff; }
.nav { display: flex; align-items: center; width: 100%; min-height: 40px; padding: 8px 12px; border-radius: 8px;
  font-size: 14px; color: var(--nav); text-decoration: none; }
.nav:hover { background: var(--slate-hi); color: #fff; }
.nav.active { background: var(--slate-hi); color: #fff; font-weight: 600; }
.nav .count { margin-left: 8px; padding: 2px 8px; border-radius: 10px; background: var(--amber); color: #fff; font-size: 12px; font-weight: 500; }
.nav-label { padding: 18px 12px 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--nav-label); }
.attr > summary { list-style: none; cursor: pointer; color: var(--nav-strong); font-weight: 500; }
.attr > summary::-webkit-details-marker { display: none; }
.attr > summary b { font-weight: 600; margin-right: 8px; }
.attr-metrics { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 8px 12px; }
.metric-link { display: block; min-height: 34px; padding: 6px 10px; border-radius: 6px; font-size: 13px; color: var(--nav-2); text-decoration: none; }
.metric-link span { color: var(--nav-label); margin-right: 8px; }
.metric-link:hover { background: var(--slate-hi); color: #fff; }
.metric-link.active { background: var(--slate-hi); color: #fff; }

.main { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.header { min-height: 72px; padding: 12px 32px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  background: #fff; border-bottom: 1px solid var(--line); }
.header-college { font-size: 17px; font-weight: 600; }
.header-sub { font-size: 13px; color: var(--muted); }
.header-user { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.header-user a { color: var(--muted); }
.content { flex-grow: 1; padding: 28px 32px 40px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack.narrow { max-width: 1000px; }
/* Owner console tables: use the whole window, wrap long headings, slimmer cells, so no sideways scroll (owner 2026-10-21) */
.stack.wide { max-width: none; }
.wide .grid th { white-space: normal; padding: 10px 12px; }
.wide .grid td { padding: 10px 12px; }
.crumb { font-size: 13px; color: var(--muted); }
.lede { font-size: 14px; color: var(--ink-2); }
.facts { display: flex; flex-wrap: wrap; gap: 12px; font-size: 14px; color: var(--ink-2); }
.facts .sep { color: var(--field-2); }
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; }
.note { font-size: 13px; color: var(--note); }

/* ---------- messages ---------- */
.toast { padding: 12px 16px; border-radius: 8px; background: var(--teal-tint); color: var(--teal-dark); font-size: 14px; margin-bottom: 16px; }
.toast.error { background: var(--bad-bg); color: var(--bad); }
.toast.warning, .toast.info-warn { background: var(--pend-bg); color: var(--pend); }
.toast.demo { background: #EFE8F7; color: #45306B; }
.toast.stale-note { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- cards, tiles, tables ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.card.pad { padding: 20px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tile { padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 6px; }
.tile-label, .tile-note { font-size: 13px; color: var(--muted); }
.tile-value { font-family: var(--serif); font-size: 38px; font-weight: 600; line-height: 1.15; }
.tile-value small { font-size: 18px; color: var(--muted); font-family: "IBM Plex Sans", sans-serif; font-weight: 400; }

.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; }
.grid th { padding: 12px 20px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  background: var(--head); border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.grid td { padding: 11px 20px; border-bottom: 1px solid var(--line-2); font-size: 14px; vertical-align: middle; }
.grid tr:last-child td { border-bottom: 0; }
.grid .num { text-align: right; font-variant-numeric: tabular-nums; }
.grid .strong { font-weight: 600; }
.grid tr.dim td { color: var(--muted); }
.grid tr.na td { color: #9AA1AB; }
.dup-warning { margin-top: 4px; font-size: 13px; color: var(--pend); }   /* Approvals: same title + start date elsewhere */
.row-actions { white-space: nowrap; text-align: right; }
/* Per-programme tables: many columns side by side, so headings wrap and cells are tighter */
.grid.compact th { white-space: normal; vertical-align: bottom; padding: 10px 10px; }
.grid.compact td { padding: 9px 10px; }
.grid.compact th:first-child, .grid.compact td:first-child { padding-left: 20px; min-width: 140px; }
.grid.compact input[type=number] { width: 72px; }
.grid.compact input[type=date] { width: 140px; }
.grid.compact input.amount { width: 130px; }          /* rupee amounts need room for 9-10 digits */
.grid.compact td.calc, .grid.compact th.calc { padding-left: 8px; padding-right: 8px; }
.grid.compact .seg { gap: 3px; }
.grid.compact .seg label { padding: 0 8px; }
.grid.compact .stacked-action { margin-top: 6px; }
.nowrap { white-space: nowrap; }
.row-actions > * + * { margin-left: 10px; }

/* Dashboard attribute rows that fold open (prototype: click a row to see its metrics) */
.attr-table { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.attr-head, .attr-row { display: grid; grid-template-columns: 90px 1fr 140px 140px 200px; align-items: center; padding: 12px 20px; }
.attr-head { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--head); border-bottom: 1px solid var(--line); }
.attr-fold { border-bottom: 1px solid var(--line-2); }
.attr-fold:last-of-type { border-bottom: 0; }
.attr-fold > summary { list-style: none; cursor: pointer; }
.attr-fold > summary::-webkit-details-marker { display: none; }
.attr-row { padding: 14px 20px; font-size: 14px; }
.attr-row:hover { background: var(--fold); }
.attr-total { border-top: 1px solid var(--line); font-weight: 600; }
.r { text-align: right; }
.share { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.bar { width: 120px; height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.bar > div { height: 8px; background: var(--teal); }
.share span { width: 40px; text-align: right; color: var(--muted); }
.attr-metrics-table { padding: 8px 20px 16px 110px; background: var(--fold); border-top: 1px solid var(--line-2); }
.m-head, .m-row { display: grid; grid-template-columns: 80px 1fr 90px 90px 90px; padding: 7px 0; }
.m-head { font-size: 12px; font-weight: 600; color: var(--muted); }
.m-row { font-size: 14px; border-top: 1px solid var(--line-2); }
.m-row.na { color: #9AA1AB; }
.approvals { margin-top: 2px; font-size: 12px; color: var(--muted); }
.approvals span + span::before { content: " · "; }
.approvals-note { margin: 0; }
.m-row a { color: inherit; text-decoration: none; }
.m-row a:hover { color: var(--teal); text-decoration: underline; }

/* ---------- forms and buttons ---------- */
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
input, select { height: 40px; padding: 0 10px; border: 1px solid var(--field); border-radius: 6px; background: #fff; color: var(--ink); max-width: 100%; }
input:focus, select:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
.grid input, .grid select { height: 36px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 16px; padding: 20px; }
.form-grid .full { grid-column: 1 / -1; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
form.inline { display: inline; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 18px; border-radius: 8px;
  border: 1px solid var(--field-2); background: #fff; color: var(--ink-2); font-weight: 500; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--teal); color: var(--teal); }
.btn.primary { border: 0; background: var(--teal); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--teal-dark); color: #fff; }
.btn.big { height: 46px; padding: 0 22px; font-size: 15px; }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.outline { height: 34px; padding: 0 12px; border: 1px solid var(--teal); color: var(--teal); border-radius: 6px; }
.btn.outline:hover { background: var(--teal-tint); }
.btn.danger { color: var(--bad); border-color: #E4B4AC; }
.btn[disabled] { opacity: .5; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--teal); cursor: pointer; font: inherit; text-decoration: underline; }
.link.danger { color: var(--bad); }

/* Yes / No segmented choice (prototype) */
.seg { display: inline-flex; gap: 6px; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label { display: inline-flex; flex-direction: row; justify-content: center; align-items: center; height: 34px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--field-2);
  background: #fff; color: var(--ink-2); font-size: 14px; font-weight: 500; cursor: pointer; }
.seg input:checked + label { border-color: var(--teal); background: var(--teal); color: #fff; }
.seg input:focus-visible + label { outline: 2px solid var(--teal); outline-offset: 2px; }
.seg input:disabled + label { cursor: default; opacity: .7; }

/* status pills */
.pill { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 13px; white-space: nowrap; }
.pill.approved { background: var(--ok-bg); color: var(--ok); }
.pill.pending { background: var(--pend-bg); color: var(--pend); }
.pill.draft, .pill.new { background: var(--draft-bg); color: var(--draft); }
.pill.rejected { background: var(--bad-bg); color: var(--bad); }
.pill.demo { background: #EFE8F7; color: #45306B; font-weight: 600; font-size: 11px; letter-spacing: .05em; }
.grade { font-weight: 600; }

/* tabs for metrics with several entry pages */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 14px; border-radius: 8px 8px 0 0; color: var(--muted); text-decoration: none; font-size: 14px; border: 1px solid transparent; margin-bottom: -1px; }
.tabs a.active { background: #fff; border-color: var(--line); border-bottom-color: #fff; color: var(--ink); font-weight: 600; }
.tabs span { padding: 8px 14px; color: #9AA1AB; font-size: 14px; }

.placeholder { padding: 24px; background: #fff; border-radius: 12px; border: 1px dashed var(--field-2); font-size: 15px; line-height: 1.6; color: var(--ink-2); }

/* ---------- login ---------- */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--slate); padding: 16px; }
.login-card { width: 100%; max-width: 440px; padding: 48px; background: var(--paper); border-radius: 16px; display: flex; flex-direction: column; gap: 20px; }
.login-card .title { font-family: var(--serif); font-size: 34px; font-weight: 600; }
.login-card p { margin: 0; font-size: 15px; color: var(--muted); line-height: 1.5; }
.login-card input { height: 44px; padding: 0 12px; border-color: var(--field-2); border-radius: 8px; }
.login-card .btn { height: 48px; font-size: 15px; }
.login-card .fine { font-size: 12px; color: var(--muted-2); }

@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .header, .content { padding-left: 16px; padding-right: 16px; }
  .tiles { grid-template-columns: 1fr; }
  .attr-head, .attr-row { grid-template-columns: 60px 1fr 80px 80px; }
  .attr-head > :last-child, .attr-row > :last-child { display: none; }
  .attr-metrics-table { padding-left: 20px; }
  .login-card { padding: 28px; }
}

/* import preview */
li.danger, tr.danger td, p.danger, div.danger { color: var(--bad); }

/* owner console */
a.plain { color: inherit; text-decoration: none; }
fieldset.plain-set { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
fieldset.plain-set legend { font-size: 13px; font-weight: 500; color: var(--ink-2); padding: 0 0 6px; }
label.choice { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; font-size: 14px; }
label.choice input { height: auto; margin-top: 3px; }
label.choice > span { flex: 1; min-width: 0; }
label.choice input[type=radio], label.choice input[type=checkbox] { flex: none; width: auto; padding: 0; }
fieldset.plain-set label.choice { width: 100%; justify-content: flex-start; text-align: left; }
label.confirm-count { align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
label.confirm-count input { width: 6em; height: 36px; }
.scope-attr { border-top: 1px solid var(--line-2); padding: 8px 0; }
.scope-metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 4px 16px; padding: 6px 0 0 26px; }
.secret { display: flex; flex-wrap: wrap; gap: 24px; padding: 14px 16px; background: var(--head); border-radius: 8px; }
.secret div { display: flex; flex-direction: column; gap: 2px; }
.secret b { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 18px; letter-spacing: .03em; }

/* Calculated figures (read-only, from the last recalculation) */
.grid td.calc { background: var(--fold); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.grid th.calc { text-align: right; }
.figures-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; color: var(--muted); }
.figures-note .stale { color: var(--pend); font-weight: 500; }
.figures-note form { display: inline; }

/* A single pooled row of calculated figures (M10.1): summary cards instead of a wide table */
.fig-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.fig-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.fig-card .label { font-size: 13px; color: var(--muted); }
.fig-card .value { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.fig-card.pct { background: var(--teal-tint); border-color: var(--teal); }
.fig-card.pct .value { font-size: 34px; color: var(--teal); }
.fig-period { font-size: 13px; color: var(--muted); }
.retention-missing { padding: 16px 18px; border-color: var(--amber, #d9a400); background: #fffbea; }

/* Help texts (benchmark review): "How to fill this" note and field tips */
details.howto { border: 1px solid var(--line, #d9dfdc); border-radius: 8px; padding: 10px 14px; background: var(--teal-tint); }
details.howto summary { cursor: pointer; font-weight: 600; color: var(--teal-dark); }
details.howto .howto-text { margin-top: 8px; font-size: 14px; color: var(--ink-2); max-width: 70ch; }
.tip { display: inline-block; margin-left: 4px; color: var(--teal-dark); cursor: help; font-weight: 400; }
.tip:focus { outline: 2px solid var(--teal-dark); outline-offset: 2px; border-radius: 4px; }
.row-note { margin-top: 4px; font-size: 12px; color: var(--note); }

/* Admin Remarks (owner 2026-10-23): marker in the last column; hover = tooltip (title), tap = shown in the cell */
.grid th.remark-col, .grid td.remark-col { width: 1%; min-width: 3.5em; padding-left: 8px; padding-right: 12px; }
.grid th.remark-col { white-space: normal; min-width: 0; width: 5.5em; }
/* Admin Remarks always in view (owner 2026-10-23): on tables wider than the window (M1.2, M2.1e, M8.2, master-data
   lists) the last column stays at the right edge while the rest scrolls sideways; no effect on tables that fit. */
.grid th.remark-col, .grid td.remark-col { position: sticky; right: 0; z-index: 1; background: #fff;
  box-shadow: inset 1px 0 0 var(--line), -6px 0 8px -6px rgba(0, 0, 0, .18); }
.grid th.remark-col { background: var(--head); z-index: 2; }
.grid.tight th, .grid.tight td { padding-left: 12px; padding-right: 12px; }   /* event logs: Admin Remarks in view at 1366 px */
.remark-mark { border: 1px solid var(--line); background: var(--teal-tint); border-radius: 12px; padding: 1px 7px;
  font-size: 13px; line-height: 1.4; cursor: pointer; }
.remark.outdated .remark-mark { background: var(--pend-bg); border-color: var(--amber); }
.remark-mark:focus-visible { outline: 2px solid var(--teal-dark); outline-offset: 2px; }
.remark-pop { display: none; margin-top: 6px; max-width: 280px; min-width: 180px; white-space: normal; font-size: 13px;
  color: var(--ink-2); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.remark.open .remark-pop { display: block; }
.remark.outdated .remark-pop { border-color: var(--amber); }
.remark-by { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
details.remark-edit { display: inline-block; margin-left: 4px; }
details.remark-edit summary { cursor: pointer; list-style: none; color: var(--teal-dark); padding: 0 4px; }
details.remark-edit summary::-webkit-details-marker { display: none; }
details.remark-edit[open] { display: block; margin: 6px 0 0; min-width: 240px; }
details.remark-edit textarea { width: 100%; min-width: 220px; font: inherit; font-size: 13px; }

/* Privacy and terms pages (public) */
.legal { max-width: 760px; line-height: 1.6; }
.legal h2 { margin-top: 28px; }
.legal ul { padding-left: 20px; }

/* Contact support */
.header-user .count { margin-left: 6px; padding: 2px 8px; border-radius: 10px; background: var(--amber); color: #fff; font-size: 12px; font-weight: 500; }
textarea { min-height: 140px; padding: 8px 10px; border: 1px solid var(--field); border-radius: 6px; background: #fff; color: var(--ink); font: inherit; font-size: 14px; resize: vertical; max-width: 100%; }
textarea:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.msg { padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.msg:last-child { border-bottom: 0; }
.msg.support { background: var(--ok-bg); }
.msg-head { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }

/* two-factor guide (2026-10-24) */
.guide .shot { max-width: 100%; height: auto; border: 1px solid var(--line, #d0d7de); border-radius: 8px; }
.guide-pair { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.guide-pair .shot { flex: 1 1 320px; min-width: 0; }
.phone-pair { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: flex-start; }   /* Help 13 (owner 2026-11-03) */
.phone-pair > .stack { flex: 1 1 280px; min-width: 0; }
.help .phone-shot { width: 200px; max-width: 30%; height: auto; max-height: none; }

/* coverage summary on M6.6a / M6.6b / M7.9a (2026-10-26) */
.coverage summary { cursor: pointer; display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.coverage tr.gap td { background: #FFF4E5; }
.coverage .gap-mark { color: #8A4B00; font-weight: 600; }
.coverage td.num, .coverage th.num { text-align: right; white-space: nowrap; }

/* Help (owner 2026-10-29, Part E): one page, also printed as the PDF for new College Admins */
.help h3 { margin: 6px 0 0; font-size: 15px; }
.help ol, .help ul { margin: 0; padding-left: 22px; }
.help li { margin: 4px 0; }
.help-contents ol { columns: 2; column-gap: 32px; }
.help-table td { vertical-align: top; }
.help-table td:first-child { width: 38%; font-weight: 600; }
.help-link { margin: 0; }
@media (max-width: 700px) { .help-contents ol { columns: 1; } }
@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  .sidebar, .header, .no-print, .toast { display: none !important; }
  .app, .main, .content { display: block !important; margin: 0 !important; padding: 0 !important; }
  body { background: #fff !important; font-size: 11.5px; line-height: 1.4; }
  .help, .help .stack { max-width: none; gap: 4px !important; }
  .help .card { border: 0; padding: 0 !important; overflow: visible; }
  .help p, .help ul, .help ol { margin: 0 0 3px; }
  .help li { margin: 1px 0; }
  .help h1 { font-size: 22px; margin: 0; }
  .help h2 { break-after: avoid; font-size: 15px; margin: 8px 0 2px; }
  .help h3 { font-size: 13px; margin: 4px 0 0; }
  .help .lede { font-size: 12px; }
  .help-contents ol { columns: 3 !important; font-size: 11px; }
  .help .shot { display: block; max-height: 190px; max-width: 100%; width: auto; margin: 4px 0; break-inside: avoid; }
  .help .phone-shot { max-height: 250px; }
  .phone-pair { break-inside: avoid; }
  .help-table th, .help-table td { padding: 3px 6px; font-size: 11px; }
  .help a { color: inherit; text-decoration: none; }
}

/* Statistics (owner 2026-11-01): list of statistics on the left, the chosen one's tables on the right */
.stats-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; align-items: start; }
.stats-list { display: flex; flex-direction: column; gap: 2px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 8px; position: sticky; top: 12px; }
.stats-list a { padding: 9px 12px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 14px; }
.stats-list a:hover { background: var(--fold); }
.stats-list a.active { background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.stats-list { max-height: calc(100vh - 24px); overflow-y: auto; }
.stats-group { padding: 10px 12px 2px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted-2); }
.stats-group:first-child { padding-top: 2px; }
.stats-main h2 { margin: 0; font-size: 20px; }
.stats-main h3 { margin: 0; font-size: 16px; }
.stats-table { gap: 8px; }
.stats-years { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.year-chip { display: inline-flex; flex-direction: row; align-items: center; margin: 0; font-weight: 400; gap: 6px; padding: 5px 10px; border: 1px solid var(--line);
  border-radius: 16px; background: #fff; font-size: 13px; }
.year-chip.graded { border-color: var(--teal); }
.tag { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 8px; background: var(--ok-bg);
  color: var(--ok); font-size: 10px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.year-chip input { width: auto; height: auto; margin: 0; }
.btn.small-btn { height: 32px; padding: 0 14px; }
.grid.stats td.label { min-width: 160px; }
.grid.stats th.num { text-align: right; white-space: normal; }
.grid.stats td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.grid.stats th.graded { background: #EEF6F4; }
.grid.stats td.zero { color: #9AA1AB; }
.grid.stats td.gap { background: #FFF4E5; color: #8A4B00; font-weight: 600; text-align: right; white-space: nowrap; }
.grid.stats td.warn { color: var(--pend); text-align: right; white-space: nowrap; }
.grid.stats td.ok { color: var(--ok); text-align: right; }
.grid.stats td.muted { text-align: right; white-space: nowrap; font-size: 12px; }
.grid.stats tr.total td { font-weight: 600; border-top: 1px solid var(--line); background: var(--fold); }
.stats-month summary { cursor: pointer; padding: 10px 16px; font-size: 14px; }
@media (max-width: 900px) {
  .stats-layout { grid-template-columns: 1fr; }
  .stats-list { position: static; flex-direction: row; flex-wrap: wrap; max-height: none; }
  .stats-group { flex-basis: 100%; }
}

/* ---------- Phones and small tablets (owner 2026-11-03, Part 2). Nothing here applies above 900 px: the desktop
   layout is unchanged. Pages never scroll sideways (wide tables scroll inside their own box); buttons, menu links
   and form fields are at least 44 px tall (easy to tap). ---------- */
/* "Approve all" asks first, on every screen (owner 2026-11-03; _approve_all_phone.html) */
.approve-all-ask > summary { list-style: none; display: inline-flex; align-items: center; cursor: pointer; }
.approve-all-ask > summary::-webkit-details-marker { display: none; }
.approve-all-ask[open] > summary { margin-bottom: 12px; opacity: .6; }
.actions > .approve-all-ask[open] { flex-basis: 100%; }
.approve-all-box { max-width: 640px; }
.approve-all-box p { margin: 0 0 10px; }
.approve-all-box .actions { margin-top: 14px; }
/* a data-entry table only slightly wider than the page gets the screen's spare room (base.html), so the pinned
   Admin Remarks column covers no column when the page opens (owner 2026-11-03) */
.stack.narrow.roomy { max-width: 1160px; }
/* ... then, only as far as needed (base.html; owner 2026-11-03, correction 3): narrower text boxes (M1.1a, M1.2,
   M1.3, M1.5), or on event lists Edit under Approve and then headings on two lines */
.slim-text .grid input:not([type]), .slim-text .grid input[type=text], .slim-text .grid input[type=url] { width: 110px; }
.stack-actions .row-actions > * { display: block; width: max-content; margin-left: auto; }
.stack-actions .row-actions > * + * { margin: 6px 0 0 auto; }
.wrap-heads .grid > thead th { white-space: normal; }
.mobile-bar, .menu-close { display: none; }
@media print, (min-width: 901px) { .phone-only { display: none !important; } }
@media screen and (max-width: 900px) {      /* screens only: the printed Help (A4, under 900 px) stays as it is */
  .desktop-only { display: none !important; }
  /* the menu: a slim bar at the top; the full menu opens over the page (#menu) and closes with "Close menu" */
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; top: 0; z-index: 40;
    min-height: 56px; padding: 6px 12px 6px 16px; background: var(--slate); }
  .mobile-bar .brand { padding: 0; font-size: 19px; }
  .mobile-bar-links { display: flex; align-items: center; gap: 4px; }
  .bar-link, .menu-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px;
    color: var(--nav-strong); text-decoration: none; font-size: 14px; font-weight: 500; }
  .bar-link .count { margin-left: 6px; padding: 2px 8px; border-radius: 10px; background: var(--amber); color: #fff; font-size: 12px; }
  .menu-btn { border: 1px solid var(--slate-hi); background: var(--slate-hi); color: #fff; }
  .bar-link:hover, .menu-btn:hover { color: #fff; }
  .sidebar { display: none; }
  .sidebar:target { display: flex; position: fixed; inset: 0; z-index: 60; width: 100%; height: 100%; padding: 12px 16px 32px; overflow-y: auto; }
  .menu-close { display: flex; align-items: center; justify-content: center; min-height: 44px; margin-bottom: 8px; border-radius: 8px;
    border: 1px solid var(--slate-hi); color: #fff; text-decoration: none; font-weight: 500; }
  .menu-close:hover, .menu-close:focus { color: #fff; background: var(--slate-hi); }
  .nav, .metric-link { min-height: 44px; }
  .metric-link { display: flex; align-items: center; }
  /* header: smaller, links tappable */
  .header { min-height: 0; padding: 10px 16px; gap: 6px; }
  .header-college { font-size: 15px; }
  .header-sub { font-size: 12px; }
  .header-user { gap: 0 14px; }
  .header-user a { display: inline-flex; align-items: center; min-height: 44px; }
  .content { padding-top: 18px; }
  h1 { font-size: 26px; }
  /* tap sizes */
  .btn, .btn.outline, .btn.small-btn { height: 44px; }
  .btn.small { height: 40px; padding: 0 12px; }
  .btn.link { height: auto; min-height: 44px; }
  button.link { min-height: 44px; padding: 0 6px; }
  input, select { height: 44px; }
  .grid input, .grid select { height: 40px; }
  .seg label { height: 44px; padding: 0 16px; }
  .year-chip { padding: 10px 12px; }
  details > summary { min-height: 44px; }
  details.howto summary { padding: 10px 0; }
  details.remark-edit summary { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; min-width: 40px; }
  .remark-mark { min-height: 36px; min-width: 40px; padding: 4px 10px; }
  /* tables: slimmer cells; the Admin Remarks column is not pinned (it would cover the other columns) */
  .grid th { padding: 10px 12px; }
  .grid td { padding: 10px 12px; }
  .grid th.remark-col, .grid td.remark-col { position: static; box-shadow: none; }
  .page-head { min-width: 0; }
  h1, h2 { overflow-wrap: anywhere; }
  .table-wrap { position: relative; }     /* the hidden Yes/No inputs stay inside the table's own sideways box */
  .actions > label { flex: 1 1 100%; min-width: 0; }
  .actions > label select { width: 100%; }
  .card.pad { padding: 16px; }
  .card.phone-pad { padding: 14px 16px; }        /* boxes unpadded on the desktop: text clear of the edge on phones */
  .help-contents a { display: inline-block; padding: 9px 0; }
  /* Dashboard attribute table: code, name, mark, maximum */
  .attr-head, .attr-row { grid-template-columns: 34px minmax(0, 1fr) 52px 64px; gap: 0 8px; padding: 12px 14px; }
  .attr-head { letter-spacing: 0; }
  .attr-metrics-table { padding: 6px 14px 12px; }
  .m-head, .m-row { grid-template-columns: 52px minmax(0, 1fr) 46px 44px 44px; gap: 0 6px; }
  /* Approvals: one card per item, its buttons always in view; "Approve all" below the list */
  .approvals-list, .approvals-list tbody, .approvals-list tr, .approvals-list td { display: block; width: auto; }
  .approvals-list tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .approvals-list tr:last-child { border-bottom: 0; }
  .approvals-list td { border: 0; padding: 3px 16px; }
  .approvals-list td.row-actions { white-space: normal; text-align: left; padding-top: 10px; }
  .approvals-list .row-actions form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
  .approvals-list .row-actions form > * + * { margin-left: 0; }
  .approvals-list .row-actions input[name=reason] { order: 1; flex: 1 1 100%; }
  .approvals-list .row-actions button[value=approve] { order: 2; }
  .approvals-list .row-actions button[value=reject] { order: 3; }
  /* People: one card per person, Reset password in view */
  .phone-cards thead { display: none; }
  .phone-cards, .phone-cards tbody, .phone-cards tr, .phone-cards td { display: block; width: auto; }
  .phone-cards tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .phone-cards tr:last-child { border-bottom: 0; }
  .phone-cards td { border: 0; padding: 3px 16px; }
  .phone-cards td:empty { display: none; }
  /* Statistics: a drop-down instead of the list; the tables scroll inside their box */
  .stats-layout { grid-template-columns: minmax(0, 1fr); }
  .stats-list { display: none; }
  .stats-picker { max-width: 100%; }
  .stats-picker select { width: 100%; }
  .stats-main, .stats-main > * { min-width: 0; }
  .help .phone-shot { max-width: calc(50% - 8px); }
  .phone-pair { gap: 16px; }
  /* wide data-entry tables: a line above says to swipe (added by base.html only when the table is wider than the
     screen); the first column (Programme, Item, Cadre) stays in view while the table is swiped */
  .swipe-hint { margin: 0 0 -6px; font-size: 13px; color: var(--muted); }
  .sticky-first > .grid > thead > tr:first-child > th:first-child, .sticky-first > .grid > tbody > tr > td:first-child {
    position: sticky; left: 0; z-index: 1; min-width: 124px; max-width: 150px; overflow-wrap: break-word; background: #fff;
    box-shadow: inset -1px 0 0 var(--line); }
  .sticky-first > .grid > thead > tr:first-child > th:first-child { z-index: 2; background: var(--head); }
  .sticky-first > .grid.compact th:first-child, .sticky-first > .grid.compact td:first-child { padding-left: 12px; }
  /* "Approve all" (_approve_all_phone.html): well apart from the Save buttons */
  .approve-all-ask { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
}
/* Number boxes (owner 2026-11-09): no up/down arrows on any page. The wheel and the arrow keys are stopped by
   number-boxes.js; the boxes stay type="number" (same checks, number keyboard on phones). */
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }
/* Long uploaded file names break anywhere, so upload pages fit a phone (owner 2026-11-09, I). */
.filename { overflow-wrap: anywhere; word-break: break-word; }
/* Event link on event lists (owner 2026-11-09, D): a small link symbol after the title, opening in a new tab. */
.event-link { text-decoration: none; margin-left: 3px; vertical-align: -2px; display: inline-block; }
.row-warning { margin-top: 4px; font-size: .85em; color: var(--pend); white-space: normal; }   /* M9.1 blank type (2026-11-15) */

/* Reports (owner 2026-11-19) */
.report-index p { margin: 0 0 14px; }
.report-form fieldset { border: 0; padding: 0; margin: 0; }
.report-form legend { font-weight: 600; margin-bottom: 6px; }
.report-ticks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 16px; font-size: 14px; }
.report-ticks.cols { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.report-ticks label.dim { color: #9AA1AB; }
.report-buttons, .report-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 6px; }
.report-summary p { margin: 0 0 4px; }
.report-count { font-size: 18px; }
.report-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.grid.report td { text-align: left; white-space: normal; }
.grid.report td.gap { text-align: left; white-space: nowrap; }
.grid.report td.gap-label { background: #FFF4E5; color: #8A4B00; font-weight: 600; }
.report-form label { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; text-align: left; gap: 8px; font-weight: 400; font-size: 14px; }
.report-form .report-row label:has(select), .report-form .report-row label:has(input[type=date]) { flex-direction: column; align-items: flex-start; gap: 4px; }
.report-form input[type=checkbox], .report-form input[type=radio] { width: 18px; height: 18px; min-height: 0; flex: none; margin: 0; padding: 0; }
.report-chips .tag { text-transform: none; }
.report-form, .report-summary { padding: 16px 18px; }
.report-sub { margin: 6px 0 0; font-size: 15px; }
.grid.report-cross td { text-align: right; }
.grid.report-cross td:first-child { text-align: left; }
.grid.report-cross td.total { font-weight: 700; }
.report-form label.archived-tick { margin-top: 6px; }
.no-data { color: #8A4B00; font-size: 12px; font-weight: 600; white-space: nowrap; cursor: help; border-bottom: 1px dotted currentColor; }

/* M8.5 Pass Percentage by programme and year (2026-11-19) */
.pass-table td.num { white-space: nowrap; }
.grid.stats td.subtotal { font-weight: 600; background: var(--fold); }
.pass-pooled { display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; }
.pass-pooled .label { font-weight: 600; }
.pass-pooled .value { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
