/* The console's look, from the "Admin" board of the online mockups:
   the app's cold grey, white cards, thin borders. Light and dark follow
   the device. */
:root {
  --bg: #F6F5FA; --surface: #FFFFFF; --border: #E4E2EE; --text: #1E1A3A;
  --muted: #5E5880; --s2: #ECEAF3; --s3: #E1DFEA; --grid: #ECEAF3;
  --a1: #2A6CD2; --a2: #C2620F;
  --ok: #23794A; --ok-soft: #DDF0E4; --warn: #B4500F; --warn-soft: #FCE9DC;
  --bad: #C23B25; --bad-soft: #FBE3DE; --info: #6A4BCF; --info-soft: #ECE7FB;
  --lvl-easy: #2C8540; --lvl-medium: #2A6CD2; --lvl-hard: #B87800;
  --lvl-expert: #C2620F; --lvl-master: #C23B25;
  --shadow: 0 1px 3px rgba(30, 26, 58, .12);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111114; --surface: #1B1B20; --border: #2E2E36; --text: #F3F2F7;
    --muted: #A9A6B8; --s2: #24242B; --s3: #33333C; --grid: #2E2E36;
    --a1: #6AA5FF; --a2: #F2B13C;
    --ok: #5CC98A; --ok-soft: #17311F; --warn: #FF8A4C; --warn-soft: #3A2416;
    --bad: #FF7A63; --bad-soft: #3A1F1B; --info: #B79CFF; --info-soft: #29233F;
    --lvl-easy: #5CC98A; --lvl-medium: #6AA5FF; --lvl-hard: #F2B13C;
    --lvl-expert: #FF8A4C; --lvl-master: #FF7A63;
    --shadow: 0 1px 3px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 600 15px/1.45 Figtree, system-ui, sans-serif; }
h1, h2, h3 { margin: 0; font-family: 'Bricolage Grotesque', Figtree, sans-serif; font-weight: 800; }
h1 { font-size: 30px; }
h2 { font-size: 18px; }
h2.big { font-size: 22px; }
h3 { font-size: 18px; }
code { font: 500 .9em 'JetBrains Mono', monospace; }
.page { max-width: 1360px; margin: 0 auto; padding: 24px 16px 48px; }
main { display: flex; flex-direction: column; gap: 20px; }

.eyebrow { font: 700 12px 'JetBrains Mono', monospace; letter-spacing: .06em; color: var(--muted); }
.muted, .note { color: var(--muted); }
.note { font-size: 13px; font-weight: 600; margin: 0; }
.error { color: var(--bad); font-weight: 700; margin: 0; }
.banner { background: var(--bad-soft); padding: 12px 16px; border-radius: 14px; }

.top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.top .title { flex: 1 1 320px; min-width: 0; }
.top h1 { margin-top: 2px; }
.pill { height: 32px; padding: 0 12px; border-radius: 16px; font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; gap: 6px; background: var(--s2); color: var(--muted); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 22px; background: var(--s2); }
.tabs button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 18px; background: transparent; color: var(--text); font: 800 14px Figtree, sans-serif; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); box-shadow: var(--shadow); }
button.ghost { min-height: 44px; min-width: 44px; padding: 0 12px; border: 1.5px solid var(--border); border-radius: 22px; background: var(--surface); color: var(--text); font: 700 14px Figtree, sans-serif; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--a1); outline-offset: 2px; }

.grid { display: grid; gap: 12px; }
.insights { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.two { grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); }
.three { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.section-head { margin-top: 8px; }

.card { border-radius: 20px; background: var(--surface); border: 1.5px solid var(--border); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; }
.card-head > h2, .card-head > h3 { flex-grow: 1; }
.legend { font-size: 13px; font-weight: 700; }
.legend.a1 { color: var(--a1); }
.legend.a2 { color: var(--a2); }
.figure { font: 800 22px 'Bricolage Grotesque', sans-serif; }

.insight { border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.insight .kind { font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.insight .head { font: 800 17px/1.25 'Bricolage Grotesque', sans-serif; }
.insight .body { font-size: 14px; color: var(--muted); }
.tone-bad { background: var(--bad-soft); } .tone-bad .kind { color: var(--bad); }
.tone-warn { background: var(--warn-soft); } .tone-warn .kind { color: var(--warn); }
.tone-ok { background: var(--ok-soft); } .tone-ok .kind { color: var(--ok); }
.tone-info { background: var(--info-soft); } .tone-info .kind { color: var(--info); }

.kpi { border-radius: 18px; background: var(--surface); border: 1.5px solid var(--border); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi .label { font-size: 13px; font-weight: 700; color: var(--muted); }
.kpi .value { font: 800 28px 'Bricolage Grotesque', sans-serif; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi .delta { font-size: 13px; font-weight: 800; color: var(--muted); }
.kpi .delta.up { color: var(--ok); }
.kpi .delta.down { color: var(--bad); }
.kpi svg { width: 100%; height: 48px; }

.chart { width: 100%; height: 200px; display: block; }
.chart.small { height: 72px; }
.axis { display: flex; justify-content: space-between; font: 500 12px 'JetBrains Mono', monospace; color: var(--muted); }

.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row .line { display: flex; gap: 10px; font-size: 14px; font-weight: 700; }
.bar-row .line span:first-child { flex-grow: 1; }
.bar-row .value { font-variant-numeric: tabular-nums; }
.track { height: 10px; border-radius: 5px; background: var(--s3); margin-top: 4px; overflow: hidden; }
.track > div { height: 100%; border-radius: 5px; background: var(--a1); }
.track.a2 > div { background: var(--a2); }

.strip { display: flex; height: 22px; border-radius: 11px; overflow: hidden; background: var(--s3); }
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; padding: 6px 0; border-bottom: 1.5px solid var(--border); }
.row:last-child { border-bottom: 0; }
.row .label { flex-grow: 1; color: var(--muted); }
.row .value { font-variant-numeric: tabular-nums; text-align: right; }
.swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.row.plain .label { color: var(--text); }

.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 700px; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-size: 12px; letter-spacing: .04em; font-weight: 800; padding: 8px 6px; text-transform: uppercase; }
th.num, td.num { text-align: right; }
th.wide { width: 36%; }
td { padding: 9px 6px; border-top: 1.5px solid var(--border); font-variant-numeric: tabular-nums; }
td.name { font-weight: 800; white-space: nowrap; }
td.name .swatch { display: inline-block; margin-right: 8px; }
.plays { display: flex; align-items: center; gap: 8px; }
.plays .fill { height: 8px; border-radius: 4px; min-width: 2px; }
.up { color: var(--ok); } .down { color: var(--bad); }
td.bad { color: var(--bad); font-weight: 800; }

.todo ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.todo li { font-size: 14px; }

.tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px 16px; }
.tables .row { border: 0; padding: 2px 0; }
.tables .label { font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.health .row .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
.health .row .label { color: var(--text); }
.health .row .value { color: var(--muted); }
footer { text-align: center; }

.empty { color: var(--muted); font-size: 14px; padding: 8px 0; }

/* Sign-in */
.login { min-height: 80vh; display: grid; place-items: center; }
.login-card { width: min(420px, 100%); }
.login-card label { font-size: 14px; font-weight: 700; }
.login-card input[type=password] { min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--bg); color: var(--text); font: 600 15px Figtree, sans-serif; }
.login-card .check { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--muted); }
.login-card .check input { width: 18px; height: 18px; }
button.primary { min-height: 48px; border: 0; border-radius: 24px; background: var(--text); color: var(--bg); font: 800 15px Figtree, sans-serif; cursor: pointer; }

@media (max-width: 520px) {
  h1 { font-size: 26px; }
  .kpi .value { font-size: 24px; }
}
