/* Theme tokens. Light is the default (a visitor with no onaro-admin-theme cookie
   gets it); the dark block below overrides the values that change, and is keyed
   to the data-bs-theme attribute App.razor stamps on <html> from that cookie.

   Names are --admin-* prefixed on purpose: the Syncfusion theme sheet also declares
   custom properties on :root, and an unprefixed --border or --surface would be a
   silent collision the day Syncfusion adds one.

   Palette: the admin portal prototype (2026-10-17, ported from the banking a3-web
   admin-web-client): slate ink on a cool grey ground, teal brand, dark navbar. The
   names below predate it and were kept, so every rule that reads them moved with it;
   the newer tokens (nav, brand-soft, chips, radius, mono) are the prototype's own.
   Contrast: light brand #0e5d70 is 7.3:1 on white; dark brand #5cb8cc carries
   near-black #08202a labels (8.1:1), never white (2.3:1). */
:root {
    color-scheme: light;

    --admin-font: "Open Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
    --admin-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
    --admin-radius: 6px;

    --admin-page-bg: #f2f5f7;
    --admin-surface: #ffffff;
    --admin-surface-subtle: #f7f9fa;
    --admin-surface-hover: #f7f9fa;
    --admin-surface-overlay: rgba(255, 255, 255, 0.35);

    --admin-border: #dce3e8;
    --admin-border-subtle: #dce3e8;
    --admin-border-row: #dce3e8;
    --admin-shadow: rgba(16, 34, 43, 0.12);

    --admin-text: #16222b;
    --admin-text-muted: #5a6975;
    --admin-nav-icon: #5a6975;

    --admin-accent: #0e5d70;
    --admin-accent-hover: #0b4b5b;
    --admin-accent-contrast: #ffffff;
    --admin-accent-soft: #e3f0f3;
    --admin-link: #0e5d70;
    --admin-focus-ring: rgba(14, 93, 112, 0.4);

    --admin-nav-bg: #13313d;
    --admin-nav-ink: #c9dbe1;
    --admin-nav-active: #ffffff;

    --admin-avatar-bg: #e3f0f3;
    --admin-avatar-fg: #0e5d70;

    --admin-success: #1d7a4a;
    --admin-danger: #b02a2a;
    --admin-checkbox-border: #929292;

    --admin-good: #1d7a4a;
    --admin-good-bg: #e2f3e9;
    --admin-warn: #8a5a00;
    --admin-warn-bg: #fbf0d6;
    --admin-bad: #b02a2a;
    --admin-bad-bg: #fbe5e5;
    --admin-info: #3b4f9c;
    --admin-info-bg: #e7ebfa;

    --admin-alert-danger-bg: #fbe5e5;
    --admin-alert-danger-border: #f3c6c6;
    --admin-alert-danger-fg: #8f1f1f;
    --admin-alert-success-bg: #e2f3e9;
    --admin-alert-success-border: #bfe2cc;
    --admin-alert-success-fg: #17613b;

    --admin-toast-danger-bg: #3d1717;
    --admin-toast-danger-accent: #f08a8a;
    --admin-toast-danger-fg: #ffffff;

    --admin-error-ui-bg: #fbf0d6;
    --admin-error-ui-fg: #16222b;
}

:root[data-bs-theme="dark"] {
    /* Tells the browser to render form controls, scrollbars and the canvas dark, which
       no amount of author CSS can do on its own. */
    color-scheme: dark;

    --admin-page-bg: #0e151a;
    --admin-surface: #152029;
    --admin-surface-subtle: #1a2731;
    --admin-surface-hover: #1a2731;
    --admin-surface-overlay: rgba(0, 0, 0, 0.5);

    --admin-border: #26353f;
    --admin-border-subtle: #26353f;
    --admin-border-row: #26353f;
    --admin-shadow: rgba(0, 0, 0, 0.4);

    --admin-text: #e2eaef;
    --admin-text-muted: #93a4b0;
    --admin-nav-icon: #93a4b0;

    --admin-accent: #5cb8cc;
    --admin-accent-hover: #74c6d8;
    --admin-accent-contrast: #08202a;
    --admin-accent-soft: #173540;
    --admin-link: #5cb8cc;
    --admin-focus-ring: rgba(92, 184, 204, 0.5);

    --admin-nav-bg: #09141a;
    --admin-nav-ink: #9fb6bf;
    --admin-nav-active: #ffffff;

    --admin-avatar-bg: #173540;
    --admin-avatar-fg: #5cb8cc;

    --admin-success: #6fd19b;
    --admin-danger: #f08a8a;
    --admin-checkbox-border: #5a6975;

    --admin-good: #6fd19b;
    --admin-good-bg: #133524;
    --admin-warn: #f0c060;
    --admin-warn-bg: #3a2c0c;
    --admin-bad: #f08a8a;
    --admin-bad-bg: #3d1717;
    --admin-info: #9fb0f5;
    --admin-info-bg: #1e2647;

    --admin-alert-danger-bg: #3d1717;
    --admin-alert-danger-border: #5a2424;
    --admin-alert-danger-fg: #f08a8a;
    --admin-alert-success-bg: #133524;
    --admin-alert-success-border: #1f4d34;
    --admin-alert-success-fg: #6fd19b;

    --admin-error-ui-bg: #3a2c0c;
    --admin-error-ui-fg: #f0e2c0;
}

html, body {
    font-family: var(--admin-font);
    background-color: var(--admin-page-bg);
    color: var(--admin-text);
}

a, .btn-link {
    color: var(--admin-link);
}

.btn-primary {
    color: var(--admin-accent-contrast);
    background-color: var(--admin-accent);
    border-color: var(--admin-accent);
}

/* Bootstrap 5.1 reads these for body text and a few utilities; pointing them at the tokens
   keeps a stray Bootstrap default from bringing back its own grey or blue. */
:root {
    --bs-body-font-family: var(--admin-font);
    --bs-body-color: var(--admin-text);
    --bs-body-bg: var(--admin-page-bg);
    --bs-primary: var(--admin-accent);
    --bs-font-monospace: var(--admin-mono);
}

/* Syncfusion's controls set their own font stack; the prototype's face is Open Sans. Named
   control classes only, never a [class*="e-"] sweep: .e-icons carries the icon font, and
   overriding it would turn every glyph into a letter. :root because the theme sheet is linked
   after app.css (see the button rules below). */
:root .e-control, :root .e-css, :root .e-btn, :root .e-input-group, :root .e-input-group input.e-input,
:root .e-grid, :root .e-grid .e-headercell, :root .e-grid .e-rowcell, :root .e-dialog, :root .e-toast,
:root .e-dropdownbase, :root .e-popup, :root .e-menu-wrapper ul .e-menu-item, :root .e-tab .e-toolbar-item .e-tab-text {
    font-family: var(--admin-font);
}

/* Syncfusion's bootstrap5 sheet hard-codes Bootstrap's blue on a primary button; the brand
   teal replaces it in both themes. The theme sheet is linked AFTER app.css, so a rule
   at Syncfusion's own specificity loses; :root lifts each one a step instead of !important. */
:root .e-btn.e-primary, :root .e-css.e-btn.e-primary {
    background-color: var(--admin-accent);
    border-color: var(--admin-accent);
    color: var(--admin-accent-contrast);
}

:root .e-btn.e-primary:hover, :root .e-css.e-btn.e-primary:hover, :root .e-btn.e-primary:focus, :root .e-css.e-btn.e-primary:focus, :root .e-btn.e-primary:active, :root .e-css.e-btn.e-primary:active, :root .e-btn.e-primary.e-active {
    background-color: var(--admin-accent-hover);
    border-color: var(--admin-accent-hover);
    color: var(--admin-accent-contrast);
}

:root .e-btn.e-outline.e-primary, :root .e-css.e-btn.e-outline.e-primary {
    background-color: transparent;
    border-color: var(--admin-accent);
    color: var(--admin-accent);
}

:root .e-btn.e-outline.e-primary:hover, :root .e-css.e-btn.e-outline.e-primary:hover {
    background-color: var(--admin-accent-soft);
    color: var(--admin-accent);
}

:root .e-btn.e-outline:not(.e-primary):not(.e-danger):hover {
    border-color: var(--admin-accent);
    color: var(--admin-accent);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem var(--admin-surface), 0 0 0 0.25rem var(--admin-focus-ring);
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--admin-success);
}

.invalid {
    outline: 1px solid var(--admin-danger);
}

.validation-message {
    color: var(--admin-danger);
}

/* Server-side validation feedback inside AdminResourceDialog. The alert reuses the same
   --admin-alert-danger-* tokens as the rest of the admin app, so it follows the light/dark
   switch without a second palette. */
.admin-form-errors {
    background-color: var(--admin-alert-danger-bg);
    border: 1px solid var(--admin-alert-danger-border);
    border-radius: 0.375rem;
    color: var(--admin-alert-danger-fg);
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
}

.admin-form-errors p {
    margin: 0;
}

.admin-form-errors-lead {
    font-weight: 600;
    margin-bottom: 0.35rem !important;
}

.admin-form-errors ul {
    margin: 0;
    padding-left: 1.15rem;
}

.admin-field-error {
    color: var(--admin-danger);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

/* Syncfusion renders every editor inside .e-input-group / .e-control-wrapper, so tinting that
   border marks the offending control whichever editor the field happens to use. The inline
   .admin-field-error text above is the primary signal - this is reinforcement, and is written so
   that a Syncfusion class change degrades to "no tint" rather than to "no message". */
.admin-field-invalid .e-input-group,
.admin-field-invalid .e-input-group.e-control-wrapper,
.admin-field-invalid .e-control-wrapper .e-input-group {
    border-color: var(--admin-danger);
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: var(--admin-checkbox-border);
}

.e-toast-container .e-toast.e-toast-danger {
    background-color: var(--admin-toast-danger-bg);
    border: 1px solid var(--admin-toast-danger-accent);
}

.e-toast-container .e-toast.e-toast-danger:hover {
    background-color: var(--admin-toast-danger-bg);
}

.e-toast-container .e-toast.e-toast-danger .e-toast-message .e-toast-title,
.e-toast-container .e-toast.e-toast-danger .e-toast-message .e-toast-content {
    color: var(--admin-toast-danger-fg);
}

.e-toast-container .e-toast.e-toast-danger .e-toast-message .e-toast-title {
    border-color: var(--admin-toast-danger-accent);
}

.e-toast-container .e-toast.e-toast-danger .e-toast-icon,
.e-toast-container .e-toast.e-toast-danger .e-toast-close-icon {
    color: var(--admin-toast-danger-accent);
}

/* --- Bootstrap 5.1 gap ------------------------------------------------------
   The vendored bootstrap.min.css here is v5.1.0, which predates data-bs-theme
   (added in 5.3) - so Bootstrap's own components ignore the attribute entirely and
   would stay light-on-light inside a dark shell. Rather than swap the vendored file
   for 5.3 and absorb its unrelated visual changes across every page, these override
   only the handful of Bootstrap classes the admin app actually uses. Verified with:
     grep -roh 'class="[^"]*"' --include=*.razor Components
   which finds alert / alert-danger / alert-success / card / text-danger / text-muted
   and nothing else. Add to this list if a new page reaches for another one.

   bootstrap.min.css is linked BEFORE app.css in App.razor, so equal specificity is
   enough here - except for .text-* which Bootstrap ships as !important utilities. */
.alert-danger {
    color: var(--admin-alert-danger-fg);
    background-color: var(--admin-alert-danger-bg);
    border-color: var(--admin-alert-danger-border);
}

.alert-success {
    color: var(--admin-alert-success-fg);
    background-color: var(--admin-alert-success-bg);
    border-color: var(--admin-alert-success-border);
}

.card {
    background-color: var(--admin-surface);
    border-color: var(--admin-border-subtle);
    color: var(--admin-text);
}

.text-danger {
    color: var(--admin-danger) !important;
}

.text-muted {
    color: var(--admin-text-muted) !important;
}

/* The bundled Bootstrap is 5.1, which predates colour modes and hard-codes a plain .table's
   text (#212529) and rules (#dee2e6): dark text and bright lines on the dark page, which left
   the Member Support age-band report unreadable. Follow the theme tokens instead. */
.table {
    color: var(--admin-text);
    border-color: var(--admin-border-subtle);
}

/* --- Theme toggle ----------------------------------------------------------- */
.theme-toggle {
    min-width: 2rem;
    line-height: 1;
}

.theme-toggle .theme-toggle-glyph {
    font-size: 1rem;
}

/* Avatar catalog: the grid thumbnail and the edit dialog's preview. Circles, because
   that is how every avatar is rendered to a member - a square preview would hide a
   picture whose subject sits in the corners. */
.admin-avatar-thumb {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.admin-avatar-preview {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    margin-top: 0.5rem;
}

/* Member avatars in admin grids. Image and initials share one class so swapping
   between them cannot shift a row by a pixel. */
.admin-member-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 50%;
    object-fit: cover;
    overflow: hidden;
    user-select: none;
    vertical-align: middle;
}

.admin-member-avatar-initials {
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
}

.admin-member-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* --- Operations dashboard (Components/Pages/Home.razor + Pages/Dashboard/*) ----
   Here rather than in a scoped Home.razor.css: Blazor stamps the b-* scope attribute only onto
   plain elements written in the .razor file that owns the stylesheet, never onto a child
   component's root and never onto anything Syncfusion renders, so scoped rules for this page
   would silently match nothing (same trap MainLayout.razor.css:13-18 documents).

   The .admin-member-cell rule above once lost its closing brace at the seam where the avatars
   and dashboard branches merged. An unclosed block makes the parser swallow every rule after
   it as invalid declarations - silently, with no console error - so this whole section never
   reached a browser while every prerender test stayed green. If the dashboard ever renders as
   unstyled text again, check the rule immediately above this comment first.

   One bold element: the attention board, on a floodlit-pitch ground in BOTH themes, read like a
   scoreboard. Everything below it stays quiet. Colour still means urgency and nothing else -
   live green is "pending", red is "overdue or stuck", and a zero is grey. */

:root {
    --admin-dash-display: "Saira Semi Condensed", var(--admin-font);

    /* The board takes the navbar's slate ground (--admin-nav-bg), so it reads as part of the
       same chrome rather than a third colour. */
    --admin-dash-board-bg: #13313d;
    --admin-dash-board-edge: #13313d;
    --admin-dash-board-fg: #e2eaef;
    --admin-dash-board-muted: #9fb6bf;
    --admin-dash-board-quiet: #6f8a96;
    --admin-dash-board-rule: rgba(226, 234, 239, 0.09);
    --admin-dash-board-live: #6fd19b;
    --admin-dash-board-red: #f08a8a;
}

:root[data-bs-theme="dark"] {
    /* Deeper than the dark page ground (#0e151a) so the board still reads as its own object,
       with a hairline edge because two near-blacks alone do not separate. */
    --admin-dash-board-bg: #09141a;
    --admin-dash-board-edge: #26353f;
}

/* ---- The attention board ---- */

.admin-dash-board {
    background: var(--admin-dash-board-bg);
    border: 1px solid var(--admin-dash-board-edge);
    border-radius: 10px;
    color: var(--admin-dash-board-fg);
    margin-bottom: 1.75rem;
    padding: 1.35rem 1.5rem 0.6rem;
}

.admin-dash-head {
    align-items: flex-start;
    column-gap: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    row-gap: 0.75rem;
}

.admin-dash-queue-heading {
    font-family: var(--admin-dash-display);
    font-size: 1.85rem;
    font-weight: 600;
    letter-spacing: -0.005em;
    line-height: 1.1;
    margin: 0;
}

.admin-dash-zone {
    color: var(--admin-dash-board-muted);
    font-size: 0.8125rem;
    margin: 0.35rem 0 0;
}

.admin-dash-amounts-toggle {
    align-items: center;
    color: var(--admin-dash-board-fg);
    display: inline-flex;
    font-size: 0.875rem;
    gap: 0.6rem;
    padding-top: 0.35rem;
}

.admin-dash-amounts-toggle label {
    cursor: pointer;
    margin: 0;
}

/* Syncfusion's off-state track is a light grey meant for a light page; on the pitch ground it
   needs an edge to be seen at all. */
.admin-dash-board .e-switch-wrapper .e-switch-inner {
    border-color: rgba(226, 234, 239, 0.45);
}

.admin-dash-board .e-switch-wrapper .e-switch-inner.e-switch-active {
    background-color: var(--admin-dash-board-live);
    border-color: var(--admin-dash-board-live);
}

/* A shared grid for every row on the board: figure, what it means, amount, where to go. The
   amount track has a floor, not a fixed width: at a fixed width a seven-figure amount wrapped
   inside the cell and changed the row height - the exact reflow the masked stand-in exists to
   prevent. max-content lets it grow instead of wrapping. */
.admin-dash-row {
    align-items: center;
    border-top: 1px solid var(--admin-dash-board-rule);
    column-gap: 1.1rem;
    display: grid;
    grid-template-columns: 4.75rem minmax(0, 1fr) minmax(6.5rem, max-content) 6.5rem;
    margin: 0 -1.5rem;
    padding: 0.55rem 1.5rem;
}

/* The urgency gutter: a bar at the board's own edge, so scanning down the left side for colour
   is the same act as scanning for work. */
.admin-dash-row-pending {
    box-shadow: inset 4px 0 0 var(--admin-dash-board-live);
}

.admin-dash-row-overdue {
    box-shadow: inset 4px 0 0 var(--admin-dash-board-red);
}

.admin-dash-figure {
    font-family: var(--admin-dash-display);
    font-size: 2.1rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    line-height: 1;
    text-align: right;
}

.admin-dash-row-quiet .admin-dash-figure {
    color: var(--admin-dash-board-quiet);
}

.admin-dash-row-pending .admin-dash-figure {
    color: var(--admin-dash-board-live);
}

.admin-dash-row-overdue .admin-dash-figure {
    color: var(--admin-dash-board-red);
}

.admin-dash-label {
    font-size: 0.95rem;
}

.admin-dash-row-quiet .admin-dash-label {
    color: var(--admin-dash-board-muted);
}

/* The textual counterpart of the overdue colour (WCAG 1.4.1): an overdue row and a merely
   pending one must differ in something a greyscale screen or a screen reader can perceive.
   Built on Syncfusion's e-badge, restyled for the pitch ground. */
.admin-dash-board .admin-dash-overdue-marker {
    background: transparent;
    border: 1px solid var(--admin-dash-board-red);
    border-radius: 999px;
    color: var(--admin-dash-board-red);
    font-size: 0.7rem;
    font-weight: 500;
    margin-inline-start: 0.6rem;
    padding: 0.15rem 0.5rem;
    vertical-align: 0.1rem;
}

.admin-dash-amount {
    font-family: var(--admin-dash-display);
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.admin-dash-action {
    text-align: right;
}

/* The way into the owning workspace. Outlined on a quiet row, filled where there is work, so
   the buttons themselves restate the gutter. */
.admin-dash-board .admin-dash-go.e-btn {
    background: transparent;
    border: 1px solid rgba(226, 234, 239, 0.28);
    color: var(--admin-dash-board-fg);
    min-width: 5rem;
}

.admin-dash-board .admin-dash-go.e-btn:hover {
    border-color: var(--admin-dash-board-fg);
}

.admin-dash-board .admin-dash-row-pending .admin-dash-go.e-btn,
.admin-dash-board .admin-dash-row-overdue .admin-dash-go.e-btn {
    background: var(--admin-dash-board-live);
    border-color: var(--admin-dash-board-live);
    color: var(--admin-dash-board-bg);
    font-weight: 600;
}

.admin-dash-board .admin-dash-go.e-btn:focus-visible,
.admin-dash-board .admin-dash-retry.e-btn:focus-visible {
    outline: 2px solid var(--admin-dash-board-live);
    outline-offset: 2px;
}

.admin-dash-board .admin-dash-retry.e-btn {
    background: transparent;
    border: 1px dashed rgba(226, 234, 239, 0.4);
    color: var(--admin-dash-board-fg);
    white-space: nowrap;
}

@media (max-width: 40rem) {
    .admin-dash-board {
        padding-inline: 1rem;
    }

    .admin-dash-row {
        grid-template-areas:
            "fig label action"
            "fig amount amount";
        grid-template-columns: 3.25rem minmax(0, 1fr) auto;
        margin-inline: -1rem;
        padding-inline: 1rem;
        row-gap: 0.15rem;
    }

    .admin-dash-figure { grid-area: fig; font-size: 1.6rem; }
    .admin-dash-label { grid-area: label; }
    .admin-dash-amount { grid-area: amount; text-align: left; }
    .admin-dash-action { grid-area: action; }

    .admin-dash-board .admin-dash-go.e-btn {
        min-width: 0;
    }
}

/* ---- The figures band: quiet, no cards - one rule above and below, hairlines between ---- */

.admin-dash-band {
    border-block: 1px solid var(--admin-border);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
    margin-bottom: 1.75rem;
}

.admin-dash-group {
    border-inline-start: 1px solid var(--admin-border-subtle);
    padding: 1rem 1.25rem 1.1rem;
}

.admin-dash-group:first-child {
    border-inline-start: none;
    padding-inline-start: 0.25rem;
}

.admin-dash-group-head {
    align-items: baseline;
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.admin-dash-metric-heading,
.admin-dash-panel-heading {
    color: var(--admin-text);
    font-family: var(--admin-dash-display);
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
}

.admin-dash-group-link {
    color: var(--admin-link);
    font-size: 0.8125rem;
}

.admin-dash-lead {
    align-items: flex-end;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    margin: 0.6rem 0 0.15rem;
}

.admin-dash-lead-figure {
    color: var(--admin-text);
    font-family: var(--admin-dash-display);
    font-size: 2.35rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    line-height: 1;
}

.admin-dash-lead-label {
    color: var(--admin-text-muted);
    font-size: 0.8125rem;
    width: 100%;
}

.admin-dash-spark {
    display: block;
    height: 28px;
    margin: 0.55rem 0 0.1rem;
    width: 100%;
}

.admin-dash-stats {
    margin: 0.75rem 0 0;
}

.admin-dash-stat {
    align-items: baseline;
    border-top: 1px solid var(--admin-border-row);
    display: flex;
    font-size: 0.8125rem;
    gap: 0.75rem;
    justify-content: space-between;
    padding: 0.3rem 0;
}

.admin-dash-stat dt {
    color: var(--admin-text-muted);
    font-weight: 400;
}

.admin-dash-stat dd {
    color: var(--admin-text);
    font-family: var(--admin-dash-display);
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    margin: 0;
}

.admin-dash-note {
    color: var(--admin-text-muted);
    font-size: 0.8125rem;
    margin: 0.25rem 0 0;
}

/* Off the board, a retry is a quiet outlined Syncfusion button. */
.admin-dash-retry.e-btn {
    margin-top: 0.5rem;
}

/* ---- Charts: two panels on a subtle surface, the trend given twice the room ---- */

.admin-dash-charts {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 70rem) {
    .admin-dash-charts {
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    }
}

.admin-dash-panel {
    background: var(--admin-surface-subtle);
    border: 1px solid var(--admin-border-subtle);
    border-radius: 10px;
    min-width: 0;
    padding: 1.1rem 1.25rem 0.75rem;
}

.admin-dash-panel-subheading {
    color: var(--admin-text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    margin: 1.1rem 0 0.25rem;
}

.admin-dash-settle {
    align-items: center;
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

/* The figure sits in the gauge's own hollow rather than beside it. Positioned over the SVG
   rather than drawn by a gauge annotation so it stays plain text the prerender can read. */
.admin-dash-gauge {
    flex: 0 0 auto;
    height: 140px;
    position: relative;
    width: 140px;
}

.admin-dash-gauge-figure {
    font-family: var(--admin-dash-display);
    font-size: 2rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    inset: 0;
    margin: 0;
    padding-top: 2.9rem;
    pointer-events: none;
    position: absolute;
    text-align: center;
}

/* ---- Recent admin activity ---- */

.admin-dash-activity {
    margin-top: 1.75rem;
}

.admin-dash-activity .admin-dash-panel-heading {
    margin-bottom: 0.5rem;
}

.admin-dash-activity-row {
    align-items: center;
    border-top: 1px solid var(--admin-border-row);
    column-gap: 1rem;
    display: grid;
    font-size: 0.875rem;
    grid-template-columns: 3.5rem 9rem minmax(0, 1fr) minmax(0, 14rem);
    padding: 0.5rem 0;
}

.admin-dash-activity-time {
    color: var(--admin-text-muted);
    font-family: var(--admin-dash-display);
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.admin-dash-activity-category.e-badge {
    background: var(--admin-surface-subtle);
    border: 1px solid var(--admin-border-subtle);
    color: var(--admin-text-muted);
    font-size: 0.72rem;
    font-weight: 500;
    justify-self: start;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-dash-activity-action {
    overflow-wrap: anywhere;
}

.admin-dash-activity-actor {
    align-items: center;
    color: var(--admin-text-muted);
    display: inline-flex;
    gap: 0.45rem;
    min-width: 0;
}

@media (max-width: 40rem) {
    .admin-dash-activity-row {
        grid-template-columns: 3rem minmax(0, 1fr);
        row-gap: 0.2rem;
    }

    .admin-dash-activity-category,
    .admin-dash-activity-action,
    .admin-dash-activity-actor {
        grid-column: 2;
    }
}

/* The charts' accessible fallback table. Clipped rather than display:none, because a hidden
   element is announced to nobody - the whole point is that every figure a chart draws is also
   readable as text. */
.admin-dash-sr-only {
    border: 0;
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

/* --- Prototype components (restyle phase R3) ---------------------------------
   The admin portal prototype's page head, panels, chips, toolbars and tables, in the
   --admin-* tokens. Bootstrap's .card is the panel (every page already uses it), so it
   takes the panel look rather than a second class; AdminPageHead and AdminStatusChip are
   the two new components. */
h1, h2, h3 {
    text-wrap: balance;
}

.admin-crumbs {
    font-size: 12px;
    color: var(--admin-text-muted);
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.admin-crumbs span + span::before {
    content: "A";
    margin-right: 6px;
}

.admin-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 4px 0 16px;
}

.admin-page-head h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: var(--admin-text);
}

.admin-route {
    font-family: var(--admin-mono);
    font-size: 11.5px;
    color: var(--admin-text-muted);
}

.admin-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-mono {
    font-family: var(--admin-mono);
    font-variant-numeric: tabular-nums;
}

/* Panels: Bootstrap's card in the prototype's flat look. */
.card {
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    box-shadow: none;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--admin-border);
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 700;
    color: var(--admin-text);
}

.card-body {
    padding: 16px;
}

.card + .card {
    margin-top: 16px;
}

.card-title {
    font-size: 14px;
    font-weight: 700;
}

/* Status chips. */
.admin-chip {
    display: inline-block;
    padding: 1px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--admin-surface-subtle);
    color: var(--admin-text-muted);
    border: 1px solid var(--admin-border);
}

/* Chips side by side, or a chip beside a name, keep a little air between them. */
.admin-chip + .admin-chip,
* + .admin-chip {
    margin-left: 4px;
}

.admin-chip.good {
    background: var(--admin-good-bg);
    color: var(--admin-good);
    border-color: transparent;
}

.admin-chip.warn {
    background: var(--admin-warn-bg);
    color: var(--admin-warn);
    border-color: transparent;
}

.admin-chip.bad {
    background: var(--admin-bad-bg);
    color: var(--admin-bad);
    border-color: transparent;
}

.admin-chip.info {
    background: var(--admin-info-bg);
    color: var(--admin-info);
    border-color: transparent;
}

/* A panel's filter row: search box, selects, and the row count pushed right. */
.admin-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px 16px;
    border-bottom: 1px solid var(--admin-border);
}

.admin-count {
    color: var(--admin-text-muted);
    font-size: 12.5px;
    margin-left: auto;
}

.admin-table-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-top: 1px solid var(--admin-border);
    color: var(--admin-text-muted);
    font-size: 12.5px;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-empty {
    padding: 28px 16px;
    text-align: center;
    color: var(--admin-text-muted);
}

/* Plain tables: uppercase muted headers on the subtle surface, rows that highlight. */
.table > thead > tr > th {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--admin-text-muted);
    font-weight: 600;
    background: var(--admin-surface-subtle);
    border-bottom: 1px solid var(--admin-border);
    white-space: nowrap;
}

.table > tbody > tr > td {
    border-bottom-color: var(--admin-border);
    vertical-align: top;
}

.table > tbody > tr.admin-row-link {
    cursor: pointer;
}

.table > tbody > tr.admin-row-link:hover > td {
    background: var(--admin-surface-subtle);
}

.table > tbody > tr.admin-row-link > td:first-child {
    color: var(--admin-accent);
    font-weight: 600;
}

/* Syncfusion grids in the same look. :root because the theme sheet is linked after app.css. */
:root .e-grid {
    border-color: var(--admin-border);
    border-radius: var(--admin-radius);
}

:root .e-grid .e-gridheader,
:root .e-grid .e-headercontent,
:root .e-grid .e-columnheader,
:root .e-grid .e-headercell {
    background-color: var(--admin-surface-subtle);
}

:root .e-grid .e-headercell .e-headercelldiv,
:root .e-grid .e-headercell .e-headertext {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--admin-text-muted);
    font-weight: 600;
}

:root .e-grid .e-rowcell {
    border-color: var(--admin-border);
}

:root .e-grid .e-row:hover .e-rowcell {
    background-color: var(--admin-surface-subtle);
}

/* Forms: the prototype's labelled field grid. Bootstrap 5.1's .form-control predates colour modes
   and hard-codes a white field, so it reads the tokens here. */
.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px 18px;
}

.admin-form-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.admin-form-field label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--admin-text-muted);
}

.admin-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.form-control {
    background-color: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    color: var(--admin-text);
    padding: 7px 10px;
}

.form-control:focus {
    background-color: var(--admin-surface);
    border-color: var(--admin-accent);
    color: var(--admin-text);
}

.form-control::placeholder {
    color: var(--admin-text-muted);
}

.admin-toolbar-filter {
    flex: 1 1 220px;
    min-width: 0;
    max-width: 360px;
}

/* The shared grid (AdminResourceGrid) as one panel: the toolbar's New button sits at the right
   end, after the count when there is one, and the grid draws no border of its own inside the card. */
.admin-toolbar-end {
    margin-left: auto;
}

.admin-count + .admin-toolbar-end {
    margin-left: 0;
}

:root .admin-grid-panel .e-grid {
    border: 0;
    border-radius: 0;
}

.admin-pager {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* A page's explaining paragraph under its head, kept to a readable measure. */
.admin-page-intro {
    color: var(--admin-text-muted);
    max-width: 48rem;
    margin-bottom: 16px;
}

/* Panels on pages that build their own grids and forms: spaced like the shared grid panel, and a
   form panel kept to a form's width. */
.admin-grid-panel,
.admin-form-panel {
    margin-bottom: 16px;
}

.admin-form-panel {
    max-width: 40rem;
}

/* A note that qualifies the whole page, under its head (Contest's "Times shown in ..."). */
.admin-page-note {
    color: var(--admin-text-muted);
    font-size: 12.5px;
    margin: -8px 0 12px;
}

/* Workspace tabs as the prototype's: a plain row on the page ground, a hairline under it, muted
   labels, and the active tab in the brand teal with a teal underline. :root outranks the theme
   sheet linked after this one; the dark sheet paints the header a surface colour of its own. */
:root .e-tab .e-tab-header {
    background: transparent;
    border-bottom: 1px solid var(--admin-border);
    margin-bottom: 16px;
}

:root .e-tab .e-tab-header .e-toolbar-items,
:root .e-tab .e-tab-header .e-toolbar-item,
:root .e-tab .e-tab-header .e-toolbar-item .e-tab-wrap {
    background: transparent;
}

:root .e-tab .e-tab-header .e-toolbar-item .e-tab-text {
    color: var(--admin-text-muted);
    font-weight: 600;
}

/* The theme repeats its active colour for tabs with an icon slot (.e-ileft/.e-iright, which every
   tab here carries), one class more specific, so those are named too. */
:root .e-tab .e-tab-header .e-toolbar-item.e-active .e-tab-text,
:root .e-tab .e-tab-header .e-toolbar-item.e-active.e-ileft .e-tab-text,
:root .e-tab .e-tab-header .e-toolbar-item.e-active.e-iright .e-tab-text,
:root .e-tab .e-tab-header .e-toolbar-item .e-tab-wrap:hover .e-tab-text {
    color: var(--admin-accent);
}

:root .e-tab .e-tab-header .e-indicator {
    background: var(--admin-accent);
}

a.e-btn,
a.e-btn:hover {
    text-decoration: none;
}

/* A member's workspace (MemberWorkspace.razor): the prototype's entity head and side menu. Global
   rather than scoped because the menu links are rendered from a RenderFragment. */
.admin-back-link {
    display: inline-block;
    color: var(--admin-accent);
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 10px;
}

.admin-entity-head {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.admin-entity-name {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.admin-entity-chips {
    display: inline-flex;
    gap: 6px;
    margin-left: auto;
}

.admin-ws-menu {
    min-width: 13rem;
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    padding: 10px 8px;
}

.admin-ws-group-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--admin-text-muted);
    font-weight: 600;
    padding: 10px 10px 4px;
}

.admin-ws-group-label:first-child {
    padding-top: 4px;
}

.admin-ws-link {
    display: block;
    border-left: 3px solid transparent;
    padding: 6px 10px 6px 12px;
    color: var(--admin-text);
    border-radius: 0 4px 4px 0;
    text-decoration: none;
}

.admin-ws-link:hover {
    background: var(--admin-surface-subtle);
    color: var(--admin-text);
}

.admin-ws-link.active {
    border-left-color: var(--admin-accent);
    background: var(--admin-accent-soft);
    color: var(--admin-accent);
    font-weight: 600;
}

/* ---- Import games: fixture drawer (ImportFixtureDrawerView) ---------------------------------- */
.admin-import-row-clickable {
    cursor: pointer;
}

.admin-import-row-clickable:hover,
.admin-import-row-clickable:focus-visible {
    background: var(--admin-surface-hover);
}

.admin-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: var(--admin-shadow);
}

.admin-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1045;
    width: min(720px, 100vw);
    overflow-y: auto;
    padding: 1.25rem;
    background: var(--admin-surface);
    color: var(--admin-text);
    border-left: 1px solid var(--admin-border);
    box-shadow: -8px 0 24px var(--admin-shadow);
    animation: admin-drawer-in 0.18s ease-out;
}

.admin-drawer:focus {
    outline: none;
}

@keyframes admin-drawer-in {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .admin-drawer {
        animation: none;
    }
}

.admin-drawer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--admin-border);
}

.admin-drawer-title {
    font-size: 1.25rem;
    margin: 0.25rem 0;
}

.admin-drawer-squads {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.admin-drawer-squad-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

@media (max-width: 767.98px) {
    .admin-drawer-squads {
        grid-template-columns: 1fr;
    }
}

/* Team logos beside team names (TeamLogo.razor): the image, or an abbreviation badge when the
   team has none. Sized by the component's Size parameter. */
/* A logo sits on a light circle so a dark crest stays visible on the dark theme. The padding comes
   out of Size (border-box), so a grid row keeps its height. It is computed from the logo's own
   size (--team-logo-size, set by TeamLogo.razor), never a percentage: percentage padding resolves
   against the containing block's width, which in a wide grid cell swelled the circle past Size and
   left the image no room at all. */
.admin-team-logo {
    box-sizing: border-box;
    padding: calc(var(--team-logo-size, 24px) * 0.12);
    border-radius: 50%;
    background-color: #f4f4f1;
    object-fit: contain;
    vertical-align: middle;
}

.admin-team-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.3rem;
    border-radius: 0.25rem;
    border: 1px solid var(--bs-border-color, #ced4da);
    font-size: 0.65rem;
    font-weight: 600;
    vertical-align: middle;
}
