﻿/*
 * Arkeron Sports design system
 *
 * This file is the final, product-level visual layer. Module styles should use
 * these semantic tokens and component classes instead of introducing local
 * colors, radii or shadows.
 */

body.app-shell {
    --sports-cobalt: #1769e0;
    --sports-cobalt-strong: #0d4fb8;
    --sports-teal: #0d9488;
    --sports-lime: #84cc16;
    --sports-amber: #d99100;
    --sports-coral: #e5484d;
    --sports-sidebar: #121817;
    --sports-sidebar-strong: #0b100f;
    --sports-sidebar-text: #f4f7f6;
    --sports-sidebar-muted: #93a19d;
    --club-primary: var(--primary-color, #1769e0);
    --club-secondary: var(--secondary-color, #0d9488);

    --app-primary: var(--sports-cobalt);
    --app-primary-strong: var(--sports-cobalt-strong);
    --app-secondary: var(--sports-teal);
    --app-accent: var(--sports-lime);
    --app-danger: var(--sports-coral);
    --app-success: #138a57;
    --app-warning: var(--sports-amber);

    --app-bg: #f2f5f4;
    --app-surface: #ffffff;
    --app-surface-muted: #f7f9f8;
    --app-surface-strong: #edf1ef;
    --app-text: #18211f;
    --app-text-soft: #5f6d69;
    --app-text-muted: #87938f;
    --app-border: #d5ddda;
    --app-border-strong: #bcc8c4;
    --app-shadow: 0 8px 24px rgba(20, 31, 28, .07);
    --app-shadow-small: 0 1px 2px rgba(20, 31, 28, .08);
    --app-primary-soft: #dceaff;
    --app-primary-faint: #f0f6ff;
    --app-secondary-soft: #dff5f1;
    --app-radius-xs: 3px;
    --app-radius-sm: 5px;
    --app-radius-md: 6px;
    --app-sidebar-width: 248px;
    --app-header-height: 68px;
    --app-bottom-nav-height: 72px;

    background: var(--app-bg);
    color: var(--app-text);
    font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Team and fixture management */

.team-hub-page,
.team-profile-page,
.team-editor-page,
.fixture-page,
.match-profile-page,
.match-editor-page { min-width: 0; }

.team-workbench,
.fixture-workbench,
.team-identity-band,
.team-context-strip,
.team-profile-page .athlete-section,
.fixture-list,
.match-event-band,
.match-detail-scoreboard,
.match-context-strip,
.match-profile-page .athlete-section {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    background: var(--app-surface);
    box-shadow: var(--app-shadow-small);
}

.team-workbench,
.fixture-workbench { margin-top: .9rem; overflow: hidden; }

.team-filter-toolbar,
.fixture-filter-toolbar {
    display: flex;
    min-height: 62px;
    align-items: center;
    gap: .48rem;
    padding: .65rem .78rem;
    border-bottom: 1px solid var(--app-border);
    background: var(--app-surface-muted);
}

.team-search-box {
    display: grid;
    width: min(100%, 390px);
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--app-border-strong);
    border-radius: var(--app-radius-xs);
    background: var(--app-surface);
}

.team-search-box:focus-within { border-color: var(--club-primary); box-shadow: 0 0 0 2px var(--club-primary-faint); }
.team-search-box > span { display: grid; place-items: center; color: var(--app-text-muted); }
.team-search-box svg { width: 15px; height: 15px; }
.team-search-box input { min-width: 0; height: 36px; border: 0; outline: 0; background: transparent; color: var(--app-text); font-size: .73rem; }
.team-filter-toolbar > .form-select { width: 180px; min-height: 36px; }
.team-result-state { margin-left: auto; color: var(--app-text-soft); font-size: .68rem; white-space: nowrap; }
.team-result-state strong { color: var(--app-text); }

.team-board-head,
.team-board-entry {
    display: grid;
    grid-template-columns: minmax(230px, 1.15fr) minmax(170px, .75fr) 150px minmax(205px, auto);
    align-items: center;
    gap: .78rem;
    padding-inline: .82rem;
}

.team-board-head {
    min-height: 38px;
    border-bottom: 1px solid var(--app-border);
    color: var(--app-text-muted);
    font-size: .62rem;
    font-weight: 800;
    text-transform: uppercase;
}

.team-board-entry { min-height: 82px; border-bottom: 1px solid var(--app-border); }
.team-board-entry:last-child { border-bottom: 0; }
.team-board-entry:hover { background: var(--app-surface-muted); }
.team-board-identity { display: flex; min-width: 0; align-items: center; gap: .68rem; color: var(--app-text); text-decoration: none; }
.team-board-identity:hover strong { color: var(--app-primary-strong); }
.team-roster-mark,
.team-crest {
    display: grid;
    place-items: center;
    border: 1px solid var(--app-border-strong);
    border-radius: var(--app-radius-xs);
    background: color-mix(in srgb, var(--sports-cobalt) 10%, var(--app-surface));
    color: var(--sports-cobalt);
    font-weight: 880;
}
.team-roster-mark { width: 42px; height: 42px; flex: 0 0 42px; font-size: .72rem; }
.team-board-identity > span:last-child,
.team-board-context { display: grid; min-width: 0; }
.team-board-identity strong,
.team-board-context strong { overflow: hidden; color: var(--app-text); font-size: .75rem; font-weight: 820; text-overflow: ellipsis; white-space: nowrap; }
.team-board-identity small,
.team-board-context small { overflow: hidden; color: var(--app-text-muted); font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.team-board-squad { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--app-border); border-radius: var(--app-radius-xs); }
.team-board-squad > span { display: grid; min-height: 43px; place-content: center; padding: .3rem .45rem; text-align: center; }
.team-board-squad > span + span { border-left: 1px solid var(--app-border); }
.team-board-squad strong { color: var(--app-text); font-size: .8rem; font-weight: 850; }
.team-board-squad small { color: var(--app-text-muted); font-size: .56rem; }
.team-board-actions { display: flex; justify-content: flex-end; gap: .36rem; }
.team-board-actions .btn { min-width: 58px; }

.team-identity-band {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr) auto;
    min-height: 124px;
    align-items: center;
    gap: .9rem;
    padding: .95rem 1rem;
    border-left: 4px solid var(--sports-cobalt);
}

.team-crest { width: 70px; height: 70px; font-size: 1rem; }
.team-identity-copy { min-width: 0; }
.team-identity-copy h1 { margin: .12rem 0 0; color: var(--app-text); font-size: 1.5rem; font-weight: 880; }
.team-identity-meta { display: flex; flex-wrap: wrap; gap: .3rem .8rem; margin-top: .3rem; color: var(--app-text-soft); font-size: .7rem; }
.team-identity-meta span + span::before { margin-right: .8rem; color: var(--app-border-strong); content: "·"; }
.team-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .42rem; }

.team-context-strip,
.match-context-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: .65rem; overflow: hidden; }
.team-context-strip > div,
.match-context-strip > div { display: grid; min-height: 62px; align-content: center; padding: .62rem .78rem; border-right: 1px solid var(--app-border); }
.team-context-strip > div:last-child,
.match-context-strip > div:last-child { border-right: 0; }
.team-context-strip small,
.match-context-strip small { color: var(--app-text-muted); font-size: .61rem; font-weight: 730; }
.team-context-strip strong,
.match-context-strip strong { overflow: hidden; margin-top: .12rem; color: var(--app-text); font-size: .78rem; font-weight: 820; text-overflow: ellipsis; white-space: nowrap; }

.team-profile-layout,
.match-profile-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(285px, .72fr); align-items: start; gap: .8rem; margin-top: .8rem; }
.team-profile-main,
.team-profile-rail,
.match-profile-main,
.match-profile-rail { display: grid; align-content: start; gap: .8rem; min-width: 0; }
.team-description-section > p { margin: 0; padding: .72rem .78rem; color: var(--app-text-soft); font-size: .71rem; line-height: 1.55; white-space: pre-wrap; }

.team-player-list { display: grid; }
.team-player-record { border-bottom: 1px solid var(--app-border); }
.team-player-record:last-child { border-bottom: 0; }
.team-player-entry { display: grid; grid-template-columns: 42px minmax(150px, 1fr) 76px 84px auto; min-height: 68px; align-items: center; gap: .62rem; padding: .48rem .72rem; }
.team-player-entry:hover { background: var(--app-surface-muted); }
.team-player-number { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--app-border-strong); border-radius: var(--app-radius-xs); background: var(--club-primary-faint); color: var(--club-primary); font-size: .7rem; font-weight: 850; }
.team-player-copy { display: grid; min-width: 0; }
.team-player-copy strong { overflow: hidden; color: var(--app-text); font-size: .73rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.team-player-copy small { overflow: hidden; color: var(--app-text-muted); font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.team-player-role { color: var(--app-text-soft); font-size: .64rem; font-weight: 730; }
.team-player-status { display: inline-flex; min-height: 25px; align-items: center; justify-content: center; padding: .2rem .38rem; border: 1px solid var(--app-border); border-radius: var(--app-radius-xs); font-size: .61rem; font-weight: 800; }
.team-player-status.is-ready { border-color: color-mix(in srgb, var(--app-success) 35%, var(--app-border)); background: color-mix(in srgb, var(--app-success) 8%, transparent); color: var(--app-success); }
.team-player-status.is-reserve { border-color: color-mix(in srgb, var(--sports-cobalt) 38%, var(--app-border)); background: color-mix(in srgb, var(--sports-cobalt) 9%, transparent); color: var(--sports-cobalt); }
.team-player-status.is-injured { border-color: color-mix(in srgb, var(--sports-amber) 45%, var(--app-border)); background: color-mix(in srgb, var(--sports-amber) 9%, transparent); color: var(--app-warning); }
.team-player-status.is-suspended { border-color: color-mix(in srgb, var(--sports-coral) 40%, var(--app-border)); background: color-mix(in srgb, var(--sports-coral) 8%, transparent); color: var(--app-danger); }
.team-player-actions { display: flex; justify-content: flex-end; gap: .35rem; }
.team-player-actions form { display: contents; }
.team-player-editor { background: var(--app-surface-muted); }
.team-player-editor > form { display: grid; grid-template-columns: 90px minmax(130px, 1fr) 130px 90px 76px; align-items: end; gap: .55rem; padding: .65rem .72rem .75rem 3.35rem; }
.team-captain-toggle { display: flex; min-height: 38px; align-items: center; gap: .42rem; color: var(--app-text); font-size: .66rem; font-weight: 730; cursor: pointer; }
.team-captain-toggle input { accent-color: var(--club-primary); }

.team-coach-list { display: grid; padding: .38rem .68rem .55rem; }
.team-coach-list article { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; min-height: 54px; align-items: center; gap: .55rem; border-bottom: 1px solid var(--app-border); }
.team-coach-list article:last-child { border-bottom: 0; }
.team-coach-list strong { overflow: hidden; color: var(--app-text); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.team-coach-mark { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--app-border); border-radius: var(--app-radius-xs); color: var(--sports-teal); }
.team-coach-mark svg { width: 15px; height: 15px; }
.team-assignment-section > form { display: grid; gap: .5rem; padding: .7rem .72rem .8rem; }
.team-assignment-section > form label { color: var(--app-text-soft); font-size: .65rem; font-weight: 730; }
.team-player-search-form > small { color: var(--app-text-muted); font-size: .62rem; }
.team-player-search-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .45rem; }
.team-player-search-box .btn { min-width: 56px; }
.team-player-search-results { display: grid; gap: .4rem; padding: 0 .72rem .8rem; }
.team-player-search-results article { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .65rem; min-width: 0; padding: .55rem .6rem; border: 1px solid var(--app-border); border-radius: var(--app-radius-sm); background: var(--app-surface-muted); }
.team-player-search-results article > span { display: grid; min-width: 0; }
.team-player-search-results article strong { overflow: hidden; color: var(--app-text); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.team-player-search-results article small { overflow: hidden; color: var(--app-text-muted); font-size: .61rem; text-overflow: ellipsis; white-space: nowrap; }
.team-player-search-results form { margin: 0; }
.team-player-search-results .btn { min-width: 54px; }
.team-player-search-help { margin: 0 .72rem .8rem; }

.team-form-map { grid-template-columns: minmax(0, 1fr); }

.fixture-filter-toolbar > .form-select { width: min(280px, 26vw); min-height: 36px; }
.fixture-filter-toolbar > label { display: grid; grid-template-columns: auto minmax(125px, 1fr); align-items: center; gap: .42rem; color: var(--app-text-muted); font-size: .61rem; font-weight: 720; }
.fixture-list-head,
.fixture-entry { display: grid; grid-template-columns: 76px minmax(330px, 1.35fr) minmax(140px, .6fr) 92px 64px; align-items: center; gap: .72rem; padding-inline: .78rem; }
.fixture-list-head { min-height: 38px; border-bottom: 1px solid var(--app-border); color: var(--app-text-muted); font-size: .62rem; font-weight: 800; text-transform: uppercase; }
.fixture-entry { position: relative; min-height: 92px; border-bottom: 1px solid var(--app-border); }
.fixture-entry::before { position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--app-border-strong); content: ""; }
.fixture-entry.is-scheduled::before { background: var(--sports-cobalt); }
.fixture-entry.is-completed::before { background: var(--sports-teal); }
.fixture-entry.is-cancelled::before { background: var(--sports-coral); }
.fixture-entry:last-child { border-bottom: 0; }
.fixture-entry:hover { background: var(--app-surface-muted); }
.fixture-date-block { display: grid; justify-items: center; line-height: 1; }
.fixture-date-block strong { color: var(--app-text); font-size: 1.35rem; font-weight: 880; }
.fixture-date-block span { margin-top: .12rem; color: var(--app-text-soft); font-size: .61rem; font-weight: 800; text-transform: uppercase; }
.fixture-date-block small { margin-top: .32rem; color: var(--app-primary-strong); font-size: .68rem; font-weight: 800; }
.fixture-versus { display: grid; grid-template-columns: minmax(100px, 1fr) 58px minmax(100px, 1fr); align-items: center; gap: .62rem; color: var(--app-text); text-decoration: none; }
.fixture-versus:hover strong { color: var(--app-primary-strong); }
.fixture-team { display: grid; min-width: 0; }
.fixture-team.is-ours { text-align: right; }
.fixture-team strong { overflow: hidden; font-size: .75rem; font-weight: 820; text-overflow: ellipsis; white-space: nowrap; }
.fixture-team small { overflow: hidden; color: var(--app-text-muted); font-size: .6rem; text-overflow: ellipsis; white-space: nowrap; }
.fixture-score { display: grid; min-width: 52px; height: 36px; place-items: center; border: 1px solid var(--app-border-strong); border-radius: var(--app-radius-xs); background: var(--app-surface-strong); color: var(--app-text); font-size: .75rem; }
.fixture-context { display: grid; min-width: 0; }
.fixture-context strong { overflow: hidden; color: var(--app-text); font-size: .69rem; text-overflow: ellipsis; white-space: nowrap; }
.fixture-context small { overflow: hidden; color: var(--app-text-muted); font-size: .6rem; text-overflow: ellipsis; white-space: nowrap; }
.fixture-status { display: inline-flex; min-height: 25px; align-items: center; justify-content: center; padding: .2rem .4rem; border: 1px solid var(--app-border); border-radius: var(--app-radius-xs); font-size: .59rem; font-weight: 800; }
.fixture-status.is-scheduled { color: var(--sports-cobalt); }
.fixture-status.is-completed { color: var(--app-success); }
.fixture-status.is-cancelled { color: var(--app-danger); }
.fixture-action { min-width: 58px; }

.match-event-band { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; min-height: 126px; align-items: center; gap: .9rem; padding: .9rem 1rem; border-left: 4px solid var(--sports-cobalt); }
.match-event-band.is-completed { border-left-color: var(--sports-teal); }
.match-event-band.is-cancelled { border-left-color: var(--sports-coral); }
.match-event-date { display: grid; width: 76px; min-height: 88px; place-content: center; justify-items: center; border: 1px solid var(--app-border); border-radius: var(--app-radius-xs); background: var(--app-surface-muted); }
.match-event-date strong { color: var(--app-text); font-size: 1.7rem; font-weight: 880; line-height: 1; }
.match-event-date span { margin-top: .16rem; color: var(--app-text-soft); font-size: .6rem; font-weight: 800; text-transform: uppercase; }
.match-event-date small { margin-top: .38rem; color: var(--app-primary-strong); font-size: .72rem; font-weight: 820; }
.match-event-copy { min-width: 0; }
.match-event-copy h1 { margin: .18rem 0 0; color: var(--app-text); font-size: 1.35rem; font-weight: 880; }
.match-event-copy h1 span { margin-inline: .2rem; color: var(--app-text-muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.match-event-copy p { margin: .3rem 0 0; color: var(--app-text-soft); font-size: .7rem; }

.match-detail-scoreboard { display: grid; grid-template-columns: minmax(0, 1fr) 110px minmax(0, 1fr); min-height: 128px; align-items: center; gap: 1rem; margin-top: .65rem; padding: .9rem 1rem; background: var(--app-surface-muted); }
.match-team-name { display: grid; min-width: 0; }
.match-team-name.is-ours { text-align: right; }
.match-team-name small { color: var(--app-text-muted); font-size: .61rem; font-weight: 760; text-transform: uppercase; }
.match-team-name strong { overflow: hidden; margin-top: .18rem; color: var(--app-text); font-size: 1.05rem; font-weight: 860; text-overflow: ellipsis; white-space: nowrap; }
.match-score-box { display: grid; justify-items: center; }
.match-score-box span { color: var(--app-text-muted); font-size: .58rem; font-weight: 800; text-transform: uppercase; }
.match-score-box strong { display: grid; min-width: 92px; min-height: 54px; margin-top: .2rem; place-items: center; border: 1px solid var(--app-border-strong); border-radius: var(--app-radius-xs); background: var(--app-surface); color: var(--app-text); font-size: 1.35rem; font-weight: 900; }
.match-context-strip strong.is-scheduled { color: var(--sports-cobalt); }
.match-context-strip strong.is-completed { color: var(--app-success); }
.match-context-strip strong.is-cancelled { color: var(--app-danger); }
.match-notes { padding: .75rem .8rem; color: var(--app-text-soft); font-size: .72rem; line-height: 1.55; white-space: pre-wrap; }
.match-form-map { grid-template-columns: minmax(0, 1fr); }
.match-result-note { display: flex; align-items: center; gap: .55rem; margin: .72rem .8rem; padding: .55rem .65rem; border-left: 3px solid var(--sports-amber); background: color-mix(in srgb, var(--sports-amber) 7%, var(--app-surface)); }
.match-result-note strong { color: var(--app-text); font-size: .67rem; }
.match-result-note span { color: var(--app-text-muted); font-size: .62rem; }

@media (max-width: 1100px) {
    .team-board-head,
    .team-board-entry { grid-template-columns: minmax(210px, 1.1fr) minmax(145px, .7fr) 130px minmax(190px, auto); }
    .fixture-list-head,
    .fixture-entry { grid-template-columns: 70px minmax(280px, 1.2fr) minmax(125px, .55fr) 88px 60px; }
    .team-profile-layout,
    .match-profile-layout { grid-template-columns: minmax(0, 1fr); }
    .team-profile-rail,
    .match-profile-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .team-profile-rail > :last-child:nth-child(odd),
    .match-profile-rail > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
    .team-board-head,
    .fixture-list-head { display: none; }
    .team-board-entry { grid-template-columns: minmax(0, 1fr) 150px; grid-template-areas: "identity squad" "context actions"; gap: .55rem .8rem; padding-block: .7rem; }
    .team-board-identity { grid-area: identity; }
    .team-board-context { grid-area: context; }
    .team-board-squad { grid-area: squad; }
    .team-board-actions { grid-area: actions; padding-top: .42rem; border-top: 1px solid var(--app-border); }
    .fixture-entry { grid-template-columns: 62px minmax(0, 1fr) 92px; grid-template-areas: "date versus status" "date context action"; gap: .55rem .72rem; padding-block: .65rem; }
    .fixture-date-block { grid-area: date; }
    .fixture-versus { grid-area: versus; }
    .fixture-context { grid-area: context; }
    .fixture-status { grid-area: status; }
    .fixture-action { grid-area: action; justify-self: end; }
    .team-player-editor > form { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-left: .72rem; }
    .team-player-editor .btn { align-self: end; }
    .team-form-map { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .match-form-map { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
    .team-filter-toolbar,
    .fixture-filter-toolbar { align-items: stretch; flex-wrap: wrap; }
    .team-search-box { width: 100%; }
    .team-filter-toolbar > .form-select { width: calc(50% - .24rem); }
    .team-result-state { width: 100%; text-align: right; }
    .fixture-filter-toolbar > .form-select { width: 100%; }
    .fixture-filter-toolbar > label { width: calc(50% - .24rem); grid-template-columns: minmax(0, 1fr); gap: .2rem; }
    .team-identity-band,
    .match-event-band { grid-template-columns: 64px minmax(0, 1fr); min-height: 108px; padding: .78rem; }
    .team-crest { width: 58px; height: 58px; }
    .team-header-actions,
    .match-event-actions { grid-column: 1 / -1; }
    .team-context-strip,
    .match-context-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .team-context-strip > div:nth-child(2n),
    .match-context-strip > div:nth-child(2n) { border-right: 0; }
    .team-context-strip > div:nth-child(-n + 2),
    .match-context-strip > div:nth-child(-n + 2) { border-bottom: 1px solid var(--app-border); }
    .team-player-entry { grid-template-columns: 38px minmax(0, 1fr) auto; grid-template-areas: "number identity status" "number role actions"; gap: .4rem .55rem; padding-block: .58rem; }
    .team-player-number { grid-area: number; }
    .team-player-copy { grid-area: identity; }
    .team-player-role { grid-area: role; }
    .team-player-status { grid-area: status; }
    .team-player-actions { grid-area: actions; }
    .team-profile-rail,
    .match-profile-rail { grid-template-columns: minmax(0, 1fr); }
    .team-profile-rail > :last-child:nth-child(odd),
    .match-profile-rail > :last-child:nth-child(odd) { grid-column: auto; }
    .match-detail-scoreboard { grid-template-columns: minmax(0, 1fr) 82px minmax(0, 1fr); min-height: 110px; gap: .6rem; padding: .72rem; }
    .match-team-name strong { font-size: .82rem; }
    .match-score-box strong { min-width: 74px; min-height: 48px; font-size: 1.05rem; }
}

@media (max-width: 575.98px) {
    .team-filter-toolbar > .form-select { width: 100%; }
    .team-filter-toolbar > .btn,
    .fixture-filter-toolbar > .btn { flex: 1; }
    .team-board-entry { grid-template-columns: minmax(0, 1fr); grid-template-areas: "identity" "context" "squad" "actions"; }
    .team-board-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .team-board-actions .btn { min-width: 0; width: 100%; }
    .fixture-entry { grid-template-columns: 54px minmax(0, 1fr); grid-template-areas: "date versus" "status status" "context action"; }
    .fixture-versus { grid-template-columns: minmax(0, 1fr); gap: .22rem; }
    .fixture-team.is-ours,
    .fixture-team.is-opponent { text-align: left; }
    .fixture-score { grid-row: 2; justify-self: start; min-width: 58px; height: 30px; }
    .fixture-team.is-opponent { grid-row: 3; }
    .fixture-status { justify-self: start; }
    .team-player-entry { grid-template-columns: 36px minmax(0, 1fr); grid-template-areas: "number identity" "role status" "actions actions"; }
    .team-player-role { align-self: center; }
    .team-player-status { justify-self: start; }
    .team-player-search-box { grid-template-columns: 1fr; }
    .team-player-search-box .btn { width: 100%; }
    .team-player-actions { width: 100%; padding-top: .4rem; border-top: 1px solid var(--app-border); }
    .team-player-actions .btn,
    .team-player-actions form { flex: 1; }
    .team-player-actions form .btn { width: 100%; }
    .team-player-editor > form { grid-template-columns: minmax(0, 1fr); }
    .team-player-editor .btn { width: 100%; }
    .team-form-map { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .match-form-map { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .team-identity-copy h1,
    .match-event-copy h1 { font-size: 1.12rem; }
    .team-header-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .team-header-actions .btn,
    .match-event-actions .btn { width: 100%; }
    .match-event-date { width: 58px; min-height: 74px; }
    .match-event-date strong { font-size: 1.35rem; }
    .match-detail-scoreboard { grid-template-columns: minmax(0, 1fr); text-align: center; }
    .match-team-name.is-ours,
    .match-team-name.is-opponent { text-align: center; }
    .match-score-box { grid-row: 2; }
    .match-result-note { align-items: flex-start; flex-direction: column; }
}

@supports (color: color-mix(in srgb, white 50%, black)) {
    body.app-shell {
        --club-primary-soft: color-mix(in srgb, var(--club-primary) 22%, transparent);
        --club-primary-faint: color-mix(in srgb, var(--club-primary) 12%, transparent);
        --club-secondary-soft: color-mix(in srgb, var(--club-secondary) 20%, transparent);
    }
}

html[data-app-theme="dark"] body.app-shell {
    --sports-sidebar: #090d0c;
    --sports-sidebar-strong: #060908;
    --sports-sidebar-text: #f1f6f4;
    --sports-sidebar-muted: #82908c;
    --app-bg: #0d1211;
    --app-surface: #151b19;
    --app-surface-muted: #1a211f;
    --app-surface-strong: #222a27;
    --app-text: #edf3f1;
    --app-text-soft: #acb8b4;
    --app-text-muted: #7e8c87;
    --app-border: #303a36;
    --app-border-strong: #45514c;
    --app-shadow: 0 10px 28px rgba(0, 0, 0, .24);
    --app-shadow-small: 0 1px 2px rgba(0, 0, 0, .34);
    --app-primary-soft: #15345e;
    --app-primary-faint: #14263d;
    --app-primary-strong: #70a7ff;
    --app-secondary-soft: #123b37;
    --app-success: #55d697;
    --app-warning: #f0b84b;
}

/* Shell */

.app-sidebar {
    background: var(--sports-sidebar) !important;
    border-right: 1px solid #27302d !important;
    box-shadow: 8px 0 28px rgba(5, 10, 8, .12);
}

.app-brand {
    min-height: var(--app-header-height);
    gap: .72rem;
    padding: .78rem .9rem;
    border-bottom-color: #28312e !important;
}

.app-brand-copy {
    min-width: 0;
    display: grid;
    gap: .12rem;
}

.app-brand-mark {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: var(--app-radius-sm) !important;
    background: #ffffff !important;
    color: var(--sports-cobalt) !important;
    box-shadow: 0 0 0 2px var(--sports-sidebar), 0 0 0 4px var(--club-primary) !important;
}

.app-brand-mark img {
    padding: 2px;
    border-radius: 3px;
    background: #fff;
}

.app-brand-title {
    color: var(--sports-sidebar-text) !important;
    font-size: .94rem;
    font-weight: 800;
    line-height: 1.2;
}

.app-brand-subtitle {
    margin: 0;
    color: var(--sports-sidebar-muted) !important;
    font-size: .64rem;
    font-weight: 650;
    line-height: 1.25;
}

.app-brand-provider strong {
    color: #c8d2cf;
    font-weight: 750;
}

.app-sidebar-scroll {
    padding: .9rem .62rem;
    scrollbar-color: #3b4844 transparent;
}

.app-nav-group {
    margin-bottom: 1.15rem;
}

.app-nav-heading {
    padding: 0 .62rem .42rem;
    color: #697773 !important;
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .08em;
}

.app-nav-list {
    gap: .12rem;
}

.app-nav-link {
    position: relative;
    min-height: 38px;
    gap: .68rem;
    padding: .5rem .65rem .5rem .72rem;
    border: 1px solid transparent;
    border-radius: var(--app-radius-sm) !important;
    color: #a8b4b0 !important;
    font-size: .84rem;
    font-weight: 650;
    transform: none !important;
}

.app-nav-link::before {
    content: "";
    position: absolute;
    top: 7px;
    bottom: 7px;
    left: -1px;
    width: 3px;
    border-radius: 0 2px 2px 0;
    background: transparent;
}

.app-nav-link:hover,
.app-nav-link:focus {
    border-color: #2c3733;
    background: #1a2320 !important;
    color: #f0f5f3 !important;
}

.app-nav-link.is-active {
    border-color: #33403b;
    background: #202b27 !important;
    color: #ffffff !important;
}

.app-nav-link.is-active::before {
    background: var(--club-primary);
}

.app-nav-link.is-active .app-nav-icon {
    color: var(--club-primary);
}

.app-nav-context-label {
    margin-inline: .62rem;
    border-color: #33403b;
    border-radius: var(--app-radius-sm);
    background: #1a2320;
    color: #dce5e2;
}

.app-sidebar-footer {
    padding: .66rem;
    border-top-color: #28312e !important;
    background: var(--sports-sidebar-strong);
}

.app-sidebar .app-user-card {
    border: 1px solid transparent;
    border-radius: var(--app-radius-sm);
    color: var(--sports-sidebar-text);
}

.app-sidebar .app-user-card:hover,
.app-sidebar .app-user-card:focus {
    border-color: #303b37;
    background: #171e1c;
}

.app-sidebar .app-user-name {
    color: var(--sports-sidebar-text);
}

.app-sidebar .app-user-role,
.app-legal-links-sidebar {
    color: var(--sports-sidebar-muted);
}

.app-sidebar .app-avatar {
    border: 2px solid var(--club-secondary);
    background: #26312d;
}

.app-topbar {
    min-height: var(--app-header-height);
    padding: .68rem 1.2rem;
    background: var(--app-surface) !important;
    border-bottom: 1px solid var(--app-border) !important;
    backdrop-filter: none !important;
    box-shadow: var(--app-shadow-small);
}

.app-page-kicker {
    color: var(--app-text-muted);
    font-size: .64rem;
    letter-spacing: .07em;
}

.app-page-title {
    font-size: 1.08rem;
    font-weight: 820;
}

.app-icon-button {
    width: 36px;
    height: 36px;
    border-radius: var(--app-radius-sm) !important;
    box-shadow: none;
}

.app-icon-button:hover,
.app-icon-button:focus {
    border-color: var(--app-border-strong);
    background: var(--app-surface-strong) !important;
    color: var(--app-primary-strong);
}

.app-topbar .app-user-card {
    min-width: 0;
    padding: .35rem .45rem;
    border: 1px solid transparent;
    border-radius: var(--app-radius-sm);
}

.app-topbar .app-user-card:hover,
.app-topbar .app-user-card:focus {
    border-color: var(--app-border);
    background: var(--app-surface-muted);
}

.app-topbar .app-avatar {
    width: 34px;
    height: 34px;
    border: 2px solid var(--club-secondary);
    border-radius: 50%;
    background: var(--app-surface-strong);
    color: var(--app-text);
}

.app-main {
    max-width: 1560px;
    padding: 1.15rem 1.25rem 1.7rem;
}

/* Typography and page headings */

body.app-shell h1,
body.app-shell h2,
body.app-shell h3,
body.app-shell h4,
body.app-shell h5,
body.app-shell h6 {
    color: var(--app-text);
    font-weight: 780;
    letter-spacing: 0;
}

body.app-shell .page-eyebrow {
    margin-bottom: .22rem;
    color: var(--app-secondary) !important;
    font-size: .66rem;
    font-weight: 820;
    letter-spacing: .06em;
    text-transform: uppercase;
}

body.app-shell .app-action-group:has(> div > .page-eyebrow) {
    padding-bottom: .78rem;
    border-bottom: 1px solid var(--app-border);
}

/* Shared components */

body.app-shell .card,
body.app-shell .card-surface,
body.app-shell .ui-card,
body.app-shell .content-panel,
body.app-shell .action-panel,
body.app-shell .detail-panel,
body.app-shell .table-panel {
    border: 1px solid var(--app-border) !important;
    border-radius: var(--app-radius-md) !important;
    background: var(--app-surface) !important;
    color: var(--app-text) !important;
    box-shadow: var(--app-shadow-small) !important;
}

body.app-shell .content-panel,
body.app-shell .detail-panel,
body.app-shell .table-panel {
    padding: 1rem;
}

body.app-shell .action-panel {
    padding: .82rem;
    background: var(--app-surface-muted) !important;
}

body.app-shell .metric-card {
    position: relative;
    min-height: 92px;
    padding: .8rem .9rem .75rem 1rem;
    overflow: hidden;
}

body.app-shell .metric-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--club-primary);
}

body.app-shell .btn {
    min-height: 32px;
    border-radius: var(--app-radius-xs) !important;
    font-weight: 700;
    letter-spacing: 0;
    box-shadow: none !important;
}

body.app-shell .btn-sm {
    min-height: 31px;
    padding: .34rem .62rem;
    font-size: .78rem;
}

body.app-shell .btn-primary {
    border-color: var(--sports-cobalt) !important;
    background: var(--sports-cobalt) !important;
    color: #fff !important;
}

body.app-shell .btn-primary:hover,
body.app-shell .btn-primary:focus {
    border-color: var(--sports-cobalt-strong) !important;
    background: var(--sports-cobalt-strong) !important;
}

body.app-shell :is(.btn-outline-light, .btn-outline-secondary) {
    border-color: var(--app-border-strong) !important;
    background: var(--app-surface) !important;
    color: var(--app-text-soft) !important;
}

body.app-shell :is(.btn-outline-light, .btn-outline-secondary):hover,
body.app-shell :is(.btn-outline-light, .btn-outline-secondary):focus {
    border-color: var(--sports-cobalt) !important;
    background: var(--app-primary-faint) !important;
    color: var(--app-primary-strong) !important;
}

body.app-shell .btn-outline-danger {
    border-color: #e8a3a6 !important;
    color: var(--app-danger) !important;
}

body.app-shell .btn-outline-danger:hover,
body.app-shell .btn-outline-danger:focus {
    border-color: var(--app-danger) !important;
    background: var(--app-danger) !important;
    color: #fff !important;
}

body.app-shell :is(.form-control, .form-select, .input-group-text, textarea) {
    min-height: 36px;
    border: 1px solid var(--app-border-strong) !important;
    border-radius: var(--app-radius-xs) !important;
    background: var(--app-surface) !important;
    color: var(--app-text) !important;
    box-shadow: none !important;
}

body.app-shell :is(.form-control, .form-select, textarea):focus {
    border-color: var(--sports-cobalt) !important;
    box-shadow: 0 0 0 3px rgba(23, 105, 224, .14) !important;
}

body.app-shell .form-label {
    margin-bottom: .3rem;
    color: var(--app-text-soft);
    font-size: .76rem;
    font-weight: 700;
}

body.app-shell .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--app-text);
    --bs-table-border-color: var(--app-border);
    margin-bottom: 0;
}

body.app-shell .table thead th {
    padding: .58rem .68rem;
    border-bottom: 1px solid var(--app-border-strong) !important;
    background: var(--app-surface-muted) !important;
    color: var(--app-text-soft) !important;
    font-size: .69rem;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
}

body.app-shell .table tbody td,
body.app-shell .table tbody th {
    padding: .62rem .68rem;
    border-color: var(--app-border) !important;
    vertical-align: middle;
}

body.app-shell .table tbody tr:hover {
    background: var(--app-surface-muted) !important;
}

body.app-shell :is(.badge, .badge-soft) {
    border-radius: 999px !important;
    font-weight: 750;
    letter-spacing: 0;
}

body.app-shell .badge.text-bg-secondary {
    border: 1px solid var(--app-border);
    background: var(--app-surface-strong) !important;
    color: var(--app-text-soft) !important;
}

body.app-shell .pagination .page-link,
body.app-shell .btn-group > .btn {
    border-radius: 0 !important;
}

body.app-shell .pagination .page-item:first-child .page-link,
body.app-shell .btn-group > :first-child {
    border-radius: var(--app-radius-xs) 0 0 var(--app-radius-xs) !important;
}

body.app-shell .pagination .page-item:last-child .page-link,
body.app-shell .btn-group > :last-child {
    border-radius: 0 var(--app-radius-xs) var(--app-radius-xs) 0 !important;
}

body.app-shell .pagination .page-item.active .page-link {
    border-color: var(--sports-cobalt) !important;
    background: var(--sports-cobalt) !important;
    color: #fff !important;
}

body.app-shell .dropdown-menu,
body.app-shell .modal-content,
body.app-shell .offcanvas {
    border: 1px solid var(--app-border) !important;
    border-radius: var(--app-radius-md) !important;
    background: var(--app-surface) !important;
    color: var(--app-text) !important;
    box-shadow: var(--app-shadow) !important;
}

body.app-shell .alert {
    border-radius: var(--app-radius-sm);
    box-shadow: none;
}

/* Dashboard: Arena Operations + Performance Lab */

body.app-shell .dashboard-page {
    display: grid;
    gap: .9rem;
}

body.app-shell .dashboard-header {
    margin: 0 !important;
    padding: .1rem 0 .75rem;
    border-bottom: 1px solid var(--app-border);
}

body.app-shell .dashboard-header h2 {
    font-size: 1.22rem;
    font-weight: 820;
}

body.app-shell .dashboard-stat-grid {
    gap: 0 !important;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    background: var(--app-surface);
    box-shadow: var(--app-shadow-small);
    overflow: hidden;
}

body.app-shell .dashboard-stat-card {
    min-height: 96px;
    padding: .8rem .92rem .72rem 1rem !important;
    border: 0 !important;
    border-right: 1px solid var(--app-border) !important;
    border-radius: 0 !important;
    background: var(--app-surface) !important;
    box-shadow: none !important;
}

body.app-shell .dashboard-stat-card:last-child {
    border-right: 0 !important;
}

body.app-shell .dashboard-stat-card::before {
    width: 3px !important;
    background: var(--club-primary) !important;
}

body.app-shell .dashboard-stat-card.accent-teal::before {
    background: var(--sports-teal) !important;
}

body.app-shell .dashboard-stat-card.accent-amber::before {
    background: var(--sports-amber) !important;
}

body.app-shell .dashboard-stat-card.accent-rose::before {
    background: var(--sports-coral) !important;
}

body.app-shell .dashboard-stat-icon {
    width: 30px;
    height: 30px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-xs) !important;
    background: var(--app-surface-muted) !important;
    color: var(--app-primary-strong) !important;
}

body.app-shell .dashboard-stat-card.accent-teal .dashboard-stat-icon {
    color: var(--sports-teal) !important;
}

body.app-shell .dashboard-stat-card.accent-amber .dashboard-stat-icon {
    color: var(--sports-amber) !important;
}

body.app-shell .dashboard-stat-card.accent-rose .dashboard-stat-icon {
    color: var(--sports-coral) !important;
}

body.app-shell .dashboard-stat-label {
    font-size: .69rem;
    font-weight: 740;
}

body.app-shell .dashboard-stat-value {
    margin-top: .28rem;
    font-size: 1.5rem;
    font-weight: 820;
    line-height: 1;
}

body.app-shell .dashboard-stat-note {
    margin-top: .34rem;
    font-size: .7rem;
}

body.app-shell :is(.dashboard-panel, .dashboard-mini-panel, .dashboard-health-row, .dashboard-tenant-context) {
    border: 1px solid var(--app-border) !important;
    border-radius: var(--app-radius-md) !important;
    background: var(--app-surface) !important;
    box-shadow: var(--app-shadow-small) !important;
}

body.app-shell .dashboard-panel-head {
    min-height: 52px;
    padding: .72rem .82rem;
    border-bottom: 1px solid var(--app-border) !important;
    background: var(--app-surface-muted) !important;
}

body.app-shell .dashboard-panel-eyebrow {
    color: var(--app-secondary) !important;
    font-size: .64rem;
    font-weight: 820;
    letter-spacing: .05em;
    text-transform: uppercase;
}

body.app-shell .dashboard-panel-title {
    margin-top: .12rem;
    font-size: .82rem;
    font-weight: 750;
}

body.app-shell .dashboard-list-item {
    min-height: 48px;
    padding: .58rem .82rem;
    border-bottom: 1px solid var(--app-border) !important;
}

body.app-shell .dashboard-list-item:hover,
body.app-shell .dashboard-list-item:focus {
    background: var(--app-surface-muted) !important;
}

body.app-shell .app-main .dashboard-mini-panel.warning,
body.app-shell .app-main .dashboard-mini-panel.success {
    background: var(--app-surface) !important;
    border-color: var(--app-border) !important;
}

body.app-shell .app-main .dashboard-mini-panel.warning {
    border-left: 3px solid var(--sports-amber) !important;
}

body.app-shell .app-main .dashboard-mini-panel.success {
    border-left: 3px solid var(--app-success) !important;
}

/* Sports domain components */

body.app-shell .sports-filter-panel {
    padding: .82rem;
    background: var(--app-surface-muted) !important;
}

body.app-shell .team-card {
    position: relative;
    overflow: hidden;
    transition: border-color .15s ease, transform .15s ease;
}

body.app-shell .team-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: var(--club-primary);
}

body.app-shell .team-card:hover {
    border-color: var(--app-border-strong) !important;
    transform: translateY(-1px);
}

body.app-shell .match-list {
    gap: .5rem !important;
}

body.app-shell .match-card {
    display: grid !important;
    grid-template-columns: 78px minmax(0, 1fr) auto;
    min-height: 78px;
    padding: 0 !important;
    overflow: hidden;
}

body.app-shell .match-card-date {
    min-width: 0 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: .72rem;
    border-right: 1px solid var(--app-border);
    background: var(--app-surface-muted);
}

body.app-shell .match-card-main {
    min-width: 0;
    align-self: center;
    padding: .72rem 1rem;
}

body.app-shell .match-card-action {
    align-self: center;
    margin-right: .8rem;
}

body.app-shell .match-scoreboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 1.5rem;
    padding: 1.6rem 1rem;
    border-block: 1px solid var(--app-border);
    background: var(--app-surface-muted);
}

body.app-shell .match-score {
    min-width: 110px;
    padding: .65rem 1rem;
    border: 1px solid var(--app-border-strong);
    border-radius: var(--app-radius-xs);
    background: var(--sports-sidebar);
    color: #fff;
    font-size: 2rem;
    font-weight: 820;
    text-align: center;
}

/* Planner uses the same system, while keeping its timeline-specific rules. */

body.app-shell .schedule-planner-page {
    --planner-hour-height: 70px;
}

body.app-shell .planner-heading {
    margin-bottom: .75rem;
    padding-bottom: .72rem;
    border-bottom: 1px solid var(--app-border);
}

body.app-shell .planner-heading h1 {
    font-size: 1.2rem;
}

body.app-shell :is(
    .planner-icon-button,
    .planner-today-button,
    .planner-toolbar,
    .planner-board-shell,
    .planner-inspector,
    .planner-view-switch,
    .planner-preset,
    .planner-copy-option,
    .planner-repeat-panel,
    .planner-load,
    .planner-selection-bar
) {
    border-radius: var(--app-radius-sm) !important;
}

body.app-shell :is(.planner-toolbar, .planner-board-shell, .planner-inspector) {
    border-color: var(--app-border) !important;
    background: var(--app-surface) !important;
    box-shadow: var(--app-shadow-small) !important;
}

body.app-shell .planner-mode-switch {
    width: 100%;
    gap: 0;
}

body.app-shell .planner-mode-option {
    border-inline: 1px solid transparent;
    border-radius: 0;
}

body.app-shell .planner-mode-option.is-active {
    border-bottom-color: var(--club-primary);
    background: var(--app-surface-muted);
    color: var(--app-text);
}

body.app-shell .planner-board-meta,
body.app-shell .planner-timeline-head,
body.app-shell .planner-month-head {
    background: var(--app-surface-muted);
}

body.app-shell .planner-day-head {
    background: var(--app-surface-muted);
}

body.app-shell .planner-day-head.is-selected,
body.app-shell .planner-day-lane.is-today {
    background: var(--club-primary-faint, var(--app-primary-faint));
}

body.app-shell .planner-event {
    box-shadow: none;
}

body.app-shell .planner-event:hover,
body.app-shell .planner-event:focus-visible {
    box-shadow: 0 4px 12px rgba(20, 31, 28, .14);
}

body.app-shell .planner-event.is-selected {
    border-color: var(--club-primary);
    box-shadow: 0 0 0 2px var(--club-primary-soft, var(--app-primary-soft));
}

body.app-shell .planner-inspector-head {
    margin-top: 0;
}

body.app-shell .planner-save-button {
    min-height: 38px;
}

/* Dark theme component corrections */

html[data-app-theme="dark"] body.app-shell :is(
    .form-control,
    .form-select,
    .input-group-text,
    textarea
) {
    background: var(--app-surface-strong) !important;
    border-color: var(--app-border-strong) !important;
    color: var(--app-text) !important;
}

html[data-app-theme="dark"] body.app-shell :is(
    .card,
    .card-surface,
    .dashboard-stat-card,
    .dashboard-panel,
    .dashboard-mini-panel,
    .ui-card,
    .content-panel,
    .action-panel,
    .detail-panel,
    .table-panel
) {
    background: var(--app-surface) !important;
    border-color: var(--app-border) !important;
    color: var(--app-text) !important;
    box-shadow: var(--app-shadow-small) !important;
}

html[data-app-theme="dark"] body.app-shell .dashboard-stat-grid {
    background: var(--app-surface);
    border-color: var(--app-border);
}

html[data-app-theme="dark"] body.app-shell :is(.dashboard-panel-head, .table thead th, .match-card-date, .match-scoreboard) {
    background: var(--app-surface-muted) !important;
}

html[data-app-theme="dark"] body.app-shell .app-main .dashboard-mini-panel.warning,
html[data-app-theme="dark"] body.app-shell .app-main .dashboard-mini-panel.success {
    background: var(--app-surface) !important;
    border-color: var(--app-border) !important;
}

html[data-app-theme="dark"] body.app-shell .app-main .dashboard-mini-panel.warning {
    border-left-color: var(--sports-amber) !important;
}

html[data-app-theme="dark"] body.app-shell .app-main .dashboard-mini-panel.success {
    border-left-color: var(--app-success) !important;
}

html[data-app-theme="dark"] body.app-shell :is(.btn-outline-light, .btn-outline-secondary) {
    background: var(--app-surface-muted) !important;
}

html[data-app-theme="dark"] body.app-shell .app-topbar {
    background: var(--app-surface) !important;
}

/* Auth */

body.app-shell .auth-page {
    background: var(--app-bg);
}

body.app-shell .auth-shell {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    background: var(--app-surface);
    box-shadow: var(--app-shadow);
}

body.app-shell .auth-brand {
    border-bottom-color: var(--app-border);
    background: var(--sports-sidebar);
}

body.app-shell .auth-brand-name {
    color: var(--sports-sidebar-text);
}

body.app-shell .auth-brand-subtitle {
    color: var(--sports-sidebar-muted);
}

body.app-shell .auth-logo {
    border-radius: var(--app-radius-sm);
    box-shadow: 0 0 0 2px var(--sports-sidebar), 0 0 0 4px var(--club-primary);
}

/* Mobile */

@media (max-width: 991.98px) {
    .app-topbar {
        min-height: 60px;
        padding: .55rem .78rem;
    }

    .app-topbar .app-brand-mark {
        width: 34px;
        height: 34px;
        box-shadow: 0 0 0 2px var(--app-surface), 0 0 0 3px var(--club-primary) !important;
    }

    .app-main {
        padding: .85rem .72rem calc(var(--app-bottom-nav-height) + 1.15rem);
    }

    .app-mobile-bottom-nav {
        height: var(--app-bottom-nav-height);
        padding: .3rem max(.3rem, env(safe-area-inset-right)) max(.3rem, env(safe-area-inset-bottom)) max(.3rem, env(safe-area-inset-left));
        border-top-color: #2a3430;
        background: rgba(13, 18, 17, .98) !important;
        box-shadow: 0 -8px 22px rgba(0, 0, 0, .18);
        backdrop-filter: none;
    }

    .app-bottom-link,
    .app-bottom-button {
        min-height: 56px;
        border-radius: var(--app-radius-sm) !important;
        color: #83918c !important;
    }

    .app-bottom-link.is-active,
    .app-bottom-link:hover,
    .app-bottom-button:hover {
        background: #202b27 !important;
        color: #fff !important;
    }

    .app-bottom-link.is-active::after {
        content: "";
        position: absolute;
        top: 3px;
        left: 28%;
        right: 28%;
        height: 2px;
        background: var(--club-primary);
    }

    .app-mobile-offcanvas .offcanvas-header {
        background: var(--sports-sidebar);
        border-bottom-color: #28312e;
    }

    .app-mobile-offcanvas .offcanvas-body {
        background: var(--sports-sidebar);
    }

    .app-mobile-offcanvas .btn-close {
        filter: invert(1) grayscale(100%) brightness(180%);
    }

    .app-mobile-offcanvas .offcanvas-header .app-brand-title {
        color: var(--sports-sidebar-text) !important;
    }

    body.app-shell .dashboard-stat-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0 !important;
    }

    body.app-shell .dashboard-stat-card {
        border-right: 1px solid var(--app-border) !important;
        border-bottom: 1px solid var(--app-border) !important;
    }

    body.app-shell .dashboard-stat-card:nth-child(2n) {
        border-right: 0 !important;
    }

    body.app-shell .match-card {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    body.app-shell .match-card-action {
        grid-column: 1 / -1;
        width: auto;
        margin: 0 .7rem .7rem;
    }

    body.app-shell .planner-mode-switch {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        overflow: hidden;
    }

    body.app-shell .planner-mode-option {
        min-width: 0;
        min-height: 46px;
        justify-content: center;
        gap: .3rem;
        padding: .42rem .25rem;
        font-size: .65rem;
        line-height: 1.2;
        text-align: center;
        white-space: normal;
    }

    body.app-shell .planner-mode-option svg {
        width: 15px;
        height: 15px;
    }
}

@media (max-width: 575.98px) {
    body.app-shell .dashboard-stat-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    body.app-shell .dashboard-stat-card,
    body.app-shell .dashboard-stat-card:nth-child(2n) {
        border-right: 0 !important;
    }

    body.app-shell .match-scoreboard {
        grid-template-columns: minmax(0, 1fr);
        gap: .8rem;
        text-align: center;
    }

    body.app-shell .match-score {
        margin-inline: auto;
    }
}

/* Full application coverage */

body.app-shell .app-main :is(
    .student-page,
    .coach-page,
    .branch-page,
    .class-page,
    .session-page,
    .attendance-page,
    .progress-page,
    .finance-page,
    .record-page,
    .interaction-page,
    .management-page,
    .settings-page,
    .access-page,
    .quick-actions-page,
    .utility-page
) {
    width: 100%;
    max-width: 1280px;
    min-width: 0;
    margin-inline: auto;
}

body.app-shell .app-main :is(
    .student-page-header,
    .coach-page-header,
    .branch-page-header,
    .class-page-header,
    .session-page-header,
    .attendance-page-header,
    .progress-page-header,
    .finance-page-header,
    .record-page-header,
    .interaction-page-header,
    .management-header,
    .settings-header,
    .access-header,
    .quick-actions-header,
    .utility-header
) {
    position: relative;
    align-items: flex-end;
    min-height: 58px;
    margin-bottom: 1rem !important;
    padding-bottom: .8rem;
    border-bottom: 1px solid var(--app-border);
}

body.app-shell .app-main :is(
    .student-page-header,
    .coach-page-header,
    .branch-page-header,
    .class-page-header,
    .session-page-header,
    .attendance-page-header,
    .progress-page-header,
    .finance-page-header,
    .record-page-header,
    .interaction-page-header,
    .management-header,
    .settings-header,
    .access-header,
    .quick-actions-header,
    .utility-header
)::after {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 68px;
    height: 3px;
    background: var(--club-primary);
    content: "";
}

body.app-shell .app-main :is(
    .student-overview-grid,
    .coach-overview-grid,
    .branch-overview-grid,
    .class-overview-grid,
    .session-overview-grid,
    .attendance-overview-grid,
    .progress-overview-grid,
    .finance-overview-grid,
    .record-overview-grid,
    .interaction-overview-grid,
    .management-stat-grid,
    .settings-metric-grid,
    .document-summary-band
) {
    gap: 0 !important;
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    background: var(--app-surface);
    box-shadow: var(--app-shadow-small);
}

body.app-shell .app-main :is(
    .student-overview-card,
    .coach-overview-card,
    .branch-overview-card,
    .class-overview-card,
    .session-overview-card,
    .attendance-overview-card,
    .progress-overview-card,
    .finance-overview-card,
    .record-overview-card,
    .interaction-overview-card,
    .management-stat,
    .settings-metric-card
) {
    position: relative;
    min-height: 82px;
    margin: 0 !important;
    border: 0 !important;
    border-right: 1px solid var(--app-border) !important;
    border-radius: 0 !important;
    background: var(--app-surface) !important;
    box-shadow: none !important;
}

body.app-shell .app-main :is(
    .student-overview-card,
    .coach-overview-card,
    .branch-overview-card,
    .class-overview-card,
    .session-overview-card,
    .attendance-overview-card,
    .progress-overview-card,
    .finance-overview-card,
    .record-overview-card,
    .interaction-overview-card,
    .management-stat,
    .settings-metric-card
)::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--sports-cobalt);
    content: "";
}

body.app-shell .app-main :is(
    .student-overview-card,
    .coach-overview-card,
    .branch-overview-card,
    .class-overview-card,
    .session-overview-card,
    .attendance-overview-card,
    .progress-overview-card,
    .finance-overview-card,
    .record-overview-card,
    .interaction-overview-card,
    .management-stat,
    .settings-metric-card
):nth-child(2)::before {
    background: var(--sports-teal);
}

body.app-shell .app-main :is(
    .student-overview-card,
    .coach-overview-card,
    .branch-overview-card,
    .class-overview-card,
    .session-overview-card,
    .attendance-overview-card,
    .progress-overview-card,
    .finance-overview-card,
    .record-overview-card,
    .interaction-overview-card,
    .management-stat,
    .settings-metric-card
):nth-child(3)::before {
    background: var(--sports-lime);
}

body.app-shell .app-main :is(
    .student-overview-card,
    .coach-overview-card,
    .branch-overview-card,
    .class-overview-card,
    .session-overview-card,
    .attendance-overview-card,
    .progress-overview-card,
    .finance-overview-card,
    .record-overview-card,
    .interaction-overview-card,
    .management-stat,
    .settings-metric-card
):nth-child(4n)::before {
    background: var(--sports-amber);
}

body.app-shell .app-main :is(
    .student-overview-label,
    .coach-overview-label,
    .branch-overview-label,
    .class-overview-label,
    .session-overview-label,
    .attendance-overview-label,
    .progress-overview-label,
    .finance-overview-label,
    .record-overview-label,
    .interaction-overview-label,
    .management-stat-label
) {
    color: var(--app-text-soft) !important;
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: 0;
    text-transform: uppercase;
}

body.app-shell .app-main :is(
    .student-overview-value,
    .coach-overview-value,
    .branch-overview-value,
    .class-overview-value,
    .session-overview-value,
    .attendance-overview-value,
    .progress-overview-value,
    .finance-overview-value,
    .record-overview-value,
    .interaction-overview-value,
    .management-stat-value
) {
    color: var(--app-text) !important;
    font-size: clamp(1.08rem, 1.6vw, 1.42rem);
    font-weight: 850;
    line-height: 1.15;
}

body.app-shell .app-main :is(
    .student-list-shell,
    .student-form-shell,
    .coach-filter-shell,
    .coach-form-shell,
    .branch-form-shell,
    .class-filter-shell,
    .class-form-shell,
    .session-filter-shell,
    .session-form-shell,
    .attendance-filter-shell,
    .attendance-date-shell,
    .progress-filter-shell,
    .progress-form-shell,
    .finance-filter-shell,
    .finance-form-shell,
    .record-filter-shell,
    .interaction-filter-shell,
    .interaction-form-shell,
    .management-filter-panel,
    .management-form-panel,
    .settings-form-panel,
    .access-toolbar-panel,
    .public-panel
) {
    border: 1px solid var(--app-border) !important;
    border-top: 3px solid var(--sports-teal) !important;
    border-radius: var(--app-radius-md) !important;
    background: var(--app-surface) !important;
    box-shadow: var(--app-shadow-small) !important;
}

body.app-shell .app-main :is(
    .student-profile-hero,
    .coach-profile-hero,
    .branch-hero,
    .class-hero,
    .session-hero,
    .attendance-hero,
    .progress-hero,
    .finance-hero,
    .record-hero,
    .interaction-hero,
    .management-detail-hero,
    .settings-profile-hero,
    .access-hero
) {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--app-border) !important;
    border-radius: var(--app-radius-md) !important;
    background: var(--app-surface) !important;
    box-shadow: var(--app-shadow-small) !important;
}

body.app-shell .app-main :is(
    .student-profile-hero,
    .coach-profile-hero,
    .branch-hero,
    .class-hero,
    .session-hero,
    .attendance-hero,
    .progress-hero,
    .finance-hero,
    .record-hero,
    .interaction-hero,
    .management-detail-hero,
    .settings-profile-hero,
    .access-hero
)::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--club-primary), var(--club-secondary));
    content: "";
}

body.app-shell .app-main :is(
    .student-static-card,
    .student-note-card,
    .coach-roster-card,
    .branch-action-link,
    .class-roster-card,
    .class-action-link,
    .session-note-card,
    .session-action-link,
    .attendance-record-card,
    .progress-record-card,
    .progress-student-card,
    .finance-panel,
    .finance-ledger,
    .finance-installment-card,
    .finance-status-card,
    .finance-student-balance-card,
    .record-panel,
    .record-link-panel,
    .interaction-panel,
    .interaction-card,
    .interaction-state-card,
    .management-info-panel,
    .management-table-panel,
    .settings-card,
    .settings-panel,
    .access-card,
    .access-group,
    .access-role-card,
    .document-file-card,
    .document-owner-card,
    .document-missing-card,
    .notification-panel,
    .messaging-sidebar,
    .messaging-panel,
    .quick-actions-group,
    .public-consent-card,
    .public-success-card
) {
    border: 1px solid var(--app-border) !important;
    border-radius: var(--app-radius-md) !important;
    background: var(--app-surface) !important;
    box-shadow: var(--app-shadow-small) !important;
}

body.app-shell .app-main :is(
    .coach-card,
    .branch-card,
    .class-card,
    .finance-card,
    .interaction-card,
    .record-card
) {
    overflow: hidden;
    border: 1px solid var(--app-border) !important;
    border-radius: var(--app-radius-md) !important;
    background: var(--app-surface) !important;
    box-shadow: var(--app-shadow-small) !important;
    transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

body.app-shell .app-main :is(
    .coach-card,
    .branch-card,
    .class-card,
    .finance-card,
    .interaction-card,
    .record-card
):hover {
    border-color: var(--app-border-strong) !important;
    box-shadow: var(--app-shadow) !important;
    transform: translateY(-1px);
}

body.app-shell .app-main :is(
    .branch-card-accent,
    .class-card-accent,
    .finance-card-rail,
    .interaction-card-rail,
    .record-card-rail
) {
    background: linear-gradient(90deg, var(--club-primary), var(--club-secondary)) !important;
}

body.app-shell .app-main :is(
    .student-profile-avatar,
    .coach-profile-avatar,
    .coach-avatar,
    .branch-mark,
    .branch-hero-mark,
    .class-hero-mark,
    .progress-avatar,
    .progress-hero-avatar,
    .interaction-avatar,
    .management-avatar,
    .settings-avatar,
    .class-roster-avatar,
    .app-avatar
) {
    border: 1px solid var(--app-border-strong) !important;
    border-radius: var(--app-radius-sm) !important;
    background: var(--club-primary-faint, var(--app-primary-faint)) !important;
    color: var(--club-primary) !important;
    box-shadow: none !important;
}

body.app-shell .app-main :is(
    .branch-action-link,
    .class-action-link,
    .coach-action-link,
    .session-action-link,
    .quick-action-item
) {
    border: 1px solid var(--app-border) !important;
    border-radius: var(--app-radius-sm) !important;
    background: var(--app-surface-muted) !important;
    color: var(--app-text) !important;
    box-shadow: none !important;
}

body.app-shell .app-main :is(
    .branch-action-link,
    .class-action-link,
    .coach-action-link,
    .session-action-link,
    .quick-action-item
):hover,
body.app-shell .app-main :is(
    .branch-action-link,
    .class-action-link,
    .coach-action-link,
    .session-action-link,
    .quick-action-item
):focus-visible {
    border-color: var(--club-primary) !important;
    background: var(--club-primary-faint, var(--app-primary-faint)) !important;
    color: var(--app-text) !important;
    transform: translateY(-1px);
}

body.app-shell .app-main .quick-actions-group {
    overflow: hidden;
}

body.app-shell .app-main .quick-actions-group-head {
    min-height: 50px;
    padding: .72rem .9rem;
    border-bottom: 1px solid var(--app-border);
    background: var(--app-surface-muted);
}

body.app-shell .app-main .quick-actions-group-icon,
body.app-shell .app-main .quick-action-icon {
    border-radius: var(--app-radius-sm) !important;
    background: var(--app-primary-soft) !important;
    color: var(--sports-cobalt) !important;
}

body.app-shell .app-main .quick-action-item.is-primary {
    border-color: var(--app-border) !important;
    background: var(--app-surface) !important;
    box-shadow: inset 3px 0 0 var(--club-primary) !important;
}

body.app-shell .app-main .finance-page-header {
    align-items: flex-start;
    flex-direction: column;
}

body.app-shell .app-main .finance-page-actions {
    width: 100%;
    justify-content: flex-start;
}

body.app-shell .app-main :is(.settings-card-head, .access-card-head, .management-table-head, .notification-panel-head, .messaging-panel-head, .messaging-sidebar-head) {
    min-height: 52px;
    padding: .75rem .9rem;
    border-bottom: 1px solid var(--app-border) !important;
    background: var(--app-surface-muted) !important;
}

body.app-shell .app-main :is(.settings-card-body, .access-card-body, .management-info-panel, .interaction-card-body, .record-card-body) {
    padding: .9rem !important;
}

body.app-shell .app-main :is(.settings-summary-row, .management-summary-row, .settings-list-row, .access-state-row, .finance-category-row) {
    min-height: 42px;
    padding-block: .5rem;
    border-bottom: 1px solid var(--app-border);
}

body.app-shell .app-main :is(.settings-summary-row, .management-summary-row, .settings-list-row, .access-state-row, .finance-category-row):last-child {
    border-bottom: 0;
}

body.app-shell .app-main :is(.management-field-label, .settings-field-label, .finance-info-label, .record-info-label, .interaction-info-label, .branch-info-label, .coach-info-label, .session-info-label) {
    color: var(--app-text-soft) !important;
    font-size: .74rem;
    font-weight: 650;
}

body.app-shell .app-main :is(.management-field-value, .settings-field-value, .finance-info-value, .record-info-value, .interaction-info-value, .branch-info-value, .coach-info-value, .session-info-value) {
    color: var(--app-text) !important;
    font-weight: 750;
}

body.app-shell .app-main :is(.session-timeline-card, .attendance-record-card, .progress-record-card, .finance-ledger-row) {
    border-color: var(--app-border) !important;
    border-radius: var(--app-radius-sm) !important;
    background: var(--app-surface) !important;
    box-shadow: none !important;
}

body.app-shell .app-main .session-timeline-track {
    width: 3px;
    background: var(--club-primary) !important;
}

body.app-shell .app-main .session-timeline-time,
body.app-shell .app-main .attendance-record-date,
body.app-shell .app-main .progress-record-date,
body.app-shell .app-main .finance-ledger-date,
body.app-shell .app-main .interaction-date-mark,
body.app-shell .app-main .record-date-mark,
body.app-shell .app-main .finance-date-mark {
    border-radius: var(--app-radius-sm) !important;
    background: var(--app-surface-strong) !important;
    color: var(--app-text) !important;
}

body.app-shell .app-main :is(.messaging-layout, .document-detail-layout, .finance-detail-layout, .record-detail-layout, .interaction-detail-layout) {
    gap: .85rem !important;
}

body.app-shell .app-main .messaging-layout {
    min-height: min(680px, calc(100vh - 170px));
}

body.app-shell .app-main :is(.messaging-sidebar, .messaging-panel) {
    overflow: hidden;
}

body.app-shell .app-main .conversation-item {
    border-bottom-color: var(--app-border) !important;
    background: var(--app-surface) !important;
}

body.app-shell .app-main .conversation-item:hover,
body.app-shell .app-main .conversation-item.active {
    background: var(--club-primary-faint, var(--app-primary-faint)) !important;
}

body.app-shell .app-main :is(.interaction-segmented, .record-toggle-tabs, .finance-status-tabs) {
    gap: 0 !important;
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    background: var(--app-surface-muted);
}

body.app-shell .app-main :is(.interaction-segmented, .record-toggle-tabs, .finance-status-tabs) .btn,
body.app-shell .app-main :is(.record-tab, .finance-tab) {
    border: 0 !important;
    border-right: 1px solid var(--app-border) !important;
    border-radius: 0 !important;
}

body.app-shell .app-main :is(.interaction-segmented, .record-toggle-tabs, .finance-status-tabs) :last-child {
    border-right: 0 !important;
}

body.app-shell .app-main :is(.empty-state, .student-empty-state, .coach-empty-state, .branch-empty-state, .class-empty-state, .session-empty-state, .attendance-empty-state, .progress-empty-state, .finance-empty-state, .record-empty-state, .interaction-empty-state, .management-empty, .settings-empty, .quick-actions-empty, .messaging-empty) {
    padding: 2rem 1.25rem !important;
    border: 1px dashed var(--app-border-strong) !important;
    border-radius: var(--app-radius-md) !important;
    background: var(--app-surface-muted) !important;
    color: var(--app-text-soft) !important;
    text-align: center;
}

body.app-shell .app-main :is(.class-pill, .coach-pill, .session-pill, .attendance-pill, .progress-pill, .finance-pill, .record-pill, .interaction-pill, .access-status-pill) {
    border-radius: 999px !important;
    font-size: .7rem;
    font-weight: 750;
}

body.app-shell .app-main :is(.badge-soft-primary, .badge-soft-info) {
    border-color: color-mix(in srgb, var(--sports-cobalt) 32%, var(--app-border)) !important;
    background: var(--app-primary-soft) !important;
    color: var(--app-primary-strong) !important;
}

body.app-shell .app-main .badge-soft-success {
    border-color: color-mix(in srgb, var(--app-success) 34%, var(--app-border)) !important;
    background: color-mix(in srgb, var(--app-success) 14%, var(--app-surface)) !important;
    color: var(--app-success) !important;
}

body.app-shell .app-main .badge-soft-warning {
    border-color: color-mix(in srgb, var(--app-warning) 38%, var(--app-border)) !important;
    background: color-mix(in srgb, var(--app-warning) 15%, var(--app-surface)) !important;
    color: var(--app-warning) !important;
}

body.app-shell .app-main .badge-soft-danger {
    border-color: color-mix(in srgb, var(--app-danger) 34%, var(--app-border)) !important;
    background: color-mix(in srgb, var(--app-danger) 13%, var(--app-surface)) !important;
    color: var(--app-danger) !important;
}

body.app-shell .app-main .badge-soft-muted {
    border-color: var(--app-border) !important;
    background: var(--app-surface-strong) !important;
    color: var(--app-text-soft) !important;
}

body.app-shell .app-main :is(.modal-header, .modal-footer, .card-header, .card-footer, .accordion-item, .accordion-button) {
    border-color: var(--app-border) !important;
    background: var(--app-surface-muted) !important;
    color: var(--app-text) !important;
}

body.app-shell .app-main .accordion-button:not(.collapsed) {
    background: var(--club-primary-faint, var(--app-primary-faint)) !important;
    color: var(--app-text) !important;
    box-shadow: inset 3px 0 0 var(--club-primary) !important;
}

body.app-shell .app-main .progress {
    overflow: hidden;
    border-radius: 999px;
    background: var(--app-surface-strong);
}

body.app-shell .app-main .progress-bar {
    background: linear-gradient(90deg, var(--sports-cobalt), var(--sports-teal));
}

body.app-shell .app-main :is(.management-form-section, .settings-section-block, .class-section) {
    padding-top: .9rem;
    border-top: 1px solid var(--app-border);
}

body.app-shell .app-main :is(.management-panel-title, .settings-card-title, .surface-heading, .class-section-title, .finance-form-section-title, .interaction-form-section-title, .progress-form-section-title, .session-form-section-title, .coach-form-section-title, .branch-form-section-title, .student-form-section-title) {
    color: var(--app-text) !important;
    font-size: .86rem;
    font-weight: 800;
    letter-spacing: 0;
}

body.app-shell .app-main .legal-document-content,
body.app-shell .app-main .tenant-legal-content {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    background: var(--app-surface);
    color: var(--app-text);
}

body.app-shell .app-main .public-consent-check:has(input:checked),
body.app-shell .app-main .interaction-audience-option:has(input:checked),
body.app-shell .app-main .group-mode-option:has(input:checked) {
    border-color: var(--club-primary) !important;
    background: var(--club-primary-faint, var(--app-primary-faint)) !important;
}

html[data-app-theme="dark"] body.app-shell .app-main :is(
    .student-list-shell,
    .student-form-shell,
    .coach-filter-shell,
    .coach-form-shell,
    .branch-form-shell,
    .class-filter-shell,
    .class-form-shell,
    .session-filter-shell,
    .session-form-shell,
    .attendance-filter-shell,
    .attendance-date-shell,
    .progress-filter-shell,
    .progress-form-shell,
    .finance-filter-shell,
    .finance-form-shell,
    .record-filter-shell,
    .interaction-filter-shell,
    .interaction-form-shell,
    .management-filter-panel,
    .management-form-panel,
    .settings-form-panel,
    .access-toolbar-panel,
    .public-panel
) {
    background: var(--app-surface) !important;
}

@media (max-width: 991.98px) {
    body.app-shell .app-main :is(
        .student-overview-grid,
        .coach-overview-grid,
        .branch-overview-grid,
        .class-overview-grid,
        .session-overview-grid,
        .attendance-overview-grid,
        .progress-overview-grid,
        .finance-overview-grid,
        .record-overview-grid,
        .interaction-overview-grid,
        .management-stat-grid,
        .settings-metric-grid
    ) {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body.app-shell .app-main :is(
        .student-overview-card,
        .coach-overview-card,
        .branch-overview-card,
        .class-overview-card,
        .session-overview-card,
        .attendance-overview-card,
        .progress-overview-card,
        .finance-overview-card,
        .record-overview-card,
        .interaction-overview-card,
        .management-stat,
        .settings-metric-card
    ) {
        border-right: 1px solid var(--app-border) !important;
        border-bottom: 1px solid var(--app-border) !important;
    }

    body.app-shell .app-main :is(
        .student-overview-card,
        .coach-overview-card,
        .branch-overview-card,
        .class-overview-card,
        .session-overview-card,
        .attendance-overview-card,
        .progress-overview-card,
        .finance-overview-card,
        .record-overview-card,
        .interaction-overview-card,
        .management-stat,
        .settings-metric-card
    ):nth-child(2n) {
        border-right: 0 !important;
    }

    body.app-shell .app-main .messaging-layout {
        min-height: auto;
    }
}

@media (max-width: 767.98px) {
    body.app-shell .app-main :is(
        .student-page-header,
        .coach-page-header,
        .branch-page-header,
        .class-page-header,
        .session-page-header,
        .attendance-page-header,
        .progress-page-header,
        .finance-page-header,
        .record-page-header,
        .interaction-page-header,
        .management-header,
        .settings-header,
        .access-header,
        .quick-actions-header,
        .utility-header
    ) {
        align-items: stretch;
        min-height: 0;
    }

    body.app-shell .app-main :is(.finance-page-actions, .interaction-page-actions, .record-page-actions, .settings-actions, .management-actions, .session-header-actions) {
        justify-content: flex-start;
    }

    body.app-shell .app-main :is(.settings-grid, .management-detail-grid, .student-detail-layout, .coach-detail-layout, .branch-detail-layout, .class-detail-layout, .session-detail-layout, .finance-detail-layout, .record-detail-layout, .interaction-detail-layout) {
        gap: .75rem !important;
    }
}

@media (max-width: 575.98px) {
    body.app-shell .app-main :is(
        .student-overview-grid,
        .coach-overview-grid,
        .branch-overview-grid,
        .class-overview-grid,
        .session-overview-grid,
        .attendance-overview-grid,
        .progress-overview-grid,
        .finance-overview-grid,
        .record-overview-grid,
        .interaction-overview-grid,
        .management-stat-grid,
        .settings-metric-grid
    ) {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body.app-shell .app-main :is(
        .student-overview-card,
        .coach-overview-card,
        .branch-overview-card,
        .class-overview-card,
        .session-overview-card,
        .attendance-overview-card,
        .progress-overview-card,
        .finance-overview-card,
        .record-overview-card,
        .interaction-overview-card,
        .management-stat,
        .settings-metric-card
    ) {
        min-height: 76px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.app-shell *,
    body.app-shell *::before,
    body.app-shell *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* Reference screens: operations center, roster and athlete workspace */

.ops-kicker {
    color: var(--app-secondary);
    font-size: .66rem;
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.ops-dashboard,
.roster-page,
.athlete-profile-page,
.athlete-editor-page {
    width: 100%;
    max-width: 1360px;
    min-width: 0;
    margin-inline: auto;
}

.ops-command-header,
.roster-command-header,
.athlete-editor-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding: .2rem 0 1rem;
    border-bottom: 1px solid var(--app-border);
}

:is(.ops-command-header, .roster-command-header, .athlete-editor-header) h1 {
    margin: .2rem 0 0;
    color: var(--app-text);
    font-size: 1.55rem;
    font-weight: 850;
    line-height: 1.15;
}

:is(.ops-command-header, .roster-command-header, .athlete-editor-header) p {
    margin: .35rem 0 0;
    color: var(--app-text-soft);
    font-size: .78rem;
}

.ops-command-actions {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.ops-live-state {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    color: var(--app-text-soft);
    font-size: .7rem;
    font-weight: 700;
}

.ops-live-state > span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--app-success);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-success) 15%, transparent);
}

.ops-scoreboard,
.roster-scoreboard,
.athlete-context-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: .9rem;
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    background: var(--app-surface);
    box-shadow: var(--app-shadow-small);
}

.ops-score {
    position: relative;
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: 88px;
    padding: .82rem .95rem;
    border-right: 1px solid var(--app-border);
    color: var(--app-text);
    text-decoration: none;
}

.ops-score:last-child {
    border-right: 0;
}

.ops-score::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--sports-cobalt);
    content: "";
}

.ops-score.is-disabled,
.ops-score:hover,
.ops-score:focus {
    color: var(--app-text);
}

.ops-score:hover,
.ops-score:focus {
    background: var(--app-surface-muted);
}

.ops-score-teal::before { background: var(--sports-teal); }
.ops-score-amber::before { background: var(--sports-amber); }
.ops-score-coral::before { background: var(--sports-coral); }

.ops-score-icon {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-xs);
    background: var(--app-surface-muted);
    color: var(--app-primary-strong);
}

.ops-score-icon svg,
.ops-alert-icon svg,
.ops-empty-icon svg,
.roster-primary-action svg,
.roster-search-icon svg,
.roster-empty-icon svg,
.athlete-section-icon svg,
.athlete-action-list svg,
.athlete-form-map-note svg,
.athlete-sensitive-note svg,
.athlete-photo-preview svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ops-score small,
.roster-score small,
.athlete-context-strip small {
    display: block;
    color: var(--app-text-soft);
    font-size: .67rem;
    font-weight: 740;
    text-transform: uppercase;
}

.ops-score strong,
.roster-score strong,
.athlete-context-strip strong {
    display: block;
    margin-top: .16rem;
    color: var(--app-text);
    font-size: 1.3rem;
    font-weight: 850;
    line-height: 1.1;
}

.ops-primary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(290px, .9fr);
    gap: .9rem;
    margin-top: .9rem;
}

.ops-primary-grid > :only-child {
    grid-column: 1 / -1;
}

.ops-run-sheet,
.ops-control-rail,
.ops-intel-panel,
.roster-workbench,
.athlete-section,
.athlete-action-console,
.athlete-consent-panel,
.athlete-audit-panel,
.athlete-danger-panel,
.athlete-editor-section {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    background: var(--app-surface);
    box-shadow: var(--app-shadow-small);
}

.ops-section-head {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: .7rem;
    padding: .75rem .88rem;
    border-bottom: 1px solid var(--app-border);
    background: var(--app-surface-muted);
}

.ops-section-head h2 {
    margin: .12rem 0 0;
    color: var(--app-text);
    font-size: .9rem;
    font-weight: 800;
}

.ops-count {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    padding: .2rem .48rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-xs);
    background: var(--app-surface);
    color: var(--app-text-soft);
    font-size: .68rem;
    font-weight: 750;
    white-space: nowrap;
}

.ops-count.is-danger {
    border-color: color-mix(in srgb, var(--app-danger) 35%, var(--app-border));
    color: var(--app-danger);
}

.ops-timeline {
    padding: .45rem .8rem .6rem;
}

.ops-session {
    display: grid;
    grid-template-columns: 58px 14px minmax(0, 1fr) auto;
    align-items: stretch;
    min-height: 66px;
    color: var(--app-text);
    text-decoration: none;
}

.ops-session:hover,
.ops-session:focus {
    color: var(--app-text);
}

.ops-session-time {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: .55rem;
    text-align: right;
}

.ops-session-time strong {
    font-size: .78rem;
    font-weight: 820;
}

.ops-session-time small {
    color: var(--app-text-muted);
    font-size: .65rem;
}

.ops-session-marker {
    position: relative;
    border-left: 1px solid var(--app-border-strong);
}

.ops-session-marker::before {
    position: absolute;
    top: 50%;
    left: -5px;
    width: 9px;
    height: 9px;
    border: 2px solid var(--app-surface);
    border-radius: 50%;
    background: var(--club-primary);
    box-shadow: 0 0 0 1px var(--club-primary);
    content: "";
    transform: translateY(-50%);
}

.ops-session-body {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    margin: .3rem 0 .3rem .72rem;
    padding: .55rem .68rem;
    border: 1px solid var(--app-border);
    border-left: 3px solid var(--sports-teal);
    border-radius: var(--app-radius-xs);
    background: var(--app-surface-muted);
}

.ops-session:hover .ops-session-body {
    border-color: var(--app-border-strong);
}

.ops-session-body strong { font-size: .8rem; font-weight: 800; }
.ops-session-body span { color: var(--app-text-soft); font-size: .72rem; }
.ops-session-body small { color: var(--app-text-muted); font-size: .66rem; }

.ops-session-action {
    align-self: center;
    margin-left: .55rem;
    color: var(--app-primary-strong);
    font-size: .68rem;
    font-weight: 800;
}

.ops-empty {
    display: grid;
    min-height: 230px;
    place-content: center;
    justify-items: center;
    padding: 2rem;
    color: var(--app-text-soft);
    text-align: center;
}

.ops-empty-icon {
    display: grid;
    width: 42px;
    height: 42px;
    margin-bottom: .7rem;
    place-items: center;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    background: var(--app-surface-muted);
    color: var(--app-secondary);
}

.ops-empty strong { color: var(--app-text); font-size: .86rem; }
.ops-empty > span:last-child { margin-top: .25rem; font-size: .7rem; }

.ops-alert-stack {
    display: grid;
    gap: .5rem;
    padding: .7rem;
}

.ops-alert-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: .65rem;
    min-height: 58px;
    padding: .55rem .62rem;
    border: 1px solid var(--app-border);
    border-left: 3px solid var(--app-border-strong);
    border-radius: var(--app-radius-xs);
    background: var(--app-surface-muted);
    color: var(--app-text);
    text-decoration: none;
}

.ops-alert-item:hover,
.ops-alert-item:focus { border-color: var(--app-border-strong); color: var(--app-text); }
.ops-alert-item.is-warning {
    border-left-color: var(--sports-amber);
    background: color-mix(in srgb, var(--sports-amber) 10%, var(--app-surface));
}
.ops-alert-item.is-danger {
    border-left-color: var(--sports-coral);
    background: color-mix(in srgb, var(--sports-coral) 10%, var(--app-surface));
}
.ops-alert-item.is-clear { border-left-color: var(--app-success); }

html:not([data-app-theme="dark"]) body.app-shell .ops-alert-item.is-warning {
    border-color: #e5b850;
    border-left-color: var(--sports-amber);
    background: #fff3d6;
}

html:not([data-app-theme="dark"]) body.app-shell .ops-alert-item.is-danger {
    border-color: #eda5a8;
    border-left-color: var(--sports-coral);
    background: #fde7e8;
}

.ops-alert-item.is-warning .ops-alert-icon { color: var(--sports-amber); }
.ops-alert-item.is-danger .ops-alert-icon { color: var(--app-danger); }

html:not([data-app-theme="dark"]) body.app-shell .ops-alert-item.is-warning .ops-alert-icon {
    border-color: #e5b850;
    background: #ffe9af;
    color: #8a5700;
}

html:not([data-app-theme="dark"]) body.app-shell .ops-alert-item.is-danger .ops-alert-icon {
    border-color: #eda5a8;
    background: #fbd1d3;
    color: #ad2f35;
}

html:not([data-app-theme="dark"]) body.app-shell .ops-alert-item.is-warning > b { color: #8a5700; }
html:not([data-app-theme="dark"]) body.app-shell .ops-alert-item.is-danger > b { color: #ad2f35; }

.ops-alert-icon {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-xs);
    color: var(--app-secondary);
}

.ops-alert-copy { display: grid; min-width: 0; }
.ops-alert-copy strong { font-size: .75rem; font-weight: 800; }
.ops-alert-copy small { overflow: hidden; color: var(--app-text-soft); font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.ops-alert-item > b { color: var(--app-text); font-size: .73rem; font-weight: 830; white-space: nowrap; }

.ops-intel-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .9rem;
    margin-top: .9rem;
}

.ops-compact-list { padding: .35rem .72rem .55rem; }

.ops-compact-list a {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    border-bottom: 1px solid var(--app-border);
    color: var(--app-text);
    font-size: .72rem;
    text-decoration: none;
}

.ops-compact-list a:last-child { border-bottom: 0; }
.ops-compact-list a:hover span { color: var(--app-primary-strong); }
.ops-compact-list a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops-compact-list a b { color: var(--app-text-soft); font-size: .66rem; white-space: nowrap; }
.ops-compact-empty { padding: 1rem .2rem; color: var(--app-text-muted); font-size: .7rem; }

/* Role-specific operations dashboards */

.coach-ops-dashboard {
    width: 100%;
    max-width: 1360px;
    min-width: 0;
    margin-inline: auto;
}

.ops-announcement-board,
.ops-finance-panel,
.coach-next-session,
.coach-workload-panel,
.coach-detail-panel {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    background: var(--app-surface);
    box-shadow: var(--app-shadow-small);
}

.ops-announcement-board {
    margin-top: .9rem;
    overflow: hidden;
    border-top: 3px solid var(--club-primary);
}

.ops-announcement-head {
    display: flex;
    min-height: 52px;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    padding: .65rem .88rem;
    border-bottom: 1px solid var(--app-border);
    background: var(--app-surface-muted);
}

.ops-announcement-head h2 {
    margin: .1rem 0 0;
    color: var(--app-text);
    font-size: .9rem;
    font-weight: 820;
}

.ops-announcement-head > a,
.ops-section-head > a {
    color: var(--app-primary-strong);
    font-size: .68rem;
    font-weight: 800;
    text-decoration: none;
}

.ops-announcement-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ops-announcement-list > a {
    display: grid;
    min-width: 0;
    min-height: 78px;
    align-content: center;
    gap: .16rem;
    padding: .68rem .88rem;
    border-right: 1px solid var(--app-border);
    color: var(--app-text);
    text-decoration: none;
}

.ops-announcement-list > a:last-child { border-right: 0; }
.ops-announcement-list > a:hover { background: var(--app-surface-muted); }
.ops-announcement-list strong { overflow: hidden; font-size: .78rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.ops-announcement-list > a > span:last-child { color: var(--app-primary-strong); font-size: .64rem; font-weight: 760; }
.ops-announcement-date { color: var(--app-text-muted); font-size: .62rem; font-weight: 760; text-transform: uppercase; }
.ops-announcement-empty { padding: .9rem; color: var(--app-text-muted); font-size: .72rem; }

.ops-admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(330px, .95fr);
    gap: .9rem;
    margin-top: .9rem;
}

.ops-finance-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: 100%;
}

.ops-finance-metrics > a {
    display: flex;
    min-width: 0;
    min-height: 118px;
    flex-direction: column;
    justify-content: center;
    padding: .85rem;
    border-right: 1px solid var(--app-border);
    color: var(--app-text);
    text-decoration: none;
}

.ops-finance-metrics > a:last-child { border-right: 0; }
.ops-finance-metrics > a:hover { background: var(--app-surface-muted); }
.ops-finance-metrics > a.is-danger { background: color-mix(in srgb, var(--sports-coral) 8%, var(--app-surface)); }
html:not([data-app-theme="dark"]) body.app-shell .ops-finance-metrics > a.is-danger {
    background: #fde7e8;
}
html:not([data-app-theme="dark"]) body.app-shell .ops-finance-metrics > a.is-danger strong {
    color: #ad2f35;
}
.ops-finance-metrics small { color: var(--app-text-soft); font-size: .66rem; font-weight: 760; }
.ops-finance-metrics strong { margin-top: .28rem; font-size: 1.05rem; font-weight: 850; }
.ops-finance-metrics span { margin-top: .18rem; color: var(--app-text-muted); font-size: .64rem; }
.ops-intel-grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.ops-match-list { padding: .35rem .72rem .55rem; }

.ops-match-list > a {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: .65rem;
    min-height: 54px;
    border-bottom: 1px solid var(--app-border);
    color: var(--app-text);
    text-decoration: none;
}

.ops-match-list > a:last-child { border-bottom: 0; }
.ops-match-list > a:hover .ops-match-copy strong { color: var(--app-primary-strong); }
.ops-match-list > a > span:last-child { color: var(--app-primary-strong); font-size: .64rem; font-weight: 780; }
.ops-match-date { display: grid; justify-items: center; line-height: 1; }
.ops-match-date b { font-size: .9rem; font-weight: 850; }
.ops-match-date small { margin-top: .15rem; color: var(--app-text-muted); font-size: .58rem; text-transform: uppercase; }
.ops-match-copy { display: grid; min-width: 0; }
.ops-match-copy strong { overflow: hidden; font-size: .73rem; font-weight: 790; text-overflow: ellipsis; white-space: nowrap; }
.ops-match-copy small { overflow: hidden; color: var(--app-text-soft); font-size: .64rem; text-overflow: ellipsis; white-space: nowrap; }

.ops-quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .45rem;
    padding: .7rem;
}

.ops-quick-grid > a {
    display: flex;
    min-height: 42px;
    align-items: center;
    padding: .55rem .68rem;
    border: 1px solid var(--app-border);
    border-left: 3px solid var(--sports-cobalt);
    border-radius: var(--app-radius-xs);
    background: var(--app-surface-muted);
    color: var(--app-text);
    font-size: .72rem;
    font-weight: 760;
    text-decoration: none;
}

.ops-quick-grid > a:hover { border-color: var(--app-border-strong); color: var(--app-primary-strong); }

.coach-focus-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(270px, .7fr);
    gap: .9rem;
    margin-top: .9rem;
}

.coach-live-badge {
    display: inline-flex;
    align-items: center;
    gap: .38rem;
    color: var(--app-success);
    font-size: .65rem;
    font-weight: 800;
}

.coach-live-badge > span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-success) 14%, transparent);
}

.coach-session-body {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    min-height: 150px;
    padding: 1rem;
}

.coach-session-date {
    display: grid;
    justify-items: center;
    padding-right: 1rem;
    border-right: 1px solid var(--app-border);
}

.coach-session-date strong { font-size: 2rem; font-weight: 880; line-height: 1; }
.coach-session-date span { color: var(--club-primary); font-size: .72rem; font-weight: 820; text-transform: uppercase; }
.coach-session-date small { margin-top: .2rem; color: var(--app-text-muted); font-size: .62rem; }
.coach-session-copy { display: grid; min-width: 0; gap: .45rem; }
.coach-session-copy > a { display: grid; min-width: 0; color: var(--app-text); text-decoration: none; }
.coach-session-copy > a:hover strong { color: var(--app-primary-strong); }
.coach-session-copy > a span { color: var(--app-secondary); font-size: .7rem; font-weight: 780; }
.coach-session-copy > a strong { overflow: hidden; margin-top: .12rem; font-size: 1.12rem; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.coach-session-meta { display: flex; flex-wrap: wrap; gap: .4rem .8rem; color: var(--app-text-soft); font-size: .7rem; }
.coach-session-actions { display: flex; align-items: center; gap: .45rem; }

.coach-session-empty {
    display: grid;
    min-height: 150px;
    place-content: center;
    justify-items: center;
    color: var(--app-text-soft);
    text-align: center;
}

.coach-session-empty svg,
.coach-task-check svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.coach-session-empty strong { margin-top: .5rem; color: var(--app-text); font-size: .8rem; }
.coach-session-empty span { margin-top: .2rem; font-size: .66rem; }
.coach-workload-value { display: grid; justify-items: center; padding: 1.25rem .8rem .8rem; }
.coach-workload-value strong { font-size: 1.55rem; font-weight: 870; }
.coach-workload-value span { color: var(--app-text-soft); font-size: .68rem; }
.coach-workload-progress { height: 7px; margin: .25rem .9rem .55rem; overflow: hidden; border-radius: 4px; background: var(--app-surface-muted); }
.coach-workload-progress > span { display: block; height: 100%; border-radius: inherit; background: var(--sports-teal); }
.coach-workload-target { padding: 0 .9rem 1rem; color: var(--app-text-muted); font-size: .66rem; text-align: center; }

.coach-stat-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: .9rem;
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    background: var(--app-surface);
    box-shadow: var(--app-shadow-small);
}

.coach-stat-strip > a {
    display: flex;
    min-height: 62px;
    flex-direction: column;
    justify-content: center;
    padding: .65rem .85rem;
    border-right: 1px solid var(--app-border);
    color: var(--app-text);
    text-decoration: none;
}

.coach-stat-strip > a:last-child { border-right: 0; }
.coach-stat-strip > a:hover { background: var(--app-surface-muted); }
.coach-stat-strip small { color: var(--app-text-soft); font-size: .63rem; font-weight: 730; }
.coach-stat-strip strong { margin-top: .1rem; font-size: 1.05rem; font-weight: 850; }

.coach-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .9rem;
    margin-top: .9rem;
}

.coach-task-list { padding: .35rem .72rem .55rem; }
.coach-task-list > a {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: .6rem;
    min-height: 52px;
    border-bottom: 1px solid var(--app-border);
    color: var(--app-text);
    text-decoration: none;
}
.coach-task-list > a:last-child { border-bottom: 0; }
.coach-task-list > a:hover .coach-task-copy strong { color: var(--app-primary-strong); }
.coach-task-list > a.is-overdue .coach-task-date { color: var(--app-danger); }
.coach-task-check { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid var(--app-border); border-radius: var(--app-radius-xs); color: var(--app-secondary); }
.coach-task-copy { display: grid; min-width: 0; }
.coach-task-copy strong { overflow: hidden; font-size: .73rem; font-weight: 790; text-overflow: ellipsis; white-space: nowrap; }
.coach-task-copy small { color: var(--app-text-soft); font-size: .63rem; }
.coach-task-date { color: var(--app-text-muted); font-size: .65rem; font-weight: 780; }

@media (max-width: 991.98px) {
    .ops-admin-grid,
    .coach-focus-grid { grid-template-columns: minmax(0, 1fr); }
    .ops-finance-metrics { min-height: auto; }
}

@media (max-width: 767.98px) {
    .ops-announcement-list,
    .ops-finance-metrics,
    .coach-stat-strip,
    .coach-detail-grid,
    .ops-intel-grid-two { grid-template-columns: minmax(0, 1fr); }
    .ops-announcement-list > a,
    .ops-finance-metrics > a,
    .coach-stat-strip > a { min-height: 58px; border-right: 0; border-bottom: 1px solid var(--app-border); }
    .ops-announcement-list > a:last-child,
    .ops-finance-metrics > a:last-child,
    .coach-stat-strip > a:last-child { border-bottom: 0; }
    .coach-session-body { grid-template-columns: 58px minmax(0, 1fr); gap: .7rem; }
    .coach-session-date { padding-right: .65rem; }
    .coach-session-date strong { font-size: 1.55rem; }
    .coach-session-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

@media (max-width: 479.98px) {
    .ops-quick-grid { grid-template-columns: minmax(0, 1fr); }
    .coach-session-copy > a strong { font-size: .92rem; }
    .coach-session-actions { justify-content: stretch; }
    .coach-session-actions .btn { flex: 1; }
}

/* Roster */

.roster-command-header { margin-top: 0; }

.roster-primary-action {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}

.roster-primary-action svg { width: 16px; height: 16px; }

.roster-scoreboard { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

.roster-score {
    position: relative;
    min-height: 82px;
    padding: .72rem .88rem .7rem 1rem;
    border-right: 1px solid var(--app-border);
}

.roster-score:last-child { border-right: 0; }
.roster-score::before { position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--app-border-strong); content: ""; }
.roster-score.is-primary::before { background: var(--sports-cobalt); }
.roster-score.is-success::before { background: var(--app-success); }
.roster-score.is-teal::before { background: var(--sports-teal); }
.roster-score.is-warning::before { background: var(--sports-amber); }
.roster-score strong { font-size: 1.22rem; }
.roster-score > span { display: block; margin-top: .16rem; color: var(--app-text-muted); font-size: .65rem; }

.roster-workbench {
    margin-top: .9rem;
    overflow: hidden;
}

.roster-toolbar {
    display: flex;
    min-height: 62px;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    padding: .7rem .8rem;
    border-bottom: 1px solid var(--app-border);
    background: var(--app-surface-muted);
}

.roster-search {
    display: grid;
    width: min(100%, 660px);
    grid-template-columns: 30px minmax(0, 1fr) auto auto;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--app-border-strong);
    border-radius: var(--app-radius-xs);
    background: var(--app-surface);
}

.roster-search:focus-within { border-color: var(--club-primary); box-shadow: 0 0 0 2px var(--club-primary-faint); }

.roster-search-icon { display: grid; place-items: center; color: var(--app-text-muted); }
.roster-search-icon svg { width: 15px; height: 15px; }

.roster-search input {
    min-width: 0;
    height: 36px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--app-text);
    font-size: .75rem;
}

.roster-search-clear {
    padding: .25rem .5rem;
    color: var(--app-text-soft);
    font-size: .66rem;
    font-weight: 720;
    text-decoration: none;
}

.roster-search .btn { margin-right: 3px; }
.roster-result-state { color: var(--app-text-soft); font-size: .68rem; white-space: nowrap; }
.roster-result-state strong { color: var(--app-text); }

.roster-list-head,
.roster-entry {
    display: grid;
    grid-template-columns: minmax(250px, 1.35fr) minmax(170px, .85fr) minmax(195px, auto);
    align-items: center;
    gap: .8rem;
}

.roster-list.has-club :is(.roster-list-head, .roster-entry) {
    grid-template-columns: minmax(230px, 1.3fr) minmax(160px, .8fr) minmax(140px, .65fr) minmax(195px, auto);
}

.roster-list-head {
    min-height: 37px;
    padding: 0 .85rem;
    border-bottom: 1px solid var(--app-border);
    color: var(--app-text-muted);
    font-size: .64rem;
    font-weight: 800;
    text-transform: uppercase;
}

.roster-entry {
    position: relative;
    min-height: 76px;
    padding: .65rem .85rem;
    border-bottom: 1px solid var(--app-border);
}

.roster-entry:last-child { border-bottom: 0; }
.roster-entry:hover { background: var(--app-surface-muted); }
.roster-entry.is-inactive { opacity: .7; }

.roster-athlete {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: .72rem;
    color: var(--app-text);
    text-decoration: none;
}

.roster-athlete:hover { color: var(--app-primary-strong); }

.roster-avatar {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--app-border-strong);
    border-radius: var(--app-radius-sm);
    background: var(--club-primary-faint);
    color: var(--club-primary);
    font-size: .76rem;
    font-weight: 850;
}

.roster-avatar img { width: 100%; height: 100%; object-fit: cover; }
.roster-athlete-copy { display: grid; min-width: 0; }
.roster-athlete-copy strong { overflow: hidden; font-size: .78rem; font-weight: 820; text-overflow: ellipsis; white-space: nowrap; }
.roster-athlete-copy small { overflow: hidden; color: var(--app-text-soft); font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }

.roster-placement,
.roster-club { display: grid; min-width: 0; }
.roster-placement strong,
.roster-club strong { overflow: hidden; color: var(--app-text); font-size: .73rem; font-weight: 760; text-overflow: ellipsis; white-space: nowrap; }
.roster-placement strong.is-unassigned { color: var(--app-warning); }
.roster-placement small { overflow: hidden; color: var(--app-text-soft); font-size: .65rem; text-overflow: ellipsis; white-space: nowrap; }
.roster-mobile-label { display: none; color: var(--app-text-muted); font-size: .61rem; font-weight: 760; text-transform: uppercase; }

.roster-status span,
.athlete-state {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    padding: .2rem .45rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-xs);
    font-size: .65rem;
    font-weight: 800;
}

.roster-status .is-active,
.athlete-state.is-active { border-color: color-mix(in srgb, var(--app-success) 38%, var(--app-border)); background: color-mix(in srgb, var(--app-success) 10%, transparent); color: var(--app-success); }
.roster-status .is-passive,
.athlete-state.is-passive { color: var(--app-text-muted); }

.roster-actions { display: flex; justify-content: flex-end; gap: .35rem; }
.roster-actions .btn { min-width: 58px; }

.roster-empty {
    display: grid;
    min-height: 240px;
    place-content: center;
    justify-items: center;
    padding: 2rem;
    color: var(--app-text-soft);
    text-align: center;
}

.roster-empty-icon { display: grid; width: 44px; height: 44px; margin-bottom: .7rem; place-items: center; border: 1px solid var(--app-border); border-radius: var(--app-radius-sm); color: var(--app-secondary); }
.roster-empty strong { color: var(--app-text); font-size: .86rem; }
.roster-empty > span:last-child { margin-top: .25rem; font-size: .7rem; }

.roster-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .28rem;
    padding: .65rem .8rem;
    border-top: 1px solid var(--app-border);
    background: var(--app-surface-muted);
}

.roster-page-link {
    display: inline-grid;
    min-width: 31px;
    height: 31px;
    place-items: center;
    padding: 0 .48rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-xs);
    background: var(--app-surface);
    color: var(--app-text-soft);
    font-size: .67rem;
    font-weight: 750;
    text-decoration: none;
}

.roster-page-link:hover { border-color: var(--app-border-strong); color: var(--app-text); }
.roster-page-link.active { border-color: var(--club-primary); background: var(--club-primary); color: #fff; }
.roster-page-link.disabled { pointer-events: none; opacity: .45; }
.roster-page-gap { color: var(--app-text-muted); font-size: .68rem; }

.roster-delete-modal .modal-header,
.roster-delete-modal .modal-footer { border-color: var(--app-border); }
.roster-delete-modal .modal-body p { margin-bottom: .7rem; font-size: .8rem; }
.roster-delete-warning { padding: .62rem .68rem; border-left: 3px solid var(--sports-coral); background: color-mix(in srgb, var(--sports-coral) 7%, var(--app-surface)); color: var(--app-text-soft); font-size: .7rem; }

/* Athlete profile */

.athlete-back-link { margin-bottom: .7rem; }
.athlete-back-link a { color: var(--app-text-soft); font-size: .7rem; font-weight: 700; text-decoration: none; }
.athlete-back-link a:hover { color: var(--app-primary-strong); }

.athlete-identity-band {
    position: relative;
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    min-height: 132px;
    padding: 1rem 1.1rem;
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-left: 4px solid var(--club-primary);
    border-radius: var(--app-radius-md);
    background: var(--app-surface);
    box-shadow: var(--app-shadow-small);
}

.athlete-avatar-xl {
    display: grid;
    width: 84px;
    height: 84px;
    place-items: center;
    overflow: hidden;
    border: 2px solid var(--app-surface);
    border-radius: var(--app-radius-sm);
    background: var(--club-primary-faint);
    color: var(--club-primary);
    box-shadow: 0 0 0 1px var(--app-border-strong);
    font-size: 1.2rem;
    font-weight: 880;
}

.athlete-avatar-xl img { width: 100%; height: 100%; object-fit: cover; }
.athlete-title-row { display: flex; align-items: center; gap: .65rem; margin-top: .18rem; }
.athlete-title-row h1 { margin: 0; color: var(--app-text); font-size: 1.55rem; font-weight: 880; }
.athlete-contact-line { display: flex; flex-wrap: wrap; gap: .3rem .8rem; margin-top: .35rem; color: var(--app-text-soft); font-size: .73rem; }
.athlete-contact-line span + span { position: relative; }
.athlete-contact-line span + span::before { position: absolute; left: -.48rem; color: var(--app-border-strong); content: "·"; }

.athlete-context-strip { grid-template-columns: 80px repeat(4, minmax(0, 1fr)); margin-top: .65rem; }
.athlete-context-strip > div { min-height: 66px; padding: .65rem .78rem; border-right: 1px solid var(--app-border); }
.athlete-context-strip > div:last-child { border-right: 0; }
.athlete-context-strip strong { overflow: hidden; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }

.athlete-profile-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(290px, .75fr);
    gap: .8rem;
    margin-top: .8rem;
}

.athlete-profile-main,
.athlete-profile-rail { display: grid; align-content: start; gap: .8rem; min-width: 0; }
.athlete-section { overflow: hidden; }

.athlete-section-head {
    display: flex;
    min-height: 56px;
    align-items: center;
    gap: .62rem;
    padding: .68rem .78rem;
    border-bottom: 1px solid var(--app-border);
    background: var(--app-surface-muted);
}

.athlete-section-icon {
    display: grid;
    width: 31px;
    height: 31px;
    flex: 0 0 31px;
    place-items: center;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-xs);
    color: var(--app-secondary);
}

.athlete-section-head > div { min-width: 0; flex: 1; }
.athlete-section-head small { display: block; color: var(--app-text-muted); font-size: .61rem; font-weight: 800; text-transform: uppercase; }
.athlete-section-head h2 { margin: .1rem 0 0; color: var(--app-text); font-size: .84rem; font-weight: 820; }
.athlete-section-head > b { color: var(--app-primary-strong); font-size: .75rem; }

.athlete-data-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.athlete-data-grid > div { min-height: 65px; padding: .72rem .78rem; border-right: 1px solid var(--app-border); border-bottom: 1px solid var(--app-border); }
.athlete-data-grid > div:nth-child(3n) { border-right: 0; }
.athlete-data-grid > div:nth-last-child(-n + 3) { border-bottom: 0; }
.athlete-data-grid small,
.athlete-address small { display: block; color: var(--app-text-muted); font-size: .63rem; font-weight: 700; }
.athlete-data-grid strong { display: block; margin-top: .2rem; color: var(--app-text); font-size: .75rem; font-weight: 790; }
.athlete-address { display: grid; gap: .2rem; padding: .68rem .78rem; border-top: 1px solid var(--app-border); color: var(--app-text); font-size: .72rem; }

.athlete-team-list,
.athlete-consent-list { display: grid; padding: .45rem .72rem .6rem; }
.athlete-team-list a { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: .8rem; border-bottom: 1px solid var(--app-border); color: var(--app-text); text-decoration: none; }
.athlete-team-list a:last-child { border-bottom: 0; }
.athlete-team-list a > span { display: grid; }
.athlete-team-list a strong { font-size: .75rem; }
.athlete-team-list a small { color: var(--app-text-soft); font-size: .65rem; }
.athlete-team-list a b { color: var(--app-primary-strong); font-size: .66rem; }

.athlete-guardian-grid,
.athlete-guardian-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; padding: .72rem; }
.athlete-guardian-grid article { display: grid; min-height: 94px; align-content: start; padding: .7rem; border: 1px solid var(--app-border); border-left: 3px solid var(--sports-teal); border-radius: var(--app-radius-xs); background: var(--app-surface-muted); }
.athlete-guardian-grid article > span { color: var(--app-text-muted); font-size: .62rem; font-weight: 800; text-transform: uppercase; }
.athlete-guardian-grid article strong { margin: .24rem 0 .35rem; color: var(--app-text); font-size: .76rem; }
.athlete-guardian-grid article small { color: var(--app-text-soft); font-size: .65rem; }

.athlete-note-list { display: grid; gap: .55rem; padding: .72rem; }
.athlete-note-list article { padding: .65rem .7rem; border-left: 3px solid var(--sports-amber); background: var(--app-surface-muted); }
.athlete-note-list article strong { color: var(--app-text); font-size: .7rem; }
.athlete-note-list article p { margin: .22rem 0 0; color: var(--app-text-soft); font-size: .7rem; line-height: 1.5; white-space: pre-wrap; }
.athlete-section-empty { padding: 1rem .78rem; color: var(--app-text-muted); font-size: .7rem; }

.athlete-action-list { display: grid; padding: .42rem .62rem .6rem; }
.athlete-action-list a { display: grid; grid-template-columns: 24px minmax(0, 1fr); min-height: 42px; align-items: center; gap: .48rem; border-bottom: 1px solid var(--app-border); color: var(--app-text); font-size: .7rem; font-weight: 730; text-decoration: none; }
.athlete-action-list a:last-child { border-bottom: 0; }
.athlete-action-list a:hover { color: var(--app-primary-strong); }
.athlete-action-list svg { width: 15px; height: 15px; color: var(--app-secondary); }

.athlete-consent-list > div { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: .7rem; border-bottom: 1px solid var(--app-border); }
.athlete-consent-list > div:last-child { border-bottom: 0; }
.athlete-consent-list > div > span { display: grid; min-width: 0; }
.athlete-consent-list strong { overflow: hidden; font-size: .69rem; text-overflow: ellipsis; white-space: nowrap; }
.athlete-consent-list small { color: var(--app-text-muted); font-size: .61rem; }
.athlete-consent-list b { padding: .17rem .3rem; border-radius: var(--app-radius-xs); font-size: .58rem; white-space: nowrap; }
.athlete-consent-list b.accepted { background: color-mix(in srgb, var(--app-success) 12%, transparent); color: var(--app-success); }
.athlete-consent-list b.pending { background: color-mix(in srgb, var(--app-warning) 12%, transparent); color: var(--app-warning); }
.athlete-consent-list b.declined { background: var(--app-surface-strong); color: var(--app-text-muted); }

.athlete-audit-panel { padding: .72rem .78rem; }
.athlete-audit-panel dl { display: grid; grid-template-columns: auto 1fr; gap: .35rem .8rem; margin: .55rem 0 0; font-size: .65rem; }
.athlete-audit-panel dt { color: var(--app-text-muted); font-weight: 680; }
.athlete-audit-panel dd { margin: 0; color: var(--app-text); text-align: right; }

.athlete-danger-panel { display: flex; align-items: center; justify-content: space-between; gap: .7rem; padding: .72rem .78rem; border-left: 3px solid var(--sports-coral); }
.athlete-danger-panel > div { display: grid; }
.athlete-danger-panel strong { color: var(--app-text); font-size: .72rem; }
.athlete-danger-panel small { color: var(--app-text-muted); font-size: .62rem; }

/* Athlete editor */

.athlete-editor-mode {
    display: inline-flex;
    min-height: 27px;
    align-items: center;
    padding: .25rem .55rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-xs);
    background: var(--app-surface);
    color: var(--app-primary-strong);
    font-size: .67rem;
    font-weight: 800;
}

.athlete-editor-mode.is-active { color: var(--app-success); }
.athlete-editor-mode.is-passive { color: var(--app-text-muted); }

.athlete-editor-form {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    align-items: start;
    gap: .8rem;
    margin-top: .8rem;
}

.athlete-form-map {
    position: sticky;
    top: calc(var(--app-header-height) + .8rem);
    display: grid;
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    background: var(--app-surface);
    box-shadow: var(--app-shadow-small);
}

.athlete-form-map-title { padding: .7rem .75rem; border-bottom: 1px solid var(--app-border); background: var(--app-surface-muted); color: var(--app-text); font-size: .72rem; font-weight: 820; }
.athlete-form-map > a { display: grid; grid-template-columns: 25px minmax(0, 1fr); min-height: 43px; align-items: center; gap: .42rem; padding: 0 .72rem; border-bottom: 1px solid var(--app-border); color: var(--app-text-soft); font-size: .69rem; font-weight: 720; text-decoration: none; }
.athlete-form-map > a:hover { background: var(--app-surface-muted); color: var(--app-primary-strong); }
.athlete-form-map > a span { color: var(--app-secondary); font-size: .61rem; font-weight: 850; }
.athlete-form-map-note { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: .45rem; padding: .7rem; color: var(--app-text-muted); font-size: .62rem; line-height: 1.4; }
.athlete-form-map-note svg { width: 16px; height: 16px; color: var(--app-secondary); }

.athlete-editor-main { display: grid; gap: .8rem; min-width: 0; }
.athlete-validation-summary:empty { display: none; }
.athlete-validation-summary { padding: .7rem; border: 1px solid color-mix(in srgb, var(--app-danger) 40%, var(--app-border)); border-left: 3px solid var(--app-danger); background: color-mix(in srgb, var(--app-danger) 6%, var(--app-surface)); }
.athlete-editor-section { scroll-margin-top: calc(var(--app-header-height) + .8rem); overflow: hidden; }

.athlete-editor-section-head { display: flex; min-height: 58px; align-items: center; gap: .68rem; padding: .7rem .8rem; border-bottom: 1px solid var(--app-border); background: var(--app-surface-muted); }
.athlete-editor-section-head > span { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--app-border-strong); border-radius: var(--app-radius-xs); color: var(--app-secondary); font-size: .62rem; font-weight: 850; }
.athlete-editor-section-head small { display: block; color: var(--app-text-muted); font-size: .61rem; font-weight: 800; text-transform: uppercase; }
.athlete-editor-section-head h2 { margin: .1rem 0 0; color: var(--app-text); font-size: .86rem; font-weight: 830; }

.athlete-photo-editor { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: .85rem; align-items: center; margin: .8rem; padding: .72rem; border: 1px solid var(--app-border); border-left: 3px solid var(--club-primary); border-radius: var(--app-radius-xs); background: var(--app-surface-muted); }
.athlete-photo-preview { display: grid; width: 76px; height: 76px; place-items: center; overflow: hidden; border: 1px solid var(--app-border-strong); border-radius: var(--app-radius-sm); background: var(--club-primary-faint); color: var(--club-primary); }
.athlete-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.athlete-photo-preview svg { width: 24px; height: 24px; }
.athlete-photo-controls { min-width: 0; }
.athlete-photo-controls > label { margin-bottom: .3rem; color: var(--app-text); font-size: .69rem; font-weight: 750; }
.athlete-photo-actions { display: flex; align-items: center; gap: .6rem; margin-top: .42rem; }
.athlete-photo-actions small { color: var(--app-text-muted); font-size: .61rem; }

.athlete-field-grid { display: grid; gap: .65rem; padding: 0 .8rem .8rem; }
.athlete-field-grid + .athlete-field-grid { padding-top: 0; }
.athlete-field-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.athlete-field-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.athlete-field.span-2 { grid-column: span 2; }
.athlete-field.span-3 { grid-column: span 3; }

.athlete-field { display: grid; align-content: start; min-width: 0; }
.athlete-field > label,
.athlete-field > span:first-child { margin-bottom: .28rem; color: var(--app-text-soft); font-size: .67rem; font-weight: 730; }
.athlete-field > small { margin-top: .28rem; color: var(--app-text-muted); font-size: .6rem; }
.athlete-field > span[data-valmsg-for] { margin-top: .2rem; color: var(--app-danger); font-size: .61rem; }
.athlete-field :is(.form-control, .form-select) { min-height: 38px; font-size: .73rem; }
.athlete-field textarea.form-control { min-height: auto; }

.athlete-guardian-editor-grid fieldset { min-width: 0; padding: .72rem; border: 1px solid var(--app-border); border-top: 3px solid var(--sports-teal); border-radius: var(--app-radius-xs); background: var(--app-surface-muted); }
.athlete-guardian-editor-grid legend { float: none; width: auto; margin: 0 0 .65rem; padding: 0; color: var(--app-text); font-size: .72rem; font-weight: 820; }
.athlete-guardian-editor-grid .athlete-field-grid { padding: 0; }

.athlete-sensitive-note { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: .55rem; margin: .75rem .8rem; padding: .65rem .7rem; border-left: 3px solid var(--sports-amber); background: color-mix(in srgb, var(--sports-amber) 7%, var(--app-surface)); color: var(--app-text-soft); font-size: .65rem; line-height: 1.45; }
.athlete-sensitive-note svg { color: var(--sports-amber); }

.athlete-status-field { padding: .55rem .65rem; border: 1px solid var(--app-border); border-radius: var(--app-radius-xs); background: var(--app-surface-muted); }
.athlete-toggle { display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; }
.athlete-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.athlete-toggle > span { position: relative; width: 34px; height: 18px; border: 1px solid var(--app-border-strong); border-radius: 9px; background: var(--app-surface-strong); transition: background .15s ease; }
.athlete-toggle > span::after { position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--app-text-muted); content: ""; transition: transform .15s ease, background .15s ease; }
.athlete-toggle input:checked + span { border-color: var(--app-success); background: color-mix(in srgb, var(--app-success) 22%, transparent); }
.athlete-toggle input:checked + span::after { background: var(--app-success); transform: translateX(16px); }
.athlete-toggle b { color: var(--app-text); font-size: .67rem; }

.athlete-editor-actions { position: sticky; bottom: .6rem; z-index: 4; display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: .8rem; padding: .65rem .78rem; border: 1px solid var(--app-border-strong); border-left: 3px solid var(--club-primary); border-radius: var(--app-radius-md); background: color-mix(in srgb, var(--app-surface) 94%, transparent); box-shadow: var(--app-shadow); backdrop-filter: blur(10px); }
.athlete-editor-actions > span { color: var(--app-text-soft); font-size: .67rem; font-weight: 720; }
.athlete-editor-actions > div { display: flex; gap: .45rem; }

@media (max-width: 1100px) {
    .ops-primary-grid,
    .athlete-profile-layout { grid-template-columns: minmax(0, 1fr); }

    .ops-control-rail { order: -1; }
    .ops-alert-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ops-intel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ops-intel-panel:last-child:nth-child(odd) { grid-column: 1 / -1; }

    .roster-list-head,
    .roster-entry { grid-template-columns: minmax(220px, 1.2fr) minmax(145px, .8fr) minmax(170px, auto); }
    .roster-list.has-club :is(.roster-list-head, .roster-entry) { grid-template-columns: minmax(210px, 1.2fr) minmax(140px, .7fr) minmax(120px, .6fr) minmax(170px, auto); }
}

@media (max-width: 900px) {
    .roster-list-head { display: none; }
    .roster-entry,
    .roster-list.has-club .roster-entry {
        grid-template-columns: minmax(0, 1.4fr) minmax(135px, .7fr);
        grid-template-areas: "athlete placement" "athlete actions";
        gap: .5rem .8rem;
        padding: .72rem;
    }
    .roster-athlete { grid-area: athlete; }
    .roster-placement { grid-area: placement; }
    .roster-club { grid-area: placement; margin-top: 2.3rem; }
    .roster-actions { grid-area: actions; padding-top: .45rem; border-top: 1px solid var(--app-border); }
    .roster-mobile-label { display: block; }

    .athlete-editor-form { grid-template-columns: minmax(0, 1fr); }
    .athlete-form-map { position: static; grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .group-form-map { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .athlete-form-map-title,
    .athlete-form-map-note { display: none; }
    .athlete-form-map > a { grid-template-columns: 22px minmax(0, 1fr); border-bottom: 0; border-right: 1px solid var(--app-border); }
    .athlete-form-map > a:last-of-type { border-right: 0; }
}

@media (max-width: 767.98px) {
    .ops-command-header,
    .roster-command-header,
    .athlete-editor-header { align-items: flex-start; }

    .ops-scoreboard,
    .roster-scoreboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ops-score:nth-child(2n),
    .roster-score:nth-child(2n) { border-right: 0; }
    .ops-score:nth-child(-n + 2),
    .roster-score:nth-child(-n + 2) { border-bottom: 1px solid var(--app-border); }
    .roster-scoreboard > :last-child:nth-child(odd) { grid-column: 1 / -1; border-right: 0; }

    .ops-intel-grid { grid-template-columns: minmax(0, 1fr); }
    .ops-intel-panel:last-child:nth-child(odd) { grid-column: auto; }

    .athlete-identity-band { grid-template-columns: 72px minmax(0, 1fr); min-height: 112px; padding: .8rem; }
    .athlete-avatar-xl { width: 66px; height: 66px; }
    .athlete-header-actions { grid-column: 1 / -1; }
    .athlete-title-row h1 { font-size: 1.25rem; }
    .athlete-context-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .athlete-context-strip > div:nth-child(3) { border-right: 0; }
    .athlete-context-strip > div:nth-child(-n + 3) { border-bottom: 1px solid var(--app-border); }
    .athlete-context-strip > div:nth-child(4) { grid-column: span 1; }
    .athlete-context-strip > div:nth-child(5) { grid-column: span 2; border-right: 0; }

    .athlete-data-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .athlete-data-grid > div:nth-child(3n) { border-right: 1px solid var(--app-border); }
    .athlete-data-grid > div:nth-child(2n) { border-right: 0; }
    .athlete-data-grid > div:nth-last-child(-n + 3) { border-bottom: 1px solid var(--app-border); }
    .athlete-data-grid > div:nth-last-child(-n + 2) { border-bottom: 0; }

    .athlete-field-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .athlete-field.span-3 { grid-column: span 2; }
}

@media (max-width: 575.98px) {
    :is(.ops-command-header, .roster-command-header, .athlete-editor-header) {
        flex-direction: column;
    }
    :is(.ops-command-header, .roster-command-header, .athlete-editor-header) h1 { font-size: 1.28rem; }
    .ops-command-actions,
    .roster-primary-action { width: 100%; }
    .ops-command-actions { justify-content: space-between; }
    .roster-primary-action { justify-content: center; }

    .ops-score,
    .roster-score { min-height: 76px; padding: .65rem .7rem; }
    .ops-score-icon { display: none; }
    .ops-score strong,
    .roster-score strong { font-size: 1.12rem; }

    .ops-alert-stack { grid-template-columns: minmax(0, 1fr); }
    .ops-session { grid-template-columns: 50px 12px minmax(0, 1fr); }
    .ops-session-action { display: none; }
    .ops-timeline { padding-inline: .45rem; }

    .roster-toolbar { align-items: stretch; flex-direction: column; }
    .roster-search { width: 100%; grid-template-columns: 28px minmax(0, 1fr) auto; }
    .roster-search-clear { display: none; }
    .roster-result-state { align-self: flex-end; }

    .roster-entry,
    .roster-list.has-club .roster-entry {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "athlete athlete" "placement placement" "actions actions";
    }
    .roster-club { grid-area: placement; margin-top: 2.5rem; }
    .roster-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .roster-actions .btn { min-width: 0; width: 100%; }
    .roster-pagination { justify-content: center; overflow-x: auto; }

    .athlete-identity-band { grid-template-columns: 58px minmax(0, 1fr); gap: .7rem; }
    .athlete-avatar-xl { width: 54px; height: 54px; }
    .athlete-title-row { align-items: flex-start; flex-direction: column; gap: .3rem; }
    .athlete-contact-line { display: grid; gap: .15rem; }
    .athlete-contact-line span + span::before { display: none; }
    .athlete-context-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .athlete-context-strip > div { border-bottom: 1px solid var(--app-border); }
    .athlete-context-strip > div:nth-child(2n) { border-right: 0; }
    .athlete-context-strip > div:nth-child(3) { border-right: 1px solid var(--app-border); }
    .athlete-context-strip > div:nth-child(4) { grid-column: auto; }
    .athlete-context-strip > div:nth-child(5) { grid-column: 1 / -1; border-bottom: 0; }

    .athlete-data-grid { grid-template-columns: minmax(0, 1fr); }
    .athlete-data-grid > div { border-right: 0 !important; border-bottom: 1px solid var(--app-border) !important; }
    .athlete-data-grid > div:last-child { border-bottom: 0 !important; }
    .athlete-guardian-grid,
    .athlete-guardian-editor-grid { grid-template-columns: minmax(0, 1fr); }
    .athlete-danger-panel { align-items: stretch; flex-direction: column; }

    .athlete-form-map { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .athlete-form-map > a:nth-child(2),
    .athlete-form-map > a:nth-child(3) { border-bottom: 1px solid var(--app-border); }
    .athlete-form-map > a:nth-child(3) { border-right: 0; }
    .athlete-photo-editor { grid-template-columns: 64px minmax(0, 1fr); margin: .65rem; }
    .athlete-photo-preview { width: 58px; height: 58px; }
    .athlete-photo-actions { align-items: flex-start; flex-direction: column; }
    .athlete-field-grid.cols-2,
    .athlete-field-grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
    .athlete-field.span-2,
    .athlete-field.span-3 { grid-column: auto; }
    .athlete-editor-actions { bottom: calc(var(--app-bottom-nav-height) + .35rem); align-items: stretch; flex-direction: column; }
    .athlete-editor-actions > div { display: grid; grid-template-columns: 1fr 1.25fr; }
}

/* Coach and group management */

.staff-roster-list,
.group-roster-list {
    min-width: 0;
}

.staff-roster-head,
.staff-roster-entry,
.group-roster-head,
.group-roster-entry {
    display: grid;
    align-items: center;
    gap: .75rem;
    padding-inline: .78rem;
}

.staff-roster-head {
    grid-template-columns: minmax(220px, 1.2fr) minmax(180px, .9fr) 70px minmax(190px, auto);
    min-height: 38px;
    border-bottom: 1px solid var(--app-border);
    background: var(--app-surface-muted);
    color: var(--app-text-muted);
    font-size: .62rem;
    font-weight: 800;
    text-transform: uppercase;
}

.staff-roster-list.has-club .staff-roster-head,
.staff-roster-list.has-club .staff-roster-entry {
    grid-template-columns: minmax(210px, 1.15fr) minmax(170px, .85fr) 64px minmax(120px, .65fr) minmax(190px, auto);
}

.staff-roster-entry {
    grid-template-columns: minmax(220px, 1.2fr) minmax(180px, .9fr) 70px minmax(190px, auto);
    min-height: 82px;
    border-bottom: 1px solid var(--app-border);
}

.staff-roster-entry:last-child,
.group-roster-entry:last-child { border-bottom: 0; }
.staff-roster-entry:hover,
.group-roster-entry:hover { background: var(--app-surface-muted); }
.staff-roster-entry.is-inactive,
.group-roster-entry.is-inactive,
.group-athlete-entry.is-inactive { opacity: .7; }

.staff-avatar { border-radius: var(--app-radius-xs); background: color-mix(in srgb, var(--sports-teal) 12%, var(--app-surface)); color: var(--sports-teal); }
.staff-roster-scope,
.staff-roster-count,
.staff-roster-club { display: grid; min-width: 0; }
.staff-roster-scope strong,
.staff-roster-club strong { overflow: hidden; color: var(--app-text); font-size: .71rem; text-overflow: ellipsis; white-space: nowrap; }
.staff-roster-scope small,
.staff-roster-count small { color: var(--app-text-muted); font-size: .61rem; }
.staff-roster-count strong { color: var(--app-text); font-size: 1rem; font-weight: 850; }

.group-toolbar {
    display: flex;
    min-height: 62px;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    padding: .65rem .78rem;
    border-bottom: 1px solid var(--app-border);
}

.group-search-form { display: flex; min-width: 0; align-items: center; gap: .5rem; }
.group-search-box { width: min(430px, 46vw); }
.group-branch-filter { width: 180px; min-height: 36px; }

.group-roster-head {
    grid-template-columns: minmax(190px, 1fr) minmax(130px, .65fr) 72px 72px minmax(170px, auto);
    min-height: 38px;
    border-bottom: 1px solid var(--app-border);
    background: var(--app-surface-muted);
    color: var(--app-text-muted);
    font-size: .62rem;
    font-weight: 800;
    text-transform: uppercase;
}

.group-roster-list.has-club .group-roster-head,
.group-roster-list.has-club .group-roster-entry {
    grid-template-columns: minmax(180px, 1fr) minmax(120px, .6fr) 64px 64px minmax(115px, .6fr) minmax(170px, auto);
}

.group-roster-entry {
    grid-template-columns: minmax(190px, 1fr) minmax(130px, .65fr) 72px 72px minmax(170px, auto);
    min-height: 78px;
    border-bottom: 1px solid var(--app-border);
}

.group-roster-identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: .65rem;
    color: var(--app-text);
    text-decoration: none;
}
.group-roster-identity:hover strong { color: var(--app-primary-strong); }
.group-roster-mark,
.coach-group-mark,
.group-member-avatar {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--app-border-strong);
    border-radius: var(--app-radius-xs);
    background: var(--club-primary-faint);
    color: var(--club-primary);
    font-size: .69rem;
    font-weight: 850;
}
.group-roster-identity > span:last-child { display: grid; min-width: 0; }
.group-roster-identity strong { overflow: hidden; font-size: .75rem; font-weight: 820; text-overflow: ellipsis; white-space: nowrap; }
.group-roster-identity small { color: var(--app-text-muted); font-size: .61rem; }
.group-roster-branch,
.group-roster-club { min-width: 0; }
.group-roster-branch strong,
.group-roster-club strong { display: block; overflow: hidden; color: var(--app-text); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.group-roster-metric { display: grid; }
.group-roster-metric strong { color: var(--app-text); font-size: .92rem; font-weight: 850; }
.group-roster-metric small { color: var(--app-text-muted); font-size: .58rem; }
.group-roster-actions { display: flex; justify-content: flex-end; gap: .42rem; }

.coach-avatar-xl { border-radius: var(--app-radius-sm); background: color-mix(in srgb, var(--sports-teal) 12%, var(--app-surface)); color: var(--sports-teal); }
.coach-discipline-list { display: flex; flex-wrap: wrap; gap: .45rem; padding: .72rem; }
.coach-discipline-list > span { display: inline-flex; min-height: 30px; align-items: center; gap: .42rem; padding: .32rem .55rem; border: 1px solid var(--app-border); border-radius: var(--app-radius-xs); background: var(--app-surface-muted); color: var(--app-text); font-size: .68rem; font-weight: 750; }
.coach-discipline-list i { width: 7px; height: 7px; border-radius: 50%; background: var(--discipline-color, var(--sports-teal)); }
.coach-group-list,
.group-member-list { display: grid; padding: .4rem .72rem .6rem; }
.coach-group-list article { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; min-height: 62px; align-items: center; gap: .65rem; border-bottom: 1px solid var(--app-border); }
.group-member-list article { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; min-height: 62px; align-items: center; gap: .65rem; border-bottom: 1px solid var(--app-border); }
.coach-group-list article:last-child,
.group-member-list article:last-child { border-bottom: 0; }
.coach-group-list article > span:nth-child(2),
.group-member-copy { display: grid; min-width: 0; }
.coach-group-list strong,
.group-member-copy strong { overflow: hidden; color: var(--app-text); font-size: .73rem; text-overflow: ellipsis; white-space: nowrap; }
.coach-group-list small,
.group-member-copy small { color: var(--app-text-muted); font-size: .62rem; }

.coach-selection-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; padding: .78rem; }
.coach-selection-panel { min-width: 0; padding: .7rem; border: 1px solid var(--app-border); border-top: 3px solid var(--sports-teal); border-radius: var(--app-radius-xs); background: var(--app-surface-muted); }
.coach-selection-panel legend { float: none; width: auto; margin: 0 0 .6rem; color: var(--app-text); font-size: .72rem; font-weight: 820; }
.coach-option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .42rem; }
.coach-option { display: grid; grid-template-columns: 18px minmax(0, 1fr); min-height: 48px; align-items: center; gap: .42rem; padding: .42rem .5rem; border: 1px solid var(--app-border); border-radius: var(--app-radius-xs); background: var(--app-surface); cursor: pointer; }
.coach-option:hover { border-color: var(--app-border-strong); }
.coach-option input { margin: 0; accent-color: var(--club-primary); }
.coach-option > span { display: grid; min-width: 0; }
.coach-option b { overflow: hidden; color: var(--app-text); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.coach-option small { color: var(--app-text-muted); font-size: .58rem; }

.group-profile-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .72fr); align-items: start; gap: .8rem; margin-top: .8rem; }
.group-identity-band { border-top-color: var(--sports-cobalt); }
.group-avatar-xl { border-radius: var(--app-radius-xs); }
.group-assign-form { display: grid; gap: .5rem; padding: .72rem; }
.group-assign-form label { color: var(--app-text-soft); font-size: .66rem; font-weight: 730; }
.group-assign-form small { color: var(--app-text-muted); font-size: .59rem; line-height: 1.4; }
.group-member-actions,
.group-management-actions,
.group-athlete-actions { display: flex; align-items: center; gap: .4rem; }
.group-member-actions form,
.group-athlete-actions form { margin: 0; }
.group-management-panel { align-items: flex-start; flex-direction: column; }
.group-management-actions { width: 100%; }
.group-management-actions .btn { flex: 1; }
.group-athlete-section { margin-top: .8rem; }
.group-athlete-roster { display: grid; }
.group-athlete-entry { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: .75rem; padding: .55rem .72rem; border-bottom: 1px solid var(--app-border); }
.group-athlete-entry:last-child { border-bottom: 0; }
.group-athlete-entry:hover { background: var(--app-surface-muted); }
.group-athlete-identity { display: flex; min-width: 0; align-items: center; gap: .65rem; color: var(--app-text); text-decoration: none; }
.group-athlete-identity > span:last-child { display: grid; min-width: 0; }
.group-athlete-identity strong { overflow: hidden; font-size: .73rem; text-overflow: ellipsis; white-space: nowrap; }
.group-athlete-identity small { color: var(--app-text-muted); font-size: .61rem; }
.group-member-avatar img { width: 100%; height: 100%; object-fit: cover; }
.group-capacity-note { display: flex; align-items: center; gap: .55rem; margin: .75rem .8rem; padding: .62rem .7rem; border-left: 3px solid var(--sports-cobalt); background: var(--app-surface-muted); }
.group-capacity-note strong { color: var(--app-primary-strong); font-size: .67rem; }
.group-capacity-note span { color: var(--app-text-soft); font-size: .64rem; }

@media (max-width: 1100px) {
    .staff-roster-head,
    .staff-roster-entry { grid-template-columns: minmax(210px, 1.1fr) minmax(160px, .8fr) 58px minmax(170px, auto); }
    .staff-roster-list.has-club .staff-roster-head,
    .staff-roster-list.has-club .staff-roster-entry { grid-template-columns: minmax(190px, 1fr) minmax(145px, .75fr) 54px minmax(105px, .55fr) minmax(165px, auto); }
    .group-roster-head,
    .group-roster-entry { grid-template-columns: minmax(170px, 1fr) minmax(110px, .6fr) 58px 58px minmax(160px, auto); }
    .group-roster-list.has-club .group-roster-head,
    .group-roster-list.has-club .group-roster-entry { grid-template-columns: minmax(160px, 1fr) minmax(100px, .55fr) 52px 52px minmax(100px, .55fr) minmax(155px, auto); }
    .group-profile-layout { grid-template-columns: minmax(0, 1fr); }
    .group-profile-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .group-profile-rail > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
    .staff-roster-head,
    .group-roster-head { display: none; }
    .staff-roster-entry,
    .staff-roster-list.has-club .staff-roster-entry {
        grid-template-columns: minmax(0, 1.25fr) minmax(150px, .7fr) 60px;
        grid-template-areas: "identity scope count" "identity actions actions";
        gap: .5rem .75rem;
        padding-block: .7rem;
    }
    .staff-roster-entry .roster-athlete { grid-area: identity; }
    .staff-roster-scope { grid-area: scope; }
    .staff-roster-count { grid-area: count; }
    .staff-roster-entry .roster-actions { grid-area: actions; padding-top: .42rem; border-top: 1px solid var(--app-border); }
    .staff-roster-club { grid-area: scope; margin-top: 2.35rem; }

    .group-roster-entry,
    .group-roster-list.has-club .group-roster-entry {
        grid-template-columns: minmax(0, 1.25fr) minmax(125px, .7fr) 56px 56px;
        grid-template-areas: "identity branch students coaches" "identity actions actions actions";
        gap: .5rem .7rem;
        padding-block: .7rem;
    }
    .group-roster-identity { grid-area: identity; }
    .group-roster-branch { grid-area: branch; }
    .group-roster-entry .group-roster-metric:nth-of-type(2) { grid-area: students; }
    .group-roster-entry .group-roster-metric:nth-of-type(3) { grid-area: coaches; }
    .group-roster-actions { grid-area: actions; padding-top: .42rem; border-top: 1px solid var(--app-border); }
    .group-roster-club { grid-area: branch; margin-top: 2.3rem; }
}

@media (max-width: 767.98px) {
    .group-toolbar { align-items: stretch; flex-direction: column; }
    .group-search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
    .group-search-box { width: 100%; }
    .group-branch-filter { grid-column: 1 / -1; width: 100%; }
    .group-toolbar .roster-result-state { align-self: flex-end; }
    .coach-selection-layout,
    .group-profile-rail { grid-template-columns: minmax(0, 1fr); }
    .group-profile-rail > :last-child:nth-child(odd) { grid-column: auto; }
    .coach-group-list article { grid-template-columns: 40px minmax(0, 1fr) auto; padding-block: .5rem; }
    .coach-group-list article > .btn { grid-column: 2 / -1; justify-self: start; }
    .group-athlete-entry { align-items: stretch; flex-direction: column; }
    .group-athlete-actions { width: 100%; flex-wrap: wrap; }
}

@media (max-width: 575.98px) {
    .staff-roster-entry,
    .staff-roster-list.has-club .staff-roster-entry {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "identity identity" "scope count" "actions actions";
    }
    .staff-roster-club { grid-area: scope; margin-top: 2.45rem; }
    .staff-roster-entry .roster-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }

    .group-roster-entry,
    .group-roster-list.has-club .group-roster-entry {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "identity identity" "branch branch" "students coaches" "actions actions";
    }
    .group-roster-club { grid-area: branch; margin-top: 2.35rem; }
    .group-roster-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .group-roster-actions .btn { width: 100%; }
    .coach-option-grid { grid-template-columns: minmax(0, 1fr); }
    .coach-group-list article { grid-template-columns: 36px minmax(0, 1fr); }
    .coach-group-list article > .athlete-state { justify-self: start; }
    .coach-group-list article > .btn { grid-column: 1 / -1; width: 100%; }
    .group-member-list article { grid-template-columns: 36px minmax(0, 1fr); padding-block: .55rem; }
    .group-member-actions { grid-column: 1 / -1; }
    .group-athlete-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .group-athlete-actions .btn,
    .group-athlete-actions form,
    .group-athlete-actions form .btn { width: 100%; }
    .group-capacity-note { align-items: flex-start; flex-direction: column; }
}

/* Training operations and attendance */

.training-board-page,
.training-detail-page,
.training-form-page,
.attendance-ops-page,
.attendance-take-page,
.attendance-history-page,
.attendance-summary-page { min-width: 0; }

.training-command-header,
.attendance-command-header {
    position: relative;
    min-height: 92px;
    align-items: center;
    padding: .7rem 0 .85rem 1rem;
    border-bottom: 1px solid var(--app-border);
}

.training-command-header::before,
.attendance-command-header::before {
    position: absolute;
    inset: .72rem auto .82rem 0;
    width: 3px;
    background: var(--sports-cobalt);
    content: "";
}

.attendance-command-header::before { background: var(--sports-teal); }
.training-command-header h2,
.attendance-command-header h2 { color: var(--app-text); font-weight: 880; letter-spacing: 0; }

.training-kpi-strip,
.attendance-kpi-strip {
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    background: var(--app-surface);
    box-shadow: var(--app-shadow-small);
}

.training-kpi-strip .session-overview-card,
.attendance-kpi-strip .attendance-overview-card {
    position: relative;
    min-height: 78px;
    padding: .72rem .82rem;
    border: 0;
    border-right: 1px solid var(--app-border);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.training-kpi-strip > :last-child,
.attendance-kpi-strip > :last-child { border-right: 0; }
.training-kpi-strip > :nth-child(1)::before,
.attendance-kpi-strip > :nth-child(1)::before,
.training-kpi-strip > :nth-child(2)::before,
.attendance-kpi-strip > :nth-child(2)::before,
.training-kpi-strip > :nth-child(3)::before,
.attendance-kpi-strip > :nth-child(3)::before,
.training-kpi-strip > :nth-child(4)::before,
.attendance-kpi-strip > :nth-child(4)::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    content: "";
}
.training-kpi-strip > :nth-child(1)::before { background: var(--sports-cobalt); }
.training-kpi-strip > :nth-child(2)::before { background: var(--sports-teal); }
.training-kpi-strip > :nth-child(3)::before { background: var(--sports-lime); }
.training-kpi-strip > :nth-child(4)::before { background: var(--sports-amber); }
.attendance-kpi-strip > :nth-child(1)::before { background: var(--sports-teal); }
.attendance-kpi-strip > :nth-child(2)::before { background: var(--app-success); }
.attendance-kpi-strip > :nth-child(3)::before { background: var(--sports-amber); }
.attendance-kpi-strip > :nth-child(4)::before { background: var(--sports-cobalt); }

.training-kpi-strip :is(.session-overview-label, .attendance-overview-label),
.attendance-kpi-strip :is(.session-overview-label, .attendance-overview-label) {
    color: var(--app-text-muted);
    font-size: .62rem;
    font-weight: 800;
    text-transform: uppercase;
}

.training-kpi-strip :is(.session-overview-value, .attendance-overview-value),
.attendance-kpi-strip :is(.session-overview-value, .attendance-overview-value) {
    margin-top: .25rem;
    color: var(--app-text);
    font-size: 1.08rem;
    font-weight: 880;
}

.training-filter-bar,
.attendance-date-navigator {
    border-top: 3px solid var(--sports-teal);
    border-radius: var(--app-radius-md);
    box-shadow: var(--app-shadow-small);
}

.training-filter-bar .form-label,
.training-form-workspace .form-label,
.attendance-take-page .form-label,
.attendance-history-page .form-label,
.attendance-summary-page .form-label {
    color: var(--app-text-soft);
    font-size: .64rem;
    font-weight: 780;
}

.training-day-stack { display: grid; gap: .82rem; }
.training-day-board,
.attendance-day-board {
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    background: var(--app-surface);
    box-shadow: var(--app-shadow-small);
}

.training-day-board .session-day-header,
.attendance-day-board .session-day-header {
    min-height: 64px;
    padding: .58rem .75rem;
    border-bottom: 1px solid var(--app-border);
    background: var(--app-surface-muted);
}

.training-day-board .session-day-number,
.attendance-day-board .session-day-number {
    border: 1px solid color-mix(in srgb, var(--sports-cobalt) 28%, var(--app-border));
    border-radius: var(--app-radius-xs);
    background: var(--app-primary-faint);
    color: var(--sports-cobalt);
}

.attendance-day-board .session-day-number {
    border-color: color-mix(in srgb, var(--sports-teal) 32%, var(--app-border));
    background: var(--app-secondary-soft);
    color: var(--sports-teal);
}

.training-session-row,
.attendance-session-row { padding-inline: .72rem; }
.training-session-row .session-timeline-track span,
.attendance-session-row .session-timeline-track span { border-color: var(--app-surface); }
.training-session-row.is-scheduled .session-timeline-track span { background: var(--sports-cobalt); }
.training-session-row.is-completed .session-timeline-track span,
.attendance-session-row.is-completed .session-timeline-track span { background: var(--app-success); }
.training-session-row.is-cancelled .session-timeline-track span,
.attendance-session-row.is-cancelled .session-timeline-track span { background: var(--app-danger); }
.attendance-session-row.is-scheduled .session-timeline-track span { background: var(--sports-amber); }

.training-session-card,
.attendance-session-entry {
    min-height: 82px;
    border: 1px solid var(--app-border);
    border-left: 3px solid var(--sports-cobalt);
    border-radius: var(--app-radius-sm);
    background: var(--app-surface);
    box-shadow: none;
}
.training-session-row.is-completed .training-session-card,
.attendance-session-row.is-completed .attendance-session-entry { border-left-color: var(--app-success); }
.training-session-row.is-cancelled .training-session-card,
.attendance-session-row.is-cancelled .attendance-session-entry { border-left-color: var(--app-danger); }
.attendance-session-row.is-scheduled .attendance-session-entry { border-left-color: var(--sports-amber); }
.training-session-card:hover,
.attendance-session-entry:hover { border-color: var(--app-border-strong); background: var(--app-surface-muted); transform: none; }
.training-session-card .session-timeline-head h4,
.attendance-session-entry .session-timeline-head h4 { font-size: .79rem; font-weight: 850; }
.training-session-card .session-timeline-actions,
.attendance-session-entry .session-timeline-actions { border-left: 1px solid var(--app-border); }

.training-briefing-hero,
.attendance-roster-hero {
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-left: 4px solid var(--sports-cobalt);
    border-radius: var(--app-radius-md);
    background: var(--app-surface);
    box-shadow: var(--app-shadow-small);
}
.attendance-roster-hero { border-left-color: var(--sports-teal); }
.training-briefing-hero .session-date-block,
.attendance-roster-hero .attendance-date-block {
    border: 0;
    border-radius: var(--app-radius-xs);
    background: var(--sports-cobalt);
    color: #fff;
    box-shadow: inset 0 -5px 0 var(--sports-teal);
}
.attendance-roster-hero .attendance-date-block { background: var(--sports-teal); box-shadow: inset 0 -5px 0 var(--sports-cobalt); }
.training-briefing-hero :is(.session-date-block span, .session-date-block small),
.attendance-roster-hero :is(.attendance-date-block span, .attendance-date-block small) { color: #fff; }

.training-briefing-layout { grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); gap: .82rem; }
.training-info-panel,
.training-rail-panel,
.training-form-workspace,
.attendance-roster-toolbar,
.attendance-roster-sheet,
.attendance-summary-group {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    background: var(--app-surface);
    box-shadow: var(--app-shadow-small);
}
.training-panel-head { padding-bottom: .68rem; border-bottom: 1px solid var(--app-border); }
.training-info-panel .session-info-grid > div { padding: .62rem; border: 1px solid var(--app-border); border-radius: var(--app-radius-xs); background: var(--app-surface-muted); }
.training-info-panel .session-note-card { border-radius: var(--app-radius-xs); box-shadow: none; }
.training-rail-panel h3 { padding-bottom: .55rem; border-bottom: 1px solid var(--app-border); }

.training-form-workspace { overflow: hidden; padding: 0; }
.training-form-grid { margin: 0; padding: .2rem .85rem .9rem; }
.training-form-workspace .session-form-section-title {
    margin-inline: -.85rem;
    padding: .62rem .85rem;
    border-top: 1px solid var(--app-border);
    border-bottom: 1px solid var(--app-border);
    background: var(--app-surface-muted);
    color: var(--app-text);
    font-size: .68rem;
    font-weight: 850;
    text-transform: uppercase;
}
.training-form-workspace .session-form-section-title:first-of-type { border-top: 0; }
.training-form-workspace .session-toggle-card,
.training-form-workspace .session-day-option { border-radius: var(--app-radius-xs); background: var(--app-surface-muted); box-shadow: none; }

.attendance-date-navigator .attendance-date-actions { align-items: center; }
.attendance-roster-toolbar { border-top: 3px solid var(--sports-teal); }
.attendance-roster-toolbar > div:first-child { align-items: center !important; }
.attendance-roster-toolbar hr { border-color: var(--app-border); opacity: 1; }
.attendance-roster-toolbar .attendance-count-grid { gap: 0; overflow: hidden; border: 1px solid var(--app-border); border-radius: var(--app-radius-sm); }
.attendance-roster-toolbar .attendance-count-grid > div { min-height: 66px; border: 0; border-right: 1px solid var(--app-border); border-radius: 0; background: var(--app-surface-muted); }
.attendance-roster-toolbar .attendance-count-grid > div:last-child { border-right: 0; }
.attendance-roster-toolbar .attendance-count-grid > div div:last-child { color: var(--app-text); font-size: .9rem; font-weight: 850; }
.attendance-roster-sheet { overflow: hidden; padding: 0; }
.attendance-roster-sheet > div:first-child { min-height: 66px; align-items: center !important; padding: .72rem .82rem; border-bottom: 1px solid var(--app-border); }
.attendance-roster-sheet .table-responsive { margin-top: 0 !important; }
.attendance-roster-sheet .table thead th { padding: .62rem .72rem; background: var(--app-surface-muted); color: var(--app-text-muted); font-size: .61rem; text-transform: uppercase; }
.attendance-athlete-row { border-color: var(--app-border); }
.attendance-athlete-row:hover { background: var(--app-surface-muted); }
.attendance-athlete-row td { padding: .72rem; }
.attendance-athlete-row td:first-child strong { color: var(--app-text); font-size: .72rem; }
.attendance-athlete-row .form-check { margin-right: .3rem; padding: .35rem .42rem .35rem 1.7rem; border: 1px solid var(--app-border); border-radius: var(--app-radius-xs); background: var(--app-surface); }
.attendance-athlete-row .form-check:has(input:checked) { border-color: color-mix(in srgb, var(--sports-cobalt) 45%, var(--app-border)); background: var(--app-primary-faint); }
.attendance-athlete-row .form-check-label { color: var(--app-text-soft); font-size: .63rem; font-weight: 720; }
.attendance-athlete-row :is(.form-control, textarea),
.attendance-athlete-card :is(.form-control, textarea) { color: var(--app-text); background: var(--app-surface-muted); }
.attendance-athlete-card { padding: .72rem; border-radius: var(--app-radius-sm); box-shadow: none; }
.attendance-athlete-card.border-warning { border-left: 3px solid var(--sports-amber) !important; }
.attendance-athlete-card .status-btn { min-height: 38px; font-size: .66rem; }
.attendance-take-page #btnSaveDesktop { min-width: 150px; }

.attendance-history-page .attendance-filter-shell,
.attendance-summary-page .attendance-filter-shell { border-top: 3px solid var(--sports-teal); }
.attendance-history-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.attendance-history-grid .attendance-record-card { border-radius: var(--app-radius-sm); box-shadow: var(--app-shadow-small); }
.attendance-summary-group { overflow: hidden; }
.attendance-summary-group .surface-heading { margin: -.75rem -.75rem .6rem !important; padding: .7rem .78rem; border-bottom: 1px solid var(--app-border); background: var(--app-surface-muted); }

@media (max-width: 991.98px) {
    .training-briefing-layout { grid-template-columns: minmax(0, 1fr); }
    .training-detail-page .session-detail-layout > aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .training-detail-page .session-detail-layout > aside > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}

@media (max-width: 767.98px) {
    .training-command-header,
    .attendance-command-header { align-items: stretch; padding-left: .72rem; }
    .training-kpi-strip,
    .attendance-kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .training-kpi-strip > :nth-child(2),
    .attendance-kpi-strip > :nth-child(2) { border-right: 0; }
    .training-kpi-strip > :nth-child(-n + 2),
    .attendance-kpi-strip > :nth-child(-n + 2) { border-bottom: 1px solid var(--app-border); }
    .training-session-card .session-timeline-actions,
    .attendance-session-entry .session-timeline-actions { border-top: 1px solid var(--app-border); border-left: 0; }
    .training-detail-page .session-detail-layout > aside { grid-template-columns: minmax(0, 1fr); }
    .training-detail-page .session-detail-layout > aside > :last-child:nth-child(odd) { grid-column: auto; }
    .attendance-roster-toolbar .attendance-count-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .attendance-roster-toolbar .attendance-count-grid > div:nth-child(3n) { border-right: 0; }
    .attendance-roster-toolbar .attendance-count-grid > div:nth-child(-n + 3) { border-bottom: 1px solid var(--app-border); }
    .attendance-history-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 575.98px) {
    .training-command-header::before,
    .attendance-command-header::before { inset-block: .55rem; }
    .training-day-board .session-day-header,
    .attendance-day-board .session-day-header { padding-inline: .6rem; }
    .training-session-row,
    .attendance-session-row { padding-inline: .5rem; }
    .training-session-card,
    .attendance-session-entry { border-left-width: 3px; }
    .training-form-grid { padding-inline: .65rem; }
    .training-form-workspace .session-form-section-title { margin-inline: -.65rem; padding-inline: .65rem; }
    .attendance-roster-toolbar > div:first-child > div:last-child { width: 100%; display: grid !important; grid-template-columns: minmax(0, 1fr); }
    .attendance-roster-toolbar > div:first-child .btn { width: 100%; }
    .attendance-roster-toolbar .attendance-count-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .attendance-roster-toolbar .attendance-count-grid > div { border-bottom: 1px solid var(--app-border); }
    .attendance-roster-toolbar .attendance-count-grid > div:nth-child(2n) { border-right: 0; }
    .attendance-roster-toolbar .attendance-count-grid > div:nth-last-child(-n + 2) { border-bottom: 0; }
}

/* Finance operations */
.finance-operations-page { max-width: 1280px; }

body.app-shell .app-main .finance-command-header {
    align-items: flex-end;
    flex-direction: row;
    gap: 1rem;
    padding-left: .85rem;
}

.finance-command-header::before {
    position: absolute;
    inset: .3rem auto .85rem 0;
    width: 3px;
    background: var(--sports-teal);
    content: "";
}

body.app-shell .app-main .finance-command-header::after { display: none; }
.finance-command-header > div:first-child { max-width: 720px; }

body.app-shell .app-main .finance-command-header .finance-page-actions {
    width: auto;
    margin-left: auto;
    justify-content: flex-end;
}

.finance-kpi-strip { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.finance-kpi-strip .finance-overview-card { min-height: 74px; padding: .72rem .82rem .68rem 1rem; }
.finance-kpi-strip .finance-overview-value { font-size: 1.18rem !important; }
.finance-kpi-strip .finance-overview-value.success { color: var(--app-success) !important; }
.finance-kpi-strip .finance-overview-value.warning { color: var(--app-warning) !important; }
.finance-kpi-strip .finance-overview-value.danger { color: var(--app-danger) !important; }
.finance-kpi-strip .small,
.finance-kpi-strip .finance-overview-hint { margin-top: .18rem; font-size: .68rem; }

.finance-filter-bar {
    padding: .78rem .85rem;
    border-top: 3px solid var(--sports-cobalt);
    border-radius: var(--app-radius-sm);
    box-shadow: var(--app-shadow-small);
}

.finance-filter-bar .finance-status-tabs {
    gap: .35rem;
    margin-bottom: .72rem !important;
    padding-bottom: .65rem;
    border-bottom: 1px solid var(--app-border);
}

.finance-filter-bar .finance-tab,
.finance-date-preset {
    min-height: 30px;
    border-radius: var(--app-radius-xs);
    background: var(--app-surface);
    padding: .25rem .58rem;
    font-size: .72rem;
}

.finance-filter-bar :is(.form-control-sm, .form-select-sm) { min-height: 34px; }
.finance-filter-bar .finance-filter-form { gap: .55rem; }

.finance-record-list {
    grid-template-columns: minmax(0, 1fr);
    gap: .55rem;
}

.finance-record-row {
    min-height: 0;
    border-radius: var(--app-radius-sm);
    box-shadow: var(--app-shadow-small);
    transform: none !important;
}

.finance-record-row:hover {
    border-color: var(--app-border-strong);
    box-shadow: inset 3px 0 0 var(--sports-cobalt), var(--app-shadow-small) !important;
}

.finance-record-row:has(.finance-status.overdue) { border-left: 3px solid var(--app-danger); }
.finance-record-row:has(.finance-status.pending) { border-left: 3px solid var(--app-warning); }
.finance-record-row:has(.finance-status.paid) { border-left: 3px solid var(--app-success); }

body.app-shell .app-main .finance-record-row :is(.finance-card-rail, .finance-installment-rail) {
    width: 64px;
    border-right: 1px solid var(--app-border);
    color: var(--app-text) !important;
    background: var(--app-surface-muted) !important;
}

body.app-shell .app-main .finance-record-row :is(.finance-card-rail, .finance-installment-rail) small { color: var(--app-text-muted); }

.finance-record-row .finance-card-body {
    display: grid;
    grid-template-columns: minmax(200px, 1.1fr) minmax(130px, .7fr) minmax(300px, 1.35fr) minmax(116px, .5fr);
    grid-template-rows: auto auto;
    align-items: center;
    gap: .55rem .75rem;
    padding: .72rem .8rem;
}

.finance-record-row .finance-card-head { grid-column: 1; grid-row: 1; }
.finance-record-row .finance-card-head > .finance-status { align-self: center; }
.finance-record-row .finance-card-meta { grid-column: 2; grid-row: 1; margin-top: 0; }
.finance-record-row .finance-stat-stack {
    grid-column: 3;
    grid-row: 1;
    grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
    gap: .35rem;
    margin-top: 0;
    padding-top: 0;
}

.finance-record-row .finance-stat-row {
    display: grid;
    align-content: center;
    gap: .12rem;
    min-height: 48px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-xs);
    background: var(--app-surface-muted);
    padding: .38rem .48rem;
}

.finance-record-row .finance-stat-row span { font-size: .65rem; }
.finance-record-row .finance-stat-row strong { font-size: .78rem; text-align: left; }
.finance-record-row .finance-progress { grid-column: 1 / 4; grid-row: 2; height: 5px; margin-top: 0 !important; }
.finance-record-row .finance-card-actions {
    grid-column: 4;
    grid-row: 1 / 3;
    align-self: center;
    grid-template-columns: minmax(0, 1fr);
    margin-top: 0;
}

.finance-record-row .finance-installment-body {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) minmax(340px, 1.5fr) minmax(118px, .5fr);
    align-items: center;
    gap: .75rem;
    padding: .72rem .8rem;
}

.finance-record-row .finance-installment-body .finance-stat-stack {
    grid-column: 2;
    grid-row: auto;
    grid-template-columns: repeat(4, minmax(74px, 1fr));
    margin-top: 0;
    padding-top: 0;
}

.finance-record-row .finance-installment-body .finance-card-actions {
    grid-column: 3;
    grid-row: auto;
    margin-top: 0;
}

.finance-plan-hero {
    border-radius: var(--app-radius-sm);
    border-left: 4px solid var(--sports-teal);
    background: var(--app-surface);
    box-shadow: var(--app-shadow-small);
}

.payment-detail-page .finance-hero {
    border-radius: var(--app-radius-sm);
    border-left: 4px solid var(--sports-cobalt);
    background: var(--app-surface);
    box-shadow: var(--app-shadow-small);
}

.finance-plan-hero .finance-date-mark {
    border-radius: var(--app-radius-xs);
    background: var(--sports-cobalt);
}

.finance-balance-panel { border-left: 3px solid var(--sports-lime); }
.finance-balance-panel .finance-progress { height: 8px; border-radius: var(--app-radius-xs); }
.finance-operations-page .finance-progress { background: var(--app-surface-strong); }

.cash-flow-page .finance-command-header > div:first-child { max-width: 430px; }

.finance-ledger-console {
    border-radius: var(--app-radius-sm);
    box-shadow: var(--app-shadow-small);
}

.finance-ledger-console .finance-ledger-head {
    min-height: 52px;
    padding: .72rem .85rem;
    background: var(--app-surface-muted);
}

.finance-ledger-console .finance-ledger-row {
    min-height: 64px;
    padding: .62rem .85rem;
    transition: background-color .16s ease;
}

.finance-ledger-console .finance-ledger-row:hover { background: var(--app-surface-muted); }
.finance-ledger-console .finance-ledger-date { padding-right: .65rem; border-right: 1px solid var(--app-border); }
.finance-ledger-console .finance-ledger-amount { font-size: .88rem; }

.finance-form-workspace {
    overflow: hidden;
    padding: .9rem;
    border-top: 3px solid var(--sports-teal);
    border-radius: var(--app-radius-sm);
    box-shadow: var(--app-shadow-small);
}

.finance-form-workspace .finance-form-section-title {
    margin-inline: -.9rem;
    padding: .7rem .9rem;
    background: var(--app-surface-muted);
}

.finance-form-workspace .finance-plan-preview { border-radius: var(--app-radius-xs); background: var(--app-surface-muted); }
.finance-module-launcher { border-top: 3px solid var(--sports-teal); border-radius: var(--app-radius-sm); }

@media (max-width: 1199.98px) {
    .finance-record-row .finance-card-body {
        grid-template-columns: minmax(190px, 1fr) minmax(280px, 1.2fr) minmax(116px, .5fr);
    }

    .finance-record-row .finance-card-meta { grid-column: 1; grid-row: 2; }
    .finance-record-row .finance-stat-stack { grid-column: 2; grid-row: 1 / 3; }
    .finance-record-row .finance-progress { grid-column: 1 / 3; grid-row: 3; }
    .finance-record-row .finance-card-actions { grid-column: 3; grid-row: 1 / 4; }
}

@media (max-width: 991.98px) {
    .finance-record-row .finance-card-body,
    .finance-record-row .finance-installment-body {
        display: flex;
        align-items: stretch;
        flex-direction: column;
        gap: .6rem;
    }

    .finance-record-row .finance-card-meta { margin-top: 0; }
    .finance-record-row .finance-card-actions {
        align-self: stretch;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .finance-record-row .finance-card-actions.single { grid-template-columns: minmax(0, 1fr); }
    .finance-record-row .finance-installment-body .finance-stat-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Secondary management operations */
.secondary-ops-page {
    width: 100%;
    max-width: 1280px !important;
    margin-inline: auto;
}

body.app-shell .app-main .secondary-ops-header {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--app-border);
    margin-bottom: .85rem !important;
    padding: .15rem 0 .75rem .85rem;
    background: transparent;
}

body.app-shell .app-main .secondary-ops-header::before {
    position: absolute;
    inset-block: .15rem .75rem;
    left: 0;
    width: 3px;
    background: var(--sports-teal);
    content: "";
}

.secondary-ops-header h2 { letter-spacing: 0; }

.secondary-page-actions,
.secondary-ops-header :is(.settings-actions, .interaction-page-actions, .record-page-actions) {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: .45rem;
    margin-left: auto;
}

.secondary-kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
    gap: 0 !important;
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-top: 3px solid var(--sports-cobalt);
    border-radius: var(--app-radius-sm);
    background: var(--app-surface);
    box-shadow: var(--app-shadow-small);
}

.secondary-kpi-grid > :is(
    .branch-overview-card,
    .record-overview-card,
    .interaction-overview-card,
    .secondary-kpi-card
) {
    min-height: 82px;
    border: 0 !important;
    border-right: 1px solid var(--app-border) !important;
    border-radius: 0 !important;
    background: var(--app-surface) !important;
    box-shadow: none !important;
    padding: .75rem .85rem;
}

.secondary-kpi-grid > :last-child { border-right: 0 !important; }

.secondary-kpi-card {
    display: grid;
    align-content: center;
    gap: .12rem;
}

.secondary-kpi-card > span,
.secondary-kpi-grid :is(.branch-overview-label, .record-overview-label, .interaction-overview-label) {
    color: var(--app-text-muted);
    font-size: .67rem;
    font-weight: 750;
    text-transform: uppercase;
}

.secondary-kpi-card > strong,
.secondary-kpi-grid :is(.branch-overview-value, .record-overview-value, .interaction-overview-value) {
    color: var(--app-text);
    font-size: 1.22rem;
    font-weight: 850;
    line-height: 1.12;
}

.secondary-kpi-card > small { color: var(--app-text-muted); font-size: .7rem; }

.secondary-record-list {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: .5rem !important;
}

.secondary-record-row {
    border: 1px solid var(--app-border) !important;
    border-radius: var(--app-radius-sm) !important;
    background: var(--app-surface) !important;
    box-shadow: var(--app-shadow-small) !important;
    transform: none !important;
}

.secondary-record-row:hover {
    border-color: var(--app-border-strong) !important;
    box-shadow: inset 3px 0 0 var(--sports-cobalt), var(--app-shadow-small) !important;
    transform: none !important;
}

.secondary-record-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-xs);
    color: var(--sports-cobalt);
    background: var(--app-surface-muted);
}

.secondary-record-icon svg,
.settings-launcher-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.secondary-record-main { min-width: 0; }
.secondary-record-subline { color: var(--app-text-muted); font-size: .76rem; }

.secondary-record-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .35rem;
}

.secondary-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    color: var(--app-text-soft);
    background: var(--app-surface-muted);
    padding: .15rem .55rem;
    font-size: .69rem;
    font-weight: 750;
    white-space: nowrap;
}

.secondary-pill.accent { color: var(--sports-cobalt); border-color: color-mix(in srgb, var(--sports-cobalt) 32%, var(--app-border)); }
.secondary-pill.success { color: var(--app-success); border-color: color-mix(in srgb, var(--app-success) 34%, var(--app-border)); }
.secondary-pill.warning { color: var(--app-warning); border-color: color-mix(in srgb, var(--app-warning) 38%, var(--app-border)); }
.secondary-pill.muted { color: var(--app-text-muted); }

.secondary-record-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: .4rem;
}

.secondary-record-actions.single { grid-template-columns: minmax(0, 1fr); }
.secondary-record-actions > form { display: contents; }
.secondary-record-actions .btn { display: inline-flex; align-items: center; justify-content: center; margin: 0; }

.secondary-filter-shell {
    border-top: 3px solid var(--sports-teal) !important;
    border-radius: var(--app-radius-sm) !important;
    padding: .72rem .8rem !important;
}

.secondary-empty-state {
    padding: 1.5rem 1rem;
    text-align: center;
}

.secondary-form-workspace,
.secondary-panel,
.settings-launcher-panel {
    border: 1px solid var(--app-border) !important;
    border-top: 3px solid var(--sports-teal) !important;
    border-radius: var(--app-radius-sm) !important;
    background: var(--app-surface) !important;
    box-shadow: var(--app-shadow-small) !important;
    padding: .9rem !important;
}

.secondary-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    border-bottom: 1px solid var(--app-border);
    margin-bottom: .85rem;
    padding-bottom: .72rem;
}

.secondary-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.secondary-span-full { grid-column: 1 / -1; }

.secondary-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: .45rem;
    border-top: 1px solid var(--app-border);
    margin-top: .85rem;
    padding-top: .75rem;
}

.secondary-info-list { display: grid; }
.secondary-info-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    border-top: 1px solid var(--app-border);
    padding: .68rem 0;
    font-size: .8rem;
}
.secondary-info-list > div:first-child { border-top: 0; padding-top: 0; }
.secondary-info-list span { color: var(--app-text-muted); }
.secondary-info-list strong { color: var(--app-text); text-align: right; }

.secondary-detail-hero {
    border-top: 3px solid var(--sports-cobalt) !important;
    border-radius: var(--app-radius-sm) !important;
    background: var(--app-surface) !important;
    box-shadow: var(--app-shadow-small) !important;
}

/* Branch operations */
.secondary-record-list.branch-card-grid { grid-template-columns: minmax(0, 1fr) !important; }

.secondary-record-row.branch-card {
    position: relative;
    display: flex;
    min-height: 0;
    overflow: hidden;
}

body.app-shell .app-main .secondary-record-row.branch-card .branch-card-accent {
    width: 3px;
    flex-basis: 3px;
    background: var(--sports-teal) !important;
}

.secondary-record-row.branch-card .branch-card-body {
    display: grid;
    grid-template-columns: minmax(190px, .85fr) minmax(320px, 1.2fr) minmax(154px, .55fr);
    align-items: center;
    gap: .65rem .8rem;
    padding: .7rem .8rem;
}

.secondary-record-row.branch-card .branch-mark {
    width: 40px;
    height: 40px;
    border-radius: var(--app-radius-xs);
    background: var(--club-primary);
}

.secondary-record-row.branch-card .branch-stat-stack {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .4rem;
    margin: 0;
    padding: 0;
}

.secondary-record-row.branch-card .branch-stat-row {
    min-height: 44px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-xs);
    background: var(--app-surface-muted);
    padding: .42rem .55rem;
}

.secondary-record-row.branch-card .branch-stat-row > * {
    white-space: nowrap;
}

.secondary-record-row.branch-card .branch-card-actions {
    align-self: center;
    gap: .4rem;
    margin: 0;
}

/* Discipline and document definition operations */
.discipline-record-row,
.definition-record-row {
    display: grid !important;
    align-items: center;
    gap: .7rem;
    padding: .72rem .8rem !important;
}

.discipline-record-row { grid-template-columns: minmax(0, 1fr) minmax(150px, auto); }
.definition-record-row { grid-template-columns: minmax(220px, 1fr) minmax(240px, 1fr) minmax(150px, auto); }

.discipline-record-row .settings-metric-card-head,
.definition-record-row .settings-metric-card-head {
    align-items: center;
    border: 0;
    margin: 0;
    padding: 0;
}

.discipline-record-row .settings-metric-card-actions,
.definition-record-row .settings-metric-card-actions {
    align-self: center;
    border: 0;
    margin: 0;
    padding: 0;
}

.definition-record-row .settings-metric-card-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .4rem;
}

.definition-record-row .settings-list-row {
    display: grid;
    gap: .12rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-xs);
    background: var(--app-surface-muted);
    padding: .38rem .5rem;
}

body.app-shell .app-main .settings-metric-grid.secondary-record-list {
    gap: .5rem !important;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

body.app-shell .app-main .settings-metric-card.secondary-record-row {
    min-height: 0;
    margin: 0 !important;
    border: 1px solid var(--app-border) !important;
    border-radius: var(--app-radius-sm) !important;
    background: var(--app-surface) !important;
    box-shadow: var(--app-shadow-small) !important;
}

body.app-shell .app-main .settings-metric-card.secondary-record-row::before {
    background: var(--sports-teal);
}

/* Nutrition operations */
.nutrition-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }

.nutrition-record-row {
    display: grid;
    grid-template-columns: 42px minmax(220px, 1.2fr) minmax(210px, .8fr) minmax(150px, auto);
    align-items: center;
    gap: .7rem;
    padding: .72rem .8rem;
}

.nutrition-manage-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, .65fr);
    align-items: start;
    gap: .8rem;
}

/* Document operations */
.document-operations-page .document-card-grid { grid-template-columns: minmax(0, 1fr) !important; }

.document-operations-page .document-owner-card.secondary-record-row {
    display: grid;
    grid-template-columns: minmax(230px, 1.15fr) minmax(300px, 1fr) minmax(160px, .45fr);
    align-items: center;
    gap: .7rem;
    padding: .72rem .8rem;
}

.document-operations-page .document-owner-head { align-items: center; }
.document-operations-page .document-owner-card .record-stat-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    padding: 0;
}
.document-operations-page .document-card-actions { margin: 0; padding: 0; }

/* Task operations */
.task-operations-page .interaction-card-grid { grid-template-columns: minmax(0, 1fr) !important; }

.task-operations-page .interaction-card.secondary-record-row {
    display: flex;
    min-height: 0;
}

body.app-shell .app-main .task-operations-page .interaction-card-rail {
    width: 64px;
    border-right: 1px solid var(--app-border);
    color: var(--app-text) !important;
    background: var(--app-surface-muted) !important;
    background-image: none !important;
}

.task-operations-page .interaction-card-rail small { color: var(--app-text-muted); }

.task-operations-page .interaction-card-body {
    display: grid;
    grid-template-columns: minmax(210px, 1.1fr) minmax(170px, .75fr) minmax(260px, 1fr) minmax(130px, .45fr);
    align-items: center;
    gap: .65rem .75rem;
    padding: .7rem .8rem;
}

.task-operations-page .interaction-card-head { align-items: center; }
.task-operations-page .interaction-card-meta,
.task-operations-page .interaction-stat-stack,
.task-operations-page .interaction-card-actions { margin: 0; padding: 0; }
.task-operations-page .interaction-stat-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.task-operations-page .interaction-stat-row strong { white-space: nowrap; }

/* Settings operations */
.settings-account-band {
    display: grid;
    grid-template-columns: minmax(230px, 1fr) minmax(220px, auto) minmax(230px, auto);
    align-items: center;
    gap: .8rem;
    border: 1px solid var(--app-border);
    border-top: 3px solid var(--sports-cobalt);
    border-radius: var(--app-radius-sm);
    background: var(--app-surface);
    box-shadow: var(--app-shadow-small);
    padding: .75rem .85rem;
}

.settings-account-band .settings-avatar {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    border-radius: var(--app-radius-xs);
    background: var(--club-primary);
    font-size: 1rem;
}

.settings-account-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; }

.settings-launcher-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
}

.settings-launcher-item {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: .7rem;
    min-height: 66px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-xs);
    color: var(--app-text);
    background: var(--app-surface-muted);
    padding: .65rem .7rem;
    text-decoration: none;
}

.settings-launcher-item:hover {
    border-color: var(--app-border-strong);
    color: var(--app-text);
    background: var(--app-surface);
    box-shadow: inset 3px 0 0 var(--sports-teal);
}

.settings-launcher-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-xs);
    color: var(--sports-cobalt);
    background: var(--app-surface);
}

.settings-launcher-item strong,
.settings-launcher-item small { display: block; letter-spacing: 0; }
.settings-launcher-item strong { font-size: .82rem; }
.settings-launcher-item small { margin-top: .12rem; color: var(--app-text-muted); font-size: .7rem; }
.settings-launcher-arrow { color: var(--app-text-muted); font-size: 1rem; }

html[data-app-theme="dark"] body.app-shell .secondary-pill.accent { color: #7dd3fc; }
html[data-app-theme="dark"] body.app-shell .secondary-pill.success { color: #86efac; }
html[data-app-theme="dark"] body.app-shell .secondary-pill.warning { color: #fcd34d; }

@media (max-width: 1199.98px) {
    .task-operations-page .interaction-card-body {
        grid-template-columns: minmax(190px, 1fr) minmax(240px, 1fr) minmax(125px, .4fr);
    }
    .task-operations-page .interaction-card-meta { display: none; }
}

@media (max-width: 991.98px) {
    .secondary-record-row.branch-card .branch-card-body,
    .document-operations-page .document-owner-card.secondary-record-row,
    .task-operations-page .interaction-card-body {
        display: flex;
        align-items: stretch;
        flex-direction: column;
        gap: .6rem;
    }

    .discipline-record-row,
    .definition-record-row,
    .nutrition-record-row,
    .settings-account-band,
    .nutrition-manage-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .nutrition-record-row { grid-template-columns: 42px minmax(0, 1fr); }
    .nutrition-record-row .secondary-record-meta,
    .nutrition-record-row .secondary-record-actions { grid-column: 1 / -1; }
    .settings-account-band .secondary-record-actions { justify-self: stretch; }
}

@media (max-width: 767.98px) {
    body.app-shell .app-main .secondary-ops-header {
        align-items: stretch;
        flex-direction: column;
        padding-left: .75rem;
    }

    .secondary-page-actions,
    .secondary-ops-header :is(.settings-actions, .interaction-page-actions, .record-page-actions) {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        margin-left: 0;
    }

    .secondary-page-actions .btn,
    .secondary-ops-header :is(.settings-actions, .interaction-page-actions, .record-page-actions) .btn,
    .secondary-record-actions .btn { width: 100%; }

    .secondary-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .secondary-kpi-grid > :nth-child(2n) { border-right: 0 !important; }
    .secondary-kpi-grid > :nth-child(-n + 2) { border-bottom: 1px solid var(--app-border) !important; }
    .secondary-form-grid,
    .settings-launcher-grid,
    .definition-record-row .settings-metric-card-body { grid-template-columns: minmax(0, 1fr); }
    .secondary-span-full { grid-column: auto; }
    .secondary-record-actions { grid-template-columns: minmax(0, 1fr); }
    .secondary-record-row.branch-card .branch-stat-stack { grid-auto-flow: row; }
    .settings-account-meta { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 575.98px) {
    .secondary-page-actions,
    .secondary-ops-header :is(.settings-actions, .interaction-page-actions, .record-page-actions) {
        grid-template-columns: minmax(0, 1fr);
    }
    .nutrition-record-row { display: flex; align-items: stretch; flex-direction: column; }
    .nutrition-record-row .secondary-record-icon { width: 38px; height: 38px; }
    .task-operations-page .interaction-card-rail { width: 52px; }
    .secondary-record-row.branch-card .branch-card-actions {
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .secondary-record-row.branch-card .branch-card-actions .btn { width: 100%; }
}

@media (max-width: 767.98px) {
    body.app-shell .app-main .finance-command-header {
        align-items: stretch;
        flex-direction: column;
        padding-left: .72rem;
    }

    body.app-shell .app-main .finance-command-header .finance-page-actions {
        width: 100%;
        margin-left: 0;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.app-shell .app-main .finance-command-header .finance-page-actions .btn { width: 100%; }
    .finance-kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .finance-record-row .finance-card-actions { grid-template-columns: minmax(0, 1fr); }
    .finance-record-row .finance-card-actions .btn { width: 100%; }
}

body.app-shell .app-main :is(.finance-plan-hero, .payment-detail-page .finance-hero) .finance-date-mark {
    color: #fff;
    background: var(--club-primary) !important;
}

@media (max-width: 575.98px) {
    .finance-command-header::before { inset-block: .55rem; }
    body.app-shell .app-main .finance-command-header .finance-page-actions { grid-template-columns: minmax(0, 1fr); }
    .finance-filter-bar { padding-inline: .65rem; }
    .finance-record-row { flex-direction: row; }
    body.app-shell .app-main .finance-record-row :is(.finance-card-rail, .finance-installment-rail) {
        width: 54px;
        min-height: 0;
        flex-direction: column;
    }
    .finance-record-row .finance-card-body,
    .finance-record-row .finance-installment-body { min-width: 0; padding: .65rem; }
    .finance-record-row .finance-stat-stack,
    .finance-record-row .finance-installment-body .finance-stat-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Communication center */
.communication-page {
    width: 100%;
    max-width: 1280px !important;
    margin-inline: auto;
}

body.app-shell .app-main .communication-page-header {
    position: relative;
    align-items: flex-end;
    min-height: 72px;
    border-bottom: 1px solid var(--app-border);
    margin-bottom: .85rem !important;
    padding: .2rem 0 .72rem .82rem;
}

body.app-shell .app-main .communication-page-header::before {
    position: absolute;
    inset-block: .2rem .72rem;
    left: 0;
    width: 3px;
    background: var(--sports-teal);
    content: "";
}

body.app-shell .app-main .communication-page-header::after {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 68px;
    height: 3px;
    background: var(--sports-cobalt);
    content: "";
}

body.app-shell .app-main .communication-summary-strip {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 0 !important;
    overflow: hidden;
    border: 1px solid var(--app-border) !important;
    border-radius: var(--app-radius-sm) !important;
    background: var(--app-surface) !important;
    box-shadow: var(--app-shadow-small) !important;
}

body.app-shell .app-main .communication-summary-strip > .interaction-overview-card {
    min-height: 78px;
    border: 0 !important;
    border-right: 1px solid var(--app-border) !important;
    border-radius: 0 !important;
    background: var(--app-surface) !important;
    box-shadow: none !important;
    padding: .72rem .82rem !important;
}

body.app-shell .app-main .communication-summary-strip > .interaction-overview-card:last-child {
    border-right: 0 !important;
}

body.app-shell .app-main .communication-summary-strip .interaction-overview-label {
    margin-bottom: .18rem;
    color: var(--app-text-muted);
    font-size: .66rem;
    font-weight: 800;
    text-transform: uppercase;
}

body.app-shell .app-main .communication-summary-strip .interaction-overview-value {
    font-size: 1.2rem;
    font-weight: 850;
}

.communication-filter-shell {
    border-top: 3px solid var(--sports-teal) !important;
    border-radius: var(--app-radius-sm) !important;
    box-shadow: var(--app-shadow-small) !important;
    padding: .72rem .8rem !important;
}

.communication-state {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    color: var(--app-text-muted);
    background: var(--app-surface-muted);
    padding: .12rem .5rem;
    font-size: .66rem;
    font-weight: 800;
    white-space: nowrap;
}

.communication-state.success { color: var(--app-success); border-color: color-mix(in srgb, var(--app-success) 38%, var(--app-border)); }
.communication-state.warning { color: var(--app-warning); border-color: color-mix(in srgb, var(--app-warning) 42%, var(--app-border)); }
.communication-state.muted { color: var(--app-text-muted); }
.communication-state.new { color: var(--sports-cobalt); border-color: color-mix(in srgb, var(--sports-cobalt) 35%, var(--app-border)); }

/* Announcement publishing */
body.app-shell .app-main .announcement-feed {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: .5rem !important;
}

body.app-shell .app-main .announcement-feed-item {
    display: grid !important;
    grid-template-columns: 72px minmax(0, 1fr);
    min-height: 0 !important;
    overflow: hidden;
    border: 1px solid var(--app-border) !important;
    border-radius: var(--app-radius-sm) !important;
    background: var(--app-surface) !important;
    box-shadow: var(--app-shadow-small) !important;
    transform: none !important;
}

body.app-shell .app-main .announcement-feed-item:hover {
    border-color: var(--app-border-strong) !important;
    box-shadow: inset 3px 0 0 var(--sports-cobalt), var(--app-shadow-small) !important;
    transform: none !important;
}

body.app-shell .app-main .announcement-feed-date {
    width: auto !important;
    min-height: 100%;
    color: var(--app-text) !important;
    border-right: 1px solid var(--app-border);
    background: var(--app-surface-muted) !important;
}

body.app-shell .app-main .announcement-feed-date span { color: var(--sports-cobalt); }
body.app-shell .app-main .announcement-feed-date small { color: var(--app-text-muted); }

.announcement-feed-body {
    display: grid !important;
    grid-template-columns: minmax(240px, 1.25fr) minmax(210px, .85fr) minmax(230px, .8fr);
    align-items: center;
    gap: .55rem .8rem;
    padding: .7rem .8rem !important;
}

.announcement-feed-body > .interaction-card-head { align-items: center; }
.announcement-feed-kicker {
    margin-bottom: .14rem;
    color: var(--sports-teal);
    font-size: .64rem;
    font-weight: 850;
    text-transform: uppercase;
}

.announcement-feed-scope {
    align-content: center;
    margin-top: 0 !important;
}

.announcement-feed-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .55rem;
}

.announcement-feed-window {
    display: grid;
    gap: .12rem;
    color: var(--app-text-muted);
    font-size: .7rem;
}

.announcement-detail-hero,
.communication-callout {
    border-top: 3px solid var(--sports-cobalt) !important;
    border-radius: var(--app-radius-sm) !important;
    background: var(--app-surface) !important;
    box-shadow: var(--app-shadow-small) !important;
}

body.app-shell .app-main .announcement-detail-date {
    color: var(--app-text) !important;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-xs) !important;
    background: var(--app-surface-muted) !important;
}

body.app-shell .app-main .announcement-detail-date span { color: var(--sports-cobalt); }
body.app-shell .app-main .announcement-detail-date small { color: var(--app-text-muted); }

.announcement-reading-layout { grid-template-columns: minmax(0, 1fr) minmax(260px, 320px) !important; }
.announcement-reading-surface,
.announcement-meta-panel,
.communication-form-shell {
    border-radius: var(--app-radius-sm) !important;
    box-shadow: var(--app-shadow-small) !important;
}

.announcement-reading-surface { border-top: 3px solid var(--sports-teal) !important; }
.announcement-meta-panel { border-top: 3px solid var(--sports-amber) !important; }
.announcement-reading-surface .interaction-content-box {
    min-height: 240px;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    font-size: .92rem;
    line-height: 1.72;
}

.communication-form-shell {
    border-top: 3px solid var(--sports-teal) !important;
    padding: .9rem !important;
}

.announcement-editor-form .interaction-form-section-title {
    color: var(--sports-teal);
    font-size: .7rem;
    text-transform: uppercase;
}

.announcement-editor-form .interaction-audience-option {
    border-radius: var(--app-radius-xs) !important;
    background: var(--app-surface-muted) !important;
}

/* Messaging workspace */
body.app-shell .app-main .communication-messaging-layout {
    grid-template-columns: minmax(290px, 340px) minmax(0, 1fr);
    gap: .65rem;
}

body.app-shell .app-main .communication-messaging-layout :is(.messaging-sidebar, .messaging-panel) {
    min-height: min(680px, calc(100vh - 198px));
    border-radius: var(--app-radius-sm) !important;
    background: var(--app-surface) !important;
    box-shadow: var(--app-shadow-small) !important;
}

body.app-shell .app-main .communication-messaging-layout .messaging-sidebar { border-top: 3px solid var(--sports-teal); }
body.app-shell .app-main .communication-messaging-layout .messaging-panel { border-top: 3px solid var(--sports-cobalt); }

.communication-messaging-layout .messaging-sidebar-head,
.communication-messaging-layout .messaging-panel-head {
    min-height: 66px;
    padding: .72rem .8rem;
}

.communication-messaging-layout .conversation-item {
    position: relative;
    padding: .72rem .8rem;
}

.communication-messaging-layout .conversation-item.active {
    border-color: var(--app-border);
    background: var(--app-surface-muted);
}

.communication-messaging-layout .conversation-item.active::before {
    position: absolute;
    inset-block: 0;
    left: 0;
    width: 3px;
    background: var(--sports-teal);
    content: "";
}

.communication-messaging-layout .interaction-avatar,
.communication-people-panel .interaction-avatar {
    border-radius: var(--app-radius-xs);
    color: var(--sports-cobalt);
    background: var(--app-surface-muted);
}

.communication-messaging-layout .message-scroll {
    max-height: none;
    background: color-mix(in srgb, var(--app-surface-muted) 55%, var(--app-surface));
    padding: .85rem;
}

body.app-shell .app-main .communication-messaging-layout .message-bubble {
    border-radius: var(--app-radius-sm) !important;
    box-shadow: none;
}

body.app-shell .app-main .communication-messaging-layout .message-bubble.mine {
    color: #fff;
    border-color: var(--sports-cobalt) !important;
    background: var(--sports-cobalt) !important;
}

body.app-shell .app-main .communication-messaging-layout .message-bubble.theirs {
    background: var(--app-surface) !important;
}

.communication-messaging-layout .message-compose { background: var(--app-surface); padding: .72rem .8rem; }
.communication-messaging-layout .message-compose-form { gap: .45rem; }
.messaging-mobile-back { display: none; }

.communication-people-panel {
    border-radius: var(--app-radius-sm) !important;
    border-top: 3px solid var(--sports-teal) !important;
    box-shadow: var(--app-shadow-small) !important;
}

.communication-people-panel .people-item { padding: .72rem .8rem; }
.communication-people-layout { gap: .65rem; }

/* Notification activity */
.notification-activity-panel {
    overflow: hidden;
    border-radius: var(--app-radius-sm) !important;
    border-top: 3px solid var(--sports-teal) !important;
    box-shadow: var(--app-shadow-small) !important;
}

.notification-activity-list { display: grid; }
.notification-day-group { display: grid; }
.notification-day-group + .notification-day-group { border-top: 1px solid var(--app-border); }
.notification-day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    color: var(--app-text);
    background: var(--app-surface-muted);
    padding: .48rem .8rem;
    font-size: .72rem;
    font-weight: 800;
}
.notification-day-head small { color: var(--app-text-muted); font-weight: 650; }

.notification-activity-item {
    position: relative;
    min-height: 72px;
    padding: .65rem .8rem !important;
}

.notification-activity-item.unread::before {
    position: absolute;
    inset-block: 0;
    left: 0;
    width: 3px;
    background: var(--sports-cobalt);
    content: "";
}

.notification-type-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-xs);
    color: var(--app-text-soft);
    background: var(--app-surface-muted);
    font-size: .6rem;
    font-weight: 900;
}

.notification-type-mark.message { color: var(--sports-cobalt); }
.notification-type-mark.money { color: var(--app-success); }
.notification-type-mark.attendance { color: var(--sports-amber); }
.notification-type-mark.training { color: var(--sports-teal); }
.notification-type-mark.support { color: var(--app-danger); }

/* Performance command center */
.performance-workspace {
    width: 100%;
    max-width: 1280px !important;
    margin-inline: auto;
}

body.app-shell .app-main .performance-page-header {
    position: relative;
    align-items: flex-end;
    min-height: 72px;
    border-bottom: 1px solid var(--app-border);
    margin-bottom: .85rem !important;
    padding: .2rem 0 .72rem .82rem;
}

body.app-shell .app-main .performance-page-header::before {
    position: absolute;
    inset-block: .2rem .72rem;
    left: 0;
    width: 3px;
    background: var(--sports-lime);
    content: "";
}

body.app-shell .app-main .performance-page-header::after {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 68px;
    height: 3px;
    background: var(--sports-teal);
    content: "";
}

body.app-shell .app-main .performance-summary-strip {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
    gap: 0 !important;
    overflow: hidden;
    border: 1px solid var(--app-border) !important;
    border-radius: var(--app-radius-sm) !important;
    background: var(--app-surface) !important;
    box-shadow: var(--app-shadow-small) !important;
}

body.app-shell .app-main .performance-summary-strip > .progress-overview-card {
    min-height: 78px;
    border: 0 !important;
    border-right: 1px solid var(--app-border) !important;
    border-radius: 0 !important;
    background: var(--app-surface) !important;
    box-shadow: none !important;
    padding: .72rem .82rem !important;
}

body.app-shell .app-main .performance-summary-strip > .progress-overview-card:last-child { border-right: 0 !important; }
body.app-shell .app-main .performance-summary-strip .progress-overview-label {
    margin-bottom: .18rem;
    color: var(--app-text-muted);
    font-size: .66rem;
    font-weight: 800;
    text-transform: uppercase;
}
body.app-shell .app-main .performance-summary-strip .progress-overview-value { font-size: 1.2rem; font-weight: 850; }

.performance-filter-bar {
    border-top: 3px solid var(--sports-teal) !important;
    border-radius: var(--app-radius-sm) !important;
    box-shadow: var(--app-shadow-small) !important;
    padding: .72rem .8rem !important;
}

body.app-shell .app-main .performance-athlete-list {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: .5rem !important;
}

body.app-shell .app-main .performance-athlete-row {
    display: grid;
    grid-template-columns: minmax(260px, 1.2fr) minmax(280px, 1fr) minmax(220px, auto);
    align-items: center;
    gap: .7rem .9rem;
    min-height: 0 !important;
    border: 1px solid var(--app-border) !important;
    border-radius: var(--app-radius-sm) !important;
    background: var(--app-surface) !important;
    box-shadow: var(--app-shadow-small) !important;
    padding: .72rem .8rem !important;
    transform: none !important;
}

body.app-shell .app-main .performance-athlete-row:hover {
    border-color: var(--app-border-strong) !important;
    box-shadow: inset 3px 0 0 var(--sports-lime), var(--app-shadow-small) !important;
    transform: none !important;
}

body.app-shell .app-main .performance-athlete-row .progress-avatar {
    width: 44px;
    height: 44px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-xs) !important;
    color: var(--sports-teal);
    background: var(--app-surface-muted) !important;
}

.performance-athlete-meta { align-content: center; margin-top: 0 !important; }
.performance-athlete-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-self: center;
    gap: .4rem;
    margin: 0 !important;
    padding: 0 !important;
}

.performance-athlete-actions .btn { display: inline-flex; align-items: center; justify-content: center; }

.performance-athlete-hero,
.performance-detail-hero {
    border-top: 3px solid var(--sports-lime) !important;
    border-radius: var(--app-radius-sm) !important;
    background: var(--app-surface) !important;
    box-shadow: var(--app-shadow-small) !important;
}

body.app-shell .app-main :is(.performance-athlete-hero .progress-hero-avatar, .performance-detail-hero .progress-record-date) {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-xs) !important;
    color: var(--sports-teal);
    background: var(--app-surface-muted) !important;
}

body.app-shell .app-main .performance-detail-hero .progress-record-date small { color: var(--app-text-muted); }

body.app-shell .app-main .performance-timeline {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: .5rem !important;
}

body.app-shell .app-main .performance-timeline-item {
    display: grid !important;
    grid-template-columns: 68px minmax(0, 1fr);
    min-height: 0 !important;
    overflow: hidden;
    border: 1px solid var(--app-border) !important;
    border-radius: var(--app-radius-sm) !important;
    background: var(--app-surface) !important;
    box-shadow: var(--app-shadow-small) !important;
    transform: none !important;
}

body.app-shell .app-main .performance-timeline-item:hover {
    border-color: var(--app-border-strong) !important;
    box-shadow: inset 3px 0 0 var(--sports-lime), var(--app-shadow-small) !important;
    transform: none !important;
}

body.app-shell .app-main .performance-timeline-date {
    width: auto !important;
    min-height: 100%;
    color: var(--app-text) !important;
    border-right: 1px solid var(--app-border);
    background: var(--app-surface-muted) !important;
}
body.app-shell .app-main .performance-timeline-date span { color: var(--sports-teal); }
body.app-shell .app-main .performance-timeline-date small { color: var(--app-text-muted); }
.performance-timeline-body { padding: .72rem .8rem !important; }
.performance-discipline-pill { color: var(--sports-teal) !important; border-color: color-mix(in srgb, var(--sports-teal) 35%, var(--app-border)) !important; }

.performance-record-notes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .45rem;
    margin-top: .65rem;
}

.performance-record-note {
    min-width: 0;
    border: 1px solid var(--app-border);
    border-left: 3px solid var(--sports-teal);
    border-radius: var(--app-radius-xs);
    background: var(--app-surface-muted);
    padding: .46rem .56rem;
}
.performance-record-note.goal { border-left-color: var(--sports-amber); }
.performance-record-note > span {
    color: var(--app-text-muted);
    font-size: .62rem;
    font-weight: 850;
    text-transform: uppercase;
}
.performance-record-note > p {
    display: -webkit-box;
    margin: .1rem 0 0;
    color: var(--app-text-soft);
    font-size: .75rem;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.performance-data-panel,
.performance-form-panel {
    border-radius: var(--app-radius-sm) !important;
    background: var(--app-surface) !important;
    box-shadow: var(--app-shadow-small) !important;
}
.performance-data-panel { border-top: 3px solid var(--sports-teal) !important; }
.performance-comparison-panel { border-top-color: var(--sports-cobalt) !important; }
.performance-history-panel { border-top-color: var(--sports-lime) !important; }
.performance-narrative-panel { border-top-color: var(--sports-amber) !important; }
.performance-form-panel { border-top: 3px solid var(--sports-lime) !important; padding: .9rem !important; }

body.app-shell .app-main .performance-form-panel .progress-metric-field {
    height: 100%;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-xs);
    background: var(--app-surface-muted);
    padding: .65rem;
}

.performance-form-panel .progress-form-section-title {
    color: var(--sports-teal);
    font-size: .7rem;
    text-transform: uppercase;
}

@media (max-width: 991.98px) {
    .announcement-feed-body,
    body.app-shell .app-main .performance-athlete-row {
        grid-template-columns: minmax(0, 1fr) minmax(220px, .8fr);
    }

    .announcement-feed-footer,
    .performance-athlete-actions { grid-column: 1 / -1; }
    .announcement-feed-footer { grid-template-columns: minmax(0, 1fr) auto; }
}

@media (max-width: 767.98px) {
    body.app-shell .app-main :is(.communication-page-header, .performance-page-header) {
        align-items: stretch;
        min-height: 0;
        flex-direction: column;
    }

    body.app-shell .app-main :is(.communication-page-header, .performance-page-header) :is(.interaction-page-actions, .progress-hero-actions) {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    body.app-shell .app-main :is(.communication-page-header, .performance-page-header) .btn { width: 100%; }
    body.app-shell .app-main :is(.communication-summary-strip, .performance-summary-strip) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    body.app-shell .app-main :is(.communication-summary-strip, .performance-summary-strip) > :nth-child(2n) { border-right: 0 !important; }
    body.app-shell .app-main :is(.communication-summary-strip, .performance-summary-strip) > :nth-child(-n + 2) { border-bottom: 1px solid var(--app-border) !important; }

    body.app-shell .app-main .announcement-feed-item { grid-template-columns: 56px minmax(0, 1fr); }
    .announcement-feed-body,
    body.app-shell .app-main .performance-athlete-row { grid-template-columns: minmax(0, 1fr); }
    .announcement-feed-footer { grid-template-columns: minmax(0, 1fr); }
    .announcement-feed-footer .btn { width: 100%; }
    .announcement-reading-layout,
    .performance-record-notes { grid-template-columns: minmax(0, 1fr) !important; }

    body.app-shell .app-main .communication-messaging-layout { grid-template-columns: minmax(0, 1fr); }
    body.app-shell .app-main .communication-messaging-layout :is(.messaging-sidebar, .messaging-panel) { min-height: calc(100vh - 178px); }
    .messaging-workspace-page.has-selected-conversation .messaging-sidebar,
    .messaging-workspace-page.conversation-picker-only .messaging-panel { display: none; }
    .messaging-mobile-back {
        display: inline-flex;
        align-items: center;
        color: var(--sports-cobalt);
        font-size: .72rem;
        font-weight: 800;
        text-decoration: none;
    }
    .messaging-mobile-back::before { margin-right: .28rem; content: "\2190"; }
    .communication-messaging-layout .messaging-panel-head { align-items: flex-start; flex-direction: column; }

    .notification-activity-item { align-items: flex-start; }
    .notification-activity-item .notification-meta { min-width: 58px; }
    .performance-athlete-actions { grid-column: auto; }
}

@media (max-width: 575.98px) {
    body.app-shell .app-main :is(.communication-page-header, .performance-page-header) :is(.interaction-page-actions, .progress-hero-actions) { grid-template-columns: minmax(0, 1fr); }
    body.app-shell .app-main .performance-timeline-item { grid-template-columns: 52px minmax(0, 1fr); }
    .performance-athlete-actions { grid-template-columns: minmax(0, 1fr) !important; }
    .notification-activity-item { gap: .55rem; }
    .notification-type-mark { width: 36px; height: 36px; flex-basis: 36px; }
}

/* Account workspace */

body.app-shell .app-main .account-workspace {
    width: 100%;
    max-width: 1180px;
    margin-inline: auto;
}

body.app-shell .app-main .account-page-header::after { background: var(--sports-cobalt); }

body.app-shell .app-main .account-profile-hero {
    position: relative;
    overflow: hidden;
    border-left: 4px solid var(--sports-cobalt) !important;
    border-radius: var(--app-radius-sm) !important;
}

body.app-shell .app-main .account-profile-hero::after {
    position: absolute;
    inset: 0 0 0 auto;
    width: 7px;
    background: var(--sports-teal);
    content: "";
}

body.app-shell .app-main .account-profile-hero .settings-avatar {
    border-radius: var(--app-radius-xs);
    background: var(--app-surface-muted);
    color: var(--sports-cobalt);
}

body.app-shell .app-main .account-detail-grid {
    grid-template-columns: minmax(300px, .82fr) minmax(0, 1.35fr);
    gap: .8rem;
}

body.app-shell .app-main :is(.account-access-panel, .account-personal-panel, .account-command-panel, .account-form-panel, .account-photo-panel, .account-security-panel) {
    border-radius: var(--app-radius-sm) !important;
}

body.app-shell .app-main .account-access-panel { border-top: 3px solid var(--sports-teal) !important; }
body.app-shell .app-main .account-personal-panel { border-top: 3px solid var(--sports-lime) !important; }
body.app-shell .app-main .account-command-panel { border-top: 3px solid var(--sports-cobalt) !important; }
body.app-shell .app-main .account-photo-panel { border-top: 3px solid var(--sports-amber) !important; }
body.app-shell .app-main .account-security-panel { border-top: 3px solid var(--sports-teal) !important; }

body.app-shell .app-main .account-access-panel .settings-summary-row {
    padding: .62rem 0;
}

body.app-shell .app-main .account-command-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .55rem;
}

body.app-shell .app-main .account-command-grid .btn {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 38px;
    width: 100%;
}

body.app-shell .app-main .account-form-panel { border-top: 3px solid var(--sports-cobalt) !important; }

/* Registration workspace */

body.app-shell .app-main .registration-workspace {
    width: 100%;
    max-width: 1180px;
    min-width: 0;
    margin-inline: auto;
}

body.app-shell .app-main .registration-page-header::after { background: var(--sports-teal); }

.registration-layout {
    display: grid;
    grid-template-columns: 205px minmax(0, 1fr);
    align-items: start;
    gap: .8rem;
}

.registration-rail {
    position: sticky;
    top: 78px;
    display: grid;
    gap: .35rem;
    border: 1px solid var(--app-border);
    border-top: 3px solid var(--sports-cobalt);
    border-radius: var(--app-radius-sm);
    background: var(--app-surface);
    padding: .7rem;
}

.registration-rail-title {
    margin-bottom: .25rem;
    color: var(--app-text-muted);
    font-size: .67rem;
    font-weight: 850;
    text-transform: uppercase;
}

.registration-rail a {
    display: grid;
    grid-template-columns: 27px minmax(0, 1fr);
    align-items: center;
    gap: .5rem;
    min-height: 38px;
    padding: .38rem .45rem;
    border: 1px solid transparent;
    border-radius: var(--app-radius-xs);
    color: var(--app-text-soft);
    font-size: .78rem;
    font-weight: 750;
    text-decoration: none;
}

.registration-rail a span {
    color: var(--sports-teal);
    font-size: .66rem;
    font-weight: 900;
}

.registration-rail a:hover,
.registration-rail a:focus {
    border-color: var(--app-border);
    background: var(--app-surface-muted);
    color: var(--app-text);
}

body.app-shell .app-main .registration-form-panel {
    min-width: 0;
    border-top: 3px solid var(--sports-teal) !important;
    border-radius: var(--app-radius-sm) !important;
}

.registration-section-title {
    scroll-margin-top: 90px;
    padding-top: .4rem !important;
    color: var(--sports-cobalt) !important;
}

.registration-section-title:not(:first-child) {
    margin-top: .45rem;
    border-top: 1px solid var(--app-border);
    padding-top: 1rem !important;
}

body.app-shell .app-main .registration-summary-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.app-shell .app-main .application-queue {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: .5rem;
}

body.app-shell .app-main .application-queue-item {
    min-width: 0;
    border-radius: var(--app-radius-sm) !important;
    box-shadow: none !important;
}

body.app-shell .app-main .record-card.application-queue-item {
    grid-template-columns: 66px minmax(0, 1fr);
}

body.app-shell .app-main .application-queue-body {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(180px, .8fr) minmax(200px, .72fr) auto;
    align-items: center;
    gap: .7rem;
}

body.app-shell .app-main .application-queue-body :is(.record-card-head, .record-card-meta, .record-stat-stack, .record-card-actions) {
    margin: 0;
}

body.app-shell .app-main .application-queue-body .record-card-head {
    align-items: center;
}

body.app-shell .app-main .application-queue-body .record-card-actions .btn { min-width: 92px; }

body.app-shell .app-main .demo-application-queue .demo-application-item {
    display: grid;
    grid-template-columns: minmax(200px, .8fr) minmax(0, 1.4fr) auto;
    align-items: center;
    gap: .8rem;
    padding: .75rem;
}

body.app-shell .app-main .demo-application-item :is(.utility-card-head, .utility-card-body, .utility-card-actions) {
    margin: 0;
}

.registration-success-page {
    display: grid;
    place-items: center;
    min-height: min(72vh, 620px);
}

body.app-shell .app-main .registration-success-card {
    width: min(100%, 560px);
    border-top: 3px solid var(--sports-lime) !important;
    border-radius: var(--app-radius-sm) !important;
    text-align: center;
}

.registration-success-mark {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin: 0 auto 1rem;
    border: 2px solid var(--sports-lime);
    border-radius: 50%;
    color: var(--sports-lime);
    font-size: 1.35rem;
    font-weight: 900;
}

.registration-success-status {
    display: inline-flex;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: var(--app-surface-muted);
    padding: .34rem .65rem;
    color: var(--app-text-soft);
    font-size: .72rem;
    font-weight: 750;
}

/* Legal workspace */

body.app-shell .app-main .legal-workspace {
    width: 100%;
    max-width: 1000px;
    min-width: 0;
    margin-inline: auto;
}

body.app-shell .app-main .legal-reading-page { max-width: 900px; }

.legal-page-header {
    position: relative;
    margin-bottom: 1rem;
    padding-bottom: .85rem;
    border-bottom: 1px solid var(--app-border);
}

.legal-page-header::after {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 68px;
    height: 3px;
    background: var(--sports-cobalt);
    content: "";
}

body.app-shell .app-main .legal-reading-surface {
    border-left: 4px solid var(--sports-teal) !important;
    border-radius: var(--app-radius-sm) !important;
    padding: clamp(1rem, 3vw, 2rem) !important;
    font-size: .92rem;
    line-height: 1.8;
    white-space: pre-line;
}

.legal-consent-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: .8rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    background: var(--app-surface);
}

.legal-consent-summary > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .7rem;
    min-height: 66px;
    padding: .75rem;
    border-right: 1px solid var(--app-border);
}

.legal-consent-summary > div:last-child { border-right: 0; }
.legal-consent-summary span { color: var(--app-text-soft); font-size: .72rem; font-weight: 750; }
.legal-consent-summary strong { color: var(--app-text); font-size: 1.25rem; }

body.app-shell .app-main .legal-consent-panel,
body.app-shell .app-main .tenant-acceptance-panel {
    border-top: 3px solid var(--sports-cobalt) !important;
    border-radius: var(--app-radius-sm) !important;
}

body.app-shell .app-main .legal-consent-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .8rem;
    border-radius: var(--app-radius-xs) !important;
}

body.app-shell .app-main .legal-consent-item.notice { border-left-color: var(--sports-cobalt) !important; }
body.app-shell .app-main .legal-consent-item.required { border-left-color: var(--sports-amber) !important; }
body.app-shell .app-main .legal-consent-item.optional { border-left-color: var(--sports-teal) !important; }

.legal-acceptance-summary {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 !important;
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
}

.legal-acceptance-summary > div {
    min-width: 0;
    padding: .75rem;
    border-right: 1px solid var(--app-border);
}

.legal-acceptance-summary > div:last-child { border-right: 0; }

body.app-shell .app-main .legal-acceptance-check {
    border: 1px solid var(--app-border);
    border-left: 3px solid var(--sports-lime);
    border-radius: var(--app-radius-xs);
    background: var(--app-surface-muted);
    padding: .75rem .75rem .75rem 2.2rem;
}

/* Payment support workspace */

body.app-shell .app-main .payment-support-workspace {
    width: 100%;
    max-width: 1180px;
    min-width: 0;
    margin-inline: auto;
}

body.app-shell .app-main .payment-support-header::after { background: var(--sports-amber); }

.payment-connection-status {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: .8rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    background: var(--app-surface);
}

.payment-connection-status > div {
    min-width: 0;
    padding: .7rem .8rem;
    border-right: 1px solid var(--app-border);
}

.payment-connection-status > div:last-child { border-right: 0; }
.payment-connection-status span { display: block; color: var(--app-text-muted); font-size: .67rem; font-weight: 800; text-transform: uppercase; }
.payment-connection-status strong { display: block; margin-top: .22rem; color: var(--app-text); font-size: .9rem; }
.payment-connection-status strong.success { color: var(--app-success); }
.payment-connection-status strong.warning { color: var(--sports-amber); }

body.app-shell .app-main .payment-connection-layout {
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, .72fr);
    gap: .8rem;
}

body.app-shell .app-main .payment-credential-panel {
    border-top: 3px solid var(--sports-teal) !important;
    border-radius: var(--app-radius-sm) !important;
}

body.app-shell .app-main .payment-provider-guide {
    position: sticky;
    top: 78px;
    border-top: 3px solid var(--sports-amber) !important;
    border-radius: var(--app-radius-sm) !important;
}

body.app-shell .app-main .payment-security-alert {
    border-radius: var(--app-radius-xs) !important;
}

.payment-checkout-context {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .7rem;
    margin-bottom: .65rem;
    border: 1px solid var(--app-border);
    border-left: 3px solid var(--sports-teal);
    border-radius: var(--app-radius-xs);
    background: var(--app-surface);
    padding: .58rem .7rem;
    color: var(--app-text-soft);
    font-size: .75rem;
}

body.app-shell .app-main .payment-frame-panel {
    overflow: hidden;
    border-top: 3px solid var(--sports-cobalt) !important;
    border-radius: var(--app-radius-sm) !important;
    padding: 0 !important;
}

.payment-provider-frame {
    display: block;
    width: 100%;
    min-height: 720px;
    border: 0;
    background: #fff;
}

.payment-return-page {
    display: grid;
    place-items: center;
    min-height: min(70vh, 600px);
}

body.app-shell .app-main .payment-return-state {
    width: min(100%, 560px);
    border-top: 3px solid var(--sports-teal) !important;
    border-radius: var(--app-radius-sm) !important;
    padding: 2rem !important;
}

.payment-return-pulse {
    width: 42px;
    height: 42px;
    margin: 0 auto 1rem;
    border: 3px solid var(--app-border);
    border-top-color: var(--sports-teal);
    border-radius: 50%;
    animation: payment-return-spin .85s linear infinite;
}

@keyframes payment-return-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .payment-return-pulse { animation: none; }
}

@media (max-width: 991.98px) {
    body.app-shell .app-main .account-detail-grid,
    .registration-layout,
    body.app-shell .app-main .payment-connection-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .registration-rail {
        position: static;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .registration-rail-title { grid-column: 1 / -1; }
    body.app-shell .app-main .account-command-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    body.app-shell .app-main .application-queue-body { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.app-shell .app-main .application-queue-body :is(.record-card-head, .record-card-actions) { grid-column: 1 / -1; }
    body.app-shell .app-main .payment-provider-guide { position: static; }
}

@media (max-width: 767.98px) {
    body.app-shell .app-main .account-command-grid,
    body.app-shell .app-main .registration-summary-strip,
    .legal-consent-summary,
    .legal-acceptance-summary,
    .payment-connection-status {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .registration-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.app-shell .app-main .application-queue-body { grid-template-columns: minmax(0, 1fr); }
    body.app-shell .app-main .application-queue-body :is(.record-card-head, .record-card-actions) { grid-column: auto; }
    body.app-shell .app-main .demo-application-queue .demo-application-item { grid-template-columns: minmax(0, 1fr); }
    body.app-shell .app-main .legal-consent-item { grid-template-columns: minmax(0, 1fr); }
    body.app-shell .app-main .legal-consent-item .public-consent-read { width: 100%; }
    .legal-consent-summary > div:nth-child(2n),
    .payment-connection-status > div:nth-child(2n),
    .legal-acceptance-summary > div:nth-child(2n) { border-right: 0; }
    .legal-consent-summary > div:nth-child(-n + 2),
    .payment-connection-status > div:nth-child(-n + 2),
    .legal-acceptance-summary > div:nth-child(-n + 2) { border-bottom: 1px solid var(--app-border); }
    .payment-checkout-context { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 575.98px) {
    body.app-shell .app-main .account-command-grid,
    .registration-rail,
    body.app-shell .app-main .registration-summary-strip,
    .legal-consent-summary,
    .legal-acceptance-summary,
    .payment-connection-status {
        grid-template-columns: minmax(0, 1fr);
    }

    .legal-consent-summary > div,
    .payment-connection-status > div,
    .legal-acceptance-summary > div {
        border-right: 0;
        border-bottom: 1px solid var(--app-border);
    }

    .legal-consent-summary > div:last-child,
    .payment-connection-status > div:last-child,
    .legal-acceptance-summary > div:last-child { border-bottom: 0; }
    body.app-shell .app-main .record-card.application-queue-item { grid-template-columns: 52px minmax(0, 1fr); }
}
/* ========================================================================== */
/* Platform operations workspace                                              */
/* ========================================================================== */

body.app-shell .app-main .platform-workspace {
    width: min(100%, 1380px);
    min-width: 0;
    margin-inline: auto;
}

body.app-shell .app-main .platform-page-header {
    position: relative;
    width: 100%;
    min-width: 0;
    align-items: flex-end;
    padding-bottom: .9rem;
    border-bottom: 1px solid var(--app-border);
}

body.app-shell .app-main .platform-page-header::after {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 68px;
    height: 3px;
    content: "";
    background: var(--sports-cobalt);
}

body.app-shell .app-main .platform-page-kicker {
    margin-bottom: .28rem;
    color: var(--sports-teal);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

body.app-shell .app-main .platform-tabs {
    display: flex;
    min-width: 0;
    max-width: 100%;
    gap: .25rem;
    padding: .25rem;
    overflow-x: auto;
    border: 1px solid var(--app-border);
    border-radius: 6px;
    background: var(--app-surface);
    scrollbar-width: thin;
}

body.app-shell .app-main .platform-tabs .btn {
    width: auto !important;
    min-width: max-content;
    min-height: 34px;
    flex: 0 0 auto;
    border-color: transparent;
    white-space: nowrap;
}

body.app-shell .app-main .platform-tabs .btn-outline-secondary {
    color: var(--app-text-muted);
}

body.app-shell .app-main .platform-tabs .btn-outline-secondary:hover {
    color: var(--app-text);
    border-color: var(--app-border);
    background: var(--app-surface-strong);
}

body.app-shell .app-main .platform-context-strip {
    border-left: 3px solid var(--sports-teal);
    border-radius: 4px;
}

body.app-shell .app-main .platform-summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-block: 1px solid var(--app-border);
    background: var(--app-surface);
}

body.app-shell .app-main .platform-summary-strip > div {
    display: grid;
    gap: .2rem;
    min-width: 0;
    padding: .8rem 1rem;
    border-right: 1px solid var(--app-border);
}

body.app-shell .app-main .platform-summary-strip > div:last-child {
    border-right: 0;
}

body.app-shell .app-main .platform-summary-strip span {
    color: var(--app-text-muted);
    font-size: .68rem;
    font-weight: 750;
    text-transform: uppercase;
}

body.app-shell .app-main .platform-summary-strip strong {
    min-width: 0;
    overflow: hidden;
    color: var(--app-text);
    font-size: 1.08rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.app-shell .app-main .platform-dashboard-page .dashboard-stat-card {
    min-height: 128px;
    border-top: 3px solid var(--sports-cobalt);
    box-shadow: none;
}

body.app-shell .app-main .platform-dashboard-page .dashboard-stat-card.accent-teal {
    border-top-color: var(--sports-teal);
}

body.app-shell .app-main .platform-dashboard-page .dashboard-stat-card.accent-amber {
    border-top-color: var(--sports-amber);
}

body.app-shell .app-main .platform-dashboard-page .dashboard-stat-card.accent-rose {
    border-top-color: var(--sports-rose);
}

body.app-shell .app-main .platform-ledger-panel {
    border-top: 3px solid var(--sports-teal);
}

body.app-shell .app-main .platform-tenant-table tbody tr {
    transition: background-color .15s ease;
}

body.app-shell .app-main .platform-tenant-table tbody tr:hover {
    background: var(--app-surface-strong);
}

body.app-shell .app-main .platform-tenant-hero {
    position: relative;
    border-left: 3px solid var(--sports-cobalt);
}

body.app-shell .app-main .platform-tenant-detail-page .management-info-panel:nth-child(1) {
    border-top: 3px solid var(--sports-teal);
}

body.app-shell .app-main .platform-tenant-detail-page .management-info-panel:nth-child(2) {
    border-top: 3px solid var(--sports-amber);
}

body.app-shell .app-main .platform-form-panel {
    border-top: 3px solid var(--sports-teal);
}

body.app-shell .app-main .platform-event-stream,
body.app-shell .app-main .platform-ticket-queue {
    display: grid;
    gap: .5rem;
}

body.app-shell .app-main .platform-event-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: .8rem;
    padding: .72rem .8rem;
    border: 1px solid var(--app-border);
    border-left: 3px solid var(--sports-cobalt);
    border-radius: 4px;
    background: var(--app-surface);
}

body.app-shell .app-main .platform-event-row time {
    display: grid;
    gap: .08rem;
    color: var(--app-text-muted);
    font-size: .68rem;
}

body.app-shell .app-main .platform-event-row time strong {
    color: var(--app-text);
    font-size: .9rem;
}

body.app-shell .app-main .platform-event-main {
    min-width: 0;
}

body.app-shell .app-main .platform-ticket-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(260px, 1fr) auto;
    align-items: stretch;
    min-width: 0;
    overflow: hidden;
    border-left: 3px solid var(--sports-amber);
    box-shadow: none;
}

body.app-shell .app-main .platform-ticket-row .utility-card-head,
body.app-shell .app-main .platform-ticket-row .utility-card-body,
body.app-shell .app-main .platform-ticket-row .utility-card-actions {
    margin: 0;
    padding: .78rem .9rem;
}

body.app-shell .app-main .platform-ticket-row .utility-card-head,
body.app-shell .app-main .platform-ticket-row .utility-card-body {
    border-right: 1px solid var(--app-border);
}

body.app-shell .app-main .platform-ticket-row .utility-card-actions {
    display: flex;
    align-items: center;
}

body.app-shell .app-main .platform-monitor-page .dashboard-main-grid > .dashboard-panel {
    border-top: 3px solid var(--sports-teal);
}

body.app-shell .app-main .platform-monitor-page .dashboard-main-grid > .dashboard-panel:last-child {
    border-top-color: var(--sports-amber);
}

body.app-shell .app-main .platform-demo-page .demo-application-queue {
    grid-template-columns: minmax(0, 1fr);
}

body.app-shell .app-main .platform-demo-page .demo-application-item {
    border-left: 3px solid var(--sports-teal);
}

@media (max-width: 767.98px) {
    body.app-shell .app-main .platform-page-header {
        align-items: stretch;
    }

    body.app-shell .app-main .platform-page-header .dashboard-actions,
    body.app-shell .app-main .platform-page-header .management-actions {
        width: 100%;
    }

    body.app-shell .app-main .platform-tabs {
        width: 100%;
    }

    body.app-shell .app-main .platform-dashboard-page .dashboard-stat-card {
        min-height: 92px;
    }

    body.app-shell .app-main .platform-summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.app-shell .app-main .platform-summary-strip > div:nth-child(2) {
        border-right: 0;
    }

    body.app-shell .app-main .platform-summary-strip > div:nth-child(-n + 2) {
        border-bottom: 1px solid var(--app-border);
    }

    body.app-shell .app-main .platform-event-row {
        grid-template-columns: 74px minmax(0, 1fr) auto;
    }

    body.app-shell .app-main .platform-event-row > .btn {
        grid-column: 2 / -1;
        justify-self: start;
    }

    body.app-shell .app-main .platform-ticket-row {
        grid-template-columns: minmax(0, 1fr);
    }

    body.app-shell .app-main .platform-ticket-row .utility-card-head,
    body.app-shell .app-main .platform-ticket-row .utility-card-body {
        border-right: 0;
        border-bottom: 1px solid var(--app-border);
    }
}

@media (max-width: 575.98px) {
    body.app-shell .app-main .platform-summary-strip {
        grid-template-columns: minmax(0, 1fr);
    }

    body.app-shell .app-main .platform-summary-strip > div,
    body.app-shell .app-main .platform-summary-strip > div:nth-child(2) {
        border-right: 0;
    }

    body.app-shell .app-main .platform-summary-strip > div:not(:last-child) {
        border-bottom: 1px solid var(--app-border);
    }

    body.app-shell .app-main .platform-event-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    body.app-shell .app-main .platform-event-row time {
        grid-column: 1 / -1;
        grid-template-columns: auto 1fr;
        align-items: baseline;
        gap: .4rem;
    }

    body.app-shell .app-main .platform-event-row > .btn {
        grid-column: 1 / -1;
    }
}
