:root {
    color-scheme: light;
    --paper: #f0f0e8;
    --surface: #f8f8f2;
    --ink: #202421;
    --muted: #777d76;
    --line: #d8dbd2;
    --acid: #c9f259;
    --red: #d84d39;
    --green: #315943;
    --display: 'Arial Narrow', 'Roboto Condensed', Impact, sans-serif;
    --body: 'Trebuchet MS', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 0; background: var(--paper); }

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: var(--body);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.login-page { min-height: 100svh; overflow-x: hidden; }
.login-shell { display: grid; min-height: 100svh; padding: 22px; place-items: center; }
.login-content { display: grid; width: min(100%, 360px); gap: 10px; padding: 30px; border: 1px solid var(--line); background: var(--surface); animation: enter-up 350ms ease-out both; }
.login-mark { display: grid; width: 39px; aspect-ratio: 1; margin-bottom: 12px; place-items: center; color: var(--acid); background: var(--ink); font-family: var(--display); font-size: 27px; font-weight: 900; }
.login-content h1 { margin: 0 0 12px; font-family: var(--display); font-size: 32px; font-weight: 900; line-height: 1; }
.topbar-brand span { color: var(--muted); font-weight: 500; }

.eyebrow {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0;
}

.status-dot, .rail-live {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 0 3px rgb(216 77 57 / 12%);
}

.intro-row h1 {
    margin: 23px 0 12px;
    font-family: var(--display);
    font-size: 70px;
    font-weight: 900;
    line-height: .93;
}

.login-content label { margin-top: 5px; font-size: 11px; font-weight: 700; }
.login-content input:not([type=hidden]) {
    width: 100%;
    min-height: 49px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 2px;
    outline: none;
    background: var(--surface);
}
.login-content input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgb(49 89 67 / 12%); }
.login-error { margin: 2px 0 0; color: #a32e25; font-size: 12px; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
    min-height: 42px;
    padding: 0 15px;
    border: 1px solid transparent;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.button:active { transform: translateY(1px); }
.button:focus-visible, .logout-button:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.button-dark { color: #fff; background: var(--ink); }
.button-dark:hover { background: var(--green); }
.login-submit { min-height: 49px; margin-top: 10px; }

.app-shell { min-height: 100vh; }
.rail {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 2;
    display: flex;
    width: 43px;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    padding: 17px 0;
    color: var(--paper);
    background: var(--ink);
}
.rail-brand { font-family: var(--display); font-size: 20px; font-weight: 900; }
.rail-brand span { color: var(--acid); }
.rail-label { writing-mode: vertical-rl; color: #909790; font-size: 9px; font-weight: 700; }
.rail-active { display: grid; width: 29px; aspect-ratio: 1; place-items: center; color: var(--ink); background: var(--acid); font-size: 10px; font-weight: 800; }
.rail-spacer { flex: 1; }
.rail-live { margin-bottom: 7px; background: var(--acid); box-shadow: 0 0 0 3px rgb(201 242 89 / 14%); }

.main-content { width: calc(100% - 43px); margin-left: 43px; padding: 0 15px 16px; }
.topbar { display: flex; min-height: 52px; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); }
.topbar-brand { font-size: 9px; font-weight: 900; }
.topbar-actions { display: flex; align-items: center; gap: 3px; }
.topbar-date { color: var(--muted); font-size: 10px; }
.topbar-date { display: none; }
.logout-button { padding: 7px 0 7px 8px; border: 0; background: transparent; font-size: 10px; font-weight: 700; cursor: pointer; }
.logout-button span { margin-left: 6px; color: var(--red); font-size: 14px; }

.intro-row { display: flex; align-items: start; flex-direction: column; gap: 15px; padding: 30px 0 16px; animation: enter-up 420ms ease-out both; }
.eyebrow-divider { color: #a3a89f; }
.intro-row h1 { margin: 13px 0 0; font-size: 32px; }
.intro-row h1 span { color: var(--green); }
.button-outline { border-color: var(--line); background: transparent; }
.button-outline:hover { border-color: var(--ink); background: var(--surface); }
.refresh-button { min-height: 36px; flex: none; align-self: end; margin-top: -8px; font-size: 10px; }
.refresh-icon { font-size: 17px; line-height: 1; }
.refresh-button.is-loading .refresh-icon { animation: spin 700ms linear infinite; }
.data-line { display: flex; min-height: 27px; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 12px; color: var(--muted); font-size: 9px; }

.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); animation: enter-up 480ms 35ms ease-out both; }
.metric { min-width: 0; min-height: 125px; padding: 14px 12px; border-right: 1px solid var(--line); }
.metric:first-child { border-left: 1px solid var(--line); }
.metric:nth-child(odd) { border-left: 1px solid var(--line); }
.metric:nth-child(n + 3) { border-top: 1px solid var(--line); }
.metric-featured { background: var(--acid); }
.metric-top { display: flex; justify-content: space-between; gap: 8px; font-size: 9px; font-weight: 800; }
.metric-mark { color: rgb(32 36 33 / 42%); }
.metric-value { display: block; margin: 15px 0 4px; font-family: var(--display); font-size: 39px; font-weight: 900; line-height: .92; }
.metric-note { color: #696f68; font-size: 10px; }

.analytics-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 11px; margin-top: 13px; }
.panel { min-width: 0; padding: 15px 13px; border: 1px solid var(--line); background: var(--surface); }
.panel-heading { display: flex; min-height: 40px; align-items: start; justify-content: space-between; gap: 12px; }
.panel-heading h2, .section-heading h2 { margin: 7px 0 0; font-family: var(--display); font-size: 21px; font-weight: 800; line-height: 1; }
.panel-heading .eyebrow, .section-heading .eyebrow { font-size: 8px; }
.period-label { flex: none; padding: 6px 7px; background: #e8eae1; color: #60675f; font-size: 8px; font-weight: 800; }
.chart-wrap { position: relative; height: 180px; margin-top: 17px; }
.chart-wrap canvas { display: block; width: 100%; height: 100%; }
.empty-state { position: absolute; inset: 50% 0 auto; margin: 0; color: var(--muted); font-size: 11px; text-align: center; transform: translateY(-50%); }
.chart-legend { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 9px; }
.chart-legend span:first-child { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend i { width: 8px; height: 8px; background: var(--green); }
.table-wrap { overflow-x: auto; margin-top: 20px; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 8px; }
th:last-child, td:last-child { width: 64px; text-align: right; }
td { max-width: 1px; padding: 12px 0; border-bottom: 1px solid #e7e9e1; font-size: 10px; }
td:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td:last-child { font-weight: 800; }
.table-placeholder { color: var(--muted); text-align: left !important; }

.site-section { margin-top: 25px; animation: enter-up 520ms 80ms ease-out both; }
.section-heading { display: flex; align-items: start; flex-direction: column; gap: 10px; margin-bottom: 13px; }
.section-heading h2 { font-size: 23px; }
.section-caption { color: var(--muted); font-size: 8px; font-weight: 700; }
.club-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.club-stat { display: flex; min-width: 0; min-height: 103px; flex-direction: column; justify-content: space-between; gap: 10px; padding: 12px; border-right: 1px solid var(--line); }
.club-stat:nth-child(odd) { border-left: 1px solid var(--line); }
.club-stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
.club-stat > span { color: var(--muted); font-size: 8px; font-weight: 800; }
.club-stat strong { font-family: var(--display); font-size: 35px; font-weight: 900; line-height: .9; }
.club-stat small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.app-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 12px; padding: 17px 0 3px; color: var(--muted); font-size: 7px; font-weight: 700; }

@keyframes enter-up { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 651px) {
    .rail { width: 63px; gap: 27px; padding: 21px 0; }
    .rail-brand { font-size: 23px; }
    .rail-active { width: 33px; }
    .main-content { width: min(calc(100% - 63px), 1470px); margin-left: 63px; padding: 0 28px 20px; }
    .topbar { min-height: 61px; gap: 15px; }
    .topbar-brand { font-size: 10px; }
    .topbar-actions { gap: 18px; }
    .topbar-date { display: inline; }
    .intro-row { align-items: end; flex-direction: row; justify-content: space-between; gap: 20px; padding: 43px 0 16px; }
    .intro-row h1 { font-size: 42px; }
    .refresh-button { align-self: auto; margin-top: 0; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metric { min-height: 141px; padding: 17px; }
    .metric-value { font-size: 42px; }
    .metric:nth-child(n + 3) { border-top: 1px solid var(--line); }
    .analytics-grid { gap: 13px; margin-top: 18px; }
    .panel { padding: 19px; }
    .panel-heading h2 { font-size: 23px; }
    .chart-wrap { height: 205px; }
    .site-section { margin-top: 28px; }
    .section-heading { align-items: end; flex-direction: row; justify-content: space-between; gap: 14px; }
    .section-heading h2 { font-size: 25px; }
    .club-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .club-stat { min-height: 112px; padding: 14px 13px; }
    .club-stat:nth-child(odd) { border-left: 0; }
    .club-stat:nth-child(3n + 1) { border-left: 1px solid var(--line); }
    .club-stat:nth-child(n + 4) { border-top: 1px solid var(--line); }
    .app-footer { flex-wrap: nowrap; gap: 12px; font-size: 8px; }
}

@media (min-width: 901px) {
    .main-content { padding-right: clamp(35px, 4vw, 62px); padding-left: clamp(35px, 4vw, 62px); }
    .intro-row h1 { font-size: 52px; }
    .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .metric { padding: 17px; }
    .metric:nth-child(odd) { border-left: 0; }
    .metric:first-child { border-left: 1px solid var(--line); }
    .metric:nth-child(n + 3) { border-top: 0; }
    .metric-value { font-size: 46px; }
    .analytics-grid { grid-template-columns: minmax(0, 1.55fr) minmax(250px, 1fr); }
    .club-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .club-stat:nth-child(3n + 1) { border-left: 0; }
    .club-stat:first-child { border-left: 1px solid var(--line); }
    .club-stat:nth-child(n + 4) { border-top: 0; }
}

@media (min-width: 1500px) {
    .main-content { margin-right: auto; }
}

@media (max-width: 380px) {
    .intro-row h1 { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}