/* Future Ground School — Enrollment
   One stylesheet, no framework, no build step. */

:root {
    --ink:        #14202e;
    --ink-soft:   #4a5c70;
    --ink-faint:  #7d8fa3;
    --line:       #dfe5ec;
    --line-soft:  #eef2f6;
    --bg:         #f4f7fa;
    --panel:      #ffffff;

    --brand:      #12395f;
    --brand-dark: #0c2841;
    --accent:     #0f7ea8;

    --ok:         #1a7f52;
    --ok-bg:      #e7f5ee;
    --warn:       #a86a08;
    --warn-bg:    #fdf3e2;
    --bad:        #b3261e;
    --bad-bg:     #fdeceb;
    --info-bg:    #e8f1f8;

    --radius:     8px;
    --shadow:     0 1px 2px rgba(20, 32, 46, .06), 0 2px 8px rgba(20, 32, 46, .04);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

/* ---- environment banner ------------------------------------------------ */

.env-banner {
    background: var(--warn);
    color: #fff;
    text-align: center;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
}

/* ---- shell ------------------------------------------------------------- */

.shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 232px;
    flex: 0 0 232px;
    background: var(--brand-dark);
    color: #c9d8e6;
    display: flex;
    flex-direction: column;
    padding: 18px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 18px 20px;
}

.brand-mark {
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .04em;
    padding: 5px 8px;
    border-radius: 5px;
}

.brand-text { color: #fff; font-weight: 600; }

.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 18px;
    color: #c9d8e6;
    text-decoration: none;
    font-size: 14px;
    border-left: 3px solid transparent;
}

.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }

.nav-link.is-active {
    background: rgba(255, 255, 255, .1);
    border-left-color: var(--accent);
    color: #fff;
    font-weight: 600;
}

.nav-badge {
    background: var(--accent);
    color: #fff;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 700;
}

.sidebar-foot {
    margin-top: auto;
    padding: 16px 18px 0;
    border-top: 1px solid rgba(255, 255, 255, .1);
}

a.who { display: block; text-decoration: none; }
a.who:hover .who-name { text-decoration: underline; }
a.who:hover .who-context { color: #c4d6e6; }

.who-name { color: #fff; font-size: 14px; font-weight: 600; }
.who-context { font-size: 12px; color: #93aac1; margin-top: 1px; }

.signout {
    display: inline-block;
    margin-top: 10px;
    font-size: 13px;
    color: #93aac1;
}

/* ---- main -------------------------------------------------------------- */

.main {
    flex: 1;
    min-width: 0;
    padding: 26px 32px 60px;
}

.page-head { margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 23px; letter-spacing: -.01em; }

.crumbs { font-size: 13px; color: var(--ink-faint); margin-bottom: 5px; }
.crumbs a { color: var(--ink-faint); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs > * + *::before { content: "/"; margin: 0 7px; color: var(--line); }

/* ---- panels ------------------------------------------------------------ */

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line-soft);
}

.panel-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.panel-body { padding: 18px; }
.panel-body.tight { padding: 0; }

/* ---- stat tiles -------------------------------------------------------- */

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.tile {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 15px 17px;
}

.tile-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ink-faint);
}

.tile-value { font-size: 27px; font-weight: 650; margin-top: 4px; letter-spacing: -.02em; }
.tile-note { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

/* A tile that goes somewhere. It has to LOOK like it does, or it stays a
   number nobody thinks to click — which is how the draft count sat unread. */
a.tile-link {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: border-color .12s, box-shadow .12s, transform .12s;
}

a.tile-link:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 10px rgba(17, 63, 103, .1);
    transform: translateY(-1px);
}

a.tile-link:hover .tile-note { color: var(--accent); }

a.tile-link.is-current {
    border-color: var(--accent);
    box-shadow: inset 3px 0 0 var(--accent);
}

/* ---- seat meter -------------------------------------------------------- */

.meter {
    height: 6px;
    background: var(--line-soft);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 9px;
}

.meter-fill { height: 100%; background: var(--accent); }
.meter-fill.is-tight { background: var(--warn); }
.meter-fill.is-full  { background: var(--bad); }

/* ---- tables ------------------------------------------------------------ */

table { width: 100%; border-collapse: collapse; }

th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ink-faint);
    font-weight: 600;
    padding: 10px 18px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

td {
    padding: 11px 18px;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfe; }

.t-num { text-align: right; font-variant-numeric: tabular-nums; }
.t-muted { color: var(--ink-soft); font-size: 13px; }

.table-scroll { overflow-x: auto; }

/* ---- badges ------------------------------------------------------------ */

.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-draft    { background: var(--line-soft); color: var(--ink-soft); }
.badge-pending  { background: var(--warn-bg);   color: var(--warn); }
.badge-approved { background: var(--ok-bg);     color: var(--ok); }
.badge-rejected { background: var(--bad-bg);    color: var(--bad); }

/* ---- diff rows (approval preview) -------------------------------------- */

.diff-add    { background: var(--ok-bg); }
.diff-remove { background: var(--bad-bg); }

.diff-mark { font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.diff-add    .diff-mark { color: var(--ok); }
.diff-remove .diff-mark { color: var(--bad); }

/* ---- forms ------------------------------------------------------------- */

label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }

input[type=text], input[type=email], input[type=password],
input[type=number], input[type=search], select, textarea {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
    background: #fff;
    color: var(--ink);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(15, 126, 168, .13);
}

.field { margin-bottom: 14px; }
.field-hint { font-size: 12px; color: var(--ink-faint); margin-top: 4px; font-weight: 400; }

.field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

fieldset { border: 0; margin: 0 0 14px; padding: 0; }

.choice {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 6px;
    margin-bottom: 6px;
    font-weight: 400;
    cursor: pointer;
}

.choice:hover { border-color: var(--accent); background: #fbfdff; }
.choice input { width: auto; margin: 0; }
.choice.is-disabled { opacity: .55; cursor: not-allowed; background: var(--line-soft); }

/* ---- buttons ----------------------------------------------------------- */

.btn {
    display: inline-block;
    padding: 8px 15px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: var(--brand);
    color: #fff;
    font: inherit;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
}

.btn:hover { background: var(--brand-dark); }

.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--line-soft); }

.btn-ok  { background: var(--ok); }
.btn-ok:hover { background: #15683f; }

.btn-bad { background: var(--bad); }
.btn-bad:hover { background: #8f1e17; }

.btn-sm { padding: 5px 11px; font-size: 13px; }

.btn:disabled, .btn.is-disabled { opacity: .5; cursor: not-allowed; }

.btn-row { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }

/* ---- alerts ------------------------------------------------------------ */

.alert {
    padding: 11px 15px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
    border: 1px solid transparent;
}

.alert-success { background: var(--ok-bg);   color: var(--ok);   border-color: #bfe3d1; }
.alert-error   { background: var(--bad-bg);  color: var(--bad);  border-color: #f3c9c6; }
.alert-info    { background: var(--info-bg); color: var(--brand); border-color: #c7dcec; }

/* ---- empty state ------------------------------------------------------- */

.empty { padding: 40px 20px; text-align: center; color: var(--ink-faint); }
.empty-title { font-weight: 600; color: var(--ink-soft); margin-bottom: 4px; }

/* ---- filter bar -------------------------------------------------------- */

.filters {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line-soft);
}

.filters .field { margin: 0; min-width: 160px; }

/* ---- login ------------------------------------------------------------- */

.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(160deg, var(--brand-dark), #143a5c 60%, #0f5876);
}

.auth-card {
    background: #fff;
    width: 100%;
    max-width: 380px;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 12px 34px rgba(6, 22, 38, .28);
}

.auth-card h1 { margin: 0 0 4px; font-size: 20px; }
.auth-sub { color: var(--ink-faint); font-size: 13px; margin-bottom: 20px; }
.auth-card .btn { width: 100%; text-align: center; }
.auth-alt { margin-top: 16px; font-size: 13px; text-align: center; }

/* ---- responsive -------------------------------------------------------- */

@media (max-width: 820px) {
    .shell { flex-direction: column; }

    .sidebar {
        width: 100%;
        flex: none;
        flex-direction: row;
        align-items: center;
        overflow-x: auto;
        padding: 10px 12px;
        gap: 6px;
    }

    .brand { padding: 0 12px 0 0; }
    .sidebar nav { display: flex; gap: 4px; }
    .nav-link { border-left: 0; border-radius: 6px; padding: 7px 11px; white-space: nowrap; }
    .nav-link.is-active { border-left: 0; }
    .sidebar-foot { margin: 0 0 0 auto; padding: 0 0 0 12px; border: 0; display: flex; align-items: center; gap: 12px; }
    .main { padding: 18px 16px 44px; }
}

/* --- v3 ------------------------------------------------------------------ */

/* Campus pickers and any other multi-select list of short labels. Auto-fit
   rather than a fixed column count: the same markup has to hold two campuses
   and forty without either wasting a screen or needing a media query. */
.choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 6px;
}

.choice-grid .choice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 7px 9px;
    border: 1px solid var(--rule, #dde2e8);
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}

.choice-grid .choice:hover { border-color: var(--accent, #275c7e); }
.choice-grid .choice input { margin-top: 2px; flex: none; }

/* Proposed changes on the approvals screen. A card per proposal rather than a
   table row: what changed is itself a small table, and nesting that inside a
   row makes both unreadable. */
.proposal {
    border: 1px solid var(--rule, #dde2e8);
    border-left: 3px solid var(--warn, #9a5b00);
    border-radius: 3px;
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.proposal-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
}

.proposal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.proposal-actions input[type=text] { flex: 1 1 240px; }

/* --- mission control ------------------------------------------------------ */

.mission-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.mission-filters .field { margin: 0; min-width: 150px; }

/* Two up on a wide screen, one up when there is not room. Charts get a
   readable minimum rather than being squeezed to fit a column count. */
.mission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 16px;
}

.mission-grid .panel { margin: 0; }

/* Charts ----------------------------------------------------------------- */

.chart { display: block; max-width: 100%; overflow: visible; }

.chart-label { font-size: 12px; fill: var(--ink-soft); }
.chart-value { font-size: 12px; fill: var(--ink); font-variant-numeric: tabular-nums; }

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-bottom: 10px;
    font-size: 12.5px;
    color: var(--ink-soft);
}

.chart-legend .key { display: inline-flex; align-items: center; gap: 6px; }

.chart-legend .key i {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
    flex: none;
}

.chart-table { margin-top: 12px; }

.chart-table > summary {
    cursor: pointer;
    font-size: 12.5px;
    color: var(--ink-soft);
    padding: 4px 0;
}

.chart-table > summary:hover { color: var(--accent); }
.chart-table table { margin-top: 8px; }

/* Tiles get a secondary figure without competing with the headline. */
.tile-of { color: var(--ink-faint); font-size: 18px; font-weight: 500; }

/* Worth a look ----------------------------------------------------------- */

.attn {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 11px 16px;
    border-bottom: 1px solid var(--line-soft);
    text-decoration: none;
    color: inherit;
}

.attn:last-child { border-bottom: 0; }
.attn:hover { background: var(--line-soft); }
.attn span:last-child { display: flex; flex-direction: column; gap: 1px; }
.attn strong { font-weight: 600; }

/* A shape as well as a colour, so status never rests on hue alone. */
.attn-mark {
    flex: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}

.attn-critical .attn-mark { background: #d03b3b; }
.attn-serious  .attn-mark { background: #ec835a; }
.attn-warning  .attn-mark { background: #a86a08; }

/* A tile that links somewhere is still a tile, not a link: the numbers must
   not arrive underlined and accent-coloured just because the wrapper is an
   anchor. Hover carries the affordance instead. */
a.tile {
    text-decoration: none;
    color: inherit;
    transition: border-color .12s ease, box-shadow .12s ease;
}

a.tile:hover {
    border-color: var(--accent);
    box-shadow: 0 1px 2px rgba(20, 32, 46, .10), 0 3px 12px rgba(20, 32, 46, .07);
}

a.tile .tile-value { color: var(--ink); }
a.tile:hover .tile-label { color: var(--accent); }

/* A reconcile step: a tick, a headline, and why it is being proposed. */
.recon {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line-soft);
    cursor: pointer;
}

.recon:last-child { border-bottom: 0; }
.recon:hover { background: var(--line-soft); }
.recon input { margin-top: 3px; flex: none; }
.recon span:last-child { display: flex; flex-direction: column; gap: 1px; }
.recon .t-muted { font-size: 13px; }

/* ---------------------------------------------------------------------------
   Mass upload grid
   ---------------------------------------------------------------------------
   A dense, spreadsheet-shaped table. Cells are real inputs rather than
   contenteditable so that pasting, tabbing and screen readers all behave the
   way people already expect from a form.
   --------------------------------------------------------------------------- */

.grid-scroll {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    max-height: 62vh;
    overflow-y: auto;
}

table.grid {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    font-size: .86rem;
}

table.grid th,
table.grid td {
    border-bottom: 1px solid var(--line-soft);
    border-right: 1px solid var(--line-soft);
    padding: 0;
}

table.grid thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: .4rem .5rem;
    text-align: left;
    font-size: .76rem;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--ink-soft);
    white-space: nowrap;
}

table.grid thead tr.grid-subhead th {
    top: 2.05rem;
    font-size: .68rem;
    padding: .15rem .5rem;
    text-align: center;
    color: var(--ink-faint);
}

table.grid .grid-group-head { text-align: center; }

table.grid input[type="text"],
table.grid input:not([type]),
table.grid select {
    border: 0;
    background: transparent;
    width: 100%;
    min-width: 8.5rem;
    padding: .35rem .5rem;
    font: inherit;
    color: var(--ink);
    border-radius: 0;
}

table.grid input.w-wide { min-width: 14rem; }

table.grid input:focus,
table.grid select:focus {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
    background: #fff;
}

table.grid td.grid-num,
table.grid th.grid-num {
    width: 2.6rem;
    min-width: 2.6rem;
    text-align: right;
    padding: .35rem .45rem;
    color: var(--ink-faint);
    background: var(--bg);
    font-variant-numeric: tabular-nums;
    position: sticky;
    left: 0;
    z-index: 1;
}

table.grid td.grid-tick {
    text-align: center;
    padding: .3rem .45rem;
    min-width: 2.6rem;
}

table.grid tr.row-bad td.grid-num { background: var(--bad-bg); color: var(--bad); }
table.grid .cell-bad { background: var(--bad-bg); box-shadow: inset 0 0 0 1px #f3c9c6; }

/* An email the platform already knows. Sits under the email cell, so the row
   says who it matched without costing a column. */
.match {
    display: block;
    padding: 0 .5rem .3rem;
    font-size: .72rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 16rem;
}

.match-ok   { color: var(--ok); }
.match-warn { color: var(--warn); }
.match-bad  { color: var(--bad); font-weight: 600; }

/* Inline in prose, where the grid explains itself. */
p .match {
    display: inline;
    padding: 0 .28rem;
    border-radius: 4px;
    background: var(--ok-bg);
}

.fill-down {
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--ink-soft);
    border-radius: 4px;
    cursor: pointer;
    font-size: .75rem;
    line-height: 1;
    padding: .18rem .3rem;
    margin-left: .25rem;
}

.fill-down:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.fill-hint {
    display: inline-block;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0 .28rem;
    font-size: .78rem;
    color: var(--ink-soft);
    background: var(--panel);
}

.inline-select {
    padding: .3rem .5rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
    background: var(--panel);
}

/* --- statuses: the three colours the review is built around --------------- */

.st {
    display: inline-block;
    border-radius: 999px;
    padding: .1rem .5rem;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .04em;
    white-space: nowrap;
}

.st-new     { background: var(--ok-bg);   color: var(--ok); }
.st-update  { background: var(--warn-bg); color: var(--warn); }
.st-match   { background: var(--line-soft); color: var(--ink-faint); }
.st-blocked { background: var(--bad-bg);  color: var(--bad); }

/* The same three, as a left edge on the row they describe. Colour alone is
   never the only signal — every one of these rows also carries a text badge. */
.st-row-new     td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
.st-row-update  td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.st-row-blocked td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.st-row-update  { background: #fffdf7; }
.st-row-blocked { background: var(--bad-bg); }

.summary-table { width: auto; }
.summary-table th {
    text-align: left;
    padding: .25rem 1.25rem .25rem 0;
    font-weight: 600;
    color: var(--ink-soft);
    white-space: nowrap;
}
.summary-table td { padding: .25rem 0; }

.t-small { font-size: .8rem; }
.t-small s { color: var(--ink-faint); }

.st-row-match td { color: var(--ink-soft); }
.st-row-match td:first-child { box-shadow: inset 3px 0 0 var(--line); }

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1rem;
    align-items: center;
    margin: 0 0 .9rem;
    font-size: .82rem;
    color: var(--ink-soft);
}

/* ---------------------------------------------------------------------------
   Dashboard: scope chooser, class cards, sync colours
   --------------------------------------------------------------------------- */

.scope-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .6rem;
}

.scope-card {
    display: block;
    padding: .8rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}

.scope-card:hover { border-color: var(--accent); color: var(--accent); }

.gcards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: .9rem;
}

.gcard {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    padding: .9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .55rem;
    border-top: 4px solid var(--line);
}

/* Colour is carried on the top edge AND in a text badge on every card. */
.gcard-ok    { border-top-color: var(--ok); }
.gcard-stale { border-top-color: var(--warn); background: #fffdf7; }
.gcard-not   { border-top-color: var(--ink-faint); }

.gcard-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .5rem;
}

.gcard-title { font-weight: 700; }
.gcard-code  { font-family: ui-monospace, monospace; font-size: .78rem; color: var(--ink-faint); }

.gcard-meta {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    font-size: .84rem;
    color: var(--ink-soft);
}

.gcard-students {
    font-size: .8rem;
    line-height: 1.45;
    color: var(--ink-soft);
    border-top: 1px dashed var(--line-soft);
    padding-top: .5rem;
    max-height: 7.5rem;
    overflow-y: auto;
}

.gcard-foot { margin-top: auto; }

.sync-ok    { background: var(--ok-bg);     color: var(--ok); }
.sync-stale { background: var(--warn-bg);   color: var(--warn); }
.sync-not   { background: var(--line-soft); color: var(--ink-soft); }

.tile-sync-ok    .tile-value { color: var(--ok); }
.tile-sync-stale .tile-value { color: var(--warn); }
.tile-sync-not   .tile-value { color: var(--ink-faint); }

/* ---------------------------------------------------------------------------
   Mission control: the tool tiles
   --------------------------------------------------------------------------- */

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: .9rem;
}

.tool {
    display: block;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    background: var(--panel);
    color: var(--ink);
    text-decoration: none;
}

.tool:hover { border-color: var(--accent); box-shadow: var(--shadow); }

.tool-title  { font-weight: 700; margin-bottom: .35rem; }
.tool-figure { font-size: 1.7rem; font-weight: 700; color: var(--brand); line-height: 1.1; }
.tool-note   { font-size: .82rem; color: var(--ink-soft); margin-top: .35rem; }
.tool-warn   { border-color: var(--warn); background: var(--warn-bg); }

/* --- The placard: who owns this class, worn on top of the card ------------ */

.gcard-placard {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .25rem .7rem;
    margin: -0.9rem -1rem 0;
    padding: .6rem 1rem;
    background: var(--brand);
    /* The card's radius minus its 4px coloured top border, so the placard's
       corners sit flush inside it instead of poking out. */
    border-radius: calc(var(--radius) - 4px) calc(var(--radius) - 4px) 0 0;
}

.gcard-placard a { text-decoration: none; }
.gcard-placard a:hover { text-decoration: underline; }

.pl-district { color: #fff; font-weight: 700; font-size: .95rem; }
.pl-campus   { color: #cfe0f2; font-size: .84rem; }
.pl-teacher  {
    color: #fff;
    font-size: .8rem;
    background: rgba(255, 255, 255, .14);
    border-radius: 999px;
    padding: .1rem .55rem;
    margin-left: auto;
}

/* --- The roster: every student, two columns, each a link ------------------- */

.gcard-roster {
    list-style: none;
    margin: 0;
    padding: .5rem 0 0;
    border-top: 1px dashed var(--line-soft);
    columns: 2;
    column-gap: 1.2rem;
    font-size: .82rem;
    max-height: 11rem;
    overflow-y: auto;
}

.gcard-roster li {
    break-inside: avoid;
    padding: .1rem 0;
}

.gcard-roster a {
    color: var(--ink-soft);
    text-decoration: none;
}

.gcard-roster a:hover { color: var(--accent); text-decoration: underline; }

/* Combo cells: dropdown of what exists, text box only while "new…" is chosen. */
td.grid-combo { min-width: 13rem; }
td.grid-combo select { min-width: 12rem; max-width: 16rem; }
td.grid-combo input {
    display: block;
    min-width: 12rem;
    border-top: 1px dashed var(--line) !important;
}

/* --- Districts directory --------------------------------------------------- */

.dir-name {
    display: flex;
    align-items: center;
    gap: .7rem;
}

.avatar {
    flex: 0 0 auto;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    font-size: .85rem;
    letter-spacing: .02em;
}

.avatar-house { background: var(--ok); font-size: 1.1rem; }

th.sortable a {
    color: inherit;
    text-decoration: none;
}

th.sortable a:hover { color: var(--accent); }

.seat-cell { min-width: 13rem; }

.seat-line {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .1rem 0;
    font-size: .78rem;
}

.seat-line .seat-code {
    flex: 0 0 2.4rem;
    color: var(--ink-faint);
    font-weight: 600;
}

.seat-line .meter {
    flex: 1;
    margin-top: 0;
}

.seat-line .seat-nums {
    flex: 0 0 3.6rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--ink-soft);
}

table.directory td { vertical-align: middle; }

/* Directory rows: the name cell IS the open link; figures sized like tiles. */
a.dir-link { color: inherit; text-decoration: none; }
a.dir-link:hover strong { color: var(--accent); text-decoration: underline; }

table.directory td.t-num {
    font-size: 1.25rem;
    font-weight: 650;
    letter-spacing: -.01em;
}

table.directory td.t-num a { color: inherit; text-decoration: none; }
table.directory td.t-num a:hover { color: var(--accent); }

/* --- People ---------------------------------------------------------------- */

/* The three doors. Bigger than a tool tile because they are the whole page,
   and each one says what it is FOR — "add a login" and "add a student" are
   different tables with different lifecycles, and a row of identical buttons
   would hide that. */
.door-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.door {
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    color: inherit;
    text-decoration: none;
    transition: border-color .12s, box-shadow .12s, transform .12s;
}

.door:hover {
    border-color: var(--accent);
    box-shadow: 0 3px 14px rgba(17, 63, 103, .12);
    transform: translateY(-2px);
}

.door-mark {
    font-size: 1.5rem;
    line-height: 1;
    margin-bottom: .7rem;
}

.door-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -.01em;
}

.door-note {
    font-size: .82rem;
    color: var(--ink-soft);
    margin-top: .4rem;
    flex: 1;
}

.door-figure {
    margin-top: 1rem;
    padding-top: .7rem;
    border-top: 1px solid var(--line-soft);
    font-size: 1.35rem;
    font-weight: 650;
    color: var(--brand);
    letter-spacing: -.02em;
}

.door-figure span {
    font-size: .76rem;
    font-weight: 500;
    color: var(--ink-faint);
    letter-spacing: 0;
    margin-left: .3rem;
}

.avatar-student { background: var(--accent); }

/* A deactivated person stays legible — greyed out, not hidden. Somebody is
   looking for them precisely BECAUSE they cannot sign in. */
tr.is-off td { opacity: .62; }
tr.is-off .avatar { background: var(--ink-faint); }

/* Row actions look like links, not a wall of buttons: four buttons per row
   over fifty rows is two hundred buttons, and the eye stops seeing any of
   them. Each still posts a real form with its own CSRF token. */
.row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .2rem .75rem;
    font-size: .8rem;
    white-space: nowrap;
}

.row-actions form { display: inline; }

.row-actions a,
.row-actions button {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: var(--accent);
    cursor: pointer;
    text-decoration: none;
}

.row-actions a:hover,
.row-actions button:hover { text-decoration: underline; }

.row-actions button.is-bad { color: var(--bad); }
