/* Shared page frame (header pill, pop-overs) and the overview pages. Layout
   from Ali's mock-ups of 10 November 2026; colours and type from
   www.mrcollege.ac.uk, read from the live site on 11 November 2026. */
:root {
  --navy: #002147;      /* the site's buttons and headings */
  --deep: #001022;      /* the site's darkest navy, used for text */
  --royal: #27479e;     /* the site's link blue */
  --teal: #16616d;      /* the site's second colour */
  --yellow: #fbe92f;    /* the site's highlight */
  --ink: #001022;
  --soft: #5a6a7e;
  --panel: #f5f7fa;
  --panel-2: #e9edf3;
  --line: #d9e0e9;
  --blue: var(--navy);
  --bad: #b3261e;
  --bg: #ffffff;
  --serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
body.board {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Montserrat, "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  font-weight: 400;
}
a { color: var(--royal); text-underline-offset: 3px; }
.bar a, a.stat, .menu a { color: inherit; }
.bar-gap { height: 20px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: #fff; padding: 8px; z-index: 20; }
.board-wrap { max-width: 1360px; margin: 0 auto; padding: 24px 24px 48px; }

/* Header pill */
.bar {
  display: flex; align-items: center; gap: 24px;
  background: var(--panel); border-radius: 40px;
  padding: 10px 36px 10px 36px; min-height: 76px;
}
.bar-brand { display: flex; align-items: center; gap: 14px; text-decoration: none; flex: none; }
.bar-logo { height: 40px; width: auto; display: block; }
.bar-title { font-family: var(--serif); color: var(--navy); font-size: clamp(1.3rem, 2.2vw, 2rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; white-space: nowrap; }
.bar-nav { margin-left: auto; display: flex; gap: 28px; }
.bar-nav a { text-decoration: none; font-weight: 500; font-size: 0.98rem; color: var(--soft) !important; padding: 4px 0; border-bottom: 3px solid transparent; transition: color .15s, border-color .15s; }
.bar-nav a[aria-current="page"] { color: var(--navy) !important; font-weight: 600; border-bottom-color: var(--yellow); }
.bar-nav a:hover { color: var(--navy) !important; border-bottom-color: var(--line); }
.bar-end { display: flex; align-items: center; gap: 18px; margin-left: 48px; }

/* Pop-overs built on <details>, so they work without JavaScript */
.pop { position: relative; }
.pop > summary { list-style: none; cursor: pointer; }
.pop > summary::-webkit-details-marker { display: none; }
.pop-panel {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 10;
  background: #fff; border-radius: 18px; padding: 18px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.14); min-width: 280px;
  display: grid; gap: 10px;
}
.pop-panel label { font-size: 0.85rem; color: var(--soft); }
.round-btn {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; background: var(--navy); transition: background .15s;
}
.round-btn:hover { background: var(--royal); }
.search-row { display: flex; gap: 8px; }
.user { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy); color: var(--yellow); font-weight: 600;
}
.user-text { display: grid; line-height: 1.25; }
.hello { color: var(--soft); font-weight: 400; font-size: 0.85rem; }
.who { font-weight: 600; color: var(--navy); }
.menu a, .menu button {
  display: block; text-align: left; text-decoration: none; padding: 8px 10px;
  border-radius: 10px; font: inherit; background: none; border: 0; cursor: pointer; width: 100%;
}
.menu a:hover, .menu button:hover { background: var(--panel); }
.menu form { margin: 0; border-top: 1px solid #eee; padding-top: 6px; }

/* Toolbar under the header */
.toolbar { display: flex; justify-content: flex-end; align-items: center; gap: 18px; margin: 4px 0 18px; }
.select-pill { position: relative; }
.select-pill select {
  appearance: none; -webkit-appearance: none;
  font: inherit; font-weight: 500; color: var(--navy);
  background: var(--panel); border: 0; border-radius: 30px;
  padding: 10px 64px 10px 28px; min-height: 44px; cursor: pointer;
}
.select-pill .chev {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 50%; background: #fff;
  display: grid; place-items: center; pointer-events: none;
}
.filter-btn {
  display: flex; align-items: center; gap: 18px;
  background: var(--navy); color: #fff;
  border-radius: 30px; padding: 4px 20px 4px 4px; min-height: 44px; font-weight: 500;
  transition: background .15s;
}
.filter-btn:hover { background: var(--royal); }
.filter-dot {
  width: 34px; height: 34px; border-radius: 50%; background: var(--yellow); color: var(--navy);
  display: grid; place-items: center;
}
.pop-filter select, .pop-search input {
  font: inherit; padding: 9px 12px; border: 1px solid #d6d6d6; border-radius: 12px; width: 100%;
}
.pill-btn {
  font: inherit; color: #fff; border: 0; border-radius: 20px; padding: 8px 18px; cursor: pointer;
  background: var(--navy);
}
.pill-btn:hover { background: var(--royal); }
.clear { font-size: 0.9rem; color: var(--royal) !important; }
.exports a { color: var(--royal); font-weight: 600; }
.exports { display: flex; gap: 14px; border-top: 1px solid #eee; padding-top: 10px; font-size: 0.9rem; }

/* Number cards */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; margin-bottom: 26px; }
.stat {
  background: var(--panel); border-radius: 22px; min-height: 155px;
  padding: 26px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-decoration: none;
}
a.stat[href]:hover { box-shadow: inset 0 0 0 2px var(--navy); }
.stat-label { font-weight: 500; color: var(--soft); font-size: 1.05rem; letter-spacing: -0.02em; text-align: center; }
.stat-n { font-weight: 700; font-size: 2.2rem; line-height: 1.1; color: var(--navy); font-variant-numeric: tabular-nums; }
.stat-n.zero { color: var(--soft); }
/* Dashboard: every count in one line of small tiles; the line scrolls sideways
   if there are more programmes than fit. */
.cards-line { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; padding-bottom: 4px; }
.cards-line .cards { display: contents; }
.cards-line .stat {
  flex: 1 0 96px; min-height: 0; padding: 6px 10px; gap: 0; border-radius: 6px;
  justify-content: center; border: 1px solid var(--line);
}
.cards-line .stat-label { font-size: 0.72rem; line-height: 1.2; }
.cards-line .stat-n { font-size: 1.05rem; }
.cards-line .empty { align-self: center; font-size: 0.85rem; white-space: nowrap; }
.empty { grid-column: 1 / -1; color: var(--soft); font-weight: 400; }

/* The offers table: one box per cell as in the mock-up, drawn in the
   college's navy at a weight that lets the names lead. */
.offers-table { margin-top: 10px; }
.table-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 18px; margin: 0 0 6px; }
.table-head h2 { font-family: var(--serif); color: var(--navy); font-size: 1.1rem; font-weight: 700; margin: 0; }
.row-count { margin: 0; color: var(--soft); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.row-count a { color: var(--royal); margin-left: 10px; }
.grid-scroll { overflow: auto; position: relative; max-height: calc(100vh - 150px); border: 1px solid #bfc8d4; }
.grid { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 1060px; background: #fff; }
.grid th, .grid td { border: 1px solid #d4dae3; padding: 4px 8px; text-align: left; vertical-align: middle; word-wrap: break-word; line-height: 1.3; }
.grid thead tr:first-child th { font-size: 0.78rem; font-weight: 700; color: var(--navy); background: #e9edf3; border-bottom: 0; padding: 6px 8px 4px; position: sticky; top: 0; z-index: 2; }
.grid th.mark, .grid td.mark, .grid th.action-col { text-align: center; }
.grid th:nth-child(1) { width: 13%; }
.grid th:nth-child(2) { width: 18%; }
.grid th:nth-child(3) { width: 18%; }
.grid th:nth-child(4) { width: 15%; }
.grid th:nth-child(5) { width: 9%; }
.grid th.mark { overflow-wrap: normal; word-wrap: normal; }
.grid td.email { overflow-wrap: anywhere; color: var(--soft); }
.grid td.addr { color: var(--soft); font-size: 0.78rem; }
.grid td { font-weight: 400; font-size: 0.82rem; }
.grid tbody tr { transition: background .12s; }
.grid tbody tr:hover { box-shadow: inset 0 0 0 9999px rgba(0, 16, 34, 0.04); }
.grid td a { font-weight: 600; text-decoration: none; color: var(--navy); }
.grid td a:hover { color: var(--royal); text-decoration: underline; }
/* Links drawn as buttons keep the button's colours, not the table's link colour. */
.grid td a.btn { color: #fff; text-decoration: none; }
.grid td a.btn:hover { color: #fff; text-decoration: none; }
.grid td a.btn.secondary, .grid td a.btn.secondary:hover { color: var(--navy); }
.grid .tick { display: inline-block; width: 16px; height: 16px; vertical-align: middle; }
.grid .tick svg { display: block; width: 100%; height: 100%; }
.grid .tick.yes { color: var(--teal); }
.grid .tick.no { color: var(--bad); }
.grid .tick.wait { color: var(--royal); }
.grid .tick.none { color: #9aa6b5; }
/* Sized so the whole table, Action included, fits a 1100px-wide window. */
.students-grid { min-width: 1080px; }
.students-grid th:nth-child(1) { width: 11%; }
.students-grid th:nth-child(2) { width: 15%; }
.students-grid th:nth-child(3) { width: 13%; }
.students-grid th:nth-child(4) { width: 12%; }
.students-grid th:nth-child(5) { width: 8%; }
.students-grid th:nth-child(n+6):nth-child(-n+9) { width: 7%; }
.students-grid th:nth-child(10) { width: 13%; }
.students-grid th.mark, .students-grid td.mark { padding-left: 2px; padding-right: 2px; }
.students-grid .col-filters td.mark { padding-left: 4px; padding-right: 4px; }
.students-grid .col-filters select { padding-left: 6px !important; padding-right: 18px !important; }
.students-grid td, .students-grid th { padding-left: 8px; padding-right: 8px; }
.grid .row-actions { text-align: center; }
.grid .row-actions form { display: inline-block; margin: 1px; }
.grid .row-actions form:last-child { margin-bottom: 0; }
.grid .btn.small { padding: 2px 8px; min-height: 0; font-size: 0.72rem; border-radius: 4px; white-space: nowrap; line-height: 1.4; max-width: 100%; }
.grid .row-actions .cell-note { font-size: 0.78rem; color: var(--soft); }
.grid .due { display: block; font-size: 0.68rem; color: var(--soft); font-weight: 400; margin-top: 1px; }
.grid .due.late { color: var(--bad); }
/* The filter row: one control under each heading. */
.grid .col-filters td { background: #e9edf3; border-top: 0; padding: 2px 4px 4px; position: sticky; top: 25px; z-index: 2; }
.grid .col-filters input, .grid .col-filters select {
  width: 100%; min-height: 24px !important; height: 24px; padding: 2px 6px !important; font: inherit; font-size: 0.75rem; color: var(--ink);
  background: #fff; border: 1px solid #c3ccd8 !important; border-radius: 3px !important;
}
.grid .col-filters select { padding-right: 24px; }
.grid .col-filters input:hover, .grid .col-filters select:hover { border-color: #b7c2d2; }
.grid .col-filters input:focus-visible, .grid .col-filters select:focus-visible { outline: 2px solid var(--royal); outline-offset: 1px; border-color: var(--royal); }
.grid .col-filters input::placeholder { color: #8795a8; }
.tag { display: inline-block; flex: none; white-space: nowrap; padding: 0 6px; border-radius: 3px; font-size: 0.72rem; font-weight: 600; }
.tag-morning { background: #fdf8c8; color: #5c5200; }
.tag-evening { background: #e3e9f6; color: var(--navy); }
.dash { color: #9aa6b5; }
.empty-row { color: var(--soft); text-align: center !important; padding: 18px 12px !important; }
.note { margin: 14px 0 0; color: var(--soft); font-weight: 400; font-size: 0.88rem; }

/* Report: offers by course */
.report-title h2 { font-family: var(--serif); color: var(--navy); font-size: 1.6rem; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.01em; }
.report-sum { margin: 0 0 22px; color: var(--ink); font-size: 1.02rem; max-width: 70ch; }
.kpi-strip { display: grid; grid-template-columns: repeat(5, 1fr); margin: 0 0 28px; background: var(--panel); border-radius: 18px; overflow: hidden; }
.kpi-strip > div { padding: 16px 20px; }
.kpi-strip > div + div { border-left: 1px solid var(--line); }
.kpi-strip dt { font-size: 0.85rem; color: var(--soft); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.kpi-strip dd { margin: 4px 0 0; font-size: 1.75rem; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi-strip dd small { font-size: 0.9rem; color: var(--soft); font-weight: 500; margin-left: 2px; }
.kpi-strip > div:last-child dd { font-size: 2.1rem; }
.sw { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.sw-acc, .seg.acc { background: var(--teal); }
.sw-rej, .seg.rej { background: var(--bad); }
.sw-pen, .seg.pen { background: var(--royal); }
.seg.lap { background: #c9d1dc; }
.report-table table { min-width: 860px; }
.report-table .bar-col { width: 28%; }
.stack { display: flex; height: 14px; border-radius: 4px; overflow: hidden; min-width: 6px; gap: 2px; background: #fff; }
.seg { display: block; min-width: 3px; }
.report-table tbody th a { color: var(--navy); text-decoration: none; }
.report-table tbody th a:hover { color: var(--royal); text-decoration: underline; }
.report-table tfoot th, .report-table tfoot td { font-weight: 700; color: var(--navy); border-top: 2px solid var(--navy); }

/* Four nav links no longer fit beside the name: they move to their own row. */
@media (max-width: 1180px) {
  .bar { flex-wrap: wrap; row-gap: 4px; }
  .bar-nav { order: 3; width: 100%; margin-left: 0; padding: 0 0 4px; }
  .bar-end { margin-left: auto; }
}
@media (max-width: 960px) {
  .kpi-strip { grid-template-columns: repeat(3, 1fr); }
  .kpi-strip > div:nth-child(4) { border-left: 0; }
  .kpi-strip > div:nth-child(n+4) { border-top: 1px solid var(--line); }
  .cards { gap: 16px; }
  .stat-label { font-size: 0.95rem; }
  .user-text { display: none; }
}
@media (max-width: 640px) {
  .board-wrap { padding: 16px 16px 40px; }
  .bar { flex-wrap: wrap; border-radius: 26px; padding: 12px 18px; gap: 12px; }
  .bar-nav { margin-left: 0; order: 3; width: 100%; gap: 6px 16px; flex-wrap: wrap; }
  .bar-nav a { font-size: 0.95rem; }
  .bar-end { margin-left: auto; }
  .toolbar { justify-content: space-between; margin-bottom: 28px; gap: 12px; }
  /* Four in a line, as in the design; on a phone the row scrolls sideways. */
  .cards { grid-template-columns: repeat(4, minmax(132px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 4px; }
  .stat { min-height: 120px; padding: 18px 10px; }
  .stat-label { font-size: 0.85rem; }
  .pop-panel { min-width: 240px; }
  .kpi-strip { grid-template-columns: 1fr 1fr; }
  .kpi-strip > div { border-left: 0 !important; border-top: 1px solid var(--line); }
  .kpi-strip > div:nth-child(-n+2) { border-top: 0; }
  .kpi-strip > div:nth-child(even) { border-left: 1px solid var(--line) !important; }
  .kpi-strip > div:last-child { grid-column: 1 / -1; border-left: 0 !important; }
  /* On a phone the figures matter more than the bars. */
  .report-table table { min-width: 0; }
  .report-table .bar-col { display: none; }
  .report-table th, .report-table td { padding: 10px 8px; font-size: 0.85rem; }
}
.board-wrap.narrow { max-width: 760px; }
.grid .dash, .report .dash { color: #8795a8; font-size: 0.85rem; }

/* Rows coloured by the student's answer, in Excel's own Good, Neutral and Bad
   fills (Ali, 12 November 2026): accepted green, pending amber, rejected red.
   The tick columns still say the same in words for screen readers. */
.grid tr.st-accepted > td { background: #c6efce; }
.grid tr.st-pending > td { background: #ffeb9c; }
.grid tr.st-rejected > td { background: #ffc7ce; }
.grid tr.st-accepted .tag, .grid tr.st-pending .tag, .grid tr.st-rejected .tag { background: rgba(255, 255, 255, 0.7); }
.grid tr.st-pending .due, .grid tr.st-rejected .due { color: #4a3a00; }
.grid tr.st-rejected .due, .grid tr.st-rejected td.email, .grid tr.st-rejected td.addr { color: #5c1a14; }
.grid tr.st-accepted td.email, .grid tr.st-accepted td.addr { color: #1d4a26; }
.grid tr.st-pending td.email, .grid tr.st-pending td.addr { color: #4a3a00; }
.grid tr.st-pending .due.late { color: #9c0006; }
.legend { display: flex; gap: 14px; align-items: center; margin: 0; font-size: 0.78rem; color: var(--soft); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 14px; height: 14px; border: 1px solid #bfc8d4; display: inline-block; }
.legend .l-acc { background: #c6efce; }
.legend .l-pen { background: #ffeb9c; }
.legend .l-rej { background: #ffc7ce; }

/* One line per row, as in a spreadsheet: long text ends in an ellipsis and
   shows in full when pointed at. */
.students-grid tbody td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 28px; }
.students-grid tbody td.row-actions { overflow: visible; }
.students-grid tbody td.empty-row { white-space: normal; }
.grid .students-grid td.email, .students-grid td.email { overflow-wrap: normal; }
.students-grid .due { display: inline; margin: 0 0 0 3px; }
.students-grid .tick { width: 14px; height: 14px; }
/* A slimmer header and toolbar. */
.bar { min-height: 56px; padding: 6px 24px; }
.bar-logo { height: 32px; }
.bar-title { font-size: clamp(1.15rem, 1.8vw, 1.5rem); }
.round-btn, .avatar { width: 36px; height: 36px; }
.select-pill select { padding: 5px 44px 5px 16px; min-height: 32px; font-size: 0.85rem; }
.select-pill .chev { width: 24px; height: 24px; right: 4px; }
.filter-btn { min-height: 32px; padding: 3px 14px 3px 3px; gap: 10px; font-size: 0.85rem; }
.filter-dot { width: 26px; height: 26px; }
.students-grid th:nth-child(1) { width: 12%; }
.students-grid th:nth-child(2) { width: 16%; }
.students-grid th:nth-child(3) { width: 14%; }
.students-grid th:nth-child(4) { width: 13%; }
.students-grid th:nth-child(5) { width: 7%; }
.students-grid th:nth-child(6), .students-grid th:nth-child(7), .students-grid th:nth-child(9) { width: 5.5%; }
.students-grid th:nth-child(8) { width: 8.5%; }
.students-grid th:nth-child(10) { width: 13%; }

/* Report: the same compact style */
.report-title h2 { font-size: 1.2rem; }
.report-sum { margin: 0 0 12px; font-size: 0.88rem; }
.kpi-strip { border-radius: 6px; margin: 0 0 14px; border: 1px solid var(--line); }
.kpi-strip > div { padding: 6px 12px; }
.kpi-strip dt { font-size: 0.72rem; }
.kpi-strip dd { font-size: 1.1rem; margin-top: 0; }
.kpi-strip > div:last-child dd { font-size: 1.2rem; }
.sw-acc, .seg.acc { background: #63be7b; }
.sw-pen, .seg.pen { background: #f4c542; }
.sw-rej, .seg.rej { background: #e06666; }
.stack { height: 10px; border-radius: 2px; }
.stat { border-radius: 6px; }
