/* ============================================================
   Score7 — the admin console
   Handoff §12. The console is another application: it uses the
   TechXYZ design system without the layer the game puts on top,
   so there is no cream, no #2B2A76, no yellow and no hard shadow
   anywhere below this line. An administrator suspending an
   account should know from the colour of the screen that they
   are not playing.

   The names are the roles the handoff gives them rather than the
   hexes, because most of these are already declared in
   tokens/colors.css and the point of the block is to say which
   of them the console reaches for.
   ============================================================ */

:root {
    /* ---- Surfaces ------------------------------------------- */
    --admin-shell: var(--ink-900);
    --admin-page: var(--neutral-50);
    --admin-surface: var(--neutral-0);

    /* Card and table borders. Between --neutral-100 and --neutral-200 and neither of them:
       the console draws a lot of them at once, and at that density the darker one turns the
       page into a grid while the lighter one disappears. */
    --admin-border: #E3EAF0;

    /* The rule between two rows of a table. Lighter again — inside a card that already has
       a border, a row separator as strong as the frame reads as eight small cards. */
    --admin-row-rule: #EFF3F6;
    --admin-field-border: var(--neutral-200);

    /* A row under the pointer, or the one being read. Barely there on purpose: it has to
       survive being drawn over an amber or a red row without arguing with either. */
    --admin-row-hover: #F7FBFE;

    /* ---- Ink ------------------------------------------------ */
    --admin-text: var(--ink-900);
    --admin-text-2: var(--neutral-600);
    --admin-meta: var(--neutral-500);
    --admin-quiet: var(--neutral-400);

    /* ---- Azure: action, focus, what is active --------------- */
    --admin-action: var(--azure-600);
    --admin-spark: var(--azure-500);
    --admin-on-soft: var(--azure-700);
    --admin-soft: var(--azure-50);
    --admin-soft-border: #A9DBF5;

    /* ---- Green: nothing is wrong ---------------------------- */
    --admin-good: var(--success-500);

    /* ---- Amber: something is waiting ------------------------ */
    --admin-waiting: #C77700;
    --admin-waiting-soft: #FFF6E8;
    --admin-waiting-border: #F0D3A0;
    --admin-waiting-row: #FFFBF3;

    /* ---- Red: something is destructive ---------------------- */
    --admin-danger: var(--danger-500);
    --admin-danger-ink: var(--danger-700);
    --admin-danger-soft: #FFF6F5;
    --admin-danger-border: #F3CFCB;
    --admin-danger-text: #8A5652;

    /* ---- The histogram -------------------------------------- */
    --admin-bar: #D6E6F0;
    --admin-bar-weekend: #A9DBF5;
    --admin-bar-before: var(--azure-600);
    --admin-bar-yesterday: var(--azure-500);

    /* ---- On the dark shell ---------------------------------- */
    --admin-on-shell: rgba(255, 255, 255, .85);
    --admin-on-shell-idle: rgba(255, 255, 255, .68);
    --admin-on-shell-meta: rgba(255, 255, 255, .5);
    --admin-on-shell-surface: rgba(255, 255, 255, .05);
    --admin-on-shell-border: rgba(255, 255, 255, .1);
    --admin-on-shell-hover: rgba(255, 255, 255, .06);
    --admin-active-shell: rgba(0, 171, 252, .16);

    /* The brand glow behind the lock. */
    --admin-glow: radial-gradient(circle, rgba(0, 171, 252, .25), transparent 70%);

    /* ---- Focus ---------------------------------------------- */
    /* Two rings, because one of them is drawn on #0C2236 and the other on white. Non-negotiable
       (RGAA, §8): the console is operated entirely from the keyboard by anyone who operates it
       that way, and a ring that vanishes on the sidebar is a navigation nobody can see. */
    --admin-ring: 0 0 0 3px rgba(0, 171, 252, .35);
    --admin-ring-dark: 0 0 0 3px rgba(0, 171, 252, .5);
    --admin-ring-field: 0 0 0 3px rgba(0, 171, 252, .18);

    /* ---- The one shadow the console has --------------------- */
    /* Popovers, and nothing else. §12: the cards get a 1px border and no elevation — density
       is what this screen trades for, unlike the player app. */
    --admin-popover-shadow: 0 14px 30px rgba(12, 34, 54, .18);

    /* ---- Where the console stops being wide ----------------- */
    /* 900px rather than the app's tablet breakpoint: a table of seven columns needs more room
       than a scoreboard does (§7.6). Declared for the reader, not read by CSS — a media query
       cannot take a custom property. */
    --admin-breakpoint: 900px;
}

/* ============================================================
   Primitives shared by every console screen.
   Layout chrome lives in AdminLayout.razor.css and screen
   specifics in each screen's own scoped sheet; what is here is
   what more than one of them draws the same way.
   ============================================================ */

.s7-admin-eyebrow {
    margin: 0 0 10px;
    font: 600 9.5px var(--font-sans);
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--admin-quiet);
}

.s7-admin-card {
    padding: 16px 18px;
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    background: var(--admin-surface);
}

/* The table wrapper of #A03 and #A06: one card, clipped, with the rows drawn inside it. */
/* <b>Not clipped.</b> A row menu is drawn inside this box and has to be able to leave it, and
   `overflow: hidden` cut every popover the bottom rows opened. « Open those upwards instead »
   only moved which rows it happened to — at four accounts it happened to the last one, which is
   the shape beta is in.

   The radius survives on the two children that touch the corners instead of as a clip over all
   of them: 13px rather than 14px, because a child rounds inside a 1px border. */
.s7-admin-table {
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    background: var(--admin-surface);
}

.s7-admin-table > :first-child {
    border-radius: 13px 13px 0 0;
}

.s7-admin-table > :last-child {
    border-radius: 0 0 13px 13px;
}

/* One child that is both ends at once: an empty state, or a list of one. Last, because
   border-radius is a shorthand and the rule above would otherwise square its top. */
.s7-admin-table > :only-child {
    border-radius: 13px;
}

.s7-admin-table__head {
    padding: 11px 18px;
    background: var(--admin-page);
    font: 600 9.5px var(--font-sans);
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--admin-quiet);
}

.s7-admin-table__row {
    padding: 13px 18px;
    border-top: 1px solid var(--admin-row-rule);
    transition: background 140ms var(--ease-standard);
}

.s7-admin-table__row:first-of-type {
    border-top: 0;
}

.s7-admin-table__row:hover {
    background: var(--admin-row-hover);
}

/* The empty state every list here shares. */
.s7-admin-empty {
    padding: 34px 18px;
    text-align: center;
    font: 400 11.5px var(--font-sans);
    color: var(--admin-meta);
}

/* The two-column footnote under a table (#A03, #A06). */
.s7-admin-notes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px;
    margin-top: 16px;
    font: 400 10.5px/1.6 var(--font-sans);
    color: var(--admin-quiet);
}

.s7-admin-notes b {
    color: var(--admin-text-2);
}

/* A number the console leads with: the four figures, the « à traiter » counters. */
.s7-admin-figure {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--admin-text);
    font-variant-numeric: tabular-nums;
}

/* Focus, everywhere, in both flavours. */
.s7-admin :focus-visible {
    outline: none;
    box-shadow: var(--admin-ring);
    border-radius: 8px;
}

.s7-admin__aside :focus-visible {
    box-shadow: var(--admin-ring-dark);
}

@media (prefers-reduced-motion: reduce) {
    .s7-admin-table__row {
        transition: none;
    }
}

@media (max-width: 900px) {
    .s7-admin-notes {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

/* ============================================================
   The lock's field.
   Global rather than scoped to AdminLock, and not by preference:
   CSS isolation stamps its scope attribute onto the elements a
   component writes itself, and this one is an InputText — a
   child component, whose <input> carries no scope of ours. The
   same reason the account screens keep their field styling in
   score7-account.css.
   ============================================================ */

.s7-lock__input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 0;
    border-radius: 10px;
    background: #fff;
    font: 400 13px var(--font-sans);
    color: var(--admin-text);
}

.s7-lock__input:focus-visible {
    outline: none;
    box-shadow: var(--admin-ring-dark);
}

/* ============================================================
   The sidebar's navigation.
   Here rather than in AdminLayout.razor.css because the entries
   are NavLink components: CSS isolation reaches the elements a
   component writes itself, never the <a> a child renders. Same
   story as the lock's field above.
   ============================================================ */

.s7-admin__nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.s7-admin__entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 9px;
    font: 500 12px var(--font-sans);
    color: var(--admin-on-shell-idle);
    text-decoration: none;
    transition: background 140ms var(--ease-standard), color 140ms var(--ease-standard);
}

.s7-admin__entry:hover {
    background: var(--admin-on-shell-hover);
    color: var(--admin-on-shell);
}

/* NavLink writes this class itself; the Match on each entry is what keeps the dashboard from
   claiming it on every screen under /admin. */
.s7-admin__entry.active {
    background: var(--admin-active-shell);
    font-weight: 600;
    color: var(--admin-spark);
}

.s7-admin__total {
    font: 600 10.5px var(--font-sans);
    color: var(--admin-on-shell-meta);
    font-variant-numeric: tabular-nums;
}

.s7-admin__pill {
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--admin-spark);
    font: 700 9.5px var(--font-sans);
    color: #052235;
}


/* ============================================================
   The console's modals.
   Global rather than scoped, because three components share
   them — the suspension, the deletion and the account card —
   and a copy per component is the shape that drifts.

   Nothing borrowed from the game's .s7-modal: that one is cream
   and 2px ink, which is the whole of what §1a says the console
   must not look like.
   ============================================================ */

.s7-adm-scrim {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(12, 34, 54, .45);
    font-family: var(--font-sans);
}

.s7-adm-modal {
    width: 100%;
    max-width: 440px;
    padding: 22px 24px;
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    background: var(--admin-surface);
    box-shadow: var(--admin-popover-shadow);
}

.s7-adm-modal--danger {
    border-color: var(--admin-danger-border);
}

.s7-adm-modal__title {
    margin: 0 0 8px;
    font: 700 16px var(--font-sans);
    color: var(--admin-text);
}

.s7-adm-modal__body {
    margin: 0 0 16px;
    font: 400 11.5px/1.7 var(--font-sans);
    color: var(--admin-text-2);
}

.s7-adm-modal--danger .s7-adm-modal__body {
    color: var(--admin-danger-text);
}

.s7-adm-modal__choice {
    display: flex;
    gap: 8px;
    margin: 0 0 18px;
    padding: 0;
    border: 0;
}

.s7-adm-modal__legend {
    display: block;
    margin-bottom: 8px;
    padding: 0;
    font: 600 9.5px var(--font-sans);
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--admin-quiet);
}

.s7-adm-choice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border: 1px solid var(--admin-field-border);
    border-radius: 10px;
    font: 500 12px var(--font-sans);
    color: var(--admin-text-2);
    cursor: pointer;

    /* « 7 jours » is two words and one choice; wrapped, it reads as two. */
    white-space: nowrap;
}

.s7-adm-choice--on {
    border-color: var(--admin-action);
    background: var(--admin-soft);
    font-weight: 600;
    color: var(--admin-on-soft);
}

.s7-adm-modal__field {
    width: 100%;
    height: 40px;
    margin-bottom: 18px;
    padding: 0 14px;
    border: 1px solid var(--admin-field-border);
    border-radius: 10px;
    background: var(--admin-page);
    font: 400 12px var(--font-sans);
    color: var(--admin-text);
}

.s7-adm-modal__field:focus {
    outline: none;
    background: var(--admin-surface);
    border: 2px solid var(--admin-action);
    box-shadow: var(--admin-ring-field);
}

.s7-adm-modal__foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.s7-adm-modal__cancel {
    height: 38px;
    padding: 0 16px;
    border: 0;
    border-radius: 10px;
    background: none;
    font: 600 12px var(--font-sans);
    color: var(--admin-meta);
    cursor: pointer;
}

.s7-adm-modal__go {
    height: 38px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: var(--admin-action);
    font: 600 12px var(--font-sans);
    color: #fff;
    cursor: pointer;
}

.s7-adm-modal__go--danger {
    background: var(--admin-danger);
}

/* Disabled until the pseudo matches, which is the whole of the confirmation. */
.s7-adm-modal__go:disabled {
    background: var(--admin-field-border);
    color: var(--admin-quiet);
    cursor: default;
}

/* ---- The account card ------------------------------------- */

.s7-adm-card__head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.s7-adm-card__names {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.s7-adm-card__email {
    font: 400 11px var(--font-sans);
    color: var(--admin-meta);
    overflow: hidden;
    text-overflow: ellipsis;
}

.s7-adm-card__facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 18px;
    margin: 0 0 16px;
}

.s7-adm-card__facts dt {
    font: 600 9.5px var(--font-sans);
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--admin-quiet);
}

.s7-adm-card__facts dd {
    margin: 2px 0 0;
    font: 500 12px var(--font-sans);
    color: var(--admin-text);
}

/* Said out loud rather than left to the journal to reveal later. Somebody who learns from the
   screen that opening a card is recorded is somebody who will not be surprised by it. */
.s7-adm-card__logged {
    margin: 0 0 18px;
    padding: 10px 12px;
    border: 1px solid var(--admin-soft-border);
    border-radius: 11px;
    background: var(--admin-soft);
    font: 400 10.5px var(--font-sans);
    color: var(--admin-on-soft);
}

@media (max-width: 900px) {
    .s7-adm-scrim {
        align-items: flex-end;
        padding: 0;
    }

    .s7-adm-modal {
        max-width: none;
        border-radius: 18px 18px 0 0;
        padding-bottom: calc(22px + var(--safe-bottom));
    }

    .s7-adm-modal__foot {
        flex-direction: column-reverse;
    }

    .s7-adm-modal__cancel,
    .s7-adm-modal__go {
        width: 100%;
        min-height: 44px;
    }

    .s7-adm-card__facts {
        grid-template-columns: 1fr;
    }
}
