:root { --primary: #003366; --ink: #1c2430; --muted: #5b6675; --line: #d9dee6; --bg: #f6f7f9; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); padding-top: 3.5rem; }
/* Frame (day 15): fixed top bar, sidebar on the left from lg up, offcanvas below. */
.topbar { background: var(--primary); color: #fff; min-height: 3.5rem; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.topbar .brand { color: #fff; font-weight: 600; text-decoration: none; }
.sidebar { width: 15.5rem; background: #fff; border-right: 1px solid var(--line); }
@media (min-width: 992px) { .sidebar { position: fixed; top: 3.5rem; bottom: 0; left: 0; overflow-y: auto; } body.with-sidebar .app-main { margin-left: 15.5rem; } }
.sidebar-nav { padding: .75rem 0 1.5rem; }
.sidebar-nav .nav-link { display: block; padding: .45rem 1.1rem; color: var(--ink); text-decoration: none; border-left: .25rem solid transparent; }
.sidebar-nav .nav-link:hover { background: #f0f3f7; }
.sidebar-nav .nav-link.active { background: #e8f1fb; border-left-color: var(--primary); color: var(--primary); font-weight: 600; }
.sidebar-heading { margin: 1rem 1.1rem .25rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.app-main { max-width: 90rem; padding: 1.25rem; }
footer { padding: 1.5rem 0 .5rem; text-align: center; color: var(--muted); font-size: .875rem; }
.card { background: #fff; border: 1px solid var(--line); border-radius: .6rem; padding: 1.25rem; box-shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 4px 12px rgba(16, 24, 40, .05); }
.narrow { max-width: 28rem; margin: 2rem auto; }
.flash { padding: .75rem 1rem; border-radius: .375rem; background: #e8f1fb; }
.flash-error { background: #fdecec; }
.flash-success { background: #e9f7ee; }
.button, button:not(.btn):not(.btn-close):not(.navbar-toggler) { display: inline-block; padding: .55rem 1rem; border: 0; border-radius: .375rem; background: var(--primary); color: #fff; font: inherit; text-decoration: none; cursor: pointer; }
button.link { background: none; color: inherit; padding: 0; text-decoration: underline; }
button.danger { background: #a12020; }
.table-wrap { overflow-x: auto; }
/* A table that is not already inside a card gets its own (day 15). */
.app-main > .table-wrap, .app-main > section > .table-wrap, .app-main > div:not(.card) > .table-wrap { background: #fff; border: 1px solid var(--line); border-radius: .6rem; padding: .25rem .75rem; margin: .75rem 0 1rem; box-shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 4px 12px rgba(16, 24, 40, .05); }
.table-wrap table { background: transparent; } .table-wrap tr:last-child td { border-bottom: 0; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: .5rem .75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
label { display: block; margin: .75rem 0 .25rem; font-weight: 600; }
h1 { font-size: 1.6rem; margin: .25rem 0 1rem; } h2 { font-size: 1.2rem; margin: 1.5rem 0 .6rem; } h3 { font-size: 1.05rem; }
input[type=text], input[type=email], select { width: 100%; max-width: 28rem; padding: .5rem; border: 1px solid var(--line); border-radius: .375rem; font: inherit; }
ul.checks, ul.menu { list-style: none; padding: 0; }
ul.checks label { display: inline; font-weight: 400; }
.error { color: #a12020; font-size: .875rem; }
.muted { color: var(--muted); }
ul.menu li { margin: .4rem 0; }
form.inline { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
form.inline label { margin: 0; }
form.inline select, form.inline input:not([type=checkbox]) { width: auto; max-width: 100%; }
input.short, input[type=number] { width: 5rem; padding: .5rem; border: 1px solid var(--line); border-radius: .375rem; font: inherit; }
.status { padding: .1rem .5rem; border-radius: 1rem; background: #e8f1fb; font-size: .875rem; }
.status-ok { background: #e9f7ee; }
.status-partial { background: #fff4d6; }
.status-failed { background: #fdecec; }
tr.unmapped td { background: #fff4d6; }

/* Supervision forms: built for a phone held in one hand in a classroom. */
.stack > * + * { margin-top: .9rem; }
.eyebrow { margin: 0; color: var(--muted); font-size: .875rem; }
.session-head h1, .session h3 { margin: .15rem 0; }
.session { margin: .75rem 0; }
.session.pending { border-left: .35rem solid #a12020; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.actions.sticky { position: sticky; bottom: 0; padding: .75rem 0; background: var(--bg); }
.button.secondary, button.secondary { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.daynav { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; }
.daynav a { padding: .45rem .8rem; border: 1px solid var(--line); border-radius: 2rem; background: #fff; text-decoration: none; color: var(--ink); }
.daynav a.current { background: var(--primary); color: #fff; border-color: var(--primary); }
fieldset { border: 0; padding: 0; margin: 0; }
fieldset.criterion, fieldset.finding { padding: .75rem 0; border-top: 1px solid var(--line); }
legend { padding: 0; margin-bottom: .4rem; font-weight: 600; }
fieldset.criterion legend { font-weight: 400; }
.choices { display: flex; flex-wrap: wrap; gap: .4rem; }
.choice { margin: 0; font-weight: 400; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: inline-block; min-width: 3rem; min-height: 2.75rem; padding: .65rem .9rem; text-align: center; border: 1px solid var(--line); border-radius: .5rem; background: #fff; cursor: pointer; }
.choice input:checked + span { background: var(--primary); color: #fff; border-color: var(--primary); }
.choice input:focus-visible + span { outline: 3px solid #7fb0e6; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
input[type=time], input[type=url], textarea { width: 100%; padding: .6rem; border: 1px solid var(--line); border-radius: .375rem; font: inherit; }
.session-head + h2 { margin-top: 1rem; }
fieldset.finding select, fieldset.criterion input[type=text] { margin-top: .5rem; max-width: none; width: 100%; }
label.inline-check { display: inline-flex; gap: .4rem; align-items: center; font-weight: 400; margin: .5rem 0; }
@media (max-width: 30rem) { .app-main { padding: .75rem; } .card { padding: 1rem; } button, .button { min-height: 2.75rem; } }
.school-head { margin: 1.25rem 0 .25rem; padding-bottom: .25rem; border-bottom: 2px solid var(--primary); }

/* KPI strip on the advisor caseload. */
.kpi-strip { display: flex; flex-wrap: wrap; gap: 1rem 2rem; margin-bottom: 1rem; }
.kpi-strip div { display: flex; flex-direction: column; }
.kpi-value { font-size: 1.5rem; font-weight: 600; }

/* Boards: one column per workflow state. */
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; align-items: start; }
.board .column { background: #eef1f5; border-radius: .5rem; padding: .75rem; }
.board .column h2 { margin: 0 0 .5rem; font-size: 1rem; }
.board .card { padding: .75rem; margin-bottom: .6rem; }
.board .card.overdue { border-left: .35rem solid #a12020; }
.board .card p { margin: .2rem 0; }

/* Dashboard cards with deltas, and trend charts. */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr)); gap: .9rem; margin: 1rem 0; }
.cards > *, .charts > * { min-width: 0; }
.chart, .kpi-spark { min-width: 0; max-width: 100%; }
.kpi-card { padding: .9rem 1rem; border-left: .35rem solid var(--status, #8a94a3); }
.kpi-card .kpi-value { margin: .1rem 0; font-size: 1.9rem; line-height: 1.1; }
.kpi-card p { margin: .15rem 0; }
.kpi-body { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.kpi-main { min-width: 0; flex: 1; }
.kpi-gauge { flex: 0 0 96px; height: 96px; margin: -.5rem -.5rem -.5rem 0; }
.kpi-spark { height: 44px; margin: .35rem -.25rem 0; }
.badge.delta { font-weight: 600; }
.drops-monthly { display: flex; flex-direction: row; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; margin: 1rem 0; }
.drops-monthly-figures { flex: 1 1 16rem; min-width: 0; }
.drops-monthly-chart { flex: 3 1 22rem; min-width: 0; height: 150px; }
.delta-good.badge { background: #e9f7ee; color: #1d7a3a; } .delta-bad.badge { background: #fdecec; color: #a12020; } .delta-flat.badge { background: #eef1f5; color: var(--muted); }
.small { font-size: .875rem; }
.delta-good { color: #1d7a3a; }
.delta-bad { color: #a12020; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr)); gap: 1rem; margin: 1rem 0; }

/* Director's dashboard (day 8c): headline strip with gauges, scorecard, chart grid. */
.headline .kpi-card { border-top: .3rem solid var(--line); }
.status-good { --status: #1d7a3a; } .status-warning { --status: #b7791f; } .status-bad { --status: #a12020; } .status-none { --status: #8a94a3; }
.headline .kpi-card.status-good, .headline .kpi-card.status-warning, .headline .kpi-card.status-bad { border-top-color: var(--status); }
.status-dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 50%; background: var(--status, #8a94a3); margin-right: .3rem; vertical-align: middle; }
.status-dot.status-good { background: #1d7a3a; } .status-dot.status-warning { background: #b7791f; } .status-dot.status-bad { background: #a12020; }
.chart { min-height: 4rem; }
.charts .span-all { grid-column: 1 / -1; margin: .75rem 0 0; }
.charts h2.span-all { border-bottom: 2px solid var(--primary); padding-bottom: .25rem; }
.chart-wide { min-height: 20rem; }
.scorecard td.cell { text-align: right; font-variant-numeric: tabular-nums; }
.scorecard td.cell-good { background: #e9f7ee; } .scorecard td.cell-warning { background: #fff4d6; } .scorecard td.cell-bad { background: #fdecec; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.kpi-strip.compact { gap: .75rem 1.25rem; margin: .5rem 0; }
.kpi-strip.compact .kpi-value { font-size: 1.25rem; }
ul.compact { margin: .4rem 0; padding-left: 1.1rem; }
details.card summary { cursor: pointer; font-weight: 600; }
details.card > *:not(summary) { margin-top: .75rem; }

/* Multi-select assignment: the action bar stays in view while the list scrolls. */
.sticky-top { position: sticky; top: 0; z-index: 2; margin-bottom: .5rem; padding: .6rem .9rem; }
.sticky-top select { width: auto; max-width: 18rem; }
input.pick, #select-all { width: 1.2rem; height: 1.2rem; }

/* Critical KPI (drop rate): a heavier frame so it reads first. */
.kpi-card.critical { border: 2px solid var(--status, #8a94a3); border-left-width: .35rem; grid-column: span 1; }
.kpi-card.critical .eyebrow { font-weight: 600; color: var(--ink); }
