/* Coach Data Room */
.coach-data-room {
    --coach-accent: var(--site-primary, #f56600);
    --coach-ink: #172434;
    --coach-muted: #5d6875;
    --coach-line: #d8dee5;
    --coach-surface: #fff;
    --coach-soft: #f5f7f9;
    width: min(1180px, calc(100% - 24px));
    margin: 18px auto 34px;
    color: var(--coach-ink);
}

.coach-data-room__hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 26px;
    border-top: 5px solid var(--coach-accent);
    border-radius: 12px;
    background:
        linear-gradient(120deg, rgba(245, 102, 0, .1), transparent 45%),
        var(--coach-surface);
    box-shadow: 0 12px 34px rgba(23, 36, 52, .12);
}

.coach-data-room__identity {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 20px;
}

.coach-data-room__portrait {
    display: grid;
    flex: 0 0 104px;
    width: 104px;
    height: 104px;
    place-items: center;
    overflow: hidden;
    border: 3px solid #fff;
    border-radius: 10px;
    background: var(--coach-soft);
    box-shadow: 0 4px 14px rgba(23, 36, 52, .2);
}

.coach-data-room__portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.coach-data-room__portrait .material-icons {
    color: var(--coach-muted);
    font-size: 52px;
}

.coach-data-room__eyebrow,
.coach-data-room__section-head > div:first-child > span,
.coach-chart-card header span {
    color: var(--site-secondary, #522d80);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.coach-data-room__hero h1 {
    margin: 3px 0 5px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(27px, 4vw, 42px);
    line-height: 1.05;
}

.coach-data-room__hero p {
    margin: 0;
    color: var(--coach-muted);
    font-size: 14px;
}

.coach-data-room__back {
    flex: 0 0 auto;
    padding: 9px 12px;
    border: 1px solid var(--coach-line);
    border-radius: 7px;
    color: var(--coach-ink);
    background: var(--coach-surface);
    font-weight: 800;
    text-decoration: none;
}

.coach-data-room__back:hover,
.coach-data-room__back:focus-visible {
    border-color: var(--coach-accent);
    color: var(--coach-accent);
    text-decoration: none;
}

.coach-data-room__empty {
    margin-top: 16px;
    padding: 58px 24px;
    border: 1px solid var(--coach-line);
    border-radius: 12px;
    background: var(--coach-surface);
    text-align: center;
}

.coach-data-room__empty .material-icons {
    color: var(--coach-accent);
    font-size: 48px;
}

.coach-data-room__tabs {
    display: flex;
    gap: 3px;
    margin-top: 16px;
    overflow-x: auto;
    border: 1px solid var(--coach-line);
    border-radius: 10px 10px 0 0;
    background: var(--coach-soft);
    scrollbar-width: thin;
}

.coach-data-room__tabs a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: max-content;
    gap: 6px;
    padding: 13px 15px;
    border-bottom: 3px solid transparent;
    color: var(--coach-muted);
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
}

.coach-data-room__tabs a[aria-selected="true"] {
    border-bottom-color: var(--coach-accent);
    color: var(--coach-ink);
    background: var(--coach-surface);
}

.coach-data-room__tabs .material-icons {
    font-size: 18px;
}

.coach-data-room__tabs a:focus-visible,
.coach-data-room__back:focus-visible,
.coach-data-room select:focus-visible {
    outline: 3px solid rgba(245, 102, 0, .35);
    outline-offset: 2px;
}

.coach-data-room__panels {
    border: 1px solid var(--coach-line);
    border-top: 0;
    border-radius: 0 0 12px 12px;
    background: var(--coach-surface);
}

.coach-data-room__panel {
    padding: 25px;
}

.coach-data-room.is-enhanced .coach-data-room__panel[hidden] {
    display: none;
}

.coach-data-room__section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.coach-data-room__section-head h2 {
    margin: 2px 0 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 28px;
}

.coach-data-room__select {
    display: grid;
    gap: 4px;
    color: var(--coach-muted);
    font-size: 11px;
    font-weight: 800;
}

.coach-game-log-controls {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    flex-wrap: wrap;
}

.coach-game-log-record {
    display: grid;
    gap: 2px;
    min-width: 7.5rem;
    text-align: right;
}

.coach-game-log-record__label {
    color: var(--coach-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.coach-game-log-record__value {
    color: var(--coach-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.coach-game-log-record__meta {
    color: var(--coach-muted);
    font-size: 12px;
    font-weight: 600;
}

.coach-data-room select {
    min-width: 104px;
    padding: 7px 30px 7px 9px;
    border: 1px solid var(--coach-line);
    border-radius: 6px;
    color: var(--coach-ink);
    background: var(--coach-surface);
}

.coach-overview-grid,
.coach-career-record {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--coach-line);
    border-radius: 9px;
}

.coach-overview-grid > div,
.coach-career-record > div {
    min-width: 0;
    padding: 16px;
    border-right: 1px solid var(--coach-line);
    background: var(--coach-soft);
}

.coach-overview-grid > div:last-child,
.coach-career-record > div:last-child {
    border-right: 0;
}

.coach-overview-grid dt,
.coach-career-record dt {
    margin-bottom: 5px;
    color: var(--coach-muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.coach-overview-grid dd,
.coach-career-record dd {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 23px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.coach-chart-card {
    margin-top: 20px;
    padding: 17px;
    border: 1px solid var(--coach-line);
    border-radius: 9px;
    background: var(--coach-surface);
}

.coach-chart-card header h3 {
    margin: 2px 0 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
}

.coach-chart-card__canvas {
    width: 100%;
    height: 320px;
    margin-top: 12px;
}

.coach-chart-card__summary,
.coach-data-room__notice {
    margin: 10px 0 0;
    color: var(--coach-muted);
    font-size: 12px;
    line-height: 1.55;
}

.coach-table-scroll {
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--coach-line);
    border-radius: 8px;
}

.coach-table-scroll.is-dragging {
    cursor: grabbing;
    user-select: none;
}

.coach-data-room table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    font-size: 13px;
}

.coach-data-room th,
.coach-data-room td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--coach-line);
    text-align: left;
    white-space: nowrap;
}

.coach-data-room th {
    color: var(--coach-muted);
    background: var(--coach-soft);
    font-size: 10px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.coach-data-room thead th[data-sort] {
    padding: 0;
}

.coach-data-room .stat-th-sort {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.3em;
    width: 100%;
    margin: 0;
    padding: 11px 12px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    white-space: nowrap;
    cursor: pointer;
}

.coach-data-room .stat-th-sort::after {
    content: "\2195";
    opacity: 0.4;
    font-size: 0.95em;
    line-height: 1;
}

.coach-data-room thead th[aria-sort="ascending"] .stat-th-sort::after {
    content: "\25B2";
    opacity: 1;
    color: var(--coach-accent, #f56600);
}

.coach-data-room thead th[aria-sort="descending"] .stat-th-sort::after {
    content: "\25BC";
    opacity: 1;
    color: var(--coach-accent, #f56600);
}

.coach-data-room .stat-th-sort:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--coach-ink, #172434);
}

.coach-data-room .stat-th-sort:focus-visible {
    outline: 2px solid var(--coach-accent, #f56600);
    outline-offset: -2px;
}

html.dark-mode .coach-data-room .stat-th-sort:hover,
body.dark .coach-data-room .stat-th-sort:hover,
[data-theme="dark"] .coach-data-room .stat-th-sort:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--dm-text-primary, #f2ede6);
}

.coach-data-room tbody tr:last-child td {
    border-bottom: 0;
}

.coach-data-room td a {
    color: var(--coach-accent);
    font-weight: 600;
    text-decoration: none;
}

.coach-data-room td a:hover,
.coach-data-room td a:focus-visible {
    text-decoration: underline;
}

.coach-coverage,
.coach-coverage-note {
    display: inline-flex;
    margin-right: 5px;
    padding: 3px 7px;
    border-radius: 999px;
    background: #e8edf2;
    color: var(--coach-ink);
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
}

.coach-coverage--complete,
.coach-coverage--reviewed {
    background: #dff3e7;
    color: #17643a;
}

.coach-coverage--partial {
    background: #fff0d9;
    color: #8a4a00;
}

.coach-coverage-note {
    margin-top: 3px;
    background: #eee8f5;
    color: #522d80;
}

.coach-result {
    font-weight: 900;
}

.coach-result--w { color: #167a44; }
.coach-result--l { color: #a33131; }
.coach-result--t { color: #765800; }

.coach-game-number {
    display: inline-block;
    margin-left: 4px;
    color: var(--coach-muted);
    font-size: 10px;
    font-weight: 800;
}

.coach-split-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.coach-split-card,
.coach-opponent-splits {
    overflow: hidden;
    border: 1px solid var(--coach-line);
    border-radius: 8px;
}

.coach-split-card h3,
.coach-opponent-splits h3 {
    margin: 0;
    padding: 12px 14px;
    border-bottom: 1px solid var(--coach-line);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 17px;
}

.coach-split-card table {
    min-width: 0;
}

.coach-opponent-splits {
    margin-top: 14px;
}

.coach-career-list {
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.coach-career-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 13px 4px;
    border-bottom: 1px solid var(--coach-line);
}

.coach-career-list li > div {
    display: grid;
    gap: 3px;
}

.coach-career-list span {
    color: var(--coach-muted);
    font-size: 12px;
}

html[data-coach-stats-initial-tab] .coach-data-room__panel {
    display: none;
}
html[data-coach-stats-initial-tab] .coach-data-room__tabs a[aria-selected="true"] {
    border-bottom-color: transparent;
    color: var(--coach-muted);
    background: transparent;
}
html[data-coach-stats-initial-tab="overview"] [data-coach-stats-tab="overview"],
html[data-coach-stats-initial-tab="season-records"] [data-coach-stats-tab="season-records"],
html[data-coach-stats-initial-tab="game-log"] [data-coach-stats-tab="game-log"],
html[data-coach-stats-initial-tab="splits"] [data-coach-stats-tab="splits"],
html[data-coach-stats-initial-tab="career"] [data-coach-stats-tab="career"] {
    border-bottom-color: var(--coach-accent);
    color: var(--coach-ink);
    background: var(--coach-surface);
}
html[data-coach-stats-initial-tab="overview"] #coach-panel-overview,
html[data-coach-stats-initial-tab="season-records"] #coach-panel-season-records,
html[data-coach-stats-initial-tab="game-log"] #coach-panel-game-log,
html[data-coach-stats-initial-tab="splits"] #coach-panel-splits,
html[data-coach-stats-initial-tab="career"] #coach-panel-career {
    display: block;
}

html.dark-mode .coach-data-room,
[data-theme="dark"] .coach-data-room,
body.dark .coach-data-room {
    --coach-ink: var(--dm-text-primary, #f1f5f9);
    --coach-muted: var(--dm-text-secondary, #cbd5e1);
    --coach-line: var(--dm-border, #46515b);
    --coach-surface: var(--dm-bg-elevated, #202a33);
    --coach-soft: var(--dm-bg-card, #17212a);
}

html.dark-mode .coach-data-room__eyebrow,
html.dark-mode .coach-data-room__section-head > div:first-child > span,
html.dark-mode .coach-chart-card header span,
html.dark-mode .coach-data-room th,
[data-theme="dark"] .coach-data-room__eyebrow,
[data-theme="dark"] .coach-data-room__section-head > div:first-child > span,
[data-theme="dark"] .coach-chart-card header span,
[data-theme="dark"] .coach-data-room th,
body.dark .coach-data-room__eyebrow,
body.dark .coach-data-room__section-head > div:first-child > span,
body.dark .coach-chart-card header span,
body.dark .coach-data-room th {
    color: var(--dm-text-primary, #f1f5f9);
}

html.dark-mode .coach-game-log-record__label,
html.dark-mode .coach-game-log-record__meta {
    color: var(--dm-text-secondary, #cbd5e1);
}

html.dark-mode .coach-game-log-record__value {
    color: var(--dm-text-primary, #f1f5f9);
}

html.dark-mode .coach-coverage-note {
    color: var(--dm-text-primary, #f1f5f9);
    background: #4b3d5c;
}

html.dark-mode .coach-coverage--complete,
html.dark-mode .coach-coverage--reviewed {
    color: #d9ffe8;
    background: #20583b;
}

html.dark-mode .coach-coverage--partial {
    color: #ffe9c7;
    background: #70420f;
}

html.dark-mode .coach-result--w { color: #74d99f; }
html.dark-mode .coach-result--l { color: #ff9b9b; }
html.dark-mode .coach-result--t { color: #ffe08a; }

@media (max-width: 760px) {
    .coach-data-room {
        width: min(100% - 12px, 1180px);
        margin-top: 8px;
    }

    .coach-data-room__hero {
        align-items: flex-start;
        flex-direction: column;
        padding: 17px;
    }

    .coach-data-room__identity {
        align-items: flex-start;
    }

    .coach-data-room__portrait {
        flex-basis: 78px;
        width: 78px;
        height: 78px;
    }

    .coach-data-room__back {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }

    .coach-data-room__panel {
        padding: 16px 12px;
    }

    .coach-overview-grid,
    .coach-career-record,
    .coach-split-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .coach-overview-grid > div:nth-child(2n),
    .coach-career-record > div:nth-child(2n) {
        border-right: 0;
    }

    .coach-chart-card__canvas {
        height: 280px;
    }
}

@media (max-width: 460px) {
    .coach-data-room__identity {
        flex-direction: column;
    }

    .coach-data-room__tabs a {
        padding: 11px;
    }

    .coach-data-room__section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .coach-game-log-controls {
        width: 100%;
        justify-content: space-between;
    }

    .coach-game-log-record {
        text-align: left;
    }

    .coach-split-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .coach-data-room *,
    .coach-data-room *::before,
    .coach-data-room *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
