/* ==========================================================================
   hoops-fixtures – design system
   Brand tokens default to FIBA Basketball Champions League; overridden at
   runtime from Settings (--brand-*).
   ========================================================================== */

:root {
    --brand-primary: #0A153F;
    --brand-ink: #111720;
    --brand-accent: #60C0CA;
    --brand-accent-ink: #0A153F;

    --font-display: "BrandDisplay", "Chakra Petch", "Mona Sans", system-ui, sans-serif;
    --font-body: "Mona Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

    --bg: #F4F5F7;
    --surface: #FFFFFF;
    --surface-2: #F8F9FB;
    --surface-3: #EEF0F4;
    --line: #E3E5EA;
    --line-strong: #CED0D9;
    --text: #111720;
    --text-2: #4A5060;
    --text-3: #747679;
    --focus: color-mix(in srgb, var(--brand-accent) 55%, transparent);

    --side-bg: var(--brand-primary);
    --side-bg-2: #0D1A4A;
    --side-text: #C9CFE0;
    --side-text-strong: #FFFFFF;

    --ok: #2F9E6B;
    --ok-bg: #E6F6EE;
    --warn: #C77C02;
    --warn-bg: #FFF4DB;
    --bad: #D93644;
    --bad-bg: #FDE8EA;
    --info: #2C6ECB;
    --info-bg: #E7F0FD;

    /* availability levels */
    --lv-unavailable: #E5484D;
    --lv-low: #F5A524;
    --lv-very_low: #F2D45C;
    --lv-potential: #FF8F8F;
    --lv-preferred: #46A758;

    --radius-s: 6px;
    --radius: 10px;
    --radius-l: 14px;
    --shadow-1: 0 1px 2px rgba(10, 21, 63, .06), 0 1px 1px rgba(10, 21, 63, .04);
    --shadow-2: 0 6px 24px rgba(10, 21, 63, .10), 0 2px 6px rgba(10, 21, 63, .06);
    --shadow-3: 0 18px 60px rgba(10, 21, 63, .22);
    --side-w: 248px;
    --top-h: 60px;
    --ease: cubic-bezier(.2, .8, .2, 1);
    color-scheme: light;
}

:root[data-theme="dark"] {
    --bg: #0B0F17;
    --surface: #121826;
    --surface-2: #161D2D;
    --surface-3: #1C2436;
    --line: #232C40;
    --line-strong: #2F3A52;
    --text: #E8EAF0;
    --text-2: #A9B0C2;
    --text-3: #7C849A;
    --side-bg: #080C14;
    --side-bg-2: #0E1422;
    --ok-bg: #12291F;
    --warn-bg: #2B2210;
    --bad-bg: #2E1418;
    --info-bg: #13213A;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 6px 24px rgba(0, 0, 0, .45);
    color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0B0F17;
        --surface: #121826;
        --surface-2: #161D2D;
        --surface-3: #1C2436;
        --line: #232C40;
        --line-strong: #2F3A52;
        --text: #E8EAF0;
        --text-2: #A9B0C2;
        --text-3: #7C849A;
        --side-bg: #080C14;
        --side-bg-2: #0E1422;
        --ok-bg: #12291F;
        --warn-bg: #2B2210;
        --bad-bg: #2E1418;
        --info-bg: #13213A;
        --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
        --shadow-2: 0 6px 24px rgba(0, 0, 0, .45);
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font: 400 14px/1.5 var(--font-body);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "tnum" 1, "cv11" 1;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--brand-accent) 35%, transparent); }

.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 15px; height: 15px; }
.i-lg { width: 22px; height: 22px; }

h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
.display { font-family: var(--font-display); font-weight: 600; letter-spacing: .01em; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.mono { font-family: var(--font-mono); font-size: .92em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-s { display: flex; flex-direction: column; gap: 6px; }
.spacer { flex: 1; }

/* ------------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.side {
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column;
    background: linear-gradient(180deg, var(--side-bg) 0%, var(--side-bg-2) 100%);
    color: var(--side-text);
    border-right: 1px solid rgba(255, 255, 255, .04);
    z-index: 30;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; min-height: 76px; }
.side-brand img { height: 40px; width: auto; }
.side-brand .wordmark { font-family: var(--font-display); color: #fff; font-size: 17px; line-height: 1.05; text-transform: uppercase; letter-spacing: .02em; }
.side-brand .wordmark small { display: block; color: var(--brand-accent); font-size: 10px; letter-spacing: .14em; }
.side-context { margin: 0 12px 10px; padding: 10px 12px; border-radius: var(--radius); background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07); cursor: pointer; transition: background .15s; }
.side-context:hover { background: rgba(255, 255, 255, .09); }
.side-context .lbl { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-accent); }
.side-context .val { color: #fff; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.side-nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.nav-sec { margin: 14px 10px 6px; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: rgba(201, 207, 224, .55); }
.nav-link { position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 10px; margin: 1px 0; border-radius: 8px; color: var(--side-text); font-weight: 500; transition: background .15s, color .15s; }
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-link.is-active { background: rgba(96, 192, 202, .14); color: #fff; }
.nav-link.is-active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand-accent); }
.nav-link.is-active .i { color: var(--brand-accent); }
.nav-link .badge { margin-left: auto; }
.side-foot { padding: 12px 14px; border-top: 1px solid rgba(255, 255, 255, .06); display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; background: var(--brand-accent); color: var(--brand-accent-ink); flex: none; }
.side-foot .who { color: #fff; font-weight: 600; font-size: 13px; line-height: 1.2; }
.side-foot .role { font-size: 11px; color: var(--side-text); text-transform: capitalize; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
    position: sticky; top: 0; z-index: 20;
    height: var(--top-h); display: flex; align-items: center; gap: 12px;
    padding: 0 24px;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid var(--line);
}
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 13px; min-width: 0; }
.crumbs b { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-trigger { margin-left: auto; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px 0 12px; width: 300px; max-width: 34vw; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text-3); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.search-trigger:hover { border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.search-trigger span { flex: 1; text-align: left; }
kbd { font: 600 11px var(--font-body); padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2); }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.menu-toggle { display: none; }

.content { padding: 24px; max-width: 1680px; width: 100%; margin: 0 auto; }
.content.wide { max-width: none; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: .01em; }
.page-head p { margin: 4px 0 0; color: var(--text-3); max-width: 760px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-accent); font-weight: 700; margin-bottom: 6px; }
:root:not([data-theme="dark"]) .eyebrow { color: color-mix(in srgb, var(--brand-accent) 60%, var(--brand-primary)); }

/* ---------------------------------------------------------------- buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line-strong);
    background: var(--surface); color: var(--text); font-weight: 600; font-size: 13.5px;
    cursor: pointer; white-space: nowrap; user-select: none;
    transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--brand-primary) 85%, #fff); border-color: transparent; }
:root[data-theme="dark"] .btn-primary { background: var(--brand-accent); border-color: var(--brand-accent); color: var(--brand-accent-ink); }
.btn-accent { background: var(--brand-accent); border-color: var(--brand-accent); color: var(--brand-accent-ink); }
.btn-accent:hover { background: color-mix(in srgb, var(--brand-accent) 85%, #fff); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); border-color: transparent; }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); border-color: var(--bad); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; gap: 6px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; border-radius: 11px; }
.btn-icon { width: 36px; padding: 0; }
.btn-sm.btn-icon { width: 30px; }
.btn-group { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; background: var(--surface); }
.btn-group a, .btn-group button { height: 34px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; font-weight: 600; font-size: 13px; color: var(--text-2); cursor: pointer; }
.btn-group > * + * { border-left: 1px solid var(--line) !important; }
.btn-group .is-on { background: var(--brand-primary); color: #fff; }
:root[data-theme="dark"] .btn-group .is-on { background: var(--brand-accent); color: var(--brand-accent-ink); }

/* ------------------------------------------------------------------ cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow-1); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { font-size: 14.5px; font-weight: 700; }
.card-head .sub { color: var(--text-3); font-size: 12.5px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; background: var(--surface-2); border-radius: 0 0 var(--radius-l) var(--radius-l); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }

.hero {
    position: relative; overflow: hidden; border-radius: var(--radius-l); padding: 26px 28px;
    color: #fff; background:
        radial-gradient(900px 300px at 100% 0%, color-mix(in srgb, var(--brand-accent) 35%, transparent), transparent 60%),
        linear-gradient(135deg, var(--brand-primary), var(--brand-ink));
    box-shadow: var(--shadow-2);
}
.hero::after { content: ""; position: absolute; right: -60px; bottom: -90px; width: 320px; height: 320px; border-radius: 50%; border: 36px solid rgba(255,255,255,.04); }
.hero h1 { font-family: var(--font-display); font-size: 30px; font-weight: 600; }
.hero p { color: rgba(255, 255, 255, .72); margin: 6px 0 0; }
.hero .hero-logo { height: 54px; width: auto; }

.kpi { padding: 16px 18px; }
.kpi .lbl { color: var(--text-3); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.kpi .val { font-family: var(--font-display); font-size: 30px; font-weight: 600; margin-top: 4px; line-height: 1.1; }
.kpi .meta { color: var(--text-3); font-size: 12.5px; margin-top: 4px; }

/* ---------------------------------------------------------------- badges */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-brand { background: color-mix(in srgb, var(--brand-accent) 18%, transparent); color: color-mix(in srgb, var(--brand-accent) 55%, var(--text)); }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; user-select: none; transition: all .15s; }
.chip:hover { border-color: var(--text-3); color: var(--text); }
.chip.is-on { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
:root[data-theme="dark"] .chip.is-on { background: var(--brand-accent); color: var(--brand-accent-ink); border-color: var(--brand-accent); }
.chip .sw { width: 10px; height: 10px; border-radius: 3px; }
.flag { display: inline-grid; place-items: center; min-width: 30px; height: 18px; padding: 0 4px; border-radius: 4px; font-size: 10px; font-weight: 800; letter-spacing: .04em; background: var(--surface-3); color: var(--text-2); }
.gtag { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-weight: 800; font-size: 11.5px; color: #fff; background: var(--g, var(--brand-primary)); }

/* ------------------------------------------------------------------ forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.input, .select, textarea.input {
    height: 38px; width: 100%; padding: 0 12px; border-radius: 9px;
    border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus { outline: none; border-color: var(--brand-accent); box-shadow: 0 0 0 3px var(--focus); }
.input-sm, .select-sm { height: 30px; font-size: 13px; padding: 0 9px; border-radius: 7px; }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23747679' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
.input-icon { position: relative; }
.input-icon .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 36px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.switch { position: relative; display: inline-flex; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--brand-accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--surface-3); }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: all .15s; }
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.range { width: 100%; accent-color: var(--brand-accent); }

/* ----------------------------------------------------------------- tables */
.table-wrap { overflow: auto; border-radius: 0 0 var(--radius-l) var(--radius-l); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th { position: sticky; top: 0; z-index: 1; text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); background: var(--surface-2); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-compact td { padding: 7px 12px; }
.table a.link { font-weight: 600; }
.table a.link:hover { color: var(--info); }
.club-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.club-logo { width: 26px; height: 26px; border-radius: 7px; flex: none; display: grid; place-items: center; font-size: 10px; font-weight: 800; color: #fff; background: var(--brand-primary); overflow: hidden; }
.club-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

/* ------------------------------------------------------------------ alert */
.alert { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid; font-size: 13.5px; }
.alert .i { margin-top: 1px; }
.alert-info { background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: var(--text); }
.alert-info .i { color: var(--info); }
.alert-warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.alert-warn .i { color: var(--warn); }
.alert-bad { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.alert-bad .i { color: var(--bad); }
.alert-ok { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.alert-ok .i { color: var(--ok); }
.alert b { font-weight: 700; }
.empty { padding: 48px 24px; text-align: center; color: var(--text-3); }
.empty .i { width: 40px; height: 40px; color: var(--line-strong); margin: 0 auto 12px; }
.empty h3 { color: var(--text); font-size: 16px; margin-bottom: 6px; }
.empty p { margin: 0 auto 16px; max-width: 420px; }

/* ----------------------------------------------------------------- toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; min-width: 280px; max-width: 420px; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 11px; background: var(--brand-ink); color: #fff; box-shadow: var(--shadow-3); font-size: 13.5px; animation: toast-in .25s var(--ease); }
.toast .i { margin-top: 1px; }
.toast.ok .i { color: #6EE7B7; }
.toast.bad .i { color: #FF8F8F; }
.toast.warn .i { color: #F5C451; }
.toast.out { animation: toast-out .2s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ---------------------------------------------------------- dialog/popup */
dialog.modal { padding: 0; border: 0; border-radius: var(--radius-l); background: var(--surface); color: var(--text); box-shadow: var(--shadow-3); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 64px); }
dialog.modal::backdrop { background: rgba(8, 12, 22, .55); backdrop-filter: blur(3px); }
dialog.modal[open] { animation: pop .2s var(--ease); }
dialog.modal-lg { width: min(860px, calc(100vw - 32px)); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 20px; overflow: auto; max-height: calc(100vh - 200px); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }

.menu { position: fixed; z-index: 90; min-width: 220px; padding: 6px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); animation: pop .12s var(--ease); }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: none; text-align: left; font-size: 13.5px; cursor: pointer; color: var(--text); }
.menu button:hover, .menu a:hover, .menu .is-hl { background: var(--surface-3); }
.menu .sep { height: 1px; margin: 5px 4px; background: var(--line); }
.menu .menu-title { padding: 6px 10px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); font-weight: 700; }
.menu .delta { margin-left: auto; font-weight: 700; font-size: 12px; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--bad); }

/* ------------------------------------------------------- command palette */
.palette { width: min(640px, calc(100vw - 32px)); margin-top: 12vh; }
.palette .p-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.palette .p-input input { flex: 1; border: 0; background: transparent; outline: none; font-size: 16px; }
.palette .p-list { max-height: 380px; overflow: auto; padding: 6px; }
.palette .p-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.palette .p-item .k { margin-left: auto; color: var(--text-3); font-size: 12px; }
.palette .p-item.is-hl { background: var(--surface-3); }
.palette .p-group { padding: 8px 12px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); font-weight: 700; }

/* ----------------------------------------------------------- level chips */
.lv { --c: var(--line-strong); }
.lv-unavailable { --c: var(--lv-unavailable); }
.lv-low { --c: var(--lv-low); }
.lv-very_low { --c: var(--lv-very_low); }
.lv-potential { --c: var(--lv-potential); }
.lv-preferred { --c: var(--lv-preferred); }
.lv-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--c); display: inline-block; flex: none; }

/* ------------------------------------------------------ availability grid */
.matrix-wrap { overflow: auto; max-height: calc(100vh - 230px); border-radius: 0 0 var(--radius-l) var(--radius-l); }
.matrix { border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.matrix th, .matrix td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.matrix thead th { position: sticky; z-index: 3; background: var(--surface-2); font-weight: 700; color: var(--text-2); padding: 0; }
.matrix thead tr:first-child th { top: 0; height: 30px; font-size: 12px; }
.matrix thead tr:nth-child(2) th { top: 30px; height: 38px; font-size: 11px; font-weight: 600; line-height: 1.15; }
.matrix .sticky-col { position: sticky; left: 0; z-index: 2; background: var(--surface); min-width: 250px; max-width: 250px; padding: 0 12px; text-align: left; }
.matrix thead .sticky-col { z-index: 4; background: var(--surface-2); }
.matrix .gd-head { text-align: center; letter-spacing: .04em; }
.matrix .gd-head.alt { background: var(--surface-3); }
.matrix td.cell { width: 44px; min-width: 44px; height: 32px; text-align: center; cursor: pointer; position: relative; transition: filter .1s; }
.matrix td.cell:hover { filter: brightness(.94); box-shadow: inset 0 0 0 2px var(--brand-accent); }
.matrix td.cell[data-level] { background: color-mix(in srgb, var(--c) 78%, var(--surface)); }
.matrix td.cell[data-level="unavailable"]::after { content: "✕"; color: #fff; font-weight: 800; font-size: 11px; }
.matrix td.cell[data-level="preferred"]::after { content: "★"; color: #fff; font-size: 11px; }
.matrix td.cell.gd-end { border-right: 2px solid var(--line-strong); }
.matrix td.cell.has-note::before { content: ""; position: absolute; top: 3px; right: 3px; width: 5px; height: 5px; border-radius: 50%; background: var(--brand-primary); }
.matrix tr.grp-row td { background: var(--surface-2); font-weight: 700; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); height: 28px; padding: 0 12px; position: sticky; left: 0; }
.matrix tr.is-dim { opacity: .45; }
.brushes { display: flex; gap: 6px; flex-wrap: wrap; }
.brush { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 8px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; font-size: 12.5px; cursor: pointer; transition: all .15s; }
.brush .lv-dot { width: 16px; height: 16px; border-radius: 5px; }
.brush kbd { margin-left: 2px; }
.brush.is-on { border-color: var(--text); box-shadow: 0 0 0 2px var(--focus); }

/* ---------------------------------------------------------- schedule board */
.board-shell { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.board-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.scorebar { display: flex; align-items: stretch; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow-1); margin-bottom: 14px; overflow: hidden; }
.scorebar > div { padding: 12px 18px; border-right: 1px solid var(--line); }
.scorebar > div:last-child { border-right: 0; }
.scorebar .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); font-weight: 700; }
.scorebar .val { font-family: var(--font-display); font-size: 22px; font-weight: 600; line-height: 1.2; }
.scorebar .val.ok { color: var(--ok); }
.scorebar .val.bad { color: var(--bad); }
.scorebar .title { flex: 1; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.scorebar .title b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.gd-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow-1); margin-bottom: 14px; overflow: hidden; }
.gd-block-head { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.gd-block-head .gd-no { font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.gd-block-head .gd-groups { display: flex; gap: 4px; }
.gd-days { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; }
.gd-day { min-height: 80px; padding: 10px; border-right: 1px solid var(--line); transition: background .15s; }
.gd-day:last-child { border-right: 0; }
.gd-day.drop-ok { background: color-mix(in srgb, var(--brand-accent) 10%, transparent); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand-accent) 45%, transparent); }
.gd-day-head { display: flex; align-items: baseline; gap: 8px; margin: 0 2px 8px; }
.gd-day-head b { font-size: 13px; }
.gd-day-head .count { margin-left: auto; font-size: 12px; color: var(--text-3); font-weight: 600; }
.gd-day-head .count.off { color: var(--bad); }
.matches { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }

.match {
    position: relative; display: grid; grid-template-columns: 4px 46px 1fr auto; align-items: center; gap: 0 10px;
    padding: 8px 10px 8px 0; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
    cursor: grab; transition: box-shadow .15s, border-color .15s, transform .15s, opacity .15s; user-select: none;
}
.match:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2); }
.match .bar { align-self: stretch; border-radius: 10px 0 0 10px; background: var(--g, var(--brand-primary)); margin: -8px 0; }
.match .time { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--text-2); text-align: center; line-height: 1.15; }
.match .time small { display: block; font-family: var(--font-body); font-size: 10px; color: var(--text-3); font-weight: 700; }
.match .teams { min-width: 0; line-height: 1.3; }
.match .team { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match .team.away { color: var(--text-2); font-weight: 500; }
.match .team .flag { min-width: 28px; height: 16px; font-size: 9.5px; }
.match .side-icons { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.match .issue-dot { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; }
.match .issue-dot.hard { background: var(--bad); }
.match .issue-dot.soft { background: var(--warn); }
.match.is-locked { background: repeating-linear-gradient(135deg, var(--surface), var(--surface) 8px, var(--surface-2) 8px, var(--surface-2) 16px); }
.match.is-locked .lock { color: var(--text-2); }
.match .lock { color: transparent; }
.match.is-hard { border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--bad) 25%, transparent); }
.match.is-hl { border-color: var(--brand-accent); box-shadow: 0 0 0 3px var(--focus); transform: translateY(-1px); }
.match.is-dim { opacity: .3; }
.match.dragging { opacity: .4; transform: scale(.98); }
.match.flash { animation: flash 1.2s var(--ease); }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-accent) 60%, transparent); } }

.issues-panel { position: sticky; top: calc(var(--top-h) + 16px); max-height: calc(100vh - var(--top-h) - 32px); display: flex; flex-direction: column; }
.issues-panel .card-body { overflow: auto; padding: 8px; }
.issue { display: flex; gap: 10px; padding: 9px 10px; border-radius: 9px; cursor: pointer; font-size: 13px; transition: background .12s; }
.issue:hover, .issue.is-on { background: var(--surface-3); }
.issue .sev { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
.issue .sev.hard { background: var(--bad); }
.issue .sev.soft { background: var(--warn); }
.issue .cost { margin-left: auto; font-weight: 700; color: var(--text-3); font-size: 12px; white-space: nowrap; }
.rule-sum { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.rule-sum:hover, .rule-sum.is-on { background: var(--surface-3); }
.rule-sum .bar { flex: 1; height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.rule-sum .bar i { display: block; height: 100%; background: var(--warn); border-radius: 4px; }

/* team × game-day matrix */
.tm { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12.5px; }
.tm th { position: sticky; top: 0; background: var(--surface-2); z-index: 2; padding: 8px 6px; font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--line); }
.tm td { padding: 4px; border-bottom: 1px solid var(--line); text-align: center; }
.tm td.team-col { text-align: left; padding: 6px 12px; white-space: nowrap; font-weight: 600; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.tm .ha { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 96px; height: 30px; padding: 0 8px; border-radius: 8px; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: all .12s; }
.tm .ha.H { background: color-mix(in srgb, var(--brand-primary) 10%, var(--surface)); color: var(--text); }
:root[data-theme="dark"] .tm .ha.H { background: color-mix(in srgb, var(--brand-accent) 18%, var(--surface)); }
.tm .ha.A { background: var(--surface-2); color: var(--text-2); }
.tm .ha b { font-size: 10.5px; font-weight: 800; width: 16px; height: 16px; border-radius: 4px; display: grid; place-items: center; background: var(--brand-primary); color: #fff; }
.tm .ha.A b { background: var(--text-3); }
.tm .ha:hover { border-color: var(--brand-accent); }
.tm .ha.bad { box-shadow: inset 0 0 0 2px var(--bad); }
.tm .ha.soft { box-shadow: inset 0 0 0 2px var(--warn); }
.tm tr.grp-sep td { padding: 0; height: 6px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.streak { display: inline-flex; gap: 2px; }
.streak i { width: 7px; height: 14px; border-radius: 2px; background: var(--line-strong); }
.streak i.H { background: var(--brand-primary); }
:root[data-theme="dark"] .streak i.H { background: var(--brand-accent); }

/* --------------------------------------------------------------- groups UI */
.groups-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.group-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow-1); overflow: hidden; }
.group-card-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.group-card-head .gtag { width: 30px; height: 30px; font-size: 15px; border-radius: 8px; }
.group-slot { min-height: 160px; padding: 8px; display: flex; flex-direction: column; gap: 6px; transition: background .15s; }
.group-slot.drop-ok { background: color-mix(in srgb, var(--brand-accent) 10%, transparent); }
.club-pill { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); cursor: grab; font-weight: 600; font-size: 13px; transition: box-shadow .15s; }
.club-pill:hover { box-shadow: var(--shadow-2); }
.club-pill .flag { margin-left: auto; }
.club-pill.dragging { opacity: .4; }
.gd-pattern { display: flex; gap: 4px; flex-wrap: wrap; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface-2); }
.gd-pattern label { position: relative; }
.gd-pattern input { position: absolute; opacity: 0; }
.gd-pattern span { display: inline-grid; place-items: center; min-width: 30px; height: 26px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--line-strong); font-size: 11.5px; font-weight: 700; color: var(--text-3); cursor: pointer; background: var(--surface); }
.gd-pattern input:checked + span { background: var(--g, var(--brand-primary)); border-color: transparent; color: #fff; }
.pool { position: sticky; top: calc(var(--top-h) + 16px); }

/* ------------------------------------------------------------ rules page */
.rule-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 170px 110px; gap: 16px; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.rule-row:last-child { border-bottom: 0; }
.rule-row.is-off .rule-main { opacity: .5; }
.rule-row h4 { font-size: 14px; margin-bottom: 2px; }
.rule-row p { margin: 0; font-size: 12.5px; color: var(--text-3); }
.rule-params { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.rule-params .param { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.rule-params .param input { width: 70px; }
.prio-hard { color: var(--bad); }
.prio-high { color: var(--warn); }

/* ---------------------------------------------------------- generator page */
.gen-hero { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.run-panel { position: relative; overflow: hidden; }
.run-overlay { position: absolute; inset: 0; z-index: 5; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(2px); }
.run-overlay.on { display: flex; }
.ring { width: 76px; height: 76px; }
.ring circle { fill: none; stroke-width: 6; }
.ring .bg { stroke: var(--surface-3); }
.ring .fg { stroke: var(--brand-accent); stroke-linecap: round; transform: rotate(-90deg); transform-origin: center; transition: stroke-dashoffset .3s linear; }
.fix-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.fix { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.fix .opts { font-weight: 700; font-size: 12.5px; color: var(--text-2); }
.meter { height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--brand-accent); border-radius: 4px; }
.scenario-best { box-shadow: inset 3px 0 0 var(--brand-accent); }

/* ----------------------------------------------------------- dashboard */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist .tick { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 2px solid var(--line-strong); color: transparent; }
.checklist .done .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.checklist .warn .tick { background: var(--warn); border-color: var(--warn); color: #fff; }
.checklist a { margin-left: auto; }
.timeline { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px; }
.tl-item { flex: 1 0 92px; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); text-align: center; }
.tl-item b { font-family: var(--font-display); font-size: 16px; display: block; }
.tl-item.past { opacity: .55; }
.tl-item.next { border-color: var(--brand-accent); box-shadow: 0 0 0 2px var(--focus); background: var(--surface); }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line); font-size: 13px; }
.activity li:last-child { border-bottom: 0; }
.activity .when { margin-left: auto; color: var(--text-3); font-size: 12px; white-space: nowrap; }
.level-bars { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--surface-3); }
.level-bars i { display: block; height: 100%; background: var(--c); }

/* ------------------------------------------------------------- import */
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 44px 24px; border: 2px dashed var(--line-strong); border-radius: var(--radius-l); background: var(--surface-2); text-align: center; cursor: pointer; transition: all .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--brand-accent); background: color-mix(in srgb, var(--brand-accent) 7%, var(--surface)); }
.dropzone .i { width: 38px; height: 38px; color: var(--brand-accent); }
.steps { display: flex; gap: 0; margin-bottom: 18px; }
.step { flex: 1; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 2px solid var(--line); color: var(--text-3); font-weight: 600; font-size: 13px; }
.step b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-size: 12px; }
.step.on { border-color: var(--brand-accent); color: var(--text); }
.step.on b { background: var(--brand-accent); color: var(--brand-accent-ink); }
.step.done b { background: var(--ok); color: #fff; }

/* ------------------------------------------------------------- login */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { position: relative; overflow: hidden; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; color: #fff;
    background: radial-gradient(800px 500px at 80% 20%, color-mix(in srgb, var(--brand-accent) 40%, transparent), transparent 60%), linear-gradient(160deg, var(--brand-primary), var(--brand-ink)); }
.auth-art::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 48px 48px; mask-image: radial-gradient(circle at 70% 40%, #000 0%, transparent 75%); }
.auth-art .court { position: absolute; right: -120px; bottom: -120px; width: 520px; height: 520px; border-radius: 50%; border: 2px solid rgba(255,255,255,.08); box-shadow: 0 0 0 60px rgba(255,255,255,.02), 0 0 0 120px rgba(255,255,255,.015); }
.auth-art h1 { font-family: var(--font-display); font-size: 44px; line-height: 1.05; font-weight: 600; position: relative; max-width: 520px; }
.auth-art p { position: relative; color: rgba(255,255,255,.7); max-width: 460px; font-size: 15px; }
.auth-art img { height: 64px; width: auto; position: relative; }
.auth-form { display: grid; place-items: center; padding: 32px; background: var(--surface); }
.auth-form form { width: min(380px, 100%); }
.auth-form h2 { font-size: 24px; margin-bottom: 6px; }

/* ------------------------------------------------------------- print */
@media print {
    .side, .top, .no-print, .issues-panel, .board-toolbar { display: none !important; }
    .shell { display: block; }
    body { background: #fff; color: #000; font-size: 11px; }
    .content { padding: 0; }
    .card, .gd-block { box-shadow: none; break-inside: avoid; }
    .board-shell { display: block; }
}

/* ---------------------------------------------------------- responsive */
@media (max-width: 1280px) {
    .board-shell, .grid-main, .gen-hero { grid-template-columns: 1fr; }
    .issues-panel { position: static; max-height: none; }
}
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .auth { grid-template-columns: 1fr; }
    .auth-art { display: none; }
}
@media (max-width: 860px) {
    .shell { grid-template-columns: 1fr; }
    .side { position: fixed; left: 0; top: 0; width: var(--side-w); transform: translateX(-100%); transition: transform .25s var(--ease); }
    .side.open { transform: none; box-shadow: var(--shadow-3); }
    .menu-toggle { display: grid; }
    .search-trigger { width: auto; }
    .search-trigger span, .search-trigger kbd { display: none; }
    .content { padding: 16px; }
    .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
    .rule-row { grid-template-columns: 44px 1fr; }
    .rule-row > :nth-child(3), .rule-row > :nth-child(4) { grid-column: 2; }
    .gd-days { grid-auto-flow: row; }
    .gd-day { border-right: 0; border-bottom: 1px solid var(--line); }
}
