/* ============================================================
   ADMIN CONSOLE — the page kit every /admin page shares
   Page header (Components/Shared/PageHeader), filter toolbar,
   tabs, sortable tables and a few cell helpers. Pages use these
   classes instead of inline styles, so a new page looks like the
   rest without copying markup from a neighbour.
   ============================================================ */

/* --- page header: denser than the member area's --- */
.shell--admin .page-head { margin-bottom: 1rem; }
.shell--admin .page-head__title { font-size: 1.5rem; }
.shell--admin .page-head__sub { max-width: 80ch; }
.shell--admin .back-link { margin-bottom: .5rem; }

/* --- filter toolbar: filters on the left, actions pushed right --- */
.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
    margin-bottom: 1rem;
}
.admin-toolbar .form-control,
.admin-toolbar .form-select { width: auto; }
.admin-toolbar .form-check { margin: 0; white-space: nowrap; font-size: .8125rem; }
.admin-toolbar__search { min-width: 15rem; }
.admin-toolbar__select { min-width: 11rem; max-width: 18rem; }
/* A number filter (minimum owed): as wide as its placeholder, not a text box's default width. */
.admin-toolbar .admin-toolbar__num { width: 10rem; }
.admin-toolbar__end {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}
@media (max-width: 767.98px) {
    .admin-toolbar__search,
    .admin-toolbar__select,
    .admin-toolbar .admin-toolbar__num { min-width: 0; width: auto; flex: 1 1 100%; }
    .admin-toolbar__end { margin-left: 0; }
}

/* --- tabs between views of one page (Entries | Registrations) --- */
.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    border-bottom: 1px solid var(--rsa-line);
    margin-bottom: 1rem;
}
.admin-tabs a {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem .9rem;
    margin-bottom: -1px;
    font-size: .875rem;
    font-weight: 600;
    color: var(--rsa-gray-500);
    border-bottom: 2px solid transparent;
}
.admin-tabs a:hover { color: var(--rsa-gray-900); }
.admin-tabs a.active {
    color: var(--rsa-purple-700);
    border-bottom-color: var(--rsa-purple-600);
    /* Same weight as the others: a bolder active tab was wider, and nudged every tab after it. */
}
.admin-tabs__count {
    min-width: 1.35rem;
    padding: 0 .4rem;
    border-radius: 999px;
    background: var(--rsa-gray-100);
    color: var(--rsa-gray-600);
    font-size: .75rem;
    line-height: 1.35rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.admin-tabs a.active .admin-tabs__count { background: var(--rsa-purple-50); color: var(--rsa-purple-700); }
.admin-tabs__dot {
    width: .45rem;
    height: .45rem;
    border-radius: 50%;
    background: var(--rsa-pink-600);
}
/* On a phone the tabs stay on one line and scroll sideways: wrapped onto two, the open tab's
   underline sat between the rows. The line under them is drawn inside the box, because a scroll
   box clips the tab's underline where it used to overlap the border. */
@media (max-width: 767.98px) {
    .admin-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        border-bottom: 0;
        box-shadow: inset 0 -1px 0 var(--rsa-line);
    }
    .admin-tabs::-webkit-scrollbar { display: none; }
    .admin-tabs a { flex: none; margin-bottom: 0; white-space: nowrap; }
}

/* --- tables: a white card around the table, sortable headers, clickable rows --- */
.admin-table {
    /* Positioned, so a visually-hidden heading inside a table that scrolls sideways stays in the
       scroll box instead of widening the whole page. */
    position: relative;
    background: var(--rsa-surface);
    border: 1px solid var(--rsa-line);
    border-radius: var(--rsa-radius-lg);
    box-shadow: var(--rsa-shadow-xs);
    overflow-x: auto;
}
.admin-table .table { margin: 0; }
/* A table of inputs (monthly fees, invoice lines): as wide as its fields, not the whole page, so a
   two-digit amount doesn't sit in a box half the screen wide. It still scrolls when too wide. */
.admin-table--fit { width: fit-content; max-width: 100%; }
.admin-table--fit .table { width: auto; }
.admin-table .table > :not(caption) > * > * { padding: .55rem .75rem; }
.admin-table .table > tbody > tr:last-child > * { border-bottom: 0; }

th.sortable {
    cursor: pointer;
    user-select: none;
}
th.sortable:hover { color: var(--rsa-gray-900); }
.sort-caret { display: inline-block; width: 1em; margin-left: .25rem; color: var(--rsa-purple-600); }
/* On a right-aligned column the caret hangs into the cell padding, so the heading lines up with the numbers under it. */
th.sortable.text-end .sort-caret { margin-right: calc(-1em - .25rem); }

tr.row-link { cursor: pointer; }

/* Totals under a table (a ledger's Charged / Paid / Outstanding): one rule above them and tighter
   rows, so they read as a summary rather than three more full-height rows. */
.shell--admin .table > tfoot > tr > * { padding-top: .35rem; padding-bottom: .35rem; border-bottom: 0; }
.shell--admin .table > tfoot > tr:first-child > * { padding-top: .7rem; border-top: 1px solid var(--rsa-line); }
.shell--admin .table > tfoot > tr:last-child > * { padding-bottom: .7rem; }
.shell--admin .table > tbody:has(+ tfoot) > tr:last-child > * { border-bottom: 0; }

.admin-foot {
    margin-top: .6rem;
    font-size: .8125rem;
    color: var(--rsa-gray-500);
}

.admin-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--rsa-gray-500);
    background: var(--rsa-surface);
    border: 1px dashed var(--rsa-line);
    border-radius: var(--rsa-radius-lg);
}
.admin-empty i { display: block; font-size: 1.6rem; margin-bottom: .4rem; color: var(--rsa-gray-400); }

/* --- cells --- */
.cell-sub { display: block; font-size: .8125rem; color: var(--rsa-gray-500); }
.cell-clip {
    display: inline-block;
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}
/* A clipped sub-line (an invoice's title under its number) is still a line of its own: .cell-clip's
   inline-block put it beside the number, with no space between them. */
.cell-sub.cell-clip { display: block; }
.cell-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: .35rem;
}
.cell-actions form { margin: 0; }

/* Masked ID number with a reveal toggle. */
.masked-id { white-space: nowrap; font-variant-numeric: tabular-nums; }
.masked-id button {
    border: 0;
    background: none;
    padding: 0 .25rem;
    color: var(--rsa-gray-400);
    font-size: .875rem;
    line-height: 1;
}
.masked-id button:hover { color: var(--rsa-purple-600); }

/* "Login as" — deliberately loud: it signs the super admin out of their own session. */
.btn-impersonate {
    --bs-btn-color: #3b2f00;
    --bs-btn-bg: var(--rsa-yellow-500);
    --bs-btn-border-color: var(--rsa-yellow-500);
    --bs-btn-hover-color: #3b2f00;
    --bs-btn-hover-bg: var(--rsa-yellow-400);
    --bs-btn-hover-border-color: var(--rsa-yellow-400);
    --bs-btn-active-bg: var(--rsa-yellow-600);
    --bs-btn-active-border-color: var(--rsa-yellow-600);
    font-weight: 600;
}

/* --- page widths: forms and detail pages read better narrower than the lists. Left-aligned, not
       centred, so every page's heading starts at the same edge as the full-width lists. --- */
.admin-narrow { max-width: 760px; margin-left: 0; margin-right: auto; }
.admin-medium { max-width: 1100px; margin-left: 0; margin-right: auto; }

/* --- stat tiles (dashboard) --- */
.admin-stat {
    display: block;
    height: 100%;
    padding: 1rem 1.1rem;
    background: var(--rsa-surface);
    border: 1px solid var(--rsa-line);
    border-radius: var(--rsa-radius-lg);
    box-shadow: var(--rsa-shadow-xs);
    color: inherit;
    transition: border-color var(--rsa-fast), box-shadow var(--rsa-fast);
}
a.admin-stat:hover { border-color: var(--rsa-purple-200); box-shadow: var(--rsa-shadow-sm); color: inherit; }
.admin-stat__label {
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--rsa-gray-500);
}
.admin-stat__value {
    font-family: var(--rsa-font-display);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--rsa-purple-600);
    font-variant-numeric: tabular-nums;
}
.admin-stat__value.is-due { color: var(--rsa-pink-600); }
.admin-stat__sub { font-size: .8125rem; color: var(--rsa-gray-500); margin-top: .15rem; }

/* --- a record's key facts, one strip above its tabs (an account's balance, swimmers, sign-in).
       Smaller than the dashboard's tiles: it sits on every tab, so it mustn't push them down.
       The 1px gaps over the line colour draw the dividers, and the last fact in a wrapped row
       stretches to the edge rather than leaving a hole. --- */
.admin-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    margin-bottom: 1rem;
    background: var(--rsa-line);
    border: 1px solid var(--rsa-line);
    border-radius: var(--rsa-radius-lg);
    box-shadow: var(--rsa-shadow-xs);
    overflow: hidden;
}
.admin-fact {
    display: flex;
    flex-direction: column;
    flex: 1 1 10rem;
    min-width: 0;
    padding: .7rem 1rem;
    background: var(--rsa-surface);
    color: inherit;
    transition: background-color var(--rsa-fast);
}
a.admin-fact:hover { background: var(--rsa-gray-50); color: inherit; }
.admin-fact__label {
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--rsa-gray-500);
}
.admin-fact__value {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--rsa-gray-900);
    font-variant-numeric: tabular-nums;
}
.admin-fact__value.is-due, .admin-fact__sub.is-due { color: var(--rsa-pink-600); }
.admin-fact__value.is-credit { color: var(--rsa-success); }
.admin-fact__sub { font-size: .8125rem; color: var(--rsa-gray-500); }
/* A long email or reference breaks inside its fact on a phone instead of running out of it. */
.admin-fact__value, .admin-fact__sub { overflow-wrap: anywhere; }

/* --- a record's details in two columns: they stay side by side at a reading distance on a wide
       screen instead of drifting to opposite edges --- */
.admin-details { max-width: 72rem; }

/* --- definition lists on detail pages --- */
.admin-dl { display: grid; grid-template-columns: minmax(8rem, max-content) 1fr; gap: .35rem 1rem; margin: 0; font-size: .875rem; }
.admin-dl dt { font-weight: 500; color: var(--rsa-gray-500); }
.admin-dl dd { margin: 0; color: var(--rsa-gray-800); min-width: 0; overflow-wrap: anywhere; }

/* --- a table inside a card: the card is already the frame, so the table's own border, radius and
       shadow would draw a second one just inside it --- */
.card .admin-table {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

/* --- danger and attention cards (delete / cancel / withdraw; Xero's "needs attention"): one look for
       all of them. Bootstrap's border-danger drew a heavy full-strength outline, and only some of these
       cards tinted their header. A soft border and a tinted header, like the member area's pink panel. --- */
.shell--admin .card.border-danger { border-color: var(--rsa-pink-200) !important; }
.shell--admin .card.border-danger > .card-header {
    background: var(--rsa-pink-50);
    color: var(--rsa-pink-700);
    border-bottom-color: var(--rsa-pink-100);
}
.shell--admin .card.border-warning { border-color: var(--rsa-yellow-200) !important; }
.shell--admin .card.border-warning > .card-header {
    background: var(--rsa-yellow-50);
    color: var(--rsa-yellow-700);
    border-bottom-color: var(--rsa-yellow-100);
}

/* --- card headers: the title, with an optional line under it (what the card is for, or a count) --- */
.card-header__sub {
    margin-top: .1rem;
    font-size: .8125rem;
    font-weight: 400;
    color: var(--rsa-gray-500);
}

/* --- a heading for a section of a page (between cards and tables, or inside a card's body) --- */
.admin-section-title {
    margin: 1.5rem 0 .6rem;
    font-size: 1rem;
    font-weight: 650;
    color: var(--rsa-gray-900);
}
.admin-tabs + .admin-section-title,
.card-body > .admin-section-title:first-child { margin-top: 0; }

/* --- long lists inside a card scroll on their own rather than stretching the page --- */
.admin-scroll { max-height: 65vh; overflow: auto; }
/* A short live preview box (the notice composer). */
.admin-preview { max-height: 220px; overflow: auto; }
/* A side card that stays in view while the form beside it scrolls (large screens only). */
@media (min-width: 992px) {
    .admin-sticky { position: sticky; top: 1rem; z-index: 1; }
}

/* --- widths for inputs inside table cells, so they don't collapse to nothing --- */
.cell-min-sm { min-width: 6rem; }
.cell-min-md { min-width: 9rem; }
.cell-min-lg { min-width: 14rem; }
.cell-w-xl { width: 22rem; }
/* A short number (a sort order): fixed, so the table doesn't share its spare width out to it. */
.cell-w-sm { width: 6rem; }

/* --- the price list dropdown beside an "add" button: as wide as its prompt, never the whole row --- */
.price-pick { width: auto; max-width: 18rem; }

/* --- clubs: a club's three brand colours, shown as they actually are --- */
.club-swatch {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 4px;
    border-radius: 5px;
    border: 1px solid var(--rsa-line);
    background: var(--club-swatch, transparent);
    vertical-align: middle;
}

/* ============================================================
   SECTIONS, NOT CARDS
   A record page (an account) is one white sheet per tab, split
   into sections by hairlines (Components/Shared/AdminSection):
   a heading row, then the content. Forms inside are AdminField
   rows, the label beside the field, as on Settings. Cards stay
   for the pages not moved over yet, flattened below so they sit
   closer to it.
   ============================================================ */

/* Cards everywhere else: no shadow and no gradient band across the top, so a page of them reads
   as one surface with divisions rather than a stack of raised boxes. */
.shell--admin .card { box-shadow: none; }
.shell--admin .card-header {
    background: var(--rsa-surface);
    border-bottom-color: var(--rsa-line-soft);
    padding-top: .85rem;
    padding-bottom: .85rem;
}

.admin-sheet {
    padding: 0 1.25rem;
    background: var(--rsa-surface);
    border: 1px solid var(--rsa-line);
    border-radius: var(--rsa-radius-lg);
    box-shadow: var(--rsa-shadow-xs);
}
@media (max-width: 575.98px) {
    .admin-sheet { padding: 0 1rem; }
}

.admin-section {
    padding: 1.35rem 0;
    border-top: 1px solid var(--rsa-line-soft);
}
.admin-section:first-child { border-top: 0; }
.admin-section__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem 1.5rem;
}
.admin-section__heading { min-width: 0; }
.admin-section__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 650;
    color: var(--rsa-gray-900);
}
.admin-section__desc {
    margin: .2rem 0 0;
    font-size: .8125rem;
    color: var(--rsa-gray-500);
}
/* On the right of the heading: a figure, a "Saved", the section's buttons. */
.admin-section__aside {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    text-align: right;
}
.admin-section__figure {
    width: 100%;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}
.admin-section__aside .admin-note { width: 100%; }
.admin-section__body { margin-top: 1rem; min-width: 0; }
/* A section whose content is folded away or has nothing to show is just its heading. */
.admin-section__body:empty { display: none; }
.admin-section__body > :last-child { margin-bottom: 0; }
.admin-section--danger .admin-section__title { color: var(--rsa-pink-700); }
/* Danger sections come last; one pink rule marks where they start. */
.admin-section:not(.admin-section--danger) + .admin-section--danger { border-top-color: var(--rsa-pink-100); }

/* Inside a sheet the sheet is the frame: a table keeps its border, not a second shadow. */
.admin-sheet .admin-table { box-shadow: none; }
.admin-sheet .admin-empty { padding: 1.75rem 1rem; }

/* A quiet line of explanation or status. */
.admin-note { font-size: .8125rem; line-height: 1.55; color: var(--rsa-gray-500); }
p.admin-note, ul.admin-note { margin-bottom: .75rem; }

/* --- a form field (Components/Shared/AdminField): label and help, the control, then a note about
       the value. Fixed column widths, not shares of the row, so a form keeps its size on a wide
       screen while the tables and the sheet around it use the width. --- */
.admin-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .4rem 2rem;
    margin-bottom: 1rem;
}
@media (min-width: 768px) {
    .admin-field {
        grid-template-columns: minmax(12rem, 17rem) minmax(0, 28rem) minmax(0, 1fr);
        align-items: start;
    }
    /* The label sits on the same line as the text in the field beside it. */
    .admin-field__label { padding-top: .25rem; }
    .admin-field__aside { padding-top: .3rem; }
}
.admin-field__control { min-width: 0; }
.admin-field__aside { font-size: .8125rem; color: var(--rsa-gray-500); }

/* Buttons under a table (add a row, save them all). */
.admin-form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
    margin-top: .9rem;
}
/* After AdminField rows, which carry their own space below. */
.admin-field + .admin-form-actions { margin-top: 0; }

/* Checkboxes that each say what they are: the whole row is the label (batches). */
.admin-check {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .55rem 0;
    border-top: 1px solid var(--rsa-line-soft);
    cursor: pointer;
}
.admin-check:first-child { border-top: 0; padding-top: 0; }
.admin-check .form-check-input { flex: none; margin: .15rem 0 0; }
.admin-check__label { display: block; font-size: .875rem; font-weight: 600; color: var(--rsa-gray-900); }
.admin-check__sub { display: block; font-size: .8125rem; color: var(--rsa-gray-500); }

/* A group of those per swimmer. */
.admin-group + .admin-group { margin-top: 1.25rem; }
.admin-group__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-bottom: .35rem;
}
.admin-group__title a { color: var(--rsa-gray-900); text-decoration: none; }
.admin-group__title a:hover { color: var(--rsa-purple-600); }
.admin-group__title + .admin-check { border-top: 0; }
.admin-group__meta { font-size: .8125rem; color: var(--rsa-gray-500); }

/* --- the edit panel (Components/Shared/AdminDrawer): Bootstrap's offcanvas, drawn open --- */
.admin-drawer {
    --bs-offcanvas-width: min(32rem, 100vw);
    --bs-offcanvas-bg: var(--rsa-surface);
    border-left: 1px solid var(--rsa-line);
    box-shadow: var(--rsa-shadow-lg);
    animation: admin-drawer-in 220ms cubic-bezier(.2, .8, .2, 1);
}
.admin-drawer .offcanvas-header { padding: 1.1rem 1.5rem; border-bottom: 1px solid var(--rsa-line-soft); }
.admin-drawer .offcanvas-title { font-size: 1.0625rem; font-weight: 650; }
.admin-drawer .offcanvas-body { padding: 1.5rem; }
.admin-drawer .form-label { margin-bottom: .3rem; font-size: .8125rem; font-weight: 600; }
.admin-drawer__foot {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    padding: .9rem 1.5rem;
    border-top: 1px solid var(--rsa-line-soft);
}
.admin-drawer__rule { border-top: 1px solid var(--rsa-line-soft); margin: .25rem 0; }
.admin-drawer__backdrop { animation: admin-fade-in 220ms ease-out; }
/* The page behind stays put while the panel is open. */
body:has(.admin-drawer) { overflow: hidden; }
@keyframes admin-drawer-in { from { transform: translateX(100%); } }
@keyframes admin-fade-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    .admin-drawer, .admin-drawer__backdrop { animation: none; }
}

/* SetupChecklist.razor: what a new club still has to set up, on its dashboard. */
.setup-checklist {
    padding: 1rem 1.15rem; border: 1px solid var(--rsa-purple-200); border-radius: var(--rsa-radius-sm);
    background: linear-gradient(180deg, var(--rsa-purple-50), #fff 70%);
}
.setup-checklist__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem; }
.setup-checklist__title { font-size: 1.05rem; font-weight: 700; margin: 0; color: var(--rsa-purple-800); }
.setup-checklist__sub { margin: .15rem 0 0; font-size: .8125rem; color: var(--rsa-gray-600); }
.setup-checklist__bar { flex: 0 1 12rem; height: 8px; border-radius: 999px; background: var(--rsa-purple-100); overflow: hidden; }
.setup-checklist__bar > span { display: block; height: 100%; border-radius: inherit; background: var(--rsa-purple-600); transition: width .3s ease; }
.setup-checklist__list { list-style: none; margin: .85rem 0 0; padding: 0; display: grid; gap: .55rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.setup-checklist__item { display: flex; gap: .55rem; align-items: flex-start; }
.setup-checklist__item > .bi { margin-top: .1rem; color: var(--rsa-gray-400); }
.setup-checklist__item.is-done > .bi { color: #12855f; }
.setup-checklist__item a { font-weight: 600; }
.setup-checklist__item.is-done a { color: var(--rsa-gray-600); text-decoration: line-through; text-decoration-color: var(--rsa-gray-300); }
.setup-checklist__hint { font-size: .8125rem; color: var(--rsa-gray-600); }
.setup-checklist__optional {
    margin-left: .35rem; padding: .05rem .4rem; border-radius: 999px; background: var(--rsa-gray-100);
    font-size: .6875rem; font-weight: 600; color: var(--rsa-gray-600); vertical-align: middle;
}

/* EventEditV2's Phases: a card per entry window. Head (number, kind, status, tools), then when it
   opens and closes on a row of their own, then what it costs. The late window wears the attention
   colour down its edge; a switched-off one fades back. */
.phase-list { display: grid; gap: .85rem; }
.phase-card {
    border: 1px solid var(--rsa-line);
    border-left: 4px solid var(--rsa-purple-400);
    border-radius: var(--rsa-radius-sm);
    background: #fff;
    transition: border-color var(--rsa-fast), opacity var(--rsa-fast);
}
.phase-card--late { border-left-color: var(--rsa-yellow-500); }
.phase-card--off { opacity: .62; border-left-color: var(--rsa-gray-300); }
.phase-card--off:focus-within { opacity: 1; }

.phase-card__head {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--rsa-line-soft);
    background: var(--rsa-gray-50);
    border-radius: calc(var(--rsa-radius-sm) - 1px) calc(var(--rsa-radius-sm) - 1px) 0 0;
}
.phase-card__title { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.phase-card__num {
    display: inline-grid; place-items: center; flex-shrink: 0;
    width: 1.75rem; height: 1.75rem; border-radius: 50%;
    background: var(--rsa-purple-50); color: var(--rsa-purple-700);
    font-size: .8125rem; font-weight: 700;
}
.phase-card--late .phase-card__num { background: var(--rsa-yellow-50); color: var(--rsa-yellow-700); }
.phase-card__name { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-weight: 650; color: var(--rsa-gray-900); }
.phase-card__summary { margin-top: .1rem; font-size: .8125rem; color: var(--rsa-gray-500); font-variant-numeric: tabular-nums; }
.phase-card__tools { display: flex; align-items: center; gap: .85rem; }

/* Normal / Late as one two-way switch rather than a dropdown with two choices. */
.phase-kind { display: inline-flex; padding: 2px; border: 1px solid var(--rsa-line); border-radius: 999px; background: #fff; }
.phase-kind__opt {
    border: 0; background: transparent; padding: .2rem .75rem; border-radius: 999px;
    font-size: .8125rem; font-weight: 600; color: var(--rsa-gray-500); cursor: pointer;
    transition: background var(--rsa-fast), color var(--rsa-fast);
}
.phase-kind__opt:hover { color: var(--rsa-gray-800); }
.phase-kind__opt.is-on { background: var(--rsa-purple-600); color: #fff; }
.phase-card--late .phase-kind__opt.is-on { background: var(--rsa-yellow-500); color: var(--rsa-gray-900); }
.phase-kind__opt:focus-visible { outline: 2px solid var(--rsa-purple-300); outline-offset: 1px; }

.phase-card__body { padding: 1rem; display: grid; gap: 1rem; }
.phase-card__when {
    display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: .75rem 1rem;
}
.phase-card__arrow { color: var(--rsa-gray-400); padding-bottom: .45rem; }
.phase-card__pricing {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .75rem 1.25rem;
    padding-top: .9rem; border-top: 1px dashed var(--rsa-line);
}
.phase-field { display: grid; gap: .3rem; min-width: 0; align-content: start; }
.phase-field__label {
    display: inline-flex; align-items: center; gap: .35rem;
    font-size: .75rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--rsa-gray-600);
}
.phase-field__label .bi { color: var(--rsa-gray-400); }
.phase-field__money { max-width: 11rem; }
.phase-field__help { font-size: .75rem; line-height: 1.45; color: var(--rsa-gray-500); }

.phase-empty {
    display: flex; align-items: center; gap: .75rem;
    padding: 1rem 1.1rem; border: 1px dashed var(--rsa-purple-200); border-radius: var(--rsa-radius-sm);
    background: var(--rsa-purple-50); font-size: .875rem; color: var(--rsa-gray-700);
}
.phase-empty > .bi { font-size: 1.35rem; color: var(--rsa-purple-400); }

/* Narrow: the dates stack, and the arrow between them turns to point down. */
@media (max-width: 991.98px) {
    .phase-card__when { grid-template-columns: minmax(0, 1fr); }
    .phase-card__arrow { transform: rotate(90deg); justify-self: start; padding: 0 0 0 .25rem; }
}
@media (prefers-reduced-motion: reduce) {
    .phase-card, .phase-kind__opt { transition: none; }
}
