/* Everything inside the page frame: headings, cards, forms, buttons, tables.
   Colours and shapes follow the overview pages in board.css. */
:root {
  --ink: #001022;
  --muted: #5a6a7e;
  --line: #d9e0e9;
  --panel: #f5f7fa;
  --card: #f5f7fa;
  --brand: #002147;
  --brand-2: #27479e;
  --ok: #166534;
  --ok-bg: #dcfce7;
  --warn: #92400e;
  --warn-bg: #fef3c7;
  --bad: #b42318;
  --bad-bg: #fee4e2;
  --info-bg: #e9edf6;
  font-family: Montserrat, "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  color: var(--ink);
  line-height: 1.55;
}
* { box-sizing: border-box; }
body { margin: 0; background: #fff; font-size: 14px; }
main a { color: var(--brand-2); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 680px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: #fff; padding: 8px; z-index: 20; }
form.inline { display: inline; margin: 0; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); text-decoration: underline; cursor: pointer; }

h1 { font-family: "Libre Baskerville", Georgia, serif; color: var(--brand); font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; margin: 0 0 20px; }
h2 { font-family: "Libre Baskerville", Georgia, serif; color: var(--brand); font-size: 1.2rem; font-weight: 700; margin: 32px 0 14px; }
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: 0.9rem; }
strong, b { font-weight: 600; }

.card { background: var(--card); border: 0; border-radius: 22px; padding: 26px 28px; margin-bottom: 22px; }

.messages { list-style: none; padding: 0; margin: 0 0 20px; }
.msg { padding: 12px 18px; border-radius: 14px; margin-bottom: 8px; background: var(--info-bg); }
.msg-success { background: var(--ok-bg); color: var(--ok); }
.msg-error { background: var(--bad-bg); color: var(--bad); }
.msg-warning { background: var(--warn-bg); color: var(--warn); }

/* Tables: boxed cells, as in the mock-up, in the college's navy */
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 12px 14px; border: 1px solid var(--line); vertical-align: middle; }
thead th { font-weight: 600; font-size: 0.85rem; color: var(--brand); background: var(--panel); }
td { font-weight: 400; }
td a, th a { font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.strong, th.strong { font-weight: 600; color: var(--brand); }
tbody tr:hover { background: #fafbfd; }
.table-scroll { overflow-x: auto; margin-bottom: 24px; position: relative; }

/* Small number tiles still used on some pages */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; margin-bottom: 22px; }
.tile { background: var(--panel); border-radius: 22px; padding: 18px; text-align: center; }
.tile .n { font-size: 1.9rem; font-weight: 700; display: block; color: var(--brand); font-variant-numeric: tabular-nums; }
.tile .l { color: var(--muted); font-weight: 500; font-size: 0.95rem; }

.filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; margin-bottom: 22px; }
.filters label { display: block; font-size: 0.85rem; color: var(--muted); }
.filters input.search { width: 260px; }

/* Inputs: rounded, on white, inside grey cards */
input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]):not([type=submit]),
select, textarea {
  font: inherit; font-weight: 400; color: var(--ink); background: #fff;
  padding: 7px 12px; border: 1px solid #c9d2de; border-radius: 6px; max-width: 100%; min-height: 38px;
  transition: border-color .15s;
}
select { padding-right: 36px; }
textarea { width: 100%; min-height: 110px; }
input[type=file] { font: inherit; max-width: 100%; }
input[type=file]::file-selector-button {
  font: inherit; border: 0; border-radius: 20px; padding: 8px 16px; margin-right: 12px; cursor: pointer;
  color: #fff; background: var(--brand);
}
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, a:focus-visible, summary:focus-visible, button:focus-visible {
  outline: 3px solid var(--brand-2); outline-offset: 2px;
}
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; flex: none; }
input[aria-invalid="true"]:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]):not([type=submit]) { border-color: var(--bad); }
.field input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]), .field textarea, .field select { width: 100%; }

.field { margin-bottom: 18px; }
.field label, .field legend { font-weight: 600; color: var(--brand); display: block; margin-bottom: 6px; }
.field .help { color: var(--muted); font-weight: 400; font-size: 0.9rem; }
.errorlist { color: var(--bad); list-style: none; padding: 0; margin: 6px 0; font-size: 0.95rem; }
.auth-card > .errorlist, .errorlist.nonfield { background: var(--bad-bg); border-radius: 14px; padding: 12px 16px; margin: 0 0 18px; }

/* Buttons: navy pills, as on the college site */
.btn {
  display: inline-block; font: inherit; font-weight: 600; padding: 11px 26px; border-radius: 30px;
  border: 2px solid transparent; color: #fff; cursor: pointer; text-decoration: none; text-align: center;
  background: var(--brand); transition: background .15s, color .15s, transform .08s;
}
main a.btn { color: #fff; }
.btn:hover { background: var(--brand-2); }
.btn:active { transform: translateY(1px); }
.btn.secondary, main a.btn.secondary { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn.secondary:hover, main a.btn.secondary:hover { background: var(--panel); }
.btn.ghost, main a.btn.ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn.ghost:hover, main a.btn.ghost:hover { color: var(--brand); background: var(--panel); }
.btn.danger, main a.btn.danger { background: var(--bad); color: #fff; }
.btn-block { display: block; width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.badge { display: inline-block; white-space: nowrap; padding: 3px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: var(--info-bg); color: var(--brand); }
.badge.accepted { background: var(--ok-bg); color: var(--ok); }
.badge.declined, .badge.withdrawn, .badge.lapsed { background: var(--bad-bg); color: var(--bad); }
.badge.sent { background: var(--warn-bg); color: var(--warn); }
.overdue { color: var(--bad); font-weight: 600; }
.soon { color: var(--warn); font-weight: 600; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 22px; margin: 0; }
dl.facts dt { color: var(--muted); font-weight: 400; }
dl.facts dd { margin: 0; font-weight: 500; }

/* Sign-in, set-up and code pages: one card, centred */
.auth { display: flex; justify-content: center; align-items: center; min-height: calc(100vh - 260px); padding: 8px 0 32px; }
.auth-card { width: 100%; max-width: 440px; padding: 34px; margin: 0; }
.auth-card.wide { max-width: 540px; }
.auth-card h1 { text-align: center; }
.auth-card .qr { text-align: center; }
.auth-card .secret { text-align: center; word-break: break-all; }
.auth-card .center { text-align: center; margin-top: 10px; }
.auth-card .notice { background: var(--info-bg); border-radius: 4px; padding: 8px 12px; }
.auth-links { text-align: center; margin-top: 18px; }

/* Radio buttons and the declaration tick box */
fieldset.plain { border: 0; padding: 0; margin: 0 0 18px; }
fieldset.plain legend { margin-bottom: 10px; padding: 0; }
.radio-list { list-style: none; padding: 0; margin: 0; }
.radio-list li { margin-bottom: 10px; }
.radio-list li, .check { display: flex; align-items: flex-start; gap: 10px; }
.radio-list li input, .check input { margin-top: 4px; }
.field label.choice, label.choice { display: inline; font-weight: 400; margin: 0; }

.linkbox { font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; background: #fff; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); }
.qr svg { width: 220px; height: 220px; background: #fff; }
.contact { margin-top: 28px; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.9em; background: var(--panel); padding: 2px 6px; border-radius: 6px; }

/* Page headings with buttons beside them */
.page-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.form-card { max-width: 680px; }
.wide-form { max-width: 800px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.email-preview { width: 100%; max-width: 680px; height: 900px; border: 0; border-radius: 22px; background: var(--panel); display: block; margin-bottom: 22px; }

@media (max-width: 640px) {
  dl.facts { grid-template-columns: 1fr; gap: 2px; }
  dl.facts dt { margin-top: 10px; }
  .grid-2 { grid-template-columns: 1fr; }
  .card { padding: 20px; }
}

/* A letter shown in the page */
.letter-frame { background: #e9e9e9; border-radius: 16px; padding: 10px; margin: 6px 0 14px; }
.letter-frame iframe { display: block; width: 100%; height: min(1100px, 85vh); border: 0; border-radius: 8px; background: #fff; }
h1 a { color: inherit; text-decoration-thickness: 2px; }

/* Changing a template's wording */
.wording textarea { min-height: 0; line-height: 1.5; resize: vertical; }
.wording .fixed-para { white-space: pre-wrap; background: var(--panel, #f4f4f4); border-radius: 10px; padding: 10px 12px; margin: 0 0 4px; }
.wording-save { position: sticky; bottom: 12px; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12); }
.wording-save { padding: 14px 18px; }
.wording-save .field { margin-bottom: 10px; }
.wording-save .field label { margin-bottom: 4px; }
.wording-save p.small { margin: 6px 0 0; }

/* Pressing Enter in a field saves a draft; only the Send button sends. */
.enter-default { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Morning or evening, as two large choices */
fieldset.choice-row { border: 0; padding: 0; margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 10px; }
fieldset.choice-row legend { width: 100%; padding: 0; margin-bottom: 6px; }
fieldset.choice-row .choice {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; min-height: 46px;
  background: #fff; border: 1px solid #c9d2de; border-radius: 12px; cursor: pointer; font-weight: 500;
}
fieldset.choice-row .choice:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
fieldset.choice-row .errorlist { width: 100%; }
.tag { display: inline-block; flex: none; white-space: nowrap; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.tag-morning { background: #fdf8c8; color: #5c5200; }
.tag-evening { background: #e3e9f6; color: var(--brand); }

/* My Gmail */
.gmail-card { max-width: 680px; }
.gmail-card h2 { margin: 0; }
.gmail-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.gmail-dot { width: 14px; height: 14px; border-radius: 50%; background: #c9d2de; flex: none; }
.gmail-dot.ok { background: #16616d; box-shadow: 0 0 0 4px #d8ebee; }
.gmail-dot.bad { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-bg); }
.gmail-email { margin: 2px 0 0; font-weight: 600; color: var(--brand); }
.gmail-steps { margin: 0 0 18px; padding-left: 20px; }
.gmail-steps li { margin-bottom: 6px; }
.gmail-notice { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; background: var(--warn-bg); color: var(--warn); border-radius: 14px; padding: 12px 18px; margin-bottom: 18px; }
.gmail-notice a { font-weight: 600; color: var(--brand); }
.gmail-head p { margin: 2px 0 0; }

/* Actions inside a table row */
.btn.small { padding: 6px 14px; font-size: 0.85rem; }
.row-actions form { display: inline; margin: 0; }
.row-actions .btn { white-space: nowrap; }
.cell-note { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 4px; }

/* The offer's journey: one step per line, oldest first */
.journey { list-style: none; margin: 0 0 28px; padding: 0; max-width: 760px; }
.journey-step { position: relative; display: flex; gap: 16px; padding: 0 0 18px; }
.journey-step::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: -2px; width: 2px; background: var(--line); }
.journey-step:last-child::before { display: none; }
.journey-dot { flex: none; width: 16px; height: 16px; margin-top: 3px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); position: relative; z-index: 1; }
.journey-step.good .journey-dot { border-color: #16616d; background: #16616d; }
.journey-step.bad .journey-dot { border-color: var(--bad); background: var(--bad); }
.journey-step.wait .journey-dot { border-color: #9aa6b5; border-style: dashed; }
.journey-body p { margin: 0; }
.journey-title { font-weight: 600; color: var(--brand); }
.journey-step.bad .journey-title { color: var(--bad); }
.journey-step.wait .journey-title { color: var(--muted); }
.journey-detail { color: var(--ink); font-size: 0.93rem; margin-top: 2px !important; }
.journey-meta { color: var(--muted); font-size: 0.82rem; margin-top: 3px !important; }

/* Title, first name and last name on one row */
.grid-name { display: grid; grid-template-columns: 120px 1fr 1fr; gap: 0 18px; }
@media (max-width: 640px) { .grid-name { grid-template-columns: 1fr; } }

/* The student's file */
.file-list ul { list-style: none; margin: 0; padding: 0; }
.file-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; padding: 8px 0; }
.file-list li + li { border-top: 1px solid var(--line); }
.file-list .file-name { font-weight: 600; color: var(--brand); }
.file-list .cell-note { margin: 0; }
.record-link { margin: 0 0 18px; }

/* ------------------------------------------------------------------------
   The compact spreadsheet style, used across the whole app (Ali, 12
   November 2026): small boxes, thin grey gridlines, one line per row, and
   Excel's Good, Neutral and Bad fills for accepted, pending and rejected.
   ------------------------------------------------------------------------ */
h1 { font-size: clamp(1.15rem, 1.8vw, 1.45rem); margin: 0 0 12px; }
h2 { font-size: 1rem; margin: 20px 0 8px; }
.page-head { margin-bottom: 12px; gap: 10px; }
.card { border-radius: 6px; padding: 14px 16px; margin-bottom: 14px; border: 1px solid var(--line); }
.auth-card { padding: 24px; }
.messages { margin: 0 0 12px; }
.msg { padding: 7px 12px; border-radius: 4px; margin-bottom: 6px; font-size: 0.88rem; }

/* Tables */
.table-scroll { margin-bottom: 16px; border: 1px solid #bfc8d4; overflow: auto; max-height: calc(100vh - 170px); }
.table-scroll > table { border: 0; }
table { font-size: 0.82rem; }
th, td { padding: 4px 8px; border: 1px solid #d4dae3; line-height: 1.3; }
thead th { font-size: 0.78rem; font-weight: 700; background: #e9edf3; position: sticky; top: 0; z-index: 1; }
.table-scroll > table > thead th { border-top: 0; }
tbody tr:hover { background: none; box-shadow: inset 0 0 0 9999px rgba(0, 16, 34, 0.04); }
tr.st-accepted > td { background: #c6efce; }
tr.st-sent > td, tr.st-pending > td, tr.st-awaiting_approval > td { background: #ffeb9c; }
tr.st-declined > td, tr.st-rejected > td { background: #ffc7ce; }

/* Small tiles */
.tiles { gap: 8px; margin-bottom: 14px; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.tile { border-radius: 6px; padding: 6px 10px; border: 1px solid var(--line); }
.tile .n { font-size: 1.05rem; }
.tile .l { font-size: 0.72rem; }

/* Forms */
.filters { gap: 8px; margin-bottom: 12px; }
.filters label { font-size: 0.75rem; }
.field { margin-bottom: 10px; }
.field label, .field legend { font-size: 0.82rem; margin-bottom: 3px; }
.field .help { font-size: 0.75rem; }
.errorlist { font-size: 0.8rem; margin: 3px 0; }
.auth-card > .errorlist, .errorlist.nonfield { border-radius: 4px; padding: 7px 12px; margin: 0 0 12px; }
input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]):not([type=submit]),
select, textarea { padding: 4px 8px; min-height: 30px; border-radius: 4px; font-size: 0.85rem; }
select { padding-right: 28px; }
textarea { min-height: 80px; }
input[type=file]::file-selector-button { border-radius: 4px; padding: 4px 10px; }
fieldset.choice-row .choice { padding: 4px 12px; min-height: 30px; border-radius: 4px; font-size: 0.85rem; }
fieldset.choice-row { margin-bottom: 10px; gap: 6px; }

/* Buttons */
.btn { padding: 5px 14px; border-radius: 4px; font-size: 0.82rem; border-width: 1px; }
.btn.small { padding: 2px 8px; font-size: 0.72rem; border-radius: 4px; }
.actions { gap: 8px; }

/* Badges in Excel's fills */
.badge { padding: 1px 7px; border-radius: 3px; font-size: 0.72rem; }
.badge.accepted { background: #c6efce; color: #006100; }
.badge.sent, .badge.awaiting_approval, .badge.approved, .badge.draft { background: #ffeb9c; color: #6b4a00; }
.badge.declined { background: #ffc7ce; color: #9c0006; }
.badge.withdrawn, .badge.lapsed, .badge.conditions_met { background: #e7e9ee; color: #3d4757; }
.tag { padding: 0 6px; border-radius: 3px; font-size: 0.72rem; }

/* Facts, records and the journey */
dl.facts { gap: 3px 18px; font-size: 0.85rem; }
.file-list li { padding: 4px 0; font-size: 0.85rem; }
.journey-step { padding: 0 0 10px; gap: 12px; }
.journey-dot { width: 12px; height: 12px; border-width: 2px; }
.journey-step::before { left: 5px; top: 14px; }
.journey-title { font-size: 0.88rem; }
.journey-detail { font-size: 0.8rem; }
.journey-meta { font-size: 0.72rem; }

/* Other boxes */
.linkbox, .letter-frame, .email-preview, .gmail-notice { border-radius: 6px; }
.letter-frame { padding: 6px; }
.gmail-notice { padding: 7px 12px; }
code { border-radius: 3px; }
/* Long lists: one line per row, full text on hover */
table.one-line tbody td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
