:root {
    --color-primary: #6aa62f;
    --color-primary-dark: #426f1b;
    --color-surface: #fff;
    --admin-bg: #f5f6f4;
    --admin-panel: #fff;
    --admin-ink: #17231d;
    --admin-muted: #65736b;
    --admin-line: #d9dfd9;
    --admin-blue: #1f6fa8;
    --admin-shadow: 0 16px 36px rgb(23 35 29 / 8%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--admin-bg); color: var(--admin-ink); }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.app-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 24px;
    min-height: 72px;
    padding: 0 32px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--admin-line);
}
.brand { display: inline-flex; align-items: center; justify-self: start; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; background: var(--color-primary); color: #fff; font-weight: 800; }
.brand strong, .brand small { display: block; }
.brand small { color: var(--admin-muted); font-size: 12px; }
.header-context { color: var(--admin-muted); font-size: 13px; font-weight: 700; }
.header-actions { display: flex; justify-self: end; gap: 10px; }
.header-actions a { padding: 9px 12px; border: 1px solid var(--admin-line); border-radius: 6px; color: var(--admin-blue); font-size: 13px; font-weight: 700; }
.header-actions a:hover, .header-actions a:focus-visible { border-color: var(--admin-blue); background: #f1f7fb; }

.overview-layout { width: min(1180px, calc(100% - 40px)); margin: 24px auto 48px; }
.club-band { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 360px); gap: 24px; padding: 28px; background: var(--color-primary); border: 1px solid var(--admin-line); border-radius: 8px; box-shadow: var(--admin-shadow); }
.club-band h1 { margin: 4px 0 8px; color: #fff; font-size: clamp(30px, 4vw, 46px); }
.club-band p { margin: 0; color: #fff; line-height: 1.55; }
.club-band .eyebrow { color: #eaf7dd; }
.club-notice { display: flex; align-items: flex-start; flex-direction: column; justify-content: center; gap: 6px; padding: 20px; border: 1px solid #e5d4aa; border-radius: 8px; background: #fff9e9; color: #573808; }
.club-notice span { font-size: 13px; line-height: 1.45; }
.eyebrow { margin: 0; color: var(--admin-muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
.metric-card { display: flex; align-items: baseline; min-height: 82px; padding: 18px; gap: 10px; background: var(--admin-panel); border: 1px solid var(--admin-line); border-radius: 8px; }
.metric-card strong { color: var(--color-primary-dark); font-size: 32px; line-height: 1; }
.metric-card span { color: var(--admin-muted); font-size: 13px; }

.dashboard-section, .endpoint-section { margin-top: 28px; }
.section-header { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.section-header h2 { margin: 4px 0 0; font-size: 24px; }
.section-header > p { max-width: 460px; margin: 0; color: var(--admin-muted); font-size: 13px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 14px; }
.portal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.portal-card { min-height: 180px; }
.dashboard-card { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 16px; min-height: 214px; padding: 20px; background: var(--admin-panel); border: 1px solid var(--admin-line); border-radius: 8px; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.dashboard-card:hover, .dashboard-card:focus-visible { border-color: #9fc77c; box-shadow: 0 12px 28px rgb(23 35 29 / 8%); transform: translateY(-2px); outline: none; }
.endpoint-symbol { display: grid; place-items: center; width: 80px; height: 80px; border-radius: 18px; background: #eaf4e1; color: var(--color-primary-dark); font-size: 13px; font-weight: 900; }
.endpoint-symbol--post { background: #e4f1fa; color: #135d8e; }
.card-copy { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 8px; }
.card-copy strong { color: var(--color-primary-dark); font-size: 17px; }
.card-copy code { max-width: 100%; color: var(--admin-ink); font-size: 12px; overflow-wrap: anywhere; }
.card-copy > span:last-child { color: var(--admin-muted); font-size: 13px; line-height: 1.5; }

.endpoint-list { display: grid; gap: 18px; margin-top: 14px; }
.endpoint-page { min-height: calc(100vh - 170px); }
.back-link { display: inline-flex; margin: 0 0 14px; color: var(--admin-blue); font-size: 13px; font-weight: 800; }
.back-link:hover { text-decoration: underline; }
.endpoint-hero { align-items: center; }
.endpoint-route { display: flex; min-width: 0; align-items: center; gap: 12px; padding: 20px; border-radius: 8px; background: #fff; }
.endpoint-route code { overflow-wrap: anywhere; }
.endpoint-detail { scroll-margin-top: 20px; overflow: hidden; background: var(--admin-panel); border: 1px solid var(--admin-line); border-radius: 8px; box-shadow: 0 8px 24px rgb(23 35 29 / 5%); }
.endpoint-detail--page { margin-top: 20px; }
.endpoint-detail:target { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgb(106 166 47 / 14%); }
.endpoint-detail > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--admin-line); background: #fafbfa; }
.endpoint-detail > header > div { display: flex; align-items: center; min-width: 0; gap: 12px; }
.endpoint-detail > header code { overflow-wrap: anywhere; }
.method { flex: 0 0 auto; padding: 5px 9px; border-radius: 5px; background: #eaf4e1; color: var(--color-primary-dark); font-size: 11px; font-weight: 900; }
.method--post { background: #e4f1fa; color: #135d8e; }
.scope { flex: 0 0 auto; color: var(--admin-muted); font-size: 12px; font-weight: 700; }
.endpoint-body { padding: 22px; }
.endpoint-body h3 { margin: 0 0 8px; color: var(--color-primary-dark); }
.endpoint-body > p { margin: 0 0 12px; color: var(--admin-muted); line-height: 1.6; }
.endpoint-note { padding: 12px 14px; border-left: 4px solid var(--color-primary); background: #f4f8f1; color: var(--admin-ink) !important; font-size: 13px; }
.example-page-action { margin: 16px 0 0; }
.example-page-action a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 15px; border: 1px solid var(--admin-blue); border-radius: 6px; color: var(--admin-blue); font-size: 13px; font-weight: 800; }
.example-page-action a:hover, .example-page-action a:focus-visible { background: #f1f7fb; }
.example-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.code-example { min-width: 0; overflow: hidden; border: 1px solid #26342e; border-radius: 8px; background: #17231d; color: #edf5ef; }
.code-example > div { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid #34463d; font-size: 12px; }
.code-example button { padding: 5px 8px; border: 1px solid #607269; border-radius: 5px; background: transparent; color: #fff; cursor: pointer; font-size: 11px; }
.code-example button:hover, .code-example button:focus-visible { border-color: #a8cc8b; color: #cdeab8; }
pre { margin: 0; padding: 16px; overflow: auto; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 22px max(20px, calc((100% - 1180px) / 2)); border-top: 1px solid var(--admin-line); background: #fff; color: var(--admin-muted); font-size: 12px; }
footer a { color: var(--admin-blue); font-weight: 700; }

@media (max-width: 900px) {
    .app-header { grid-template-columns: 1fr auto; padding: 0 20px; }
    .header-context { display: none; }
    .club-band { grid-template-columns: 1fr; }
    .endpoint-route { width: 100%; }
    .metric-grid, .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .example-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
    .app-header { min-height: auto; padding: 12px 16px; }
    .brand-mark { width: 38px; height: 38px; font-size: 12px; }
    .header-actions a:last-child { display: none; }
    .overview-layout { width: min(100% - 24px, 1180px); margin-top: 12px; }
    .club-band { padding: 20px; }
    .metric-grid, .dashboard-grid { grid-template-columns: 1fr; }
    .metric-card { min-height: 68px; }
    .dashboard-card { min-height: 0; }
    .section-header { align-items: flex-start; flex-direction: column; }
    .endpoint-detail > header { align-items: flex-start; flex-direction: column; }
    .scope { align-self: flex-start; }
    footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .dashboard-card { transition: none; }
}
