/* ============================================================
   DragonComp — design system
   Dark-first, product-grade UI (Linear / GitHub / Vercel family):
   deep slate surfaces (not pure black), restrained crimson accent,
   soft 1px borders, rounded corners, sentence-case type, real
   spacing + hierarchy. Light theme keeps parity.
   Swap the token blocks to re-skin the whole app.
   ============================================================ */

:root {
    /* surfaces */
    --bg: #F3F3F1;
    --surface: #FFFFFF;
    --surface-2: #ECECEA;
    --surface-3: #E2E2DF;
    --ink: #17171A;
    --ink-2: #52525B;
    --muted: #82828B;
    --line: #E0E0DC;
    --line-strong: #CCCCC7;

    /* brand */
    --accent: #D63A3F;
    --accent-hover: #C22F34;
    --accent-ink: #FFFFFF;
    --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
    --accent-border: color-mix(in srgb, var(--accent) 32%, transparent);

    /* status */
    --ok: #1F9D57;
    --ok-soft: color-mix(in srgb, var(--ok) 13%, transparent);
    --warn: #B4790E;

    /* shape + depth — card shadow carries a faint edge glow so panels lift off the page */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-pill: 999px;
    --shadow-sm:
        0 1px 2px rgba(20, 20, 25, .05),
        0 6px 18px -8px rgba(20, 20, 25, .14),
        0 0 0 1px rgba(20, 20, 25, .04);
    --shadow:
        0 2px 6px rgba(20, 20, 25, .07),
        0 18px 40px -14px rgba(20, 20, 25, .20),
        0 0 0 1px rgba(20, 20, 25, .05);
    --lift:
        0 2px 4px rgba(20, 20, 25, .06),
        0 14px 32px -10px rgba(20, 20, 25, .22),
        0 0 0 1px rgba(20, 20, 25, .06);

    /* type */
    --font-body: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: var(--font-body);
    --font-serif: "Spectral", Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0B0C0F;
        --surface: #17181D;
        --surface-2: #1E1F25;
        --surface-3: #262832;
        --ink: #E9E9EC;
        --ink-2: #B4B4BC;
        --muted: #7E7F89;
        --line: #2A2B33;
        --line-strong: #3A3B44;

        --accent: #E5484D;
        --accent-hover: #EC5A5E;
        --accent-ink: #FFFFFF;
        --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
        --accent-border: color-mix(in srgb, var(--accent) 38%, transparent);

        --ok: #3DB37E;
        --ok-soft: color-mix(in srgb, var(--ok) 16%, transparent);
        --warn: #E0A64B;

        --shadow-sm:
            0 1px 2px rgba(0, 0, 0, .45),
            0 10px 26px -12px rgba(0, 0, 0, .6),
            0 0 0 1px rgba(255, 255, 255, .045),
            0 0 26px -12px rgba(255, 255, 255, .06);
        --shadow:
            0 4px 10px rgba(0, 0, 0, .5),
            0 24px 50px -18px rgba(0, 0, 0, .7),
            0 0 0 1px rgba(255, 255, 255, .06),
            0 0 40px -16px rgba(255, 255, 255, .07);
        --lift:
            0 4px 10px rgba(0, 0, 0, .5),
            0 20px 44px -14px rgba(0, 0, 0, .7),
            0 0 0 1px rgba(255, 255, 255, .09),
            0 0 34px -12px rgba(255, 255, 255, .09);
    }
}

/* explicit light — re-asserts the defaults so a nested [data-theme="light"] pane
   overrides an ambient dark theme (used by the hero-background preview) */
[data-theme="light"] {
    --bg: #F3F3F1;
    --surface: #FFFFFF;
    --surface-2: #ECECEA;
    --surface-3: #E2E2DF;
    --ink: #17171A;
    --ink-2: #52525B;
    --muted: #82828B;
    --line: #E0E0DC;
    --line-strong: #CCCCC7;

    --accent: #D63A3F;
    --accent-hover: #C22F34;
    --accent-ink: #FFFFFF;
    --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
    --accent-border: color-mix(in srgb, var(--accent) 32%, transparent);

    --ok: #1F9D57;
    --ok-soft: color-mix(in srgb, var(--ok) 13%, transparent);
    --warn: #B4790E;

    --shadow-sm:
        0 1px 2px rgba(20, 20, 25, .05),
        0 6px 18px -8px rgba(20, 20, 25, .14),
        0 0 0 1px rgba(20, 20, 25, .04);
    --shadow:
        0 2px 6px rgba(20, 20, 25, .07),
        0 18px 40px -14px rgba(20, 20, 25, .20),
        0 0 0 1px rgba(20, 20, 25, .05);
    --lift:
        0 2px 4px rgba(20, 20, 25, .06),
        0 14px 32px -10px rgba(20, 20, 25, .22),
        0 0 0 1px rgba(20, 20, 25, .06);
}

:root[data-theme="dark"],
[data-theme="dark"] {
    --bg: #0B0C0F;
    --surface: #17181D;
    --surface-2: #1E1F25;
    --surface-3: #262832;
    --ink: #E9E9EC;
    --ink-2: #B4B4BC;
    --muted: #7E7F89;
    --line: #2A2B33;
    --line-strong: #3A3B44;

    --accent: #E5484D;
    --accent-hover: #EC5A5E;
    --accent-ink: #FFFFFF;
    --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
    --accent-border: color-mix(in srgb, var(--accent) 38%, transparent);

    --ok: #3DB37E;
    --ok-soft: color-mix(in srgb, var(--ok) 16%, transparent);
    --warn: #E0A64B;

    --shadow-sm:
        0 1px 2px rgba(0, 0, 0, .45),
        0 10px 26px -12px rgba(0, 0, 0, .6),
        0 0 0 1px rgba(255, 255, 255, .045),
        0 0 26px -12px rgba(255, 255, 255, .06);
    --shadow:
        0 4px 10px rgba(0, 0, 0, .5),
        0 24px 50px -18px rgba(0, 0, 0, .7),
        0 0 0 1px rgba(255, 255, 255, .06),
        0 0 40px -16px rgba(255, 255, 255, .07);
    --lift:
        0 4px 10px rgba(0, 0, 0, .5),
        0 20px 44px -14px rgba(0, 0, 0, .7),
        0 0 0 1px rgba(255, 255, 255, .09),
        0 0 34px -12px rgba(255, 255, 255, .09);
}

html, body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--ink);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ---------- typography ---------- */
h1, h2, h3, h4, h5, .display {
    font-family: var(--font-display);
    text-transform: none;
    letter-spacing: -.02em;
    line-height: 1.2;
    color: var(--ink);
    font-weight: 700;
}

h1 {
    font-size: clamp(1.6rem, 2.6vw, 2rem);
    margin-bottom: .5rem;
}

h2 {
    font-size: 1.2rem;
    font-weight: 650;
    margin-bottom: .75rem;
}

h3 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -.01em;
}

a {
    color: var(--ink);
    text-decoration: none;
    text-underline-offset: 3px;
    font-weight: 500;
}

    a:hover {
        color: var(--accent);
        text-decoration: none;
    }

/* opt-in accent link for standalone actions ("Change logo", "← Back", …).
   :not(.btn) so button-styled anchors keep their own colours. */
.link-accent:not(.btn),
p > a:only-child:not(.btn) {
    color: var(--accent);
}

    .link-accent:not(.btn):hover,
    p > a:only-child:not(.btn):hover {
        color: var(--accent-hover);
        text-decoration: underline;
    }

p {
    line-height: 1.6;
}

.lead-serif {
    font-family: var(--font-body);
    font-size: 1.02rem;
    line-height: 1.6;
    color: var(--ink-2);
    font-weight: 400;
}

.eyebrow {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .1em;
    font-size: .7rem;
    color: var(--muted);
    margin: 0 0 .5rem;
}

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

hr {
    border: 0;
    border-top: 1px solid var(--line);
    opacity: 1;
    margin: 1.5rem 0;
}

/* ---------- focus ---------- */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn:focus, .btn:active:focus,
.form-control:focus, .form-check-input:focus, .form-select:focus {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);
    border-color: var(--accent);
    outline: none;
}

/* ---------- buttons ---------- */
.btn {
    --bs-btn-focus-box-shadow: none;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: .875rem;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1.2;
    padding: .5rem .95rem;
    border-width: 1px;
    border-radius: var(--radius-sm);
    transition: background-color .12s ease, border-color .12s ease, color .12s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
}

.btn-sm {
    padding: .35rem .65rem;
    font-size: .8rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: .62rem 1.15rem;
    font-size: .925rem;
    border-radius: var(--radius-sm);
}

.btn svg {
    width: 1rem;
    height: 1rem;
}

.btn-primary,
.btn-primary:disabled,
.btn-primary.disabled {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

    .btn-primary:hover,
    .btn-primary:focus,
    .btn-primary:active,
    .btn-primary:not(:disabled):not(.disabled):active {
        background-color: var(--accent-hover);
        border-color: var(--accent-hover);
        color: var(--accent-ink);
    }

/* neutral / secondary — surface chip with a hairline */
.btn-secondary,
.btn-secondary:disabled,
.btn-outline-primary,
.btn-outline-secondary {
    background-color: var(--surface);
    border-color: var(--line-strong);
    color: var(--ink);
}

    .btn-secondary:hover,
    .btn-secondary:focus,
    .btn-secondary:active,
    .btn-outline-primary:hover,
    .btn-outline-primary:focus,
    .btn-outline-primary:active,
    .btn-outline-secondary:hover,
    .btn-outline-secondary:focus,
    .btn-outline-secondary:active {
        background-color: var(--surface-2);
        border-color: var(--line-strong);
        color: var(--ink);
    }

.btn-danger,
.btn-danger:disabled {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

    .btn-danger:hover,
    .btn-danger:focus,
    .btn-danger:active {
        background-color: var(--accent-hover);
        border-color: var(--accent-hover);
    }

.btn-outline-danger {
    background-color: transparent;
    border-color: var(--accent-border);
    color: var(--accent);
}

    .btn-outline-danger:hover,
    .btn-outline-danger:active {
        background-color: var(--accent-soft);
        border-color: var(--accent);
        color: var(--accent);
    }

.btn-link {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
    color: var(--accent);
    padding: 0;
    border: 0;
}

/* ---------- layout content ---------- */
.content {
    padding-top: 1.75rem;
    padding-bottom: 4rem;
    max-width: 1180px;
}

h1:focus {
    outline: none;
}

/* ---------- surfaces & cards ---------- */
.card, .list-group-item {
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink);
    border-radius: var(--radius-lg);
}

.card {
    box-shadow: var(--shadow-sm);
}

/* generic panel used across pages */
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

    .panel-head h2 {
        margin: 0;
        font-size: 1.05rem;
    }

/* ---------- tables (softened; card-lists are preferred) ---------- */
.table {
    color: var(--ink);
    border-color: var(--line);
    --bs-table-bg: transparent;
    --bs-table-color: var(--ink);
    margin-bottom: 0;
}

    .table > :not(caption) > * > * {
        background: transparent;
        color: var(--ink);
        border-bottom-color: var(--line);
        padding: .7rem .5rem;
    }

    .table thead th {
        font-family: var(--font-body);
        text-transform: none;
        letter-spacing: 0;
        font-size: .8rem;
        font-weight: 600;
        color: var(--muted);
        border-bottom: 1px solid var(--line-strong);
    }

    .table tbody tr:last-child > * {
        border-bottom: 0;
    }

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background: color-mix(in srgb, var(--surface-2) 55%, transparent);
    color: var(--ink);
}

/* ---------- forms ---------- */
.form-control, .form-select {
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    color: var(--ink);
    padding: .5rem .7rem;
    font-size: .9rem;
}

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

    .form-control:focus, .form-select:focus {
        background: var(--surface);
        color: var(--ink);
    }

    .form-control:disabled, .form-control[readonly],
    .form-select:disabled {
        background-color: var(--surface-2);
        color: var(--muted);
        opacity: 1;
    }

.form-floating > label {
    color: var(--muted);
}

label, .form-label, .control-label {
    color: var(--ink);
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: .35rem;
}

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

.form-check-input {
    border-radius: 4px !important;
    border: 1px solid var(--line-strong);
    background-color: var(--surface);
}

    /* ...but a radio stays round, so it reads as "pick one". */
    .form-check-input[type="radio"] {
        border-radius: 50% !important;
    }

    .form-check-input:checked {
        background-color: var(--accent);
        border-color: var(--accent);
    }

.form-check-label {
    font-weight: 400;
}

/* ---------- alerts ---------- */
.alert {
    border-radius: var(--radius);
    border: 1px solid var(--line);
    padding: .8rem 1rem;
    font-size: .9rem;
}

.alert-success {
    background: var(--ok-soft);
    border-color: color-mix(in srgb, var(--ok) 35%, transparent);
    color: var(--ink);
}

.alert-danger {
    background: var(--accent-soft);
    border-color: var(--accent-border);
    color: var(--ink);
}

.alert-info {
    background: var(--surface-2);
    border-color: var(--line-strong);
    color: var(--ink);
}

/* ---------- badges / pills ---------- */
.badge {
    border-radius: var(--radius-pill);
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    font-size: .75rem;
    padding: .25rem .6rem;
    border: 1px solid transparent;
}

.bg-secondary {
    background: var(--surface-2) !important;
    color: var(--ink-2) !important;
    border-color: var(--line) !important;
}

/* reusable status pill */
.pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border-radius: var(--radius-pill);
    font-size: .75rem;
    font-weight: 500;
    padding: .2rem .6rem;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--ink-2);
    white-space: nowrap;
}

.pill--accent {
    background: var(--accent-soft);
    border-color: var(--accent-border);
    color: var(--accent);
}

.pill--ok {
    background: var(--ok-soft);
    border-color: color-mix(in srgb, var(--ok) 35%, transparent);
    color: var(--ok);
}

.pill--muted {
    color: var(--muted);
}

/* ---------- messages ---------- */
.messages-filter {
    display: flex;
    gap: .5rem;
    margin-bottom: 1.25rem;
}

.messages-filter .pill {
    cursor: pointer;
    text-decoration: none;
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.message-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: .9rem;
    padding: 1rem 1.1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    transition: border-color .1s ease, background-color .1s ease;
}

    .message-card:hover {
        border-color: var(--accent-border);
        background: var(--accent-soft);
    }

.message-card--unread {
    border-color: var(--accent-border);
}

.message-card__logo {
    flex-shrink: 0;
    border-radius: var(--radius-sm);
}

.message-card__body {
    min-width: 0;
    flex: 1;
}

.message-card__top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
}

.message-card__subject {
    font-weight: 500;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-card--unread .message-card__subject {
    font-weight: 700;
}

.message-card__date {
    flex-shrink: 0;
    font-size: .8rem;
    color: var(--muted);
}

.message-card__club {
    font-size: .8rem;
    color: var(--accent);
    margin-top: .1rem;
}

.message-card__snippet {
    margin: .3rem 0 0;
    color: var(--ink-2);
    font-size: .875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-card__dot {
    flex-shrink: 0;
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
    background: var(--accent);
    margin-top: .4rem;
}

/* ---------- tabs (My Details, Club Members roster/queue) ---------- */
.tabs__nav {
    display: flex;
    border-bottom: 1px solid var(--line);
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.tabs__btn {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    appearance: none;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: .65rem .25rem;
    margin-right: 1.5rem;
    font: inherit;
    font-weight: 600;
    font-size: .9rem;
    color: var(--muted);
    cursor: pointer;
    transition: color .12s ease, border-color .12s ease;
}

    .tabs__btn:hover {
        color: var(--ink-2);
    }

    .tabs__btn.is-active {
        color: var(--ink);
        border-bottom-color: var(--accent);
    }

.tabs__btn-count {
    color: var(--muted);
    font-weight: 600;
}

/* ---------- query-string-driven tab links (Manage Club's session locations, Club
   Members roster) — a plain <a> per tab rather than [data-tabs]' client-only buttons,
   for a tab whose content also depends on other query params (search, sort, page) that
   already need a server round-trip. Global since more than one page uses it. ---------- */
.loc-tabs {
    display: flex;
    gap: .25rem;
    margin: -.25rem 0 1.1rem;
    /* the rule under the tabs is a shadow, not a border, so the active tab's underline can sit on it
       without anything overflowing (which would put a scrollbar on the strip) */
    box-shadow: inset 0 -1px 0 var(--line);
    overflow-x: auto;
    overflow-y: hidden;
}

.loc-tab {
    flex-shrink: 0;
    max-width: 14rem;
    padding: .5rem .9rem;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-size: .875rem;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .loc-tab:hover {
        color: var(--ink);
    }

    .loc-tab:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: -2px;
        border-radius: var(--radius-sm);
    }

.loc-tab--active {
    color: var(--ink);
    font-weight: 600;
    border-bottom-color: var(--accent);
}

/* ---------- session date rows (Manage Club's Next/Previous 5 cards, and the sessions
   history "view all" page) — global since both pages render the same row shape. ---------- */
.sess-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sess-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 0;
    border-bottom: 1px solid var(--line);
}

    .sess-row:first-child {
        padding-top: 0;
    }

    .sess-row:last-child {
        padding-bottom: 0;
        border-bottom: 0;
    }

.sess-row--cancelled .sess-row__body {
    opacity: .65;
}

.sess-row__body {
    flex: 1;
    min-width: 0;
}

.sess-row__title-line {
    display: flex;
    align-items: center;
    gap: .4rem;
}

    .sess-row__title-line .sess-title {
        flex: 1 1 auto;
        min-width: 0;
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.sess-row__aside {
    flex-shrink: 0;
    font-size: .78rem;
    color: var(--muted);
}

.sess-title {
    font-weight: 600;
    font-size: .9rem;
    color: var(--ink);
    text-decoration: none;
}

    .sess-title:hover {
        color: var(--accent);
    }

/* the small completed-tick that leads a row's title (kept out of the aside so it never crowds
   the RSVP/attended count there) */
.sess-tick {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    color: var(--ok);
}

    .sess-tick svg {
        width: .85rem;
        height: .85rem;
        stroke-width: 3;
    }

.sess-meta {
    margin: .15rem 0 0;
    font-size: .8rem;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.sess-meta--icon {
    display: flex;
    align-items: center;
    gap: .35rem;
}

    .sess-meta--icon svg {
        width: .85rem;
        height: .85rem;
        flex-shrink: 0;
    }

.sess-meta--holiday {
    color: var(--warn);
    font-weight: 500;
}

/* status pills: red for cancelled, amber for a club closure */
.sess-pill--cancelled {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 9%, transparent);
    border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.sess-pill--holiday {
    color: var(--warn);
    background: color-mix(in srgb, var(--warn) 12%, transparent);
    border-color: color-mix(in srgb, var(--warn) 40%, transparent);
}

/* date chip: weekday / day / month */
.sess-date {
    flex-shrink: 0;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 2.9rem;
    padding: .3rem 0;
    line-height: 1.1;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.sess-date__dow,
.sess-date__mon {
    font-size: .62rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}

.sess-date__day {
    font-size: 1.15rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* accepted / declined / attended tally (same look as the session edit page) */
.rsvp-stat {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

    .rsvp-stat::before {
        content: "";
        width: .5rem;
        height: .5rem;
        border-radius: 50%;
        background: var(--muted);
    }

    .rsvp-stat b {
        color: var(--ink);
        font-variant-numeric: tabular-nums;
    }

.rsvp-stat--accepted::before,
.rsvp-stat--attended::before {
    background: var(--ok);
}

.rsvp-stat--declined::before {
    background: var(--accent);
}

.sess-empty {
    margin: 0;
    color: var(--muted);
    font-size: .85rem;
}

/* ---------- bulk selection (Club Members "Requests" queue) ---------- */
.bulk-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1rem;
}

.bulk-actions__select-all {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .875rem;
    color: var(--ink-2);
    margin-right: auto;
}

/* ---------- validation ---------- */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--ok);
}

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

.validation-message {
    color: var(--accent);
    font-size: .825rem;
}

/* ---------- generic nav links (Identity "Manage account" menu, etc.) ---------- */
.nav-link {
    color: var(--muted);
}

    .nav-link:hover,
    .nav-link:focus {
        color: var(--ink);
    }

    .nav-link.active {
        color: var(--ink);
    }

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background-color: var(--surface-2);
    color: var(--ink);
    border-radius: var(--radius-sm);
}

.list-group-item.active {
    background: var(--surface-2);
    border-color: var(--line);
    color: var(--ink);
}

/* ---------- theme toggle ---------- */
.theme-toggle {
    font: inherit;
    font-size: .8rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ink-2);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    padding: .32rem .75rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}

    .theme-toggle:hover {
        color: var(--ink);
        border-color: var(--line-strong);
    }

    .theme-toggle .dot {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: var(--accent);
        display: inline-block;
    }

/* ---------- top-bar actions ---------- */
.topbar-actions {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

    .topbar-actions form {
        display: inline-flex;
        margin: 0;
    }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    text-decoration: none;
}

    .icon-btn:hover {
        color: var(--ink);
        background: var(--surface-2);
    }

    .icon-btn svg {
        width: 1.05rem;
        height: 1.05rem;
    }

.topbar-link {
    white-space: nowrap;
    text-decoration: none;
    text-transform: none;
    letter-spacing: 0;
    font-size: .85rem;
    font-weight: 500;
    color: var(--ink-2);
}

    .topbar-link:hover {
        color: var(--ink);
    }

/* ---------- "acting as club owner" banner ---------- */
.acting-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .55rem 2rem;
    background: var(--accent-soft);
    border-bottom: 1px solid var(--accent-border);
    color: var(--ink);
    font-size: .85rem;
    font-weight: 500;
}

.acting-banner__exit {
    flex-shrink: 0;
    background: var(--accent);
    color: var(--accent-ink);
    border: 0;
    border-radius: var(--radius-sm);
    padding: .3rem .85rem;
    font: inherit;
    font-size: .8rem;
    font-weight: 500;
    cursor: pointer;
}

    .acting-banner__exit:hover {
        background: var(--accent-hover);
    }

/* ---------- club header (logo + name) ---------- */
.club-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

    .club-head h1 {
        margin-bottom: .1rem;
    }

.club-head__meta {
    font-size: .875rem;
    margin: 0;
}

.club-head .eyebrow {
    margin-bottom: .3rem;
}

/* ---------- club hero (Manage Club top card; previewed on Club details) ---------- */
.club-hero {
    position: relative;
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
    isolation: isolate;
}

.club-hero .club-logo {
    width: 88px;
    height: 88px;
    border-radius: var(--radius);
    font-size: 2rem;
}

.club-hero__body {
    position: relative;
    min-width: 0;
    flex: 1;
}

    .club-hero__body h1 {
        margin: 0 0 .4rem;
    }

.club-hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    color: var(--muted);
    font-size: .9rem;
    margin: 0 0 1.1rem;
}

    .club-hero__meta .dot {
        opacity: .5;
    }

.club-hero__country {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

    .club-hero__country img {
        border-radius: 2px;
        border: 1px solid var(--line);
    }

.club-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    position: relative;
}

/* small "edit club details / background" affordance, top-right of the card */
.club-hero__edit {
    position: absolute;
    top: .85rem;
    right: .85rem;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-sm);
    color: var(--ink-2);
    background: color-mix(in srgb, var(--surface) 62%, transparent);
    border: 1px solid var(--line);
    backdrop-filter: blur(4px);
    transition: color .12s ease, background-color .12s ease;
}

    .club-hero__edit:hover {
        color: var(--ink);
        background: var(--surface);
    }

    .club-hero__edit svg {
        width: 1rem;
        height: 1rem;
    }

/* background image + readability scrim (theme-aware, so it works light and dark) */
.club-hero--image::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: var(--hero-image);
    background-size: cover;
    background-position: center;
}

.club-hero--image::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(
        100deg,
        var(--surface) 0%,
        color-mix(in srgb, var(--surface) 82%, transparent) 42%,
        color-mix(in srgb, var(--surface) 32%, transparent) 100%);
}

/* compact hero used inside the Club details preview panes */
.club-hero--mini {
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    margin: 0;
}

    .club-hero--mini .club-logo {
        width: 44px;
        height: 44px;
        border-radius: var(--radius-sm);
        font-size: 1rem;
    }

    .club-hero--mini h1 {
        font-size: 1.15rem;
    }

    .club-hero--mini .club-hero__meta {
        margin: 0;
    }

/* ---------- hero-background preview (two theme panes) ---------- */
.hero-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

@media (max-width: 700px) {
    .hero-preview {
        grid-template-columns: 1fr;
    }
}

.hero-preview__pane {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem;
}

.hero-preview__label {
    display: block;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: .6rem;
}

/* ---------- preset picker ---------- */
.subhead {
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 1.5rem 0 .75rem;
}

/* Titled form/panel section: a tinted icon tile + title (+ optional one-line hint). The
   icon comes from the AppIcon child component, so its size has to be set globally. */
.section-head {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin-bottom: 1.15rem;
}

.section-head__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent);
}

    .section-head__icon svg {
        width: 1.1rem;
        height: 1.1rem;
    }

.section-head h2 {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 650;
    line-height: 1.2;
}

.section-head__hint {
    margin: .1rem 0 0;
    font-size: .78rem;
    color: var(--muted);
}

.section-head__action {
    margin-left: auto;
    flex-shrink: 0;
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .75rem;
    margin-bottom: .5rem;
}

.preset-tile {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

    .preset-tile button {
        aspect-ratio: 16 / 9;
        width: 100%;
        border: 1px solid var(--line-strong);
        border-radius: var(--radius-sm);
        background-size: cover;
        background-position: center;
        cursor: pointer;
        padding: 0;
        transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
    }

    .preset-tile button:hover {
        transform: translateY(-1px);
        box-shadow: var(--lift);
    }

    .preset-tile.is-active button {
        border-color: var(--accent);
        box-shadow: 0 0 0 2px var(--accent);
    }

.preset-tile__name {
    font-size: .8rem;
    color: var(--ink-2);
}

/* ---------- club logo / initials badge ---------- */
.club-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    flex-shrink: 0;
    border: 1px solid var(--line);
    background: var(--surface-2);
    object-fit: cover;
    border-radius: var(--radius);
    overflow: hidden;
}

img.club-logo {
    object-fit: cover;
}

.club-logo--initials {
    border-color: transparent;
    background: linear-gradient(150deg, var(--accent), var(--accent-hover));
    color: var(--accent-ink);
    font-family: var(--font-body);
    font-weight: 700;
    line-height: 1;
    letter-spacing: .01em;
    text-transform: uppercase;
    user-select: none;
}

.club-name-cell {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
}

/* ---------- club location map (Leaflet) ---------- */
.loc-map-wrap .form-label {
    display: block;
}

.loc-map {
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface-2);
}

/* Both themes use Voyager. Light theme: firmer contrast, brightness eased down.
   Dark theme: brightness 0.88 so it sits in the dark card. Point ops — no seams. */
.loc-map .leaflet-tile {
    filter: brightness(0.94) contrast(1.28) saturate(1.18);
}

:root[data-theme="dark"] .loc-map .leaflet-tile {
    filter: brightness(0.88) contrast(1.06) saturate(1.05);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .loc-map .leaflet-tile {
        filter: brightness(0.88) contrast(1.06) saturate(1.05);
    }
}

.loc-map__hint {
    margin-top: .4rem;
}

/* Leaflet renders its own DOM outside scoped CSS — theme it here */
.leaflet-container {
    background: var(--surface-2);
    font: inherit;
}

.leaflet-control-attribution {
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    color: var(--muted);
}

    .leaflet-control-attribution a {
        color: var(--ink-2);
    }

.leaflet-bar a,
.leaflet-bar a:hover {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--line);
}

    .leaflet-bar a:hover {
        background: var(--surface-2);
    }

/* ---------- shared page components ---------- */
.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

    .page-head h1 {
        margin-bottom: .15rem;
    }

    .page-head__sub {
        color: var(--muted);
        font-size: .9rem;
        margin: 0;
        max-width: 60ch;
    }

    .page-head__actions {
        display: flex;
        gap: .5rem;
        flex-wrap: wrap;
    }

/* card list container + generic rows */
.card-list {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.list-row {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .8rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    color: var(--ink);
    text-decoration: none;
}

a.list-row {
    transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}

    a.list-row:hover {
        border-color: var(--line-strong);
        box-shadow: var(--lift);
        transform: translateY(-1px);
        color: var(--ink);
    }

.list-row__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

.list-row__title {
    font-weight: 600;
    font-size: .925rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-row__meta {
    font-size: .8rem;
    color: var(--muted);
}

.list-row__aside {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
}

.list-row .list-row__arrow {
    width: 1rem;
    height: 1rem;
    color: var(--muted);
    flex-shrink: 0;
}

.list-row .club-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    font-size: .9rem;
}

/* club card (dashboard / directory rows) */
.club-cards {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    max-width: 44rem;
}

.club-card {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .85rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: var(--ink);
    transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}

    .club-card:hover {
        border-color: var(--line-strong);
        box-shadow: var(--lift);
        transform: translateY(-1px);
        color: var(--ink);
    }

.club-card .club-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    font-size: .9rem;
}

.club-card__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

.club-card__name {
    font-weight: 600;
    font-size: .925rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.club-card__meta {
    font-size: .8rem;
    color: var(--muted);
}

.club-card .club-card__arrow {
    width: 1rem;
    height: 1rem;
    color: var(--muted);
    flex-shrink: 0;
}

/* directory rows aren't links — no hover lift, no pointer */
.club-card--static {
    cursor: default;
}

    .club-card--static:hover {
        border-color: var(--line);
        box-shadow: var(--shadow-sm);
        transform: none;
    }

.club-card__aside {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
}

    .club-card__aside form {
        margin: 0;
    }

@media (max-width: 560px) {
    .club-card__aside {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}

/* member roster rows */
.member-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.member-row {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .7rem 0;
    border-bottom: 1px solid var(--line);
}

    .member-row:last-child {
        border-bottom: 0;
    }

.member-row__name {
    flex: 1;
    min-width: 0;
    font-size: .9rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-row--link {
    text-decoration: none;
    color: var(--ink);
    border-radius: var(--radius-sm);
    transition: background-color .1s ease;
}

    .member-row--link:hover {
        background: var(--surface-2);
        color: var(--ink);
    }

/* round initial avatar */
.avatar {
    width: 2.1rem;
    height: 2.1rem;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--surface-3);
    color: var(--ink-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .02em;
}

/* ---------- roster / request / invite row cards (Club Members page) ----------
   Shared by ClubRosterRow.razor (a child component) and the Requests/Invites markup
   inline in ClubMembers.razor itself — kept global rather than in that page's scoped
   .razor.css, since Blazor CSS isolation doesn't reach into a child component's own
   render output. */
.roster-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

    .roster-list > li {
        list-style: none;
    }

/* A junior's card nested under their Parent/Guardian's own request card above it. */
.roster-card--indented {
    margin-left: 2.6rem;
}

    .roster-card--indented .roster-row {
        border-left: 2px solid var(--accent-border);
    }

.roster-row {
    position: relative;
    display: grid;
    grid-template-columns: 4.5rem minmax(11rem, 20rem) 1fr auto;
    align-items: center;
    column-gap: 1.25rem;
    padding: 1.1rem 1.35rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.roster-row--link {
    transition: border-color .1s ease, background-color .1s ease;
}

    .roster-row--link:hover {
        border-color: var(--accent-border);
        background: var(--accent-soft);
    }

/* Compact variant for the Members page's own three roster tabs (ClubRosterRow.razor) —
   roughly half the padded height of the plain .roster-row the Requests/Invites tabs still
   use, by shrinking padding/avatar/font-size rather than moving any content to a new line. */
.roster-row--compact {
    padding: .55rem .9rem;
}

    .roster-row--compact .avatar--roster {
        width: 2.2rem;
        height: 2.2rem;
        font-size: .85rem;
    }

    .roster-row--compact .roster-row__id {
        gap: .15rem;
    }

    .roster-row--compact .roster-row__email {
        font-size: .88rem;
    }

    .roster-row--compact .roster-row__meta {
        font-size: .72rem;
    }

@media (max-width: 720px) {
    .roster-row--compact {
        padding: .75rem;
    }
}

.roster-list--compact {
    gap: .5rem;
}

/* A member's current belts as vertical stripes down the row's left edge, newest first
   (ClubRosterRow + BeltStripe) — up to three, one per martial art. Every compact row keeps room
   for three in its left padding, so rows line up however many belts a member holds. */
.roster-list--compact .roster-row.roster-row--compact {
    padding-left: 2.25rem;
}

.roster-row__belts {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1; /* above the row's stretched link, so each stripe's tooltip shows */
    display: flex;
    gap: 2px;
    overflow: hidden;
    border-radius: calc(var(--radius) - 1px) 0 0 calc(var(--radius) - 1px);
}

.roster-row__belt {
    width: .45rem;
    height: 100%;
}

/* the roster/request/invite avatar — 50% larger than the base .avatar, with room to
   breathe in its own grid column instead of sitting flush against the row edge */
.avatar--roster {
    width: 3.15rem;
    height: 3.15rem;
    font-size: 1.1rem;
    justify-self: center;
}

.roster-row__id {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

.roster-row__email {
    font-size: .95rem;
    font-weight: 600;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

a.roster-row__email:hover {
    color: var(--ink);
}

/* let the whole row be the click target */
.stretched::after {
    content: "";
    position: absolute;
    inset: 0;
}

/* Guardian/junior cross-reference, or a request's "asked"/"invited" date — a sub-line
   indented under the name so it reads as detail about that person, not a sibling fact. */
.roster-row__meta {
    display: block;
    font-size: .8rem;
    color: var(--muted);
    padding-left: .65rem;
    border-left: 2px solid var(--line);
}

    /* the whole meta line as a link (a junior's "Guardian: X"), or one or more links inside
       it (a guardian's "Junior(s) here: X, Y") — same muted look, underline only on hover */
    a.roster-row__meta,
    .roster-row__meta a {
        color: inherit;
        text-decoration: none;
    }

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

/* tag column — starts at the same x-position on every row, like a table column */
.roster-row__tags {
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    gap: .35rem;
}

.roster-row__status {
    display: flex;
    align-items: center;
    gap: .5rem;
    justify-self: end;
    flex-shrink: 0;
}

    .roster-row__status form {
        position: relative;
        z-index: 1;
    }

    .roster-row__status input[type="checkbox"] {
        position: relative;
        z-index: 1;
        width: 1.1rem;
        height: 1.1rem;
    }

@media (max-width: 720px) {
    .roster-row {
        grid-template-columns: 3.75rem 1fr;
        row-gap: .6rem;
        padding: 1rem;
    }

    .avatar--roster {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1rem;
    }

    .roster-row__tags,
    .roster-row__status {
        grid-column: 2 / -1;
        justify-self: start;
    }

    .roster-card--indented {
        margin-left: 1.25rem;
    }
}

/* ---------- roster search / sort, and its pager (Club Members page) ---------- */
.roster-search {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-bottom: 1.1rem;
}

    .roster-search input[type="search"] {
        flex: 1 1 14rem;
        min-width: 0;
    }

    .roster-search select {
        flex: 0 0 auto;
        width: auto;
    }

.roster-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.1rem;
}

.roster-pager__label {
    font-size: .85rem;
    font-variant-numeric: tabular-nums;
}

/* small tags (e.g. disciplines) */
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.tag {
    font-size: .8rem;
    padding: .25rem .6rem;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--ink-2);
}

/* empty states */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
}

.empty-state__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--muted);
    margin-bottom: .75rem;
}

    .empty-state__icon svg {
        width: 1.3rem;
        height: 1.3rem;
    }

.empty-state__title {
    font-weight: 600;
    margin: 0 0 .2rem;
}

.empty-state__sub {
    color: var(--muted);
    font-size: .875rem;
    margin: 0 0 1rem;
    max-width: 40ch;
    margin-left: auto;
    margin-right: auto;
}

/* form panel width */
.form-panel {
    max-width: 34rem;
}

/* auth pages (login / register) */
.auth-page {
    max-width: 25rem;
    margin: 2rem auto;
}

.auth-head {
    text-align: center;
    margin-bottom: 1.5rem;
}

    .auth-head h1 {
        margin-bottom: .25rem;
    }

    .auth-head p {
        margin: 0;
        font-size: .9rem;
    }

.auth-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.75rem;
}

    .auth-card h2 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .auth-card .btn-lg {
        margin-top: .5rem;
    }

    .auth-card p a {
        color: var(--accent);
        font-size: .875rem;
    }

.auth-alt {
    text-align: center;
    font-size: .8rem;
    color: var(--muted);
    margin-top: 1rem;
}

    .auth-alt a {
        color: var(--muted);
        text-decoration: underline;
    }

.stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Club details: Details card + Preferences card side by side */
.details-cols {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 900px) {
    .details-cols {
        grid-template-columns: 1fr;
    }
}

/* Wider variant — My Details / Junior Details forms. Applied as an extra class
   alongside .details-cols / .form-panel, not an override, so other pages keep the
   narrower base values above unaffected. */
.details-cols--wide {
    grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
    gap: 2.5rem;
}

.form-panel--wide {
    max-width: none;
}

/* Country/flag picker (My Details / Junior Details / Club locations all share this). */
.country-field {
    display: flex;
    align-items: center;
    gap: .55rem;
}

    .country-field .form-select {
        flex: 1;
        min-width: 0;
    }

.loc-flag {
    flex-shrink: 0;
    border-radius: 2px;
    border: 1px solid var(--line);
    display: block;
}

/* Photo + initials fallback (My Details / Junior Details), sized up from the club-logo pattern. */
.member-photo-row {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    margin-bottom: 1.5rem;
}

.member-photo {
    width: 88px;
    height: 88px;
    flex-shrink: 0;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--surface-2);
    object-fit: cover;
    overflow: hidden;
}

.member-photo--initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-color: transparent;
    background: linear-gradient(150deg, var(--accent), var(--accent-hover));
    color: var(--accent-ink);
    font-family: var(--font-body);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: .01em;
    text-transform: uppercase;
    user-select: none;
}

.member-photo-row__actions {
    flex: 1;
    min-width: 0;
}

    .member-photo-row__actions .form-control {
        max-width: 26rem;
    }

.member-email-row {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
}

    .member-email-row .form-control {
        flex: 1;
        min-width: 12rem;
    }

.mobile-field {
    display: flex;
    gap: .55rem;
}

.mobile-field__dial {
    flex: 0 0 auto;
    width: auto;
    max-width: 14rem;
}

/* Martial-arts interest checklist (My Details / Junior Details). */
.ma-interest-note {
    margin-top: -.5rem;
    margin-bottom: 1rem;
}

.ma-interest-list .form-check {
    margin-bottom: .4rem;
}

.ma-interest-list .form-check-input:disabled ~ .form-check-label {
    opacity: .5;
}

/* Per-account martial-art checklist nested under a "who's joining" checkbox row
   (JoinClub.razor) — indented and set off with a left rule so it reads as belonging to
   the account above it. */
.ma-interest-list--nested {
    margin: .35rem 0 .75rem 1.75rem;
    padding-left: .75rem;
    border-left: 2px solid var(--line);
}

/* My Details tab-strip icons (rendered by the AppIcon child component — a page's own
   scoped CSS can't size an element a child component renders, so these live globally). */
.tabs-icon--main {
    width: 1.15rem;
    height: 1.15rem;
}

/* Juniors get the same person icon, deliberately smaller, so each tab still reads as a
   person but visibly secondary to the main account rather than a second equal one. */
.tabs-icon--junior {
    width: .8rem;
    height: .8rem;
    opacity: .8;
}

/* The plus inside "Add Junior"'s accent badge (see .tabs__btn-badge). */
.tabs-icon--badge {
    width: .65rem;
    height: .65rem;
    stroke-width: 2.75;
}

.pref-check {
    margin-bottom: 1rem;
}

    .pref-check .form-text {
        margin-top: .1rem;
        font-size: .8rem;
    }

/* ---------- error UI ---------- */
.blazor-error-boundary {
    background: var(--accent);
    padding: 1rem 1.25rem;
    color: var(--accent-ink);
    border-radius: var(--radius);
}

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

/* ---------- "Save your changes?" modal (wwwroot/js/unsaved-changes.js) ---------- */
.unsaved-dialog {
    width: min(26rem, calc(100vw - 2rem));
    padding: 1.4rem 1.5rem 1.2rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
}

    .unsaved-dialog::backdrop {
        background: rgba(10, 11, 14, .45);
    }

    .unsaved-dialog h2 {
        margin: 0 0 .4rem;
        font-size: 1.15rem;
    }

    .unsaved-dialog p {
        margin: 0 0 1.2rem;
        color: var(--muted);
    }

.unsaved-dialog__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .5rem;
}

/* ---------- grading setup (hub + belt system / skill / scale / type editors) ---------- */
.grd-intro {
    margin: 0 0 1.25rem;
}

    .grd-intro h2 {
        margin: 0 0 .25rem;
        font-size: 1.25rem;
    }

    .grd-intro p {
        max-width: 68ch;
    }

.grd-block {
    margin-bottom: 1.25rem;
}

.grd-block__head {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    margin-bottom: 1rem;
}

.grd-block__title {
    flex: 1;
    min-width: 0;
}

    .grd-block__title h2 {
        margin: 0;
        font-size: 1.1rem;
    }

    .grd-block__title p {
        margin: .15rem 0 0;
        font-size: .85rem;
        color: var(--muted);
    }

/* The three setup steps are a real sequence: a grading type needs a belt system and a scale. */
.grd-step {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    border-radius: 999px;
    background: var(--ink);
    color: var(--surface);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.grd-empty {
    margin: 0;
    color: var(--muted);
    font-size: .9rem;
    max-width: 70ch;
}

.grd-note {
    font-size: .8rem;
    color: var(--muted);
}

.grd-pill--warn {
    background: color-mix(in srgb, var(--warn) 14%, transparent);
    border-color: color-mix(in srgb, var(--warn) 40%, transparent);
    color: var(--warn);
}

/* ---- hub list items */
.grd-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .9rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: inherit;
    text-decoration: none;
    transition: border-color .15s ease, background-color .15s ease;
}

    .grd-item + .grd-item {
        margin-top: .6rem;
    }

    .grd-item:hover {
        border-color: var(--line-strong);
        background: var(--surface-2);
    }

    .grd-item:focus-visible {
        outline: 3px solid var(--accent);
        outline-offset: 2px;
    }

.grd-item--retired {
    opacity: .6;
}

.grd-item__main {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: .45rem;
}

.grd-item__name {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}

.grd-item__meta {
    font-size: .82rem;
    color: var(--muted);
}

.grd-item__go {
    color: var(--muted);
}

.grd-belt-strip {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .5rem;
}

.grd-belt-strip__belt {
    display: inline-flex;
}

/* ---- score levels (hub, presets, preview) */
.grd-levels {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
}

.grd-level {
    display: inline-grid;
    place-items: center;
    min-width: 1.9rem;
    height: 1.9rem;
    padding: 0 .45rem;
    border-radius: 7px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    font-size: .8rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.grd-level--fail {
    background: var(--accent-soft);
    border-color: var(--accent-border);
    color: var(--accent);
}

.grd-levels--big .grd-level {
    min-width: 2.75rem;
    height: 2.75rem;
    font-size: .95rem;
    border-radius: 10px;
}

.grd-preview {
    display: grid;
    gap: .4rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

/* ---- templates / presets */
.grd-templates {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
    gap: .75rem;
}

.grd-template {
    display: grid;
    gap: .5rem;
    align-content: start;
    padding: .85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: inherit;
    text-decoration: none;
}

    .grd-template:hover {
        border-color: var(--line-strong);
    }

.grd-template--on {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.grd-template__belts {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
}

.grd-template__hint {
    font-size: .8rem;
    color: var(--muted);
}

/* ---- form layout */
.grd-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .9rem 1.25rem;
}

.grd-fields__wide {
    grid-column: 1 / -1;
}

@media (max-width: 700px) {
    .grd-fields {
        grid-template-columns: minmax(0, 1fr);
    }
}

.grd-inline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}

.grd-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin: 0 0 1.5rem;
}

.grd-retire {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.grd-retire__title {
    margin: 0 0 .2rem;
    font-size: 1rem;
    font-weight: 650;
}

.grd-retire__actions {
    display: flex;
    gap: .5rem;
}

/* ---- belt rows */
.grd-belt-rows {
    display: grid;
    gap: .75rem;
    margin-bottom: .75rem;
}

.grd-belt-row {
    display: grid;
    grid-template-columns: 10rem minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: .85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

    .grd-belt-row .form-label {
        font-size: .78rem;
        margin-bottom: .2rem;
    }

.grd-belt-row__preview {
    display: grid;
    place-items: center;
    padding: .5rem;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}

.grd-belt-row__fields {
    display: grid;
    grid-template-columns: minmax(8rem, 1fr) minmax(12.5rem, 1.35fr) minmax(12rem, 1.25fr) minmax(8.5rem, .8fr);
    gap: .75rem 1rem;
    align-items: start;
}

    .grd-belt-row__fields .grd-inline {
        flex-wrap: nowrap;
    }

        .grd-belt-row__fields .grd-inline .form-select {
            flex: 1;
            min-width: 0;
        }

.grd-belt-row__actions {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.grd-color {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.grd-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    max-width: 8.5rem;
}

.grd-swatch {
    width: 1.35rem;
    height: 1.35rem;
    padding: 0;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent);
    background: var(--swatch);
    cursor: pointer;
}

    .grd-swatch:hover {
        transform: scale(1.12);
    }

.form-control-color {
    width: 2.75rem;
    height: 2.4rem;
    padding: .2rem;
    flex-shrink: 0;
}

    .form-control-color:disabled {
        opacity: .35;
    }

.grd-tabs,
.grd-min {
    width: 5rem;
    flex-shrink: 0;
}

@media (max-width: 1100px) {
    .grd-belt-row__fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .grd-belt-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .grd-belt-row__preview {
        grid-column: 1 / -1;
    }

    .grd-belt-row__actions {
        grid-column: 2;
        grid-row: 2;
    }

    .grd-belt-row__fields {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ---- skill overview matrix */
/* position: relative keeps the headers' visually-hidden (absolute) labels inside the scroller. */
.grd-matrix-wrap {
    position: relative;
    overflow-x: auto;
}

.grd-matrix {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

    .grd-matrix th,
    .grd-matrix td {
        padding: .55rem .4rem;
        border-bottom: 1px solid var(--line);
        text-align: center;
        vertical-align: middle;
    }

        .grd-matrix th:first-child {
            text-align: left;
            min-width: 12rem;
        }

    .grd-matrix thead th {
        font-weight: 600;
        font-size: .78rem;
        color: var(--muted);
    }

.grd-matrix__name {
    display: block;
    font-weight: 650;
    color: var(--ink);
    text-decoration: none;
}

    .grd-matrix__name:hover {
        text-decoration: underline;
    }

.grd-matrix__sub {
    display: block;
    font-size: .75rem;
    font-weight: 400;
    color: var(--muted);
}

.grd-matrix__retired {
    opacity: .55;
}

.grd-matrix__actions {
    white-space: nowrap;
}

    .grd-matrix__actions form {
        display: inline;
    }

.grd-tick {
    display: inline-flex;
    color: var(--ok);
}

    .grd-tick svg {
        width: 1.05rem;
        height: 1.05rem;
    }

.grd-dash {
    color: var(--muted);
}

/* ---- skill requirement rows */
.grd-req-rows {
    display: grid;
    gap: .75rem;
}

.grd-req {
    display: grid;
    grid-template-columns: 12rem minmax(0, 1fr);
    gap: 1rem;
    padding: .85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.grd-req--off {
    background: var(--surface-2);
}

    .grd-req--off .grd-req__body {
        opacity: .5;
    }

.grd-req__belt {
    display: grid;
    gap: .4rem;
    align-content: start;
}

.grd-check {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .85rem;
    cursor: pointer;
}

    .grd-check .form-check-input {
        margin: 0;
    }

.grd-req__body .form-label {
    font-size: .8rem;
    margin-bottom: .2rem;
}

.grd-req__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem 1rem;
    margin-top: .5rem;
}

.grd-req__copy {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1rem;
}

@media (max-width: 700px) {
    .grd-req {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ---- level / band rows */
.grd-rows {
    display: grid;
    gap: .5rem;
    margin-bottom: .75rem;
}

.grd-row {
    display: grid;
    grid-template-columns: 6rem minmax(6rem, 10rem) minmax(0, 1fr) auto;
    gap: .5rem;
    align-items: center;
}

.grd-row--band {
    grid-template-columns: 8rem minmax(0, 14rem) auto;
}

.grd-row--head {
    font-size: .75rem;
    font-weight: 600;
    color: var(--muted);
}

/* ---- combining methods */
.grd-methods {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr));
    gap: .6rem;
}

.grd-method {
    display: flex;
    gap: .6rem;
    align-items: flex-start;
    padding: .8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

    .grd-method:has(input:checked) {
        border-color: var(--accent);
        background: var(--accent-soft);
        box-shadow: inset 0 0 0 1px var(--accent);
    }

    .grd-method input {
        margin-top: .2rem;
        accent-color: var(--accent);
    }

.grd-method__body {
    display: grid;
    gap: .2rem;
    font-size: .82rem;
    color: var(--muted);
}

    .grd-method__body strong {
        font-size: .92rem;
        color: var(--ink);
    }

.grd-method__eg {
    font-variant-numeric: tabular-nums;
    color: var(--ink-2);
}

.grd-checks ul {
    padding-left: 1.2rem;
    font-size: .9rem;
}

.grd-checks--ok {
    border-color: color-mix(in srgb, var(--ok) 35%, transparent);
}
