/* ==========================================================================
   School interface: design tokens, navigation, workspace home, sign-in and password pages.

   Load this AFTER admin.css / app.css. Everything school-facing reads its values from the custom
   properties in section 1, so a page never needs a colour or size of its own:

     colour     --brand (the school's main colour), --brand-dark, --brand-accent, --brand-tint,
                a warm-grey surface scale --surface-0..3, hairlines --line / --line-strong,
                text --ink / --ink-2 / --ink-3, status colours
     type       --font-ui (Public Sans), --font-display (Newsreader), --font-mono (IBM Plex Mono),
                sizes --fs-sm 13px, --fs-md 15px (body), --fs-lg .. --fs-4xl
     space      --sp-1 .. --sp-8 (4px steps up to 16, then 24, 32, 48, 64)
     shape      --radius-sm 3px, --radius 4px, --radius-lg 6px (nothing rounder), --border (hairline)
     focus      --focus-ring (the one outline every interactive element uses)

   The school's own colours arrive as --navy (main) and --blue (accent) from the <style id="school-theme">
   the application adds to every page of a school that chose colours (core/theme.py); the sign-in pages set
   --brand directly. A school that chose nothing gets the platform's own pair, below. The theme check
   guarantees white text is readable on both colours, so white-on-brand needs no further test; text that
   sits on a pale tint of the brand uses --brand-dark instead.
   ========================================================================== */


/* ---------- 1. Tokens ---------------------------------------------------- */

:root {
    /* The platform's own colours, used until a school chooses its own (same as core/theme.py). */
    --navy: #0d2b52;
    --navy-2: #173e70;
    --navy-deep: #091f3b;
    --blue: #1674b9;
    --blue-2: #0f5a91;

    --brand: var(--navy);
    --brand-dark: var(--navy-deep);
    --brand-accent: var(--blue);
    --brand-tint: #e8ecf2;            /* the brand at about 8% on white; refined below where supported */

    /* One warm-grey scale for every surface and hairline. */
    --surface-0: #ffffff;             /* cards, the rail, form panels */
    --surface-1: #f7f6f3;             /* the page */
    --surface-2: #f0eee9;             /* hover, quiet fills */
    --surface-3: #e6e3dc;             /* pressed, chips */
    --line: #e4e1da;                  /* hairline borders and dividers */
    --line-strong: #cfcbc2;           /* input borders */

    --ink: #1d2127;
    --ink-2: #464b53;
    --ink-3: #666b73;                 /* still 4.9:1 on the page colour: never lighter than this for text */

    --danger: #a4261b;
    --danger-bg: #fcefed;
    --danger-line: #e8c4bf;
    --success: #1f6b45;
    --success-bg: #ecf6f0;
    --success-line: #bcdcc8;
    --warning: #8a5a00;
    --warning-bg: #fbf3e2;
    --warning-line: #e6d3a3;

    --font-ui: "Public Sans", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
    --font-display: "Newsreader", Georgia, "Times New Roman", serif;
    --font-mono: "IBM Plex Mono", ui-monospace, Consolas, "Courier New", monospace;

    --fs-xs: 11px;                    /* navigation section labels only */
    --fs-sm: 13px;
    --fs-md: 15px;
    --fs-lg: 17px;
    --fs-xl: 20px;
    --fs-2xl: 24px;
    --fs-3xl: 30px;
    --fs-4xl: 40px;

    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 24px;
    --sp-6: 32px;
    --sp-7: 48px;
    --sp-8: 64px;

    --radius-sm: 3px;
    --radius: 4px;
    --radius-lg: 6px;
    --border: 1px solid var(--line);

    --focus-ring: 2px solid var(--brand-accent);
    --shadow-pop: 0 8px 24px rgba(29, 33, 39, .12), 0 1px 2px rgba(29, 33, 39, .08);

    --dur: .18s;
    --ease: cubic-bezier(.3, .1, .2, 1);

    --rail-w: 64px;
    --rail-open: 232px;
    --header-h: 56px;
}

@supports (color: color-mix(in srgb, red, blue)) {
    :root { --brand-tint: color-mix(in srgb, var(--brand) 8%, #fff); }
}


/* ---------- 2. Base ------------------------------------------------------ */

.school-ui {
    margin: 0;
    background: var(--surface-1);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: var(--fs-md);
    line-height: 1.5;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

.school-ui *,
.school-ui *::before,
.school-ui *::after { box-sizing: border-box; }

.school-ui h1,
.school-ui h2,
.school-ui h3 { font-weight: 600; line-height: 1.25; }

/* Figures line up in columns: every table, mark and amount uses tabular numerals. */
.school-ui table,
.school-ui .metric,
.school-ui .metric-number,
.school-ui .num,
.school-ui time { font-variant-numeric: tabular-nums; }

/* Codes, IDs and candidate codes: the one place a monospace is used. */
.school-ui code,
.school-ui .code,
.school-ui .mono,
.school-ui .candidate-code,
.school-ui .credential-code {
    font-family: var(--font-mono);
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}

.school-ui a:focus-visible,
.school-ui button:focus-visible,
.school-ui input:focus-visible,
.school-ui select:focus-visible,
.school-ui textarea:focus-visible,
.school-ui [tabindex]:focus-visible {
    outline: var(--focus-ring);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 200;
    padding: 8px 16px;
    border-radius: var(--radius);
    background: var(--brand);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.ico { flex: none; width: 22px; height: 22px; }
.ico-sm { width: 18px; height: 18px; }
.ico-lg { width: 26px; height: 26px; }


/* ---------- 3. Small components used by the sign-in and workspace pages -- */

.ui-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    min-height: 44px;
    padding: 0 var(--sp-5);
    border: 1px solid transparent;
    border-radius: var(--radius);
    font: 600 var(--fs-md)/1.2 var(--font-ui);
    text-decoration: none;
    cursor: pointer;
}
.ui-btn--primary { background: var(--brand); color: #fff; }
.ui-btn--primary:hover { background: var(--brand-dark); }
.ui-btn--light { background: var(--surface-0); border-color: var(--line-strong); color: var(--ink); }
.ui-btn--light:hover { border-color: var(--brand); color: var(--brand-dark); }
.ui-btn--sm { min-height: 34px; padding: 0 var(--sp-4); font-size: var(--fs-sm); }
.ui-btn--block { width: 100%; }

.ui-field { margin: 0 0 var(--sp-4); }
.ui-field label {
    display: block;
    margin: 0 0 var(--sp-1);
    color: var(--ink);
    font-size: var(--fs-sm);
    font-weight: 600;
}
.ui-input {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 0 var(--sp-3);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface-0);
    color: var(--ink);
    font: 400 var(--fs-md)/1.4 var(--font-ui);
}
.ui-input::placeholder { color: var(--ink-3); opacity: 1; }
.ui-input:hover { border-color: var(--ink-3); }
.ui-input:focus { border-color: var(--brand-accent); }

.ui-alert {
    margin: 0 0 var(--sp-4);
    padding: var(--sp-3) var(--sp-4);
    border: 1px solid var(--line-strong);
    border-left-width: 3px;
    border-radius: var(--radius);
    background: var(--surface-0);
    font-size: var(--fs-sm);
    line-height: 1.45;
}
.ui-alert--error { background: var(--danger-bg); border-color: var(--danger-line); border-left-color: var(--danger); color: #6d1a12; }
.ui-alert--success { background: var(--success-bg); border-color: var(--success-line); border-left-color: var(--success); color: #14472e; }
.ui-alert--warning { background: var(--warning-bg); border-color: var(--warning-line); border-left-color: var(--warning); color: #5c3c00; }
.ui-alert--info { background: var(--brand-tint); border-color: var(--line-strong); border-left-color: var(--brand); color: var(--ink); }

.ui-link {
    color: var(--brand-accent);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.ui-link:hover { color: var(--brand-dark); }

/* The school's mark: its logo, or a monogram. Sized by the container that holds it. */
.school-mark { display: block; flex: none; }
.school-mark--logo { object-fit: contain; }
.school-mark--mono {
    display: grid;
    place-items: center;
    background: var(--brand);
    color: #fff;
    border-radius: var(--radius);
    font: 500 1.05em/1 var(--font-display);
    letter-spacing: .02em;
}


/* ---------- 4. The navigation rail --------------------------------------- */

.rail {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    width: var(--rail-w);
    background: var(--surface-0);
    border-right: var(--border);
    overflow: hidden;
    transition: width var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

/* Open: while it is being used (hover intent, keyboard focus) or when the person pinned it. */
.rail.is-open { width: var(--rail-open); box-shadow: var(--shadow-pop); }
html[data-rail="pinned"] .rail { width: var(--rail-open); box-shadow: none; }

/* Without scripting the rail still opens, on plain hover and focus. */
html:not(.js) .rail:hover,
html:not(.js) .rail:focus-within { width: var(--rail-open); box-shadow: var(--shadow-pop); }

.rail-brand {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    flex: none;
    height: 72px;
    padding: 0 var(--sp-3);
    border-bottom: var(--border);
    color: var(--ink);
    text-decoration: none;
}
.rail-brand .school-mark { width: 40px; height: 40px; }
.rail-brand .school-mark--mono { font-size: 17px; }
.rail-brand__text { display: block; min-width: 0; line-height: 1.2; }
.rail-brand__name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font: 600 16px/1.2 var(--font-display);
}
.rail-brand__sub { display: block; margin-top: 2px; color: var(--ink-3); font-size: 12px; }

.rail-nav {
    flex: 1;
    min-height: 0;
    padding: var(--sp-2) 0 var(--sp-3);
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}

/* Groups: Overview and Messages on top with no heading, then the Teaching and Management groups. Open, each
   group has a small heading; narrow, the heading folds into a short hairline so the icons stay grouped. */
.rail-section { margin: 0 var(--sp-2); }
/* Each group starts with a hairline across the menu, so the groups read apart at a glance, open or narrow. */
.rail-section + .rail-section { margin-top: var(--sp-2); padding-top: var(--sp-2); border-top: 1px solid var(--line-strong); }
.rail-section__label {
    position: relative;
    display: flex;
    align-items: center;
    height: 24px;
    padding: 0 var(--sp-3);
    color: var(--ink-3);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: height var(--dur) var(--ease), opacity .1s ease;
}
.rail-section__label::after {
    content: "";
    position: absolute;
    left: 12px;
    top: 50%;
    width: 24px;
    height: 1px;
    background: var(--line-strong);
    opacity: 1;
    transition: opacity .1s ease;
}
.rail.is-open .rail-section__label::after,
html[data-rail="pinned"] .rail .rail-section__label::after { opacity: 0; }
.rail:not(.is-open) .rail-section__label { height: 13px; }
html[data-rail="pinned"] .rail .rail-section__label { height: 24px; }
/* Open, each group's heading sits on a light band, so the hairlines between groups are not needed. */
.rail.is-open .rail-section__label,
html[data-rail="pinned"] .rail .rail-section__label {
    margin-bottom: 2px;
    border-radius: 6px;
    color: var(--ink-2);
    background: color-mix(in srgb, var(--brand) 5%, var(--surface-0));
}
.rail.is-open .rail-section + .rail-section,
html[data-rail="pinned"] .rail .rail-section + .rail-section { border-top-color: transparent; }
.rail-list { margin: 0; padding: 0; list-style: none; }
/* The two parts of the school menu, Teaching and Management: a heading on a band of the school's colour across the
   whole width of the menu. Narrow, only a thin band shows. */
.rail-section.rail-section--part { margin-top: var(--sp-3); }
.rail-part {
    display: flex;
    align-items: center;
    height: 30px;
    margin: 0 calc(-1 * var(--sp-2)) var(--sp-2);
    padding: 0 calc(var(--sp-3) + var(--sp-2));
    color: var(--brand);
    background: color-mix(in srgb, var(--brand) 13%, var(--surface-0));
    font-size: var(--fs-xs);
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    transition: height var(--dur) var(--ease), color .1s ease;
}
.rail:not(.is-open) .rail-part { height: 4px; color: transparent; }
.rail.is-open .rail-part,
html[data-rail="pinned"] .rail .rail-part { height: 30px; color: var(--brand); transition-delay: .07s; }

.rail-link {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 34px;
    margin: 1px 0;
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    background: none;
    color: var(--ink-2);
    font: 500 13.5px/1.25 var(--font-ui);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.rail-ico {
    position: relative;
    display: grid;
    flex: none;
    place-items: center;
    width: 40px;
    height: 34px;
    color: var(--ink-3);
}
.rail-link:hover .rail-ico { color: var(--ink-2); }
.rail-label { min-width: 0; padding-right: var(--sp-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-link--sub .rail-label { font-size: var(--fs-sm); }

@media (hover: hover) and (pointer: fine) {
    .rail-link:hover { background: var(--surface-2); color: var(--ink); }
}

/* The page you are on: the school's colour as a bar on the edge, a pale wash of it behind the row,
   and the darker shade of it for the text, so it reads on any school colour that passed the contrast check. */
.rail-link.active { color: var(--brand-dark); font-weight: 600; }
.rail-link.active::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--brand);
    opacity: .09;
    pointer-events: none;
}
.rail-link.active::after {
    content: "";
    position: absolute;
    top: 7px;
    bottom: 7px;
    left: calc(-1 * var(--sp-2));
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--brand);
}
.rail-link.active .rail-ico { color: var(--brand); }

/* Labels are always in the page (screen readers read them); they simply fade in as the rail opens. */
.rail-label,
.rail-section__label,
.rail-brand__text,
.rail-person__copy { opacity: 0; transition: opacity .1s ease; }
.rail.is-open .rail-label,
.rail.is-open .rail-section__label,
.rail.is-open .rail-brand__text,
.rail.is-open .rail-person__copy,
html[data-rail="pinned"] .rail .rail-label,
html[data-rail="pinned"] .rail .rail-section__label,
html[data-rail="pinned"] .rail .rail-brand__text,
html[data-rail="pinned"] .rail .rail-person__copy,
html:not(.js) .rail:hover .rail-label,
html:not(.js) .rail:focus-within .rail-label { opacity: 1; transition-delay: .07s; }

/* Counts: a small square figure when open, a dot on the icon when the rail is narrow. */
.rail .nav-link-copy { display: flex; flex: 1; flex-direction: column; gap: 1px; min-width: 0; padding: var(--sp-1) var(--sp-3) var(--sp-1) 0; }
.rail .nav-link-copy > span:first-child { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.rail .nav-link-copy .nav-label-text,
.rail .nav-link-copy > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.rail .nav-message-sender {
    display: block;
    overflow: hidden;
    color: var(--ink-3);
    font-size: 12px;
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rail .nav-badge {
    display: inline-block;
    min-width: 20px;
    height: 20px;
    margin-left: auto;
    padding: 0 6px;
    border-radius: var(--radius-sm);
    background: var(--danger);
    color: #fff;
    font: 600 12px/20px var(--font-ui);
    font-variant-numeric: tabular-nums;
    text-align: center;
}
.rail-dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 9px;
    height: 9px;
    border: 2px solid var(--surface-0);
    border-radius: 50%;
    background: var(--danger);
    box-sizing: content-box;
    visibility: hidden;
}
.rail-link[data-unread] .rail-dot { visibility: visible; }
.rail.is-open .rail-dot,
html[data-rail="pinned"] .rail .rail-dot { visibility: hidden; }

.rail-foot { flex: none; padding: var(--sp-1) var(--sp-2) var(--sp-2); border-top: var(--border); }
.rail-list--foot { padding-bottom: var(--sp-1); margin-bottom: var(--sp-1); border-bottom: var(--border); }
.rail-list--foot .rail-link { min-height: 32px; font-size: 13px; }
.rail-list--foot .rail-ico { height: 32px; }
.rail-foot .rail-person { padding-left: 0; }
.rail-person { display: flex; align-items: center; min-height: 48px; }
.rail-person__ava { display: grid; flex: none; place-items: center; width: 40px; height: 40px; }
.rail-avatar {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font: 600 13px/1 var(--font-ui);
    object-fit: cover;
    overflow: hidden;
}
.rail-person__copy { min-width: 0; padding-right: var(--sp-3); line-height: 1.25; }
.rail-person__name,
.rail-person__role { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-person__name { font-size: 14px; font-weight: 600; color: var(--ink); }
.rail-person__role { font-size: 12px; color: var(--ink-3); }

.rail-pin[aria-pressed="true"] { color: var(--brand-dark); }
.rail-pin[aria-pressed="true"] .rail-ico { color: var(--brand); }

/* The boxed arrow at the foot of the rail, across its edge: a solid school-coloured box. It steps out of
   the way while the menu is open from hovering, so it never covers an item; pinned open, it stays. */
.rail-edge {
    position: fixed;
    bottom: 24px;
    left: calc(var(--rail-w) - 16px);
    z-index: 61;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 2px solid var(--surface-0);
    border-radius: 9px;
    background: var(--brand);
    color: #fff;
    box-shadow: 0 4px 12px rgba(20, 36, 60, 0.28);
    cursor: pointer;
    transition: left var(--dur) var(--ease), opacity var(--dur) var(--ease), background var(--dur) var(--ease);
}
.rail-edge:hover { background: var(--brand-dark); }
.rail-edge:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
html[data-rail="pinned"] .rail-edge { left: calc(var(--rail-open) - 16px); }
html:not([data-rail="pinned"]) .rail.is-open ~ .rail-edge { opacity: 0; visibility: hidden; pointer-events: none; }
.rail-edge__close { display: none; }
html[data-rail="pinned"] .rail-edge__open { display: none; }
html[data-rail="pinned"] .rail-edge__close { display: inline; }
.rail-edge svg { display: block; }

/* The one tooltip, drawn by school-nav.js outside the rail (the rail clips anything that overflows it). */
.rail-tip {
    position: fixed;
    z-index: 90;
    padding: 6px 10px;
    border-radius: var(--radius);
    background: var(--ink);
    color: #fff;
    font: 500 var(--fs-sm)/1.3 var(--font-ui);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .1s ease;
}
.rail-tip.is-shown { opacity: 1; }

.rail-scrim {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(29, 33, 39, .45);
}
.rail-scrim[hidden] { display: none; }

/* Content moves over to make room for the rail; a pinned rail takes its full width. */
.school-ui .admin-shell { display: block; min-height: 100vh; background: var(--surface-1); }
.school-ui .admin-shell .main {
    width: auto;
    max-width: none;
    margin-left: 0;
    padding: 0;
    background: transparent;
    animation: none;
}
.school-ui .admin-shell.has-rail .main { margin-left: var(--rail-w); transition: margin-left var(--dur) var(--ease); }
html[data-rail="pinned"] .school-ui .admin-shell.has-rail .main { margin-left: var(--rail-open); }


/* ---------- 4b. Site-wide banners: connection drops, unallocated payments - */

/* core/connectivity.py writes this element on every admin page; the script (static/connectivity.js)
   only toggles the two classes below, so a page missing this rule would render an unstyled, static
   line instead of the animated, colour-coded strip every other surface (static/app.css) already has. */
.connectivity-banner {
    position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
    text-align: center; font-size: var(--fs-sm); font-weight: 700;
    padding: 0; max-height: 0; overflow: hidden; opacity: 0;
    transition: max-height .25s ease, opacity .25s ease, padding .25s ease;
    background: var(--success-bg); color: var(--success);
}
.connectivity-banner-visible { max-height: 60px; opacity: 1; padding: var(--sp-2) var(--sp-4); }
.connectivity-banner-offline { background: var(--warning-bg); color: var(--warning); }

/* A plain, always-in-flow strip (nothing to animate, nothing to dismiss): it is there for as long
   as core/security.py's context processor finds at least one posted payment nobody has allocated
   yet, and it is gone the moment the last one is, with no button of its own to make it go away. */
.finance-unallocated-banner {
    text-align: center; font-size: var(--fs-sm); font-weight: 700;
    padding: var(--sp-2) var(--sp-4);
    background: var(--warning-bg); color: var(--warning);
    border-bottom: 1px solid var(--warning-line);
}
.finance-unallocated-banner a { color: inherit; text-decoration: underline; margin-left: var(--sp-2); }

/* ---------- 5. Page header, back link, messages -------------------------- */

.ui-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    height: var(--header-h);
    padding: 0 var(--sp-6);
    background: var(--surface-1);
    border-bottom: var(--border);
}
.ui-iconbtn.ui-menu-btn { display: none; }
.ui-crumbs { flex: 1; min-width: 0; }
.ui-crumbs ol { display: flex; align-items: center; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; font-size: var(--fs-sm); color: var(--ink-3); }
.ui-crumbs li { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-crumbs li + li::before { content: "/"; margin-right: var(--sp-2); color: var(--line-strong); }
.ui-crumbs li[aria-current] { color: var(--ink); font-weight: 600; }
.ui-header-actions { display: flex; align-items: center; gap: var(--sp-2); }

/* The page header takes the school's own colour (--navy, from its brand settings). */
.ui-header {
    background: var(--navy);
    border-bottom: 0;
    color: #fff;
}
.ui-header .ui-crumbs ol { color: rgba(255, 255, 255, 0.78); }
.ui-header .ui-crumbs li + li::before { color: rgba(255, 255, 255, 0.45); }
.ui-header .ui-crumbs li[aria-current] { color: #fff; }
.ui-header .ui-iconbtn {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.22);
    color: #fff;
}
.ui-header .ui-iconbtn:hover { background: rgba(255, 255, 255, 0.2); }
.ui-toplinks { display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm); font-weight: 600; color: #fff; }
.ui-toplinks a { color: #fff; text-decoration: none; }
.ui-toplinks a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ui-toplinks__sep { color: rgba(255, 255, 255, 0.45); }
.ui-toplinks__count { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 99px; background: #fff; color: var(--brand-dark); font-size: 11px; line-height: 18px; }
.ui-account { position: relative; }
.ui-account__btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 4px; border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 10px; background: rgba(255, 255, 255, 0.12); color: #fff; font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.ui-account__btn:hover { background: rgba(255, 255, 255, 0.2); }
.ui-account__btn:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
.ui-account__ava { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; overflow: hidden; background: #fff; color: var(--brand-dark); font-weight: 700; }
.ui-account__ava img { width: 100%; height: 100%; object-fit: cover; }
.ui-account__name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-account__initials { display: none; font-weight: 700; letter-spacing: 0.04em; }
@media (max-width: 760px) {
    .ui-account__name { display: none; }
    .ui-account__initials { display: inline; }
}
.ui-account__menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 70; min-width: 180px; padding: 6px; border: var(--border); border-radius: 12px; background: var(--surface-0); box-shadow: var(--shadow-pop); }
.ui-account__menu[hidden] { display: none; }
.ui-account__menu a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--ink); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; }
.ui-account__menu a:hover, .ui-account__menu a:focus-visible { background: var(--surface-1); }

.ui-iconbtn {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    background: none;
    color: var(--ink-2);
    text-decoration: none;
    cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
    .ui-iconbtn:hover { background: var(--surface-2); color: var(--ink); }
}
.ui-count {
    position: absolute;
    top: 3px;
    right: 1px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--danger);
    box-shadow: 0 0 0 2px var(--surface-1);
    color: #fff;
    font: 600 11px/18px var(--font-ui);
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.ui-page { max-width: 1480px; padding: var(--sp-5) var(--sp-6) var(--sp-8); }

.ui-back {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    margin: 0 0 var(--sp-4);
    padding: 6px var(--sp-3) 6px var(--sp-2);
    border: 0;
    border-radius: var(--radius);
    background: none;
    color: var(--ink-2);
    font: 500 14px/1.2 var(--font-ui);
    cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
    .ui-back:hover { background: var(--surface-2); color: var(--ink); }
}

.school-ui .flash {
    margin: 0 0 var(--sp-4);
    padding: var(--sp-3) var(--sp-4);
    border: 1px solid var(--line-strong);
    border-left-width: 3px;
    border-radius: var(--radius);
    background: var(--surface-0);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.45;
}
.school-ui .flash.success { background: var(--success-bg); border-color: var(--success-line); border-left-color: var(--success); color: #14472e; }
.school-ui .flash.error,
.school-ui .flash.danger { background: var(--danger-bg); border-color: var(--danger-line); border-left-color: var(--danger); color: #6d1a12; }
.school-ui .flash.warning { background: var(--warning-bg); border-color: var(--warning-line); border-left-color: var(--warning); color: #5c3c00; }

/* A flash message as a toast (static/flash-toast.js): a small rounded card at the top of the screen, as wide as its
   words need, that goes after a few seconds. The selectors are doubled so they win over the older .flash rules in
   admin.css and above, whatever order the files load in. */
.toast-stack {
    position: fixed; z-index: 1000; top: 16px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    width: max-content; max-width: calc(100vw - 32px); pointer-events: none;
}
.flash.toast.toast {
    display: inline-flex; align-items: center; gap: 10px;
    width: auto; max-width: min(420px, calc(100vw - 32px)); margin: 0; padding: 9px 8px 9px 10px;
    border: 1px solid var(--line); border-radius: 12px;
    background: var(--surface-0); color: var(--ink);
    box-shadow: 0 10px 28px rgba(29, 33, 39, .14), 0 1px 3px rgba(29, 33, 39, .08);
    font-size: 13.5px; font-weight: 500; line-height: 1.4; pointer-events: auto;
    animation: toastIn .22s cubic-bezier(.2, .8, .3, 1) both; transition: opacity .2s ease, transform .2s ease;
}
.flash.toast.toast:hover { transform: none; }
.flash.toast.is-leaving { opacity: 0; transform: translateY(-6px); }
.flash.toast.toast--inline { display: flex; max-width: none; margin: 0 0 var(--sp-4); box-shadow: none; }
.toast__icon {
    flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
    background: var(--success); color: #fff;
}
.toast__icon svg { width: 13px; height: 13px; }
.toast--error .toast__icon { background: var(--danger); }
.toast--warning .toast__icon { background: var(--warning); }
.toast--info .toast__icon { background: var(--brand); }
.toast__text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.toast__close {
    flex: none; display: grid; place-items: center; width: 24px; height: 24px; margin: 0; padding: 0;
    border: 0; border-radius: 8px; background: transparent; color: var(--ink-3, #6b7280);
    font-size: 18px; line-height: 1; cursor: pointer;
}
.toast__close:hover, .toast__close:focus-visible { background: var(--surface-2); color: var(--ink); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .flash.toast.toast { animation: none; transition: none; }
}
@media (max-width: 560px) {
    .toast-stack { top: 10px; }
}


/* ---------- 5b. A page that takes the whole screen: the menu stays closed --- */

/* school-nav.js puts .menu-hidden on <html> while the page on screen carries data-menu-hidden (the
   exam/test timetable). The menu is then off screen until the header's menu button is pressed; it
   opens over the page, below the header so that button stays in reach, and the same button closes
   it. On a phone the ordinary drawer (section 6) already does this, so these rules are for wider
   screens only. While the portal tour is running (.pt-on, static/portal-tour.js) the menu shows as
   usual, because the tour points at it. */
@media (min-width: 769px) {
    html.js.menu-hidden:not(.pt-on) .ui-iconbtn.ui-menu-btn { display: inline-grid; }
    html.js.menu-hidden:not(.pt-on) .school-ui .admin-shell.has-rail .main,
    html.js.menu-hidden:not(.pt-on)[data-rail="pinned"] .school-ui .admin-shell.has-rail .main { margin-left: 0; }
    html.js.menu-hidden:not(.pt-on) .rail {
        top: var(--header-h);
        width: var(--rail-open);
        transform: translateX(-102%);
        visibility: hidden;
        box-shadow: none;
        transition: transform var(--dur) var(--ease), visibility 0s linear var(--dur);
    }
    html.js.menu-hidden:not(.pt-on) .rail.is-drawer-open {
        transform: none;
        visibility: visible;
        box-shadow: var(--shadow-pop);
        transition: transform var(--dur) var(--ease), visibility 0s;
    }
    /* Open, there is room for every label, as when the menu is pinned. */
    html.js.menu-hidden:not(.pt-on) .rail .rail-label,
    html.js.menu-hidden:not(.pt-on) .rail .rail-section__label,
    html.js.menu-hidden:not(.pt-on) .rail .rail-brand__text,
    html.js.menu-hidden:not(.pt-on) .rail .rail-person__copy { opacity: 1; }
    html.js.menu-hidden:not(.pt-on) .rail .rail-section__label { height: 24px; }
    html.js.menu-hidden:not(.pt-on) .rail .rail-section__label::after { opacity: 0; }
    html.js.menu-hidden:not(.pt-on) .rail .rail-part { height: 30px; color: var(--brand); }
    html.js.menu-hidden:not(.pt-on) .rail .rail-dot { visibility: hidden; }
    html.js.menu-hidden:not(.pt-on) .rail-edge { display: none; }
}


/* ---------- 6. Phones and small tablets: the rail becomes a drawer ---------- */

@media (max-width: 768px) {
    .ui-iconbtn.ui-menu-btn { display: inline-grid; }
    .ui-header { padding: 0 var(--sp-3); }
    .ui-page { padding: var(--sp-4) var(--sp-4) var(--sp-7); }

    .school-ui .admin-shell.has-rail .main,
    html[data-rail="pinned"] .school-ui .admin-shell.has-rail .main { margin-left: 0; }

    html.js .rail {
        width: min(300px, 86vw);
        transform: translateX(-102%);
        visibility: hidden;
        box-shadow: none;
        transition: transform var(--dur) var(--ease), visibility 0s linear var(--dur);
    }
    html.js .rail.is-drawer-open {
        transform: none;
        visibility: visible;
        box-shadow: var(--shadow-pop);
        transition: transform var(--dur) var(--ease), visibility 0s;
    }
    /* In the drawer there is room for everything, so nothing is hidden. */
    html.js .rail .rail-label,
    html.js .rail .rail-section__label,
    html.js .rail .rail-brand__text,
    html.js .rail .rail-person__copy { opacity: 1; }
    html .rail .rail-section__label { height: 24px; }
    html .rail .rail-section__label::after { opacity: 0; }
    html .rail .rail-section__label { margin-bottom: 2px; border-radius: 6px; color: var(--ink-2);
        background: color-mix(in srgb, var(--brand) 5%, var(--surface-0)); }
    html .rail .rail-section + .rail-section { border-top-color: transparent; }
    html .rail .rail-part { height: 30px; color: var(--brand); }
    html.js .rail .rail-dot { visibility: hidden; }
    html.js .rail .rail-pin { display: none; }
    html.js .rail-edge { display: none; }

    /* No scripting: the menu is a plain block above the page rather than a drawer nobody can open. */
    html:not(.js) .rail {
        position: static;
        width: 100%;
        max-height: none;
        border-right: 0;
        border-bottom: var(--border);
        box-shadow: none;
    }
    html:not(.js) .rail .rail-label,
    html:not(.js) .rail .rail-section__label,
    html:not(.js) .rail .rail-brand__text,
    html:not(.js) .rail .rail-person__copy { opacity: 1; }
    html:not(.js) .rail-pin { display: none; }
    html:not(.js) .rail-edge { display: none; }
    html:not(.js) .school-ui .admin-shell.has-rail .main { margin-left: 0; }
}

html.rail-locked { overflow: hidden; }


/* ---------- 7. Workspace home: choosing a workspace ------------------------- */
/* templates/admin_workspace_home.html, in the staff pages' own look: the school's header bar, a title line (.ac-top),
   one panel (.ac-panel) per workspace with its figures (.fi-k, static/finance.css) and its Enter button. The whole
   panel is the link; the page fits one screen, the two panels side by side, stacked on a phone. */

.ws {
    /* the staff components' colour names (static/admin.css sets them on staff pages; this page does not load it) */
    --text: var(--ink); --card: var(--surface-0); --muted: var(--ink-3); --bg: var(--surface-1);
    min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--surface-1); color: var(--ink);
}
.ws-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    height: var(--header-h);
    padding: 0 var(--sp-6);
    background: var(--navy);
    color: #fff;
}
.ws-bar__school { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ws-bar__school .school-mark { flex: none; width: 32px; height: 32px; }
.ws-bar__school .school-mark--mono { display: grid; place-items: center; border-radius: 6px; background: #fff; color: var(--navy); font-size: 13px; font-weight: 700; }
.ws-bar__school .school-mark--logo { padding: 2px; border-radius: 6px; background: #fff; object-fit: contain; }
.ws-bar__school > span { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.ws-bar__school b { overflow: hidden; font-size: 15px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.ws-bar__school small { font-size: 11.5px; color: rgba(255, 255, 255, .72); }
.ws-bar__me { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 13px; }
.ws-bar__ava { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: #fff; color: var(--navy); font-size: 12px; font-weight: 700; }
.ws-bar__name { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.ws-bar__out { margin-left: 4px; padding: 5px 10px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 6px; color: #fff; font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.ws-bar__out:hover { background: rgba(255, 255, 255, .12); }
.ws-bar__out:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.ws-main { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; width: 100%; max-width: 940px; margin: 0 auto; padding: var(--sp-6); box-sizing: border-box; }
.ws-top { margin-bottom: 14px; }
.ws-top h1 { font-size: 22px; }
.ws-top p { margin: 3px 0 0; max-width: 64ch; font-size: 13px; color: var(--ac-muted); }

.ws-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.ws-choices > li { display: flex; min-width: 0; }
.ws-choice {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    padding: 16px 18px;
    color: var(--ac-ink);
    text-decoration: none;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.ws-choice:hover { border-color: color-mix(in srgb, var(--ac-accent) 55%, var(--ac-line)); box-shadow: 0 4px 14px var(--ac-shadow); }
.ws-choice:focus-visible { outline: 2px solid var(--ac-accent); outline-offset: 2px; }
.ws-choice__head { display: flex; align-items: center; gap: 12px; }
.ws-choice__ico { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 8px; background: var(--ac-brand-tint); color: var(--ac-brand); }
.ws-choice__ico .ico { width: 20px; height: 20px; }
.ws-choice__title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ws-choice__title b { font-size: 16px; font-weight: 700; color: var(--ac-brand); }
.ws-choice__title small { font-size: 12px; color: var(--ac-muted); }
.ws-choice__text { font-size: 12.5px; line-height: 1.5; color: var(--ac-ink-2); }
.ws .ws-choice__facts { margin: 0; }
.ws .ws-choice__facts dd { font-size: 16px; }
.ws-choice__note { font-size: 11.5px; line-height: 1.45; color: var(--ac-muted); }
.ws-choice__go { justify-content: center; margin-top: auto; }
.ws-choice__go .ico { transition: transform .12s ease; }
.ws-choice:hover .ws-choice__go .ico { transform: translateX(3px); }
.ws .ws-choice:hover .ws-choice__go:not(.ac-btn--primary) { border-color: var(--ac-accent); color: var(--ac-accent-strong); }
.ws .ws-choice:hover .ws-choice__go.ac-btn--primary { background: var(--ac-accent-strong); border-color: var(--ac-accent-strong); }

/* One press only (templates/admin_workspace_home.html): once a door is pressed both stop answering until the page is
   loaded again; the chosen one's button shows a spinner in place of its words, and the other door fades. */
.ws-choices.is-going .ws-choice { pointer-events: none; cursor: default; }
.ws-choices.is-going .ws-choice:not(.is-chosen) { opacity: .5; }
.ws-choice.is-chosen .ws-choice__go { position: relative; color: transparent !important; }
.ws-choice.is-chosen .ws-choice__go::before { display: none; }   /* page-loading.js's own small spinner: one is enough */
.ws-choice.is-chosen .ws-choice__go::after {
    content: ""; position: absolute; top: 50%; left: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; box-sizing: border-box;
    border: 2px solid var(--ws-spin, var(--ac-accent)); border-right-color: transparent; border-radius: 50%;
    animation: ui-spin .7s linear infinite; }
.ws-choice.is-chosen .ws-choice__go.ac-btn--primary { --ws-spin: #fff; }
@media (prefers-reduced-motion: reduce) { .ws-choice.is-chosen .ws-choice__go::after { animation-duration: 2s; } }

/* Leaving for a workspace (static/page-loading.js puts the outline on .bs-stage): the page takes the workspace's own
   frame - its menu rail down the left and its content from the left, without the chooser's role line and Sign out -
   so the wait already looks like the workspace arriving rather than the chooser still waiting. */
.ws-rail-sk { display: none; }
.ws:has(.bs-stage.is-skeleton) { padding-left: var(--rail-w); }
.ws:has(.bs-stage.is-skeleton) .ws-rail-sk {
    position: fixed; inset: 0 auto 0 0; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 16px;
    width: var(--rail-w); padding-top: 16px; box-sizing: border-box; background: var(--surface-0); border-right: var(--border); }
.ws-rail-sk i { display: block; flex: none; width: 22px; height: 22px; border-radius: 6px;
    background: color-mix(in srgb, var(--line, #dfe3ea) 75%, transparent); animation: bs-pulse 1.2s ease-in-out infinite; }
.ws-rail-sk i:first-child { width: 40px; height: 40px; margin-bottom: 12px; border-radius: 10px; }
.ws:has(.bs-stage.is-skeleton) .ws-main { max-width: none; justify-content: flex-start; margin: 0; }
.ws:has(.bs-stage.is-skeleton) .ws-bar__school small,
.ws:has(.bs-stage.is-skeleton) .ws-bar__out { visibility: hidden; }
@media (max-width: 768px) {
    .ws:has(.bs-stage.is-skeleton) { padding-left: 0; }
    .ws:has(.bs-stage.is-skeleton) .ws-rail-sk { display: none; }
}

/* Phones and short screens: one panel under the other, closer together, and the header without the role line. */
@media (max-width: 720px) {
    .ws-bar { padding: 0 var(--sp-4); }
    .ws-bar__school small, .ws-bar__name { display: none; }
    .ws-main { justify-content: flex-start; padding: 16px; }
    .ws-top h1 { font-size: 19px; }
    .ws-choices { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .ws-choice { gap: 8px; padding: 12px 14px; }
    .ws-choice__ico { width: 32px; height: 32px; }
    .ws-choice__title b { font-size: 15px; }
}
@media (min-width: 721px) and (max-height: 700px) {
    .ws-main { padding: var(--sp-4) var(--sp-6); }
    .ws-choice { gap: 8px; padding: 12px 16px; }
}


/* ---------- 8. Sign-in, password and recovery pages ------------------------ */

.auth-shell {
    display: grid;
    grid-template-columns: minmax(340px, 5fr) minmax(0, 6fr);
    min-height: 100vh;
}

/* The school's side: flat brand colour, or its photographs with the name on a solid plate,
   so the words never sit on a picture. */
.auth-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--brand);
    color: #fff;
    overflow: hidden;
}
.auth-panel--photos { justify-content: flex-end; }
.auth-panel .login-slides,
.auth-panel .login-slides-tint { position: absolute; inset: 0; z-index: 0; }
.auth-panel .login-slides-tint { z-index: 1; background: var(--brand); opacity: .14; }
.login-slide {
    position: absolute;
    inset: 0;
    background-position: center;
    background-size: cover;
    opacity: 0;
    animation-name: login-fade;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-fill-mode: both;
}
.login-slide:first-child { opacity: 1; }
.login-slides-single .login-slide { animation: none; opacity: 1; }
@media (prefers-reduced-motion: reduce) {
    .login-slide { animation: none; opacity: 0; }
    .login-slide:first-child { opacity: 1; }
}

.auth-plate { position: relative; z-index: 2; padding: var(--sp-7); background: var(--brand); }
.auth-panel--photos .auth-plate { padding-top: var(--sp-6); }
.auth-plate .school-mark { width: 72px; height: 72px; }
.auth-plate .school-mark--logo { padding: var(--sp-2); border-radius: var(--radius); background: #fff; }
.auth-plate .school-mark--mono { background: #fff; color: var(--brand); font-size: 30px; }
.auth-plate__name { margin: var(--sp-5) 0 0; font: 500 38px/1.15 var(--font-display); letter-spacing: -.005em; overflow-wrap: anywhere; }
.auth-plate__motto { margin: var(--sp-2) 0 0; font-size: var(--fs-lg); line-height: 1.4; max-width: 34ch; }
.auth-plate__contact { margin: var(--sp-5) 0 0; padding: var(--sp-4) 0 0; border-top: 1px solid rgba(255, 255, 255, .35); font-size: var(--fs-sm); list-style: none; }
.auth-plate__contact li + li { margin-top: 2px; }

/* With photographs, the photographs come first: a wider side for them, and the school's name on a compact,
   see-through strip along the bottom instead of a solid block over them. Without photographs nothing changes. */
@media (min-width: 901px) {
.auth-shell:has(.auth-panel--photos) { grid-template-columns: minmax(360px, 7fr) minmax(360px, 5fr); }
.auth-panel--photos .login-slides-tint { opacity: 0; }
.auth-panel--photos::after { content: ""; position: absolute; inset: auto 0 0 0; z-index: 1; height: 42%; pointer-events: none;
    background: linear-gradient(to top, color-mix(in srgb, var(--brand) 72%, transparent), transparent); }
.auth-panel--photos .auth-plate { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: var(--sp-4);
    margin: var(--sp-5); padding: var(--sp-3) var(--sp-4); border: 1px solid color-mix(in srgb, #fff 22%, transparent); border-radius: 16px;
    background: color-mix(in srgb, var(--brand) 62%, transparent); -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2);
    box-shadow: 0 10px 30px color-mix(in srgb, var(--brand-dark) 35%, transparent); }
.auth-panel--photos .auth-plate .school-mark { grid-row: span 2; width: 52px; height: 52px; }
.auth-panel--photos .auth-plate .school-mark--mono { font-size: 22px; }
.auth-panel--photos .auth-plate__name { margin: 0; font-size: 24px; line-height: 1.2; }
.auth-panel--photos .auth-plate__motto { margin: 2px 0 0; max-width: none; font-size: var(--fs-sm); opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auth-panel--photos .auth-plate__contact { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 2px 14px; margin: var(--sp-2) 0 0; padding: var(--sp-2) 0 0;
    font-size: 12px; opacity: .9; }
.auth-panel--photos .auth-plate__contact li + li { margin-top: 0; }
}

.auth-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--sp-7) var(--sp-5);
    background: var(--surface-0);
}
.auth-card { width: 100%; max-width: 400px; }
.auth-legal { width: 100%; max-width: 400px; margin: var(--sp-6) 0 0; text-align: center; }
.auth-legal a { color: var(--ink-3); font-size: var(--fs-xs); text-decoration: underline; text-underline-offset: 3px; }
.auth-legal a:hover { color: var(--ink-2); }
.auth-back { display: inline-flex; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-5); color: var(--ink-2); font-size: 14px; font-weight: 500; text-decoration: none; }
.auth-back:hover { color: var(--brand-dark); text-decoration: underline; text-underline-offset: 3px; }
.auth-title { margin: 0 0 var(--sp-2); color: var(--ink); font: 500 var(--fs-3xl)/1.2 var(--font-display); }
.auth-lead { margin: 0 0 var(--sp-5); color: var(--ink-2); }
.auth-form { margin: 0; }
.auth-form .ui-btn { margin-top: var(--sp-2); }
.auth-help { margin: var(--sp-5) 0 0; font-size: 14px; }
.auth-note {
    margin: var(--sp-5) 0 0;
    padding: var(--sp-4) 0 0;
    border-top: var(--border);
    color: var(--ink-2);
    font-size: var(--fs-sm);
    line-height: 1.5;
}
.auth-note strong { color: var(--ink); }

/* The sign-in page's help, version and privacy link, on the school's side (login.html, block plate_extra). */
.auth-plate__extra { margin: var(--sp-3) 0 0; padding: var(--sp-2) 0 0; border-top: 1px solid color-mix(in srgb, #fff 30%, transparent); font-size: 12.5px; line-height: 1.5; }
.auth-plate__extra .auth-note { margin: 0; padding: 0; border: 0; color: color-mix(in srgb, #fff 88%, transparent); font-size: 12.5px; }
.auth-plate__extra .auth-note strong { color: #fff; }
.auth-plate__extra p { margin: var(--sp-2) 0 0; }
.auth-plate__extra .auth-help { font-size: 13px; }
.auth-plate__extra a, .auth-plate__extra .ui-link { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.auth-plate__extra .auth-version { margin-top: var(--sp-2); text-align: left; font-size: 11.5px; color: color-mix(in srgb, #fff 75%, transparent); }
.auth-plate__extra .auth-legal { width: auto; max-width: none; margin: 2px 0 0; text-align: left; }
.auth-plate__extra .auth-legal a { color: color-mix(in srgb, #fff 80%, transparent); font-size: 11.5px; }
.auth-panel--photos .auth-plate__extra { grid-column: 1 / -1; }
/* The school's logo above "Portal Sign In". */
.auth-card__mark { display: flex; justify-content: center; margin: 0 0 var(--sp-4); }
.auth-fit .auth-card > .auth-title, .auth-fit .auth-card > .auth-lead { text-align: center; }   /* the sign-in page only */
.auth-card__mark .school-mark { width: 60px; height: 60px; }
.auth-card__mark .school-mark--logo { object-fit: contain; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.auth-card__mark .school-mark--mono { display: grid; place-items: center; border-radius: var(--radius); background: var(--brand); color: #fff; font-size: 24px; }

/* Narrow screens: the school's side shrinks to a strip carrying its mark and name. */
@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; min-height: 100vh; }
    .auth-panel,
    .auth-panel--photos { flex-direction: row; justify-content: flex-start; }
    .auth-panel .login-slides,
    .auth-panel .login-slides-tint { display: none; }
    .auth-plate { display: flex; align-items: center; gap: var(--sp-3); width: 100%; padding: var(--sp-3) var(--sp-4); }
    .auth-panel--photos .auth-plate { padding-top: var(--sp-3); }
    .auth-plate .school-mark { width: 44px; height: 44px; }
    .auth-plate .school-mark--logo { padding: 4px; }
    .auth-plate .school-mark--mono { font-size: 19px; }
    .auth-plate__name { margin: 0; font-size: 22px; }
    .auth-plate__motto,
    .auth-plate__contact { display: none; }
    .auth-plate { flex-wrap: wrap; }
    .auth-plate__extra { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; width: 100%; margin-top: var(--sp-2); padding-top: var(--sp-2); }
    .auth-plate__extra .auth-note { display: none; }
    .auth-plate__extra p { margin: 0; }
    .auth-card__mark { display: none; }
    .auth-main { justify-content: flex-start; padding: var(--sp-6) var(--sp-4) var(--sp-7); }
    .auth-title { font-size: 26px; }
}

/* The sign-in page fits one screen with no scrolling: the shell is exactly the viewport, and the spacing
   tightens on shorter screens so the form, the notes and the version line all fit. Only the sign-in page
   carries .auth-fit (login.html), so the other password pages keep their normal flow. */
.auth-fit { height: 100vh; height: 100dvh; overflow: hidden; }
.auth-fit .auth-shell { height: 100%; min-height: 0; }
.auth-fit .auth-main { min-height: 0; overflow: hidden; }
.auth-fit .auth-version { margin: var(--sp-5) 0 0; text-align: center; font-size: 12px; color: var(--ink-3); }

@media (min-width: 901px) and (max-height: 820px) {
    .auth-fit .auth-main { padding: var(--sp-5); }
    .auth-fit .auth-plate { padding: var(--sp-5); }
    .auth-fit .auth-plate__name { margin-top: var(--sp-3); font-size: 32px; }
    .auth-fit .auth-panel--photos .auth-plate { padding: var(--sp-3) var(--sp-4); }
    .auth-fit .auth-panel--photos .auth-plate__name { margin-top: 0; font-size: 22px; }
    .auth-fit .auth-plate__contact { margin-top: var(--sp-3); padding-top: var(--sp-3); }
    .auth-fit .auth-title { font-size: 26px; }
    .auth-fit .auth-lead { margin-bottom: var(--sp-4); }
    .auth-fit .auth-note { margin-top: var(--sp-4); padding-top: var(--sp-3); }
    .auth-fit .auth-help { margin-top: var(--sp-3); }
    .auth-fit .auth-version { margin-top: var(--sp-3); }
}
/* The sign-in page's version and privacy line at the foot of the page (login.html, block legal): phones only; on a
   wider screen they are on the school's side. */
.auth-foot { display: none; }
@media (max-width: 900px) {
    .auth-fit .auth-plate { justify-content: center; }
    .auth-fit .auth-plate__extra { display: none; }
    .auth-foot { display: block; width: 100%; max-width: 400px; margin: auto 0 0; padding-top: var(--sp-4); text-align: center; font-size: 11.5px; line-height: 1.5; color: var(--ink-3); }
    .auth-foot p { margin: 0; }
    .auth-foot a { color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; }
    .auth-foot a:hover { color: var(--ink-2); }
}
@media (max-width: 900px) {
    .auth-fit .auth-main { padding: var(--sp-4); justify-content: flex-start; }
    .auth-fit .auth-plate { padding: var(--sp-2) var(--sp-4); }
    .auth-fit .auth-title { font-size: 24px; }
    .auth-fit .auth-lead { margin-bottom: var(--sp-3); }
    .auth-fit .auth-note { margin-top: var(--sp-3); padding-top: var(--sp-3); font-size: 13px; }
    .auth-fit .auth-help { margin-top: var(--sp-3); }
    .auth-fit .auth-version { margin-top: var(--sp-3); }
}
@media (max-width: 900px) and (max-height: 700px) {
    .auth-fit .auth-main { padding: var(--sp-3); }
    .auth-fit .auth-title { font-size: 22px; }
    .auth-fit .auth-lead { margin-bottom: var(--sp-2); font-size: 14px; }
    .auth-fit .auth-note { margin-top: var(--sp-2); padding-top: var(--sp-2); font-size: 12px; line-height: 1.4; }
    .auth-fit .auth-help { margin-top: var(--sp-2); }
    .auth-fit .auth-version { margin-top: var(--sp-2); }
    .auth-fit .auth-legal { margin-top: var(--sp-2); }
}


/* ---------- 9. Print, and people who ask for less motion -------------------- */

@media print {
    .rail,
    .rail-scrim,
    .rail-tip,
    .ui-header,
    .ui-back,
    .skip-link { display: none !important; }
    .school-ui .admin-shell.has-rail .main,
    html[data-rail="pinned"] .school-ui .admin-shell.has-rail .main { margin-left: 0 !important; }
    .ui-page { max-width: none; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .school-ui *,
    .school-ui *::before,
    .school-ui *::after {
        transition-duration: .01ms !important;
        transition-delay: 0s !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
    .login-slides .login-slide { animation: none !important; }
}


/* ---------- 10. Workspace dashboards (admin_dashboard.html, admin_school_home.html) ----
   New, generic additions to the shared component family (.ui-*), plus page-composition
   classes prefixed .wd- so they cannot collide with anything in admin.css/app.css. Nothing
   existing above this line was changed. ---------------------------------------------- */

/* .ui-alert: a caution tone, and a variant that carries an action on the same line. */
.ui-alert--warning { background: var(--warning-bg); border-color: var(--warning-line); border-left-color: var(--warning); color: #5c3c00; }
.ui-alert--action { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }

/* .ui-panel: the one bordered container every dashboard block (a chart, a table, a list) sits in. */
.ui-panel { background: var(--surface-0); border: var(--border); border-radius: var(--radius-lg); }
.ui-panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-4) var(--sp-5); border-bottom: var(--border); }
.ui-panel__title { margin: 0 0 2px; font: 600 var(--fs-lg)/1.3 var(--font-ui); color: var(--ink); }
.ui-panel__desc { margin: 0; color: var(--ink-3); font-size: var(--fs-sm); }
.ui-panel__body { padding: var(--sp-5); }

/* .ui-table: a proper data table — hairline rows, a quiet header, tabular figures already global. */
.ui-table-wrap { overflow-x: auto; }
.ui-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.ui-table th { padding: var(--sp-2) var(--sp-5); border-bottom: 1px solid var(--line-strong); color: var(--ink-3); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; text-align: left; }
.ui-table td { padding: var(--sp-3) var(--sp-5); border-bottom: var(--border); color: var(--ink); vertical-align: middle; }
.ui-table tbody tr:last-child td { border-bottom: 0; }
@media (hover: hover) and (pointer: fine) {
    .ui-table tbody tr:hover td { background: var(--surface-1); }
}
.ui-table th.num, .ui-table td.num { text-align: right; }

/* A quiet state/status indicator: a dot and a word, never a filled pill. */
.ui-status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 600; }
.ui-status::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ui-status--on { color: var(--success); }
.ui-status--off { color: var(--ink-3); }

/* A centred empty state for a panel that has nothing to show yet. */
.ui-empty { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); padding: var(--sp-7) var(--sp-5); color: var(--ink-3); text-align: center; }
.ui-empty .ico { width: 30px; height: 30px; color: var(--line-strong); }
.ui-empty p { margin: 0; max-width: 46ch; }

/* Score-tone text, shared by the two performance charts and the ranking list. */
.tone-good { color: var(--success); }
.tone-fair { color: var(--warning); }
.tone-poor { color: var(--danger); }

/* -- Page header: a title, a one-line brief, and the page's primary actions. -- */
.wd-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-5); flex-wrap: wrap; margin: 0 0 var(--sp-6); }
.wd-head__title { margin: 0 0 var(--sp-1); font: 500 var(--fs-3xl)/1.2 var(--font-display); color: var(--ink); }
.wd-head__lead { margin: 0; max-width: 62ch; color: var(--ink-2); }
.wd-head__actions { display: flex; gap: var(--sp-3); flex: none; flex-wrap: wrap; }

/* -- A named section further down the page: a heading, a brief, and one action. -- */
.wd-section { margin: 0 0 var(--sp-7); }
.wd-section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); margin: 0 0 var(--sp-4); flex-wrap: wrap; }
.wd-section__title { margin: 0 0 2px; font: 500 var(--fs-2xl)/1.3 var(--font-display); color: var(--ink); }
.wd-section__desc { margin: 0; color: var(--ink-3); font-size: var(--fs-sm); }
.wd-section__action { display: inline-flex; align-items: center; gap: var(--sp-1); }

/* -- The stat hierarchy: one headline figure in the school's colour, plus quieter supporting figures. -- */
.wd-stat-hero { display: flex; gap: var(--sp-5); align-items: stretch; flex-wrap: wrap; margin: 0 0 var(--sp-5); }
.wd-stat-hero__primary { display: flex; flex-direction: column; justify-content: center; gap: 6px; flex: 1 1 240px; min-width: 220px; padding: var(--sp-5); border: var(--border); border-radius: var(--radius-lg); background: var(--brand); color: #fff; }
.wd-stat-hero__icon { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: var(--sp-2); border-radius: var(--radius); background: rgba(255, 255, 255, .16); color: #fff; }
.wd-stat-hero__value { font: 700 var(--fs-4xl)/1 var(--font-ui); font-variant-numeric: tabular-nums; }
.wd-stat-hero__label { font-size: var(--fs-md); font-weight: 600; opacity: .94; }
.wd-stat-hero__note { font-size: var(--fs-sm); opacity: .82; }
.wd-stat-hero__secondary { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px; flex: 2 1 420px; background: var(--line); border: var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.wd-stat-chip { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-4); background: var(--surface-0); }
.wd-stat-chip__icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--radius); background: var(--brand-tint); color: var(--brand); }
.wd-stat-chip__value { font: 700 var(--fs-2xl)/1 var(--font-ui); color: var(--ink); font-variant-numeric: tabular-nums; }
.wd-stat-chip__label { font-size: var(--fs-sm); color: var(--ink-3); }

/* -- Who is online: one quiet strip, not three duplicate cards. -- */
a.wd-online { display: flex; align-items: center; margin: 0 0 var(--sp-6); border: var(--border); border-radius: var(--radius-lg); background: var(--surface-0); color: inherit; text-decoration: none; overflow: hidden; }
a.wd-online:hover { background: var(--surface-1); }
.wd-online__label { display: flex; align-items: center; gap: var(--sp-2); flex: none; padding: var(--sp-3) var(--sp-4); color: var(--ink-2); font-size: var(--fs-sm); font-weight: 600; border-right: var(--border); }
.wd-online__label .ico { color: var(--ink-3); }
.wd-online__items { display: flex; flex: 1; flex-wrap: wrap; }
.wd-online__item { display: flex; align-items: baseline; gap: var(--sp-2); flex: 1 1 140px; padding: var(--sp-3) var(--sp-4); }
.wd-online__item + .wd-online__item { border-left: var(--border); }
.wd-online__item strong { font: 600 var(--fs-xl)/1 var(--font-ui); color: var(--ink); font-variant-numeric: tabular-nums; }
.wd-online__item span { color: var(--ink-3); font-size: var(--fs-sm); }

/* -- The two performance charts: a labelled row, a track with a 50% reference tick, a fill. -- */
.wd-perf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
@media (max-width: 900px) { .wd-perf-grid { grid-template-columns: 1fr; } }
.wd-perf-legend { display: flex; gap: var(--sp-4); flex-wrap: wrap; color: var(--ink-3); font-size: 12px; }
.wd-perf-legend__dot { display: inline-block; width: 8px; height: 8px; margin-right: 4px; border-radius: 50%; vertical-align: middle; }
.wd-perf-legend__dot--good { background: var(--success); }
.wd-perf-legend__dot--fair { background: var(--warning); }
.wd-perf-legend__dot--poor { background: var(--danger); }
.wd-perf-rows { display: flex; flex-direction: column; gap: var(--sp-4); }
.wd-perf-row__top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); margin: 0 0 6px; }
.wd-perf-row__name { font-weight: 600; color: var(--ink); font-size: var(--fs-sm); }
.wd-perf-row__value { font: 600 var(--fs-md)/1 var(--font-ui); color: var(--ink); font-variant-numeric: tabular-nums; }
.wd-perf-row--empty .wd-perf-row__value { color: var(--ink-3); font-weight: 500; }
.wd-perf-row__meta { margin: 6px 0 0; color: var(--ink-3); font-size: 12px; }
.wd-perf-track { position: relative; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.wd-perf-track::after { content: ""; position: absolute; top: -2px; bottom: -2px; left: 50%; width: 1px; background: var(--line-strong); }
.wd-perf-fill { height: 100%; border-radius: 4px; }
.wd-perf-fill--good { background: var(--success); }
.wd-perf-fill--fair { background: var(--warning); }
.wd-perf-fill--poor { background: var(--danger); }
.wd-perf-fill--empty { background: transparent; }

/* -- Leading candidates: a ranked list, not a grid of identical cards. -- */
.wd-rank-list { list-style: none; margin: 0; padding: 0; }
.wd-rank-row { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-3) var(--sp-5); }
.wd-rank-row + .wd-rank-row { border-top: var(--border); }
.wd-rank-pos { display: grid; flex: none; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); font: 600 12px/1 var(--font-ui); font-variant-numeric: tabular-nums; }
.wd-rank-row--1 .wd-rank-pos { background: var(--brand); color: #fff; }
.wd-rank-avatar { display: grid; flex: none; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); font: 600 13px/1 var(--font-ui); overflow: hidden; }
.wd-rank-avatar img { width: 100%; height: 100%; object-fit: cover; }
.wd-rank-main { flex: 1; min-width: 0; }
.wd-rank-name { display: block; overflow: hidden; color: var(--ink); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.wd-rank-meta { display: block; overflow: hidden; color: var(--ink-3); font-size: var(--fs-sm); text-overflow: ellipsis; white-space: nowrap; }
.wd-rank-score { flex: none; text-align: right; }
.wd-rank-score strong { display: block; font: 600 var(--fs-lg)/1.2 var(--font-ui); font-variant-numeric: tabular-nums; }
.wd-rank-score small { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }

/* -- Setup checklist: the four things a brand-new school does before it can really run. -- */
.wd-setup { margin: 0 0 var(--sp-6); padding: var(--sp-5); border: var(--border); border-radius: var(--radius-lg); background: var(--surface-0); }
.wd-setup__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; margin: 0 0 var(--sp-4); }
.wd-setup__title { margin: 0 0 4px; font: 600 var(--fs-xl)/1.3 var(--font-ui); color: var(--ink); }
.wd-setup__lead { margin: 0; max-width: 56ch; color: var(--ink-3); font-size: var(--fs-sm); }
.wd-setup__progress { position: relative; flex: none; width: 52px; height: 52px; display: grid; place-items: center; }
.wd-setup__ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.wd-setup__ring-track { fill: none; stroke: var(--line); stroke-width: 4; }
.wd-setup__ring-fill { fill: none; stroke: var(--brand); stroke-width: 4; stroke-linecap: round; transition: stroke-dasharray var(--dur) var(--ease); }
.wd-setup__progress-text { position: absolute; font: 700 var(--fs-xs)/1 var(--font-ui); color: var(--ink); font-variant-numeric: tabular-nums; }
.wd-setup__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.wd-setup__step { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-3) var(--sp-2); border-radius: var(--radius); }
.wd-setup__step + .wd-setup__step { border-top: var(--border); }
.wd-setup__step-num {
    display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%;
    background: var(--surface-1); color: var(--ink-3); font: 700 var(--fs-sm)/1 var(--font-ui);
}
.wd-setup__step.is-done .wd-setup__step-num { background: var(--success-bg); color: var(--success); }
.wd-setup__step.is-done .wd-setup__step-num .ico { width: 15px; height: 15px; }
.wd-setup__group { list-style: none; margin: 14px 0 2px; padding: 0 2px; font-size: var(--fs-xs, 11px); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.wd-setup__group:first-child { margin-top: 0; }
.wd-setup__tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--line, #e5e9f0); color: var(--ink-3); font-size: 10.5px; font-weight: 700; vertical-align: middle; }
.wd-setup__warn { margin: 6px 0 0; padding: 6px 10px; border-radius: 8px; background: #fff6e0; border: 1px solid #f1dfb6; color: #8a5a00; font-size: var(--fs-sm); }
.wd-setup__step-body { flex: 1; min-width: 0; }
.wd-setup__step-body strong { display: block; color: var(--ink); font-size: var(--fs-md); }
.wd-setup__step.is-done .wd-setup__step-body strong { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.wd-setup__step-body p { margin: 2px 0 0; color: var(--ink-3); font-size: var(--fs-sm); line-height: 1.45; }
.wd-setup__step-go { flex: none; }
.wd-setup__step-done { flex: none; color: var(--success); font-size: var(--fs-sm); font-weight: 600; }
.wd-setup__dismiss, .wd-setup__reshow { margin: var(--sp-4) 0 0; }
.wd-setup__reshow { margin: 0 0 var(--sp-6); }
.wd-setup__dismiss button, .wd-setup__reshow button {
    border: 0; background: none; padding: 0; color: var(--ink-3); font-size: var(--fs-sm); text-decoration: underline;
    text-underline-offset: 3px; cursor: pointer;
}
.wd-setup__dismiss button:hover, .wd-setup__reshow button:hover { color: var(--ink); }
@media (max-width: 640px) {
    .wd-setup__step { flex-wrap: wrap; }
    .wd-setup__step-go { margin-left: 44px; }
}

/* -- Module groups: real information architecture instead of one flat grid. -- */
.wd-module-groups { display: flex; flex-direction: column; gap: var(--sp-6); margin: 0 0 var(--sp-6); }
.wd-module-group__label { margin: 0 0 var(--sp-3); color: var(--ink-3); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.wd-module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-4); margin: 0; padding: 0; list-style: none; }
.wd-module-card { display: flex; flex-direction: column; height: 100%; padding: var(--sp-4); border: var(--border); border-radius: var(--radius-lg); background: var(--surface-0); color: var(--ink); text-decoration: none; }
.wd-module-card__ico { display: grid; place-items: center; width: 34px; height: 34px; margin: 0 0 var(--sp-3); border-radius: var(--radius); background: var(--brand-tint); color: var(--brand); }
.wd-module-card__title { margin: 0 0 6px; font: 600 var(--fs-md)/1.3 var(--font-ui); color: var(--ink); }
.wd-module-card__text { margin: 0 0 var(--sp-3); color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.5; flex: 1; }
.wd-module-card__go { display: inline-flex; align-items: center; gap: var(--sp-1); margin-top: auto; color: var(--brand-accent); font-size: var(--fs-sm); font-weight: 600; }
.wd-module-card__go .ico { transition: transform var(--dur) var(--ease); }
.wd-module-card:hover { border-color: var(--brand); }
.wd-module-card:hover .wd-module-card__go .ico { transform: translateX(3px); }
.wd-module-card:focus-visible { outline: var(--focus-ring); outline-offset: 3px; }

@media (max-width: 720px) {
    .wd-head__title { font-size: 26px; }
    .wd-section__title { font-size: var(--fs-xl); }
    .wd-stat-hero__value { font-size: var(--fs-3xl); }
}

/* -- The staff guide (/admin/guide): a reading layout of its own, in the school's own colours,
   inside the ordinary admin shell — not the platform's own /docs, which is styled separately and
   for a different audience entirely. -- */
.guide-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr) 200px; gap: var(--sp-6); align-items: start; }
.guide-nav { position: sticky; top: var(--sp-4); display: flex; flex-direction: column; gap: 2px; }
.guide-search { margin-bottom: var(--sp-4); }
.guide-search input {
    width: 100%; padding: 8px 12px; border: var(--border); border-radius: var(--radius); background: var(--surface-0);
    font: inherit; color: var(--ink);
}
.guide-search input:focus-visible { outline: var(--focus-ring); outline-offset: 1px; }
.guide-nav-group { margin: var(--sp-4) 0 var(--sp-1); font-size: var(--fs-xs); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.guide-nav-group:first-child { margin-top: 0; }
.guide-nav a { display: block; padding: 6px 10px; border-radius: var(--radius); color: var(--ink-2); text-decoration: none; font-size: var(--fs-sm); }
.guide-nav a:hover { background: var(--surface-2); }
.guide-nav a[aria-current="page"] { background: var(--brand); color: #fff; font-weight: 600; }
.guide-main { min-width: 0; }
.guide-article { max-width: 760px; }
.guide-crumb { margin: 0 0 var(--sp-1); font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.guide-article h1 { margin: 0 0 var(--sp-2); font-size: var(--fs-3xl); font-family: var(--font-display); }
.guide-lede { margin: 0 0 var(--sp-6); font-size: var(--fs-lg); color: var(--ink-2); }
.guide-article h2 { margin: var(--sp-7) 0 var(--sp-3); padding-top: var(--sp-3); font-size: var(--fs-xl); border-top: var(--border); }
.guide-article h2:first-of-type { margin-top: var(--sp-4); padding-top: 0; border-top: 0; }
.guide-article h3 { margin: var(--sp-5) 0 var(--sp-2); font-size: var(--fs-lg); }
.guide-article p, .guide-article li { line-height: 1.65; color: var(--ink); }
.guide-article ul, .guide-article ol { padding-left: 1.3em; margin: 0 0 var(--sp-4); }
.guide-article li { margin: var(--sp-1) 0; }
.guide-article code { background: var(--brand-tint); padding: 1px 5px; border-radius: var(--radius-sm); font-size: .92em; }
.guide-article table { width: 100%; border-collapse: collapse; margin: var(--sp-4) 0; font-size: var(--fs-sm); }
.guide-article th, .guide-article td { text-align: left; padding: 8px 10px; border-bottom: var(--border); vertical-align: top; }
.guide-article th { font-size: var(--fs-xs); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.guide-note, .guide-tip, .guide-warn {
    margin: var(--sp-4) 0; padding: 12px 16px; border-left: 4px solid var(--brand-accent);
    background: var(--brand-tint); border-radius: 0 var(--radius) var(--radius) 0;
}
.guide-tip { border-color: var(--success); background: var(--success-bg); }
.guide-warn { border-color: var(--warning); background: var(--warning-bg); }
/* Troubleshooting: a problem as the reader would put it, then what to do. */
.guide-faq { margin: var(--sp-3) 0 var(--sp-5); border: var(--border); border-radius: var(--radius); overflow: hidden; }
.guide-faq dt { padding: 12px 16px 2px; font-weight: 600; color: var(--ink); line-height: 1.45; }
.guide-faq dd { margin: 0; padding: 0 16px 12px; color: var(--ink-2); line-height: 1.6; }
.guide-faq dd + dt { border-top: var(--border); }
.guide-shot { margin: var(--sp-4) 0 var(--sp-5); }
.guide-shot a { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-1);
    box-shadow: 0 8px 24px color-mix(in srgb, var(--ink) 9%, transparent); transition: box-shadow .15s ease, transform .15s ease; }
.guide-shot a:hover { box-shadow: 0 12px 30px color-mix(in srgb, var(--ink) 14%, transparent); transform: translateY(-1px); }
.guide-shot img { display: block; width: 100%; height: auto; }
.guide-shot figcaption { margin-top: var(--sp-2); font-size: var(--fs-sm); line-height: 1.45; color: var(--ink-3); }
.guide-shot figcaption::before { content: "▲ "; color: var(--brand-accent); font-size: 10px; }
.guide-note > :first-child, .guide-tip > :first-child, .guide-warn > :first-child { margin-top: 0; }
.guide-note > :last-child, .guide-tip > :last-child, .guide-warn > :last-child { margin-bottom: 0; }
.guide-pager { display: flex; justify-content: space-between; gap: var(--sp-4); margin-top: var(--sp-7); padding-top: var(--sp-4); border-top: var(--border); }
.guide-pager a { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); font-weight: 600; max-width: 45%; }
.guide-pager a.next { text-align: right; margin-left: auto; }
.guide-pager small { color: var(--ink-3); font-weight: 400; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; }
.guide-toc { position: sticky; top: var(--sp-4); display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-sm); }
.guide-toc-title { font-size: var(--fs-xs); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin-bottom: var(--sp-1); }
.guide-toc a { color: var(--ink-2); text-decoration: none; padding: 3px 0; }
.guide-toc a.sub { padding-left: var(--sp-3); font-size: .92em; }
.guide-toc a:hover { color: var(--brand); }
.guide-results { list-style: none; margin: 0; padding: 0; }
.guide-results li { padding: var(--sp-3) 0; border-top: var(--border); }
.guide-results li:first-child { border-top: 0; }
.guide-results a { font-weight: 600; text-decoration: none; color: var(--brand); }
.guide-results small { display: block; color: var(--ink-3); margin: 2px 0 4px; }
.guide-results p { margin: 0; color: var(--ink-2); font-size: var(--fs-sm); }
@media (max-width: 960px) {
    .guide-shell { grid-template-columns: 1fr; }
    .guide-nav, .guide-toc { position: static; }
}


/* ---------- 4c. Loading in place (static/inplace.js) ------------------------------------------
   Every page that loads in place shows the same thing while the next view is on its way: the current view stays,
   dimmed, under a spinner in the school's accent; a pop-up does the same inside itself; the button that was pressed
   spins until the answer arrives. Kept here, with the shell, so it shows on every page whatever else it loads. */
@keyframes ui-spin { to { transform: rotate(360deg); } }
[data-page-body] { position: relative; }
[data-page-body] > * { transition: opacity .12s ease; }
[data-page-body].is-loading { pointer-events: none; }
[data-page-body].is-loading > * { opacity: .55; }
[data-page-body].is-loading::after,
.ac-modal__body.is-loading::after {
    content: "";
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 60;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border: 3px solid color-mix(in srgb, var(--brand-accent) 18%, var(--surface-0));
    border-top-color: var(--brand-accent);
    border-radius: 50%;
    animation: ui-spin .7s linear infinite;
}
.ac-modal__body.is-loading { pointer-events: none; }
.ac-modal__body.is-loading > * { opacity: .6; }
.ac-modal__body.is-loading::after { position: absolute; top: 50%; }
/* A sign-in page (templates/auth_base.html): the spinner sits in the middle of the form column, not on the seam between
   the school's side and the form. */
.auth [data-page-body].is-loading::after { position: absolute; }
/* ...and only when no button is spinning already: a pressed Sign In shows its own, beside the words it is about. */
.auth [data-page-body].is-loading:has(.is-busy)::after { content: none; }
.ac-modal__wait { width: 26px; height: 26px; margin: 40px auto; border: 3px solid color-mix(in srgb, var(--brand-accent) 18%, var(--surface-0)); border-top-color: var(--brand-accent); border-radius: 50%; animation: ui-spin .7s linear infinite; }
[data-inplace-busy].is-busy { pointer-events: none; opacity: .85; }
[data-inplace-busy].is-busy::before { content: ""; display: inline-block; width: 11px; height: 11px; margin-right: 6px; vertical-align: -1px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ui-spin .7s linear infinite; }
@media (prefers-reduced-motion: reduce) { [data-page-body].is-loading::after, .ac-modal__body.is-loading::after, .ac-modal__wait, [data-inplace-busy].is-busy::before { animation-duration: 2s; } }

/* A pop-up opened on top of another sits a little lower and narrower, so the one beneath stays in view. */
dialog.ac-modal ~ dialog.ac-modal { margin-top: 7vh; max-height: calc(100vh - 7vh - 24px); }
dialog.ac-modal ~ dialog.ac-modal[data-size="wide"] { width: min(1040px, calc(100vw - 88px)); }
dialog.ac-modal ~ dialog.ac-modal::backdrop { background: color-mix(in srgb, var(--brand) 22%, transparent); }
/* (More specific than .auth-fit .auth-version, which centres it in the form column.) */
.auth .auth-plate .auth-plate__extra .auth-version { margin: var(--sp-2) 0 0; text-align: left; font-size: 11.5px; color: color-mix(in srgb, #fff 80%, transparent); }

/* ---------- Compact staff portal ------------------------------------------
   The staff portal (admin_base.html, .admin-shell) a step smaller: type, icons, the header and the side menu, so
   more of a page fits and it reads clean. The sizes are redefined on .admin-shell only, so the sign-in pages and
   the parent and student portals, which share this file, keep theirs. */
.school-ui .admin-shell {
    --fs-xs: 10.5px;
    --fs-sm: 12px;
    --fs-md: 13.5px;
    --fs-lg: 15.5px;
    --fs-xl: 18px;
    --fs-2xl: 21px;
    --fs-3xl: 26px;
    --fs-4xl: 34px;
    --header-h: 48px;
    font-size: var(--fs-md);
}
.admin-shell .ico { width: 19px; height: 19px; }
.admin-shell .ico-sm { width: 16px; height: 16px; }
.admin-shell .ico-lg { width: 22px; height: 22px; }

/* The header: the school name, Guide and Messages, notifications, the account and Help. */
.admin-shell .ui-header { gap: var(--sp-3); padding: 0 var(--sp-5); }
.admin-shell .ui-header-actions { gap: 6px; }
.admin-shell .ui-crumbs ol { font-size: 12.5px; }
.admin-shell .ui-toplinks { gap: 8px; font-size: 12px; }
.admin-shell .ui-toplinks__count { font-size: 10px; line-height: 16px; padding: 0 5px; }
.admin-shell .ui-iconbtn { width: 34px; height: 34px; }
.admin-shell .ui-header .ui-iconbtn .ico { width: 17px; height: 17px; }
.admin-shell .ui-count { top: 1px; right: -2px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; line-height: 16px; }
.admin-shell .ui-account__btn { height: 34px; gap: 6px; padding: 0 10px 0 3px; border-radius: 8px; font-size: 12px; }
.admin-shell .ui-account__ava { width: 26px; height: 26px; border-radius: 6px; font-size: 11px; }
.admin-shell .ui-account__menu a { padding: 7px 10px; font-size: 12px; }

/* The side menu. */
.admin-shell .rail-link { min-height: 31px; font-size: 12.5px; }
.admin-shell .rail-ico { height: 31px; }
.admin-shell .rail-list--foot .rail-link { min-height: 30px; font-size: 12px; }
.admin-shell .rail-list--foot .rail-ico { height: 30px; }
.admin-shell .rail-brand__sub { font-size: 11px; }
.admin-shell .rail-person__name { font-size: 13px; }
.admin-shell .rail-person__role { font-size: 11px; }

/* Buttons, fields and tables of the shared components. */
.admin-shell .ui-btn { min-height: 38px; padding: 0 var(--sp-4); }
.admin-shell .ui-btn--sm { min-height: 30px; padding: 0 var(--sp-3); }
.admin-shell .ui-input { min-height: 38px; }
.admin-shell .ui-table th { font-size: 10.5px; }

/* ---------- Sign-in form ---------------------------------------------------
   The form side of the sign-in and password pages (auth_base.html), in the platform console's sign-in style: Inter,
   with Outfit for a large heading; the school's logo above it on the left; messages as cards with a coloured edge;
   roomy rounded fields; one full-width button in the school's own colour. The school's side (photographs, name,
   contact details) is untouched. */
.auth .auth-main { font-family: "Inter", var(--font-ui); background: #fff; }
.auth .auth-main .auth-card { max-width: 420px; }
.auth .auth-main .auth-card__mark { justify-content: flex-start; margin: 0 0 28px; }
.auth .auth-main .auth-card__mark .school-mark { width: 52px; height: 52px; }
.auth .auth-main .auth-card__mark .school-mark--logo { border-color: #EAECF0; border-radius: 12px; }
.auth .auth-main .auth-card__mark .school-mark--mono { border-radius: 12px; font: 600 22px/1 "Outfit", var(--font-ui); }
.auth .auth-main .auth-card > .auth-title {
    margin: 0 0 8px; text-align: left; color: #0F1A2B;
    font: 600 40px/1.08 "Outfit", var(--font-display); letter-spacing: -.035em;
}
.auth .auth-main .auth-card > .auth-lead { margin: 0 0 28px; text-align: left; color: #667085; font-size: 16.5px; line-height: 1.5; }
.auth .auth-main .ui-alert {
    margin: 0 0 20px; padding: 14px 16px; border-radius: 12px; border-left-width: 4px;
    font-size: 14.5px; line-height: 1.5; box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
}
.auth .auth-main .ui-field { margin: 0 0 20px; }
.auth .auth-main .ui-field label { margin: 0 0 8px; color: #344054; font: 600 14.5px/1.3 "Inter", var(--font-ui); }
.auth .auth-main .auth-label-hint { margin-left: 6px; color: #98A2B3; font-size: 12.5px; font-weight: 400; }
.auth .auth-main .ui-input {
    min-height: 52px; padding: 0 16px; border: 1px solid #D0D5DD; border-radius: 12px; background: #fff;
    font: 400 16px/1.4 "Inter", var(--font-ui); color: #0F1A2B;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .05); transition: border-color .15s, box-shadow .15s;
}
.auth .auth-main .ui-input::placeholder { color: #98A2B3; }
.auth .auth-main .ui-input:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent);
}
.auth .auth-main .ui-btn { min-height: 52px; border-radius: 12px; font: 600 16px/1.2 "Inter", var(--font-ui); }
.auth .auth-main .ui-btn--primary { box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 4px 12px color-mix(in srgb, var(--brand) 22%, transparent); }
.auth .auth-main .ui-btn--primary:hover { background: var(--brand-dark); }
.auth .auth-main .auth-submit { justify-content: space-between; min-height: 54px; margin-top: 8px; padding: 0 22px; font-size: 16.5px; }
.auth .auth-main .auth-submit .ico { width: 20px; height: 20px; }
.auth .auth-main .auth-foot-note {
    margin: 28px 0 0; padding: 22px 0 0; border-top: 1px solid #EAECF0;
    color: #667085; font-size: 14px; line-height: 1.6;
}
.auth .auth-main .auth-foot-note p { margin: 0 0 6px; }
.auth .auth-main .auth-foot-note p:last-child { margin: 0; }
.auth .auth-main .auth-foot-note .ui-link { color: var(--brand-dark); font-weight: 600; }
.auth .auth-main .auth-note { margin: 28px 0 0; padding: 22px 0 0; border-top-color: #EAECF0; color: #667085; font-size: 14px; }
.auth .auth-main .auth-back { font-size: 14px; color: #475467; }

/* Shorter screens: the sign-in page must still fit without scrolling. */
@media (min-width: 901px) and (max-height: 820px) {
    .auth .auth-main .auth-card__mark { margin-bottom: 18px; }
    .auth .auth-main .auth-card__mark .school-mark { width: 44px; height: 44px; }
    .auth .auth-main .auth-card > .auth-title { font-size: 34px; }
    .auth .auth-main .auth-card > .auth-lead { margin-bottom: 20px; }
    .auth .auth-main .ui-field { margin-bottom: 14px; }
    .auth .auth-main .ui-input { min-height: 46px; }
    .auth .auth-main .auth-submit { min-height: 48px; }
    .auth .auth-main .auth-foot-note { margin-top: 18px; padding-top: 14px; }
}
@media (max-width: 900px) {
    .auth .auth-main .auth-card > .auth-title { font-size: 30px; }
    .auth .auth-main .auth-card > .auth-lead { margin-bottom: 18px; font-size: 15px; }
    .auth .auth-main .ui-field { margin-bottom: 14px; }
    .auth .auth-main .ui-input { min-height: 48px; }
    .auth .auth-main .auth-submit { min-height: 50px; }
    .auth .auth-main .auth-foot-note { margin-top: 18px; padding-top: 14px; font-size: 13.5px; }
}
@media (max-width: 900px) and (max-height: 700px) {
    .auth .auth-main .auth-card > .auth-title { font-size: 26px; }
    .auth .auth-main .auth-card > .auth-lead { margin-bottom: 12px; }
    .auth .auth-main .ui-field { margin-bottom: 10px; }
    .auth .auth-main .ui-input { min-height: 44px; }
    .auth .auth-main .auth-submit { min-height: 46px; }
}

/* Sign-in form, sized to the platform console's own sign-in (static/platform.css, .auth-form): a 380px column,
   a 32px heading, 14.5px fields 44px tall and a 46px button, so the form sits compact in the middle of its side
   rather than stretching across it. */
.auth .auth-main .auth-card { max-width: 380px; }
.auth .auth-main .auth-card__mark { margin-bottom: 22px; }
.auth .auth-main .auth-card__mark .school-mark { width: 44px; height: 44px; }
.auth .auth-main .auth-card > .auth-title { margin-bottom: 6px; font-size: 32px; letter-spacing: -.03em; }
.auth .auth-main .auth-card > .auth-lead { margin-bottom: 24px; font-size: 15px; }
.auth .auth-main .ui-alert { margin-bottom: 16px; padding: 11px 14px; border-radius: 10px; font-size: 13.5px; }
.auth .auth-main .ui-field { margin-bottom: 16px; }
.auth .auth-main .ui-field label { margin-bottom: 6px; font-size: 13.5px; }
.auth .auth-main .auth-label-hint { font-size: 12px; }
.auth .auth-main .ui-input { min-height: 44px; padding: 0 13px; border-radius: 9px; font-size: 14.5px; }
.auth .auth-main .ui-btn { min-height: 46px; border-radius: 10px; font-size: 15px; }
.auth .auth-main .auth-submit { min-height: 46px; margin-top: 6px; padding: 0 18px; font-size: 15px; }
.auth .auth-main .auth-submit .ico { width: 18px; height: 18px; }
.auth .auth-main .auth-foot-note { margin-top: 24px; padding-top: 18px; font-size: 13px; }
.auth .auth-main .auth-note { margin-top: 24px; padding-top: 18px; font-size: 13px; }
.auth .auth-main .auth-back { font-size: 13px; }
@media (min-width: 901px) and (max-height: 820px) {
    .auth .auth-main .auth-card > .auth-title { font-size: 28px; }
    .auth .auth-main .auth-card > .auth-lead { margin-bottom: 18px; }
    .auth .auth-main .ui-field { margin-bottom: 12px; }
    .auth .auth-main .ui-input { min-height: 40px; }
    .auth .auth-main .auth-submit { min-height: 42px; }
    .auth .auth-main .auth-foot-note { margin-top: 16px; padding-top: 12px; }
}
@media (max-width: 900px) {
    .auth .auth-main .auth-card > .auth-title { font-size: 26px; }
    .auth .auth-main .auth-card > .auth-lead { font-size: 14px; }
    .auth .auth-main .ui-input { min-height: 42px; }
    .auth .auth-main .auth-submit { min-height: 44px; }
}
@media (max-width: 900px) and (max-height: 700px) {
    .auth .auth-main .auth-card > .auth-title { font-size: 23px; }
    .auth .auth-main .ui-input { min-height: 40px; }
    .auth .auth-main .auth-submit { min-height: 42px; }
}

/* ---------- Sign-in page ----------------------------------------------------
   The sign-in and password pages (auth_base.html), in two calm halves. The school's side: its photographs filling its
   whole half, with its name and motto low on the left over a soft shade; without photographs,
   its own colour with its logo. The form's side: the school's logo and name at the top, a small, compact form in the
   middle, and the small print at the foot. The school's colour is used only where it does a job: the button, the
   links and the field being typed in. Type is small and quiet: Inter, with Outfit for the one heading. */
.si { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(400px, 1fr); min-height: 100vh; background: #fff; }
.auth-fit .si { height: 100vh; height: 100dvh; min-height: 0; }

.si-media {
    position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 0;
    overflow: hidden; background: var(--brand); color: #fff;
}
.si-media .login-slides { position: absolute; inset: 0; z-index: 0; }
.si--photos .si-media::after {
    content: ""; position: absolute; inset: auto 0 0 0; z-index: 1; height: 46%; pointer-events: none;
    background: linear-gradient(to top, rgba(8, 12, 18, .62), rgba(8, 12, 18, 0));
}
.si-caption { position: relative; display: flex; align-items: center; gap: 14px; z-index: 2; max-width: 36rem; padding: 34px 38px; }
.si-caption__name { margin: 0; font: 500 28px/1.15 var(--font-display); letter-spacing: -.01em; overflow-wrap: anywhere; }
.si-caption__motto { margin: 6px 0 0; color: rgba(255, 255, 255, .85); font: 400 13.5px/1.5 "Inter", var(--font-ui); }
.si-caption .school-mark { flex: none; width: 52px; height: 52px; border-radius: 12px; background: #fff; box-shadow: 0 2px 8px rgba(8, 12, 18, .18); }
.si-caption .school-mark--logo { padding: 5px; object-fit: contain; }
.si-caption .school-mark--mono { display: grid; place-items: center; color: var(--brand); font: 600 19px/1 "Outfit", var(--font-ui); }
.si-caption__text { min-width: 0; }

.si-side { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 26px 48px 20px; font-family: "Inter", var(--font-ui); }
.si-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.si-brand .school-mark { flex: none; width: 30px; height: 30px; }
.si-brand .school-mark--logo { padding: 2px; border: 1px solid #EAECF0; border-radius: 8px; background: #fff; object-fit: contain; }
.si-brand .school-mark--mono { display: grid; place-items: center; border-radius: 8px; background: var(--brand); color: #fff; font: 600 12px/1 "Outfit", var(--font-ui); }
.si-brand__name { overflow: hidden; color: #101828; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }

.si .si-main { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px 0; background: none; overflow: visible; }
.si .si-main .auth-card { width: 100%; max-width: 340px; }
.si .si-main .auth-card > .auth-title { margin: 0 0 4px; text-align: left; color: #0F1A2B; font: 600 26px/1.15 "Outfit", var(--font-ui); letter-spacing: -.025em; }
.si .si-main .auth-card > .auth-lead { margin: 0 0 22px; text-align: left; color: #667085; font-size: 13.5px; line-height: 1.5; }
.si .si-main .ui-alert { margin: 0 0 14px; padding: 9px 12px; border-radius: 9px; font-size: 12.5px; }
.si .si-main .ui-field { margin: 0 0 14px; }
.si .si-main .ui-field label { margin: 0 0 5px; color: #344054; font: 600 12.5px/1.3 "Inter", var(--font-ui); }
.si .si-main .auth-label-hint { margin-left: 5px; color: #98A2B3; font-size: 11.5px; font-weight: 400; }
.si .si-main .ui-input { min-height: 40px; padding: 0 12px; border: 1px solid #D0D5DD; border-radius: 8px; font: 400 13.5px/1.4 "Inter", var(--font-ui); box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.si .si-main .ui-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent); }
.si .si-main .ui-btn { min-height: 42px; border-radius: 8px; font: 600 13.5px/1.2 "Inter", var(--font-ui); }
.si .si-main .ui-btn--primary { box-shadow: 0 1px 2px rgba(16, 24, 40, .08); }
.si .si-main .auth-submit { justify-content: space-between; min-height: 42px; margin-top: 4px; padding: 0 16px; font-size: 13.5px; }
.si .si-main .auth-submit .ico { width: 16px; height: 16px; }
.si .si-main .auth-foot-note { margin: 22px 0 0; padding: 16px 0 0; border-top: 1px solid #EAECF0; color: #667085; font-size: 12px; line-height: 1.55; }
.si .si-main .auth-foot-note p { margin: 0 0 4px; }
.si .si-main .auth-foot-note p:last-child { margin: 0; }
.si .si-main .auth-foot-note .ui-link { color: var(--brand-dark); font-weight: 600; }
.si .si-main .auth-note { margin: 22px 0 0; padding: 16px 0 0; color: #667085; font-size: 12px; }
.si .si-main .auth-back { margin: 0 0 18px; color: #475467; font-size: 12.5px; }
.si .si-main .auth-help { margin-top: 16px; font-size: 12.5px; }
.si .pw-reveal__btn svg { width: 17px; height: 17px; }

.si-foot { color: #98A2B3; font-size: 11px; line-height: 1.6; }
.si-foot p { margin: 0; }
.si-foot__contact { margin-bottom: 2px !important; color: #667085; }
.si-foot a { color: inherit; text-decoration: underline; text-decoration-color: #D0D5DD; text-underline-offset: 2px; }
.si-foot a:hover { color: #344054; }

/* Shorter laptop screens: a little tighter, so the sign-in page still fits without scrolling. */
@media (min-width: 901px) and (max-height: 760px) {
    .si-side { padding: 20px 44px 16px; }
    .si-caption { padding: 26px 30px; }
    .si-caption__name { font-size: 24px; }
    .si .si-main .auth-card > .auth-lead { margin-bottom: 16px; }
    .si .si-main .ui-field { margin-bottom: 10px; }
    .si .si-main .ui-input { min-height: 38px; }
    .si .si-main .auth-submit { min-height: 40px; }
    .si .si-main .auth-foot-note { margin-top: 16px; padding-top: 12px; }
}

/* Phones and narrow windows: the school's side becomes a short banner above the form, and the page scrolls if it
   must rather than squeezing the form. */
@media (max-width: 900px) {
    .auth-fit { height: auto; overflow: visible; }
    .auth-fit .si { height: auto; min-height: 100vh; min-height: 100dvh; }
    .si { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
    .si-media { height: 160px; }
    .si:not(.si--photos) .si-media { height: 110px; }
    .si-caption { padding: 14px 18px; }
    .si-caption__name { font-size: 20px; }
    .si-caption__motto { font-size: 12px; }
    .si-caption { gap: 10px; }
    .si-caption .school-mark { width: 38px; height: 38px; border-radius: 9px; }
    .si-brand { display: none; }
    .si-side { padding: 8px 20px 16px; }
    .si .si-main { justify-content: flex-start; padding: 18px 0 22px; }
    .si .si-main .auth-card { max-width: 420px; }
    .si .si-main .auth-card > .auth-title { font-size: 23px; }
}
/* The logo row, the form and the small print share one centred column, so their left edges line up. */
.si-brand, .si-foot { width: 100%; max-width: 340px; margin-inline: auto; }

/* "This is my own device" (templates/includes/_offline_own_device.html), between the password and the Sign in button:
   a row in the form's own style, its title and a one-line hint on the left and a switch on the right. The switch is the
   real checkbox, drawn with its own background (a track, and a knob that is a radial gradient), so it stays a checkbox
   to the keyboard and to screen readers. The whole row is the label; the row takes a tint of the school's colour when
   the switch is on. */
.own-device {
    display: flex; align-items: center; gap: 14px; margin: 2px 0 16px; padding: 10px 12px;
    border: 1px solid #EAECF0; border-radius: 8px; background: #fcfcfd; cursor: pointer;
    transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.own-device[hidden] { display: none; }   /* offline.js shows it only where the browser can keep pages */
.own-device:hover { border-color: #D0D5DD; }
.own-device:has(.own-device__switch:checked) {
    border-color: color-mix(in srgb, var(--brand) 35%, #fff);
    background: color-mix(in srgb, var(--brand) 5%, #fff);
}
.own-device__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.own-device__title { color: #344054; font: 600 12.5px/1.3 "Inter", var(--font-ui); }
.own-device__hint { color: #667085; font: 400 11.5px/1.4 "Inter", var(--font-ui); }
.own-device__switch {
    flex: none; width: 36px; height: 20px; margin: 0; border: 0; border-radius: 999px; cursor: pointer;
    -webkit-appearance: none; appearance: none;
    background: radial-gradient(circle, #fff 7px, transparent 7.5px) no-repeat 2px 50% / 16px 16px, #D0D5DD;
    box-shadow: inset 0 1px 2px rgba(16, 24, 40, .12);
    transition: background-position var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.own-device__switch:checked { background-color: var(--brand); background-position: calc(100% - 2px) 50%; }
.own-device__switch:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
@media (min-width: 901px) and (max-height: 760px) {
    .own-device { margin-bottom: 12px; padding: 8px 12px; }
}

/* A NextFound Academics operator inside the school (templates/admin_base.html). */
.op-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 7px 16px; font-size: 13px;
  background: #fff4e5; color: #7a3e00; border-bottom: 1px solid #f3c58a; }
.op-banner--view { background: #eef4ff; color: #1d3f7a; border-bottom-color: #b9cdf3; }
.op-banner a { margin-left: auto; color: inherit; font-weight: 600; }

/* ==== The menu, in every portal (staff, parent, student): square, a little smaller, with the school's colour in it ====
   Section headings sit on a band of the school's colour with a bar on the edge; the page you are on is filled with the
   colour; the icons are tinted with it. What is inside the menu is made smaller (zoom), not the menu itself, so it keeps
   its width and nothing beside it moves. A phone keeps full size. */
.rail .rail-brand, .rail .rail-nav, .rail .rail-foot { zoom: .9; }
.rail, .rail *, .rail *::before, .rail *::after { border-radius: 0 !important; }
.rail { border-right: 1px solid color-mix(in srgb, var(--brand) 25%, var(--line, #e5e7eb)); }
.rail .rail-brand { border-bottom: 2px solid var(--brand); }
.rail .rail-section__label { color: var(--brand); }
.rail.is-open .rail-section__label,
html[data-rail="pinned"] .rail .rail-section__label {
  color: var(--brand); background: color-mix(in srgb, var(--brand) 11%, var(--surface-0, #fff));
  box-shadow: inset 3px 0 0 var(--brand); font-weight: 700; }
.rail .rail-section + .rail-section { border-top-color: color-mix(in srgb, var(--brand) 25%, var(--line-strong, #d0d5dd)); }
.rail .rail-ico { color: color-mix(in srgb, var(--brand) 70%, var(--ink-3, #667085)); }
.rail .rail-link.active { color: #fff; }
.rail .rail-link.active::before { background: var(--brand); opacity: 1; }
.rail .rail-link.active::after { display: none; }
.rail .rail-link.active .rail-ico { color: #fff; }
.rail .rail-link.active .rail-label { position: relative; }
.rail .rail-link.active .rail-ico, .rail .rail-link.active .rail-label { z-index: 1; }
@media (hover: hover) and (pointer: fine) {
  .rail .rail-link:not(.active):hover { background: color-mix(in srgb, var(--brand) 8%, var(--surface-0, #fff)); color: var(--brand-dark, var(--brand)); }
}

@media (max-width: 640px) { .rail .rail-brand, .rail .rail-nav, .rail .rail-foot { zoom: 1; } }
