/* Brand: Insight IT Simplified (insight-ict.co.uk) */
@font-face {
  font-family: "Hanken Grotesk";
  src: url("brand/hanken-grotesk-latin-wght-normal.c501f578bf3f.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
:root {
  --navy: #181a32; --turquoise: #014751; --blue: #81cbf1; --lime: #c4d82e; --green: #68c399;
  --ice: #f1f2f2; --tint: #f2f7f7;
  --ink: var(--navy); --muted: rgba(24, 26, 50, .72); --rule: rgba(24, 26, 50, .16);
  --bg: var(--tint); --card: #fff;
  --accent: var(--turquoise); --accent-ink: #fff;
  --ok: #1f6b4a; --warn: #8a5300; --bad: #b42318;
  --funded: #e3f3eb; --closed: var(--ice);
  --radius: 12px; --pill: 999px;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 var(--sans); color: var(--ink); background: var(--bg); display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; width: 100%; }
a { color: var(--accent); }
/* Never let a crowded menu squeeze the logo */
.wrap { max-width: 1400px; margin: 0 auto; }
main { padding: 20px; }
h1 { font-size: 28px; font-weight: 600; letter-spacing: -.015em; color: var(--turquoise); margin: 4px 0 4px; }
h2 { font-size: 19px; font-weight: 600; color: var(--navy); margin: 24px 0 8px; }
.sub { color: var(--muted); margin: 0 0 16px; }
.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
table.list { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
table.list th, table.list td { padding: 9px 12px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: middle; }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover td { background: #e9f5fb; }
table.list th { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--turquoise); background: var(--tint); }
table.list td.num, table.list th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.list tfoot td { font-weight: 700; border-top: 2px solid var(--ink); border-bottom: 0; background: #fff; }
.btn { display: inline-block; padding: 8px 18px; border-radius: var(--pill); font-weight: 600; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font: inherit; cursor: pointer; text-decoration: none; }
.btn.secondary { background: var(--card); color: var(--accent); }
.btn.danger { background: var(--card); color: var(--bad); border-color: var(--bad); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
input:not([type]), input[type=text], input[type=password], input[type=date], input[type=number], select { font: inherit; padding: 6px 10px; border: 1px solid var(--rule); border-radius: 8px; background: #fff; color: var(--ink); }
input:focus, select:focus, .btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; }
label.field { display: block; margin-bottom: 10px; }
label.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.messages li { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 6px; background: #e6f4fc; }
.messages li.success { background: #e7f3ec; color: var(--ok); }
.messages li.error { background: #fdecea; color: var(--bad); }
.messages li.warning { background: #fff4e5; color: var(--warn); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--closed); color: var(--muted); }
.pill.ok { background: var(--lime); color: var(--navy); font-weight: 600; }
.pill.warn { background: #fff4e5; color: var(--warn); }
.muted { color: var(--muted); }
.scroll { overflow-x: auto; }

/* Bookings grid */
/* Grids (bookings, places, usual week): a rounded card with light row lines, like the other tables */
table.grid { border-collapse: separate; border-spacing: 0; background: var(--card); font-size: 13px;
  border: 1px solid var(--rule); border-radius: var(--radius); }
table.grid input[type=checkbox] { accent-color: var(--turquoise); }
table.grid th, table.grid td { border: 0; border-bottom: 1px solid var(--rule); padding: 6px 7px; text-align: center; }
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid th { background: var(--tint); color: var(--turquoise); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
/* Round the corner cells so their backgrounds sit inside the card's corners */
table.grid thead tr:first-child > :first-child { border-top-left-radius: calc(var(--radius) - 1px); }
table.grid thead tr:first-child > :last-child { border-top-right-radius: calc(var(--radius) - 1px); }
table.grid tbody tr:last-child > :first-child { border-bottom-left-radius: calc(var(--radius) - 1px); }
table.grid tbody tr:last-child > :last-child { border-bottom-right-radius: calc(var(--radius) - 1px); }
table.grid thead tr + tr th { font-size: 11px; }
table.grid td.wk { text-align: left; white-space: nowrap; font-weight: 600; padding-left: 12px; }
table.grid td.closed { background: var(--closed); color: var(--muted); font-size: 11px; }
table.grid td.closed-session, table.places td.pl-closed { background: var(--closed); color: var(--muted); }
table.grid td.day-start, table.grid th.day-start { border-left: 1px solid rgba(1, 71, 81, .3); }
table.grid td.calc { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
table.grid td.calc.paid { color: var(--warn); }
table.grid input[type=checkbox] { width: 17px; height: 17px; cursor: pointer; margin: 0; }
/* Ad-hoc sessions (outside the usual week) tick in amber; usual-week ones in turquoise */
table.grid input[type=checkbox].adhoc { accent-color: #d9772b; }
table.grid input[type=checkbox].adhoc:checked { outline: 2px solid rgba(217, 119, 43, .35); outline-offset: 1px; border-radius: 3px; }
.grid-key { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.grid-key span { display: inline-flex; align-items: center; gap: 6px; }
.grid-key i.tick { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px;
  border-radius: 3px; color: #fff; font-style: normal; font-size: 12px; font-weight: 700; background: var(--turquoise); }
.grid-key i.tick.adhoc { background: #d9772b; }
table.grid tr:hover td { background: #e9f5fb; }
table.grid tr:hover td.closed { background: var(--closed); }
.pattern td, .pattern th { padding: 6px 12px; }
.dirty { color: var(--warn); font-weight: 600; display: none; }
.dirty.on { display: inline; }
/* Payments & debts */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 16px; border-left: 5px solid var(--turquoise); }
.tile span { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tile b { display: block; font-size: 26px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; line-height: 1.25; }
.tile small { color: var(--muted); }
.tile.warn { border-left-color: #d99a2b; }
.tile.bad { border-left-color: var(--bad); }
.st-paid { background: #dff1e8; color: var(--ok); font-weight: 600; }
.st-nothing_due { background: var(--ice); color: var(--muted); }
.st-part_paid { background: #fff1d6; color: var(--warn); font-weight: 600; }
.st-unpaid { background: #e6f4fc; color: var(--turquoise); font-weight: 600; }
.st-overdue { background: #fdecea; color: var(--bad); font-weight: 600; }
.st-void { background: var(--ice); color: var(--bad); font-weight: 600; text-decoration: line-through; }
details.void-box summary { cursor: pointer; }
.st-overpaid { background: #ede9fb; color: #4b3a9a; font-weight: 600; }
.aging { display: flex; height: 18px; border-radius: var(--pill); overflow: hidden; background: var(--ice); gap: 2px; }
.aging .seg { display: block; height: 100%; min-width: 4px; }
.aging-key { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.aging-key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.age0 { background: var(--blue); } .age1 { background: #e8b04a; } .age2 { background: #d9772b; } .age3 { background: var(--bad); }
.btn.sm { padding: 4px 12px; font-size: 13px; }
.nowrap { white-space: nowrap; }
td.actions form { display: inline; margin: 0; }
.linkish { background: none; border: 0; padding: 0; color: var(--bad); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-row input, .form-row select { width: 100%; }


/* Sign in */
.login-box { max-width: 420px; margin: 40px auto; }
.login-box h1 { margin-top: 0; }
.login-school { margin: 0 0 16px; padding-bottom: 14px; border-bottom: 1px solid var(--rule);
                color: var(--navy); font-weight: 600; font-size: 24px; line-height: 1.25; letter-spacing: -.01em; }
.login-school + h1 { font-size: 20px; }
.login-box input { width: 100%; }
.btn.ms-btn { display: inline-flex; align-items: center; gap: 10px; background: #fff; color: var(--navy); border-color: var(--rule); font-size: 16px; padding: 10px 20px; }
.btn.ms-btn:hover { border-color: var(--turquoise); }
.login-box hr { border: 0; border-top: 1px solid var(--rule); margin: 22px 0 10px; }

/* Academic year switcher */
.year-banner { background: #fff1d6; color: var(--warn); border-radius: var(--radius); padding: 8px 14px; margin-bottom: 12px; font-size: 14px; }

/* Enrol hints */
.hint { font-size: 12px; color: var(--warn); font-weight: 600; }

/* Emergency closure: session tick boxes */
fieldset.sessions-pick { border: 1px solid var(--rule); border-radius: 8px; padding: 10px 14px; margin: 0 0 12px; }
fieldset.sessions-pick legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
fieldset.sessions-pick label { display: inline-flex; align-items: center; gap: 6px; margin-right: 18px; font-weight: 600; }
fieldset.sessions-pick input { accent-color: var(--turquoise); width: 17px; height: 17px; }
fieldset.sessions-pick small { display: block; margin-top: 6px; font-size: 12px; }

/* Chase history */
ul.chase-log { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); }
ul.chase-log li { padding: 12px 16px; border-bottom: 1px solid var(--rule); }
ul.chase-log li:last-child { border-bottom: 0; }
ul.chase-log p { margin: 6px 0 0; }
.chase-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chase-head form { margin: 0 0 0 auto; }
.chase-phone, .chase-in_person { background: #e6f4fc; color: var(--turquoise); font-weight: 600; }
.chase-email, .chase-text { background: #ede9fb; color: #4b3a9a; font-weight: 600; }
.chase-letter, .chase-statement { background: #fff1d6; color: var(--warn); font-weight: 600; }
.chase-other { background: var(--ice); color: var(--muted); font-weight: 600; }

.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; max-height: 420px; overflow: auto; }
.pick-list label { display: flex; align-items: center; gap: 6px; }
.pick-list input, .pick-list + * input { accent-color: var(--turquoise); }

.checks-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.checks-grid fieldset { border: 1px solid var(--rule); border-radius: 8px; padding: 10px 14px; margin: 0; }
.checks-grid legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.checks-grid label.check { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-weight: 600; }
.checks-grid input[type=checkbox] { accent-color: var(--turquoise); width: 16px; height: 16px; }
.funding-checks { margin-top: 16px; }

ul.todo { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
ul.todo li { margin-bottom: 4px; }
ul.todo li.lvl-bad { color: var(--bad); }
ul.todo li.lvl-warn { color: var(--warn); }
td.neg { color: var(--bad); font-weight: 600; }

/* Places */
table.places td { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 30px; }
.pl-ok { background: #eef8f2; color: var(--ok); }
.pl-low { background: #fff1d6; color: var(--warn); }
.pl-full { background: #fde3e0; color: var(--bad); }
.pl-over { background: var(--bad); color: #fff; }
table.places tr:hover td.pl-ok { background: #e2f3e9; }
table.avail td.wanted { outline: 3px solid var(--turquoise); outline-offset: -3px; }
.pl-key { display: inline-block; padding: 0 8px; border-radius: 4px; font-size: 12px; font-weight: 600; }

/* Waiting list */
.wl-waiting { background: #e6f4fc; color: var(--turquoise); font-weight: 600; }
.wl-offered { background: var(--lime); color: var(--navy); font-weight: 600; }
.wl-accepted { background: #dff1e8; color: var(--ok); }
.wl-declined, .wl-withdrawn { background: var(--ice); color: var(--muted); }
.next-step { border-left: 5px solid var(--lime); }
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }
label.field input, label.field select, label.field textarea { width: 100%; }
input[type=email], textarea { font: inherit; padding: 6px 10px; border: 1px solid var(--rule); border-radius: 8px; background: #fff; color: var(--ink); }
label.field small { display: block; font-size: 12px; margin-top: 2px; }
small.err { color: var(--bad); font-weight: 600; }
@media (max-width: 640px) { .form-row, .form-row.three { grid-template-columns: 1fr; } }

/* Usual-week mini graphic */
.week-graphic { display: inline-flex; align-items: center; gap: 10px; vertical-align: middle; }
.wg-grid { display: grid; grid-template-columns: auto repeat(5, 16px); gap: 2px 3px; align-items: center; }
.wg-day { font-size: 10px; font-weight: 600; color: var(--muted); text-align: center; line-height: 1; padding-bottom: 1px; }
.wg-label { font-size: 10px; font-weight: 600; color: var(--muted); text-align: right; padding-right: 3px; line-height: 1; }
.wg-cell { width: 16px; height: 11px; border-radius: 3px; background: var(--ice); box-shadow: inset 0 0 0 1px var(--rule); }
.wg-cell.thin { height: 5px; }
.wg-cell.on { background: var(--turquoise); box-shadow: none; }
.wg-cell.thin.on { background: var(--blue); }
.wg-hours { font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; text-align: left; color: var(--navy); }
.wg-hours small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); }
@media print { .actions, form button { display: none; } }

/* Month-end checklist on the dashboard */
.month-end .me-month { margin-bottom: 10px; }
.month-end .me-steps { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 4px; }
.month-end .me-steps li { display: flex; gap: 8px; align-items: baseline; }
.month-end .me-tick { display: inline-flex; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--rule);
  align-items: center; justify-content: center; font-size: 12px; flex: none; transform: translateY(3px); }
.month-end .me-steps li.done .me-tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.month-end .me-steps li.done a { color: inherit; }
.month-end .me-extras { margin: 10px 0 0; padding-left: 18px; }

/* Daily register */
.register-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.register-head h1 { margin-bottom: 0; }
.register-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }
.register-session { min-width: 0; }
.register-table { width: 100%; }
.register-table td:first-child { padding-right: 6px; }
.register-counts { font-size: 14px; margin: 0 0 6px; }
.register-counts .linkish { margin-left: 6px; }
.ok-text { color: var(--ok); } .bad-text { color: var(--bad); }
.register-table td { vertical-align: middle; }
.register-marks { white-space: nowrap; text-align: right; }
.register-marks .mark { display: inline-flex; gap: 4px; align-items: center; padding: 3px 9px; border-radius: var(--pill);
  border: 1px solid var(--rule); font-size: 13px; cursor: pointer; margin-left: 3px; }
.register-marks .mark input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.register-marks .mark.clear { display: none; }
.register-marks .mark:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.register-marks .mark:has(input:checked).present { background: #dff1e8; border-color: var(--ok); color: var(--ok); font-weight: 600; }
.register-marks .mark:has(input:checked).absent { background: #fde7e4; border-color: var(--bad); color: var(--bad); font-weight: 600; }
.print-only { display: none; }
@media print {
  .nb-header, .nb-footer, .credit-footer, .no-print, .messages, .test-site-banner { display: none !important; }
  .print-only { display: block; margin-top: 18px; }
  .register-grid { grid-template-columns: 1fr; }
  .register-session { break-inside: avoid; border: 1px solid #999; box-shadow: none; }
  .register-marks .mark { border-color: #999; }
}

/* Audit readiness grid */
.audit-grid th.c, .audit-grid td.c { text-align: center; font-size: 13px; }
.audit-grid th.c { font-size: 11px; max-width: 110px; white-space: normal; }
.ok-mark { color: var(--ok); font-weight: 700; }
.gap-mark { color: var(--bad); font-weight: 700; }
/* Sign-in buttons: same width, centred, with space between */
.sso-buttons { display: flex; flex-direction: column; align-items: stretch; gap: 14px; width: 100%; max-width: 300px; margin: 18px auto 6px; }
.sso-buttons form { margin: 0; width: 100%; }
.sso-buttons .btn { width: 100%; justify-content: center; }
.audit-grid .not-needed { font-size: 11px; white-space: nowrap; }
.wg-cell.on.full, .wg-cell.thin.on.full { background: var(--bad); }
.wl-key-full { display: inline-block; width: 14px; height: 10px; border-radius: 3px; background: var(--bad); vertical-align: middle; }
