/* ─────────────────────────────────────────────────────────────
   SFLL — League Management System
   Visual system. CSS variables drive palette / type / density.
   Theme tokens are switched via data-attrs on <html>.
───────────────────────────────────────────────────────────── */

:root {
  /* — Palette: "Pacific" (default) — */
  --bg:        oklch(0.985 0.003 252);
  --bg-2:      oklch(0.97  0.006 252);
  --bg-3:      oklch(0.945 0.008 252);
  --surface:   #ffffff;
  --ink:       oklch(0.22  0.030 252);
  --ink-2:     oklch(0.45  0.025 252);
  --ink-3:     oklch(0.62  0.020 252);
  --ink-4:     oklch(0.78  0.012 252);
  --border:    oklch(0.92  0.010 252);
  --border-2:  oklch(0.86  0.012 252);

  --primary:        oklch(0.30 0.10 254);
  --primary-hover:  oklch(0.26 0.11 254);
  --primary-ink:    #ffffff;
  --primary-soft:   oklch(0.95 0.025 254);
  --primary-soft-ink: oklch(0.34 0.10 254);

  --accent:       oklch(0.56 0.20 26);
  --accent-soft:  oklch(0.95 0.040 26);
  --accent-ink:   oklch(0.45 0.18 26);

  --success:      oklch(0.55 0.13 150);
  --success-soft: oklch(0.94 0.040 150);
  --warn:         oklch(0.62 0.14 70);
  --warn-soft:    oklch(0.96 0.040 70);
  --danger:       oklch(0.56 0.20 26);
  --danger-soft:  oklch(0.95 0.040 26);

  /* — Density: "Balanced" (default) — */
  --row-h: 44px;
  --pad-x: 16px;
  --pad-y: 12px;
  --gap:   12px;
  --gap-lg: 20px;
  --radius:    10px;
  --radius-sm: 6px;
  --radius-lg: 14px;

  /* — Type: "Humanist + Display" (default) — */
  --font-body:    "Instrument Sans", system-ui, -apple-system, sans-serif;
  --font-display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", monospace;
  --font-num:     "JetBrains Mono", ui-monospace, monospace;

  /* shadows */
  --shadow-sm: 0 1px 0 oklch(0.85 0.015 252 / 0.6), 0 1px 2px oklch(0.20 0.03 252 / 0.04);
  --shadow:    0 1px 0 oklch(0.85 0.015 252 / 0.6), 0 6px 18px oklch(0.20 0.03 252 / 0.08);
  --shadow-lg: 0 20px 50px oklch(0.20 0.03 252 / 0.16), 0 2px 6px oklch(0.20 0.03 252 / 0.08);

  --nav-w: 232px;
}

/* — Palette: "Civic" (sportier, brighter) — */
html[data-palette="civic"] {
  --bg:        oklch(0.985 0.005 84);   /* cream */
  --bg-2:      oklch(0.965 0.010 84);
  --bg-3:      oklch(0.935 0.014 84);
  --surface:   #ffffff;
  --ink:       oklch(0.20 0.030 254);
  --ink-2:     oklch(0.42 0.025 254);
  --ink-3:     oklch(0.60 0.018 254);
  --border:    oklch(0.90 0.014 84);
  --border-2:  oklch(0.84 0.018 84);
  --primary:        oklch(0.28 0.13 258);
  --primary-hover:  oklch(0.24 0.14 258);
  --primary-soft:   oklch(0.94 0.040 258);
  --primary-soft-ink: oklch(0.32 0.13 258);
  --accent:       oklch(0.52 0.22 28);
  --accent-soft:  oklch(0.94 0.060 28);
  --accent-ink:   oklch(0.45 0.20 28);
}

/* — Palette: "Fog" (cool, muted, very SF) — */
html[data-palette="fog"] {
  --bg:        oklch(0.985 0.003 230);
  --bg-2:      oklch(0.965 0.005 230);
  --bg-3:      oklch(0.94  0.008 230);
  --ink:       oklch(0.24 0.020 240);
  --ink-2:     oklch(0.46 0.018 240);
  --ink-3:     oklch(0.64 0.014 240);
  --border:    oklch(0.91 0.010 240);
  --primary:        oklch(0.42 0.08 240);
  --primary-hover:  oklch(0.36 0.09 240);
  --primary-soft:   oklch(0.94 0.025 240);
  --primary-soft-ink: oklch(0.42 0.08 240);
  --accent:       oklch(0.60 0.14 40);
  --accent-soft:  oklch(0.95 0.030 40);
  --accent-ink:   oklch(0.50 0.15 40);
}

/* — Palette: "Twilight" (warm dark) — */
html[data-palette="twilight"] {
  --bg:        oklch(0.18 0.012 256);
  --bg-2:      oklch(0.22 0.014 256);
  --bg-3:      oklch(0.26 0.016 256);
  --surface:   oklch(0.22 0.014 256);
  --ink:       oklch(0.96 0.008 80);
  --ink-2:     oklch(0.78 0.012 80);
  --ink-3:     oklch(0.60 0.014 80);
  --ink-4:     oklch(0.45 0.014 80);
  --border:    oklch(0.30 0.018 256);
  --border-2:  oklch(0.36 0.022 256);
  --primary:        oklch(0.78 0.13 78);   /* warm gold */
  --primary-hover:  oklch(0.82 0.14 78);
  --primary-ink:    oklch(0.20 0.03 78);
  --primary-soft:   oklch(0.30 0.05 78);
  --primary-soft-ink: oklch(0.85 0.10 78);
  --accent:       oklch(0.70 0.18 26);
  --accent-soft:  oklch(0.32 0.07 26);
  --accent-ink:   oklch(0.78 0.16 26);
  --success:      oklch(0.72 0.13 150);
  --success-soft: oklch(0.30 0.05 150);
  --warn:         oklch(0.78 0.13 70);
  --warn-soft:    oklch(0.32 0.05 70);
  --danger:       oklch(0.70 0.18 26);
  --danger-soft:  oklch(0.32 0.07 26);
  --shadow-sm: 0 1px 0 oklch(0.10 0 0 / 0.4);
  --shadow:    0 6px 18px oklch(0.05 0 0 / 0.4);
  --shadow-lg: 0 24px 50px oklch(0.04 0 0 / 0.6);
}

/* — Type variants — */
html[data-type="geometric"] {
  --font-body:    "Geist", system-ui, sans-serif;
  --font-display: "Geist", system-ui, sans-serif;
  --font-mono:    "Geist Mono", ui-monospace, monospace;
  --font-num:     "Geist Mono", ui-monospace, monospace;
}
html[data-type="humanist-plain"] {
  --font-body:    "Instrument Sans", system-ui, sans-serif;
  --font-display: "Instrument Sans", system-ui, sans-serif;
}
html[data-type="editorial"] {
  --font-body:    "Instrument Sans", system-ui, sans-serif;
  --font-display: "Newsreader", "Instrument Sans", serif;
}

/* — Density variants — */
html[data-density="compact"] {
  --row-h: 34px;
  --pad-x: 12px;
  --pad-y: 8px;
  --gap: 8px;
  --gap-lg: 14px;
  --radius: 8px;
  --radius-sm: 5px;
}
html[data-density="airy"] {
  --row-h: 56px;
  --pad-x: 22px;
  --pad-y: 18px;
  --gap: 16px;
  --gap-lg: 28px;
  --radius: 14px;
  --radius-sm: 8px;
}

/* Alpine cloak — prevents flash before Alpine initialises */
[x-cloak] { display: none !important; }

/* ───────────────────────── base ───────────────────────── */

* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv01";
}
button { font: inherit; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

.num, .tabular { font-family: var(--font-num); font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
.display { font-family: var(--font-display); letter-spacing: -0.02em; }
.mono   { font-family: var(--font-mono); font-size: 0.92em; letter-spacing: -0.01em; }

/* ───────────────────────── shell ───────────────────────── */

.app-shell {
  display: grid;
  grid-template-columns: var(--nav-w) 1fr;
  height: 100vh;
  background: var(--bg);
}
.app-shell[data-nav="top"] {
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
}
.app-shell[data-nav="cmd"] {
  grid-template-columns: 1fr;
}

/* Sidebar */
.sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.app-shell[data-nav="top"] .sidebar,
.app-shell[data-nav="cmd"] .sidebar { display: none; }

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 14px;
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-ink);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.brand-mark--diamond {
  background: var(--primary);
  position: relative;
}
.brand-mark--diamond::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1.5px solid var(--primary-ink);
  transform: rotate(45deg);
  border-radius: 1px;
}
.brand-mark--diamond::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--primary-ink);
  border-radius: 50%;
  bottom: 9px;
  left: 50%;
  transform: translateX(-50%);
}
.sidebar__brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.sidebar__brand-text strong {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.sidebar__brand-text span {
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 0;
}

.season-switch {
  margin: 4px 12px 14px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  cursor: pointer;
}
.season-switch:hover { border-color: var(--border-2); }
.season-switch__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--success) 25%, transparent);
}
.season-switch__label { flex: 1; }
.season-switch__label strong {
  display: block;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.season-switch__label span { color: var(--ink-3); font-size: 11px; }
.season-switch__caret { color: var(--ink-3); }

.nav-section { padding: 0 8px; }
.nav-section__title {
  padding: 14px 12px 6px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-3);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
  position: relative;
}
.nav-item:hover { background: var(--bg-3); color: var(--ink); }
.nav-item--active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}
.nav-item__icon { width: 16px; height: 16px; color: var(--ink-3); flex-shrink: 0; }
.nav-item--active .nav-item__icon { color: var(--primary); }
.nav-item__count {
  margin-left: auto;
  font-family: var(--font-num);
  font-size: 11px;
  color: var(--ink-3);
  background: var(--bg-3);
  padding: 1px 6px;
  border-radius: 99px;
}
.nav-item--active .nav-item__count {
  background: var(--primary-soft);
  color: var(--primary-soft-ink);
}
.nav-item__dot {
  margin-left: auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.sidebar__bottom {
  margin-top: auto;
  padding: 10px 12px 14px;
  border-top: 1px solid var(--border);
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.user-chip:hover { background: var(--bg-3); }
.user-chip__name { font-size: 13px; font-weight: 600; line-height: 1.15; }
.user-chip__role { font-size: 11px; color: var(--ink-3); }

/* Top nav variant */
.topnav {
  display: none;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  align-items: center;
  height: 56px;
  gap: 4px;
}
.app-shell[data-nav="top"] .topnav { display: flex; }
.topnav .nav-item { padding: 6px 12px; }
.topnav .nav-item--active { background: var(--surface); }

/* ───────────────────────── main ───────────────────────── */

.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  height: 54px;
  flex-shrink: 0;
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-3);
}
.crumbs strong { color: var(--ink); font-weight: 600; }
.crumbs__sep { color: var(--ink-4); }

.search-omni {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 12.5px;
  color: var(--ink-3);
  cursor: pointer;
  width: 280px;
  user-select: none;
}
.search-omni:hover { border-color: var(--border-2); }
.search-omni__kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  background: var(--bg-3);
  padding: 1px 6px;
  border-radius: 4px;
}

.iconbtn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  color: var(--ink-2);
}
.iconbtn:hover { background: var(--bg-3); color: var(--ink); }

.scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}
.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 28px 80px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 22px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.05;
}
.page-sub {
  color: var(--ink-3);
  font-size: 13.5px;
  margin-top: 4px;
}
.page-header__actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

/* ─────────────────────── buttons ─────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 8px;
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-3); }
.btn--primary {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: var(--primary);
}
.btn--primary:hover { background: var(--primary-hover); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn--ghost:hover { background: var(--bg-3); color: var(--ink); }
.btn--danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn--sm { padding: 4px 9px; font-size: 12px; border-radius: 6px; }
.btn--icon { padding: 6px; }

/* ─────────────────────── cards ─────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.card__title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card__title-sub { color: var(--ink-3); font-size: 12.5px; margin-left: 6px; font-weight: 400; }
.card__head .btn { margin-left: auto; }
.card__body { padding: 16px 18px; }
.card__list > * + * { border-top: 1px solid var(--border); }

/* ─────────────────────── stat tiles ─────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  margin-bottom: 22px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  position: relative;
}
.stat__label {
  font-size: 12px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat__value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 4px;
  line-height: 1.05;
}
.stat__delta {
  font-family: var(--font-num);
  font-size: 11.5px;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.stat__delta--up { color: var(--success); }
.stat__delta--down { color: var(--danger); }
.stat__delta--flat { color: var(--ink-3); }

/* ─────────────────────── pills/tags ─────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
}
.pill--neutral { background: var(--bg-3); color: var(--ink-2); }
.pill--success { background: var(--success-soft); color: var(--success); }
.pill--warn    { background: var(--warn-soft);    color: var(--warn); }
.pill--danger  { background: var(--danger-soft);  color: var(--accent-ink); }
.pill--primary { background: var(--primary-soft); color: var(--primary-soft-ink); }
.pill--ghost   { background: transparent; color: var(--ink-3); border: 1px solid var(--border); }
.pill__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ─────────────────────── tables ─────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.table th {
  text-align: left;
  padding: 10px var(--pad-x);
  background: var(--bg-2);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}
.table td {
  padding: var(--pad-y) var(--pad-x);
  border-bottom: 1px solid var(--border);
  height: var(--row-h);
  vertical-align: middle;
}
.table tr:hover td { background: var(--bg-2); }
.table tr.is-selected td { background: var(--primary-soft); }
.table .col-num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.table .col-actions { width: 1%; white-space: nowrap; text-align: right; }
.table--clickable tbody tr { cursor: pointer; }

/* avatar */
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg-3);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}
.avatar--sm { width: 22px; height: 22px; font-size: 10px; }
.avatar--lg { width: 44px; height: 44px; font-size: 14px; }
.avatar--xl { width: 72px; height: 72px; font-size: 22px; }
.avatar--giants  { background: oklch(0.6 0.16 40);  color: #fff; }
.avatar--dodgers { background: oklch(0.32 0.13 258); color: #fff; }
.avatar--yankees { background: oklch(0.25 0.06 254); color: #fff; }
.avatar--athletics { background: oklch(0.42 0.11 145); color: #fff; }
.avatar--cubs    { background: oklch(0.48 0.14 258); color: #fff; }
.avatar--redsox  { background: oklch(0.50 0.18 26);  color: #fff; }
.avatar--cardinals{ background: oklch(0.52 0.19 28); color: #fff; }
.avatar--astros  { background: oklch(0.45 0.18 38);  color: #fff; }
.avatar--tigers  { background: oklch(0.40 0.18 254); color: #fff; }
.avatar--phillies{ background: oklch(0.55 0.20 22);  color: #fff; }
.avatar--brewers { background: oklch(0.55 0.14 70);  color: #fff; }
.avatar--marlins { background: oklch(0.65 0.13 200); color: #fff; }
.avatar--rangers { background: oklch(0.45 0.15 240); color: #fff; }
.avatar--rays    { background: oklch(0.55 0.13 190); color: #fff; }

/* row layout */
.player-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.player-cell__name { font-weight: 600; line-height: 1.15; }
.player-cell__sub  { font-size: 11.5px; color: var(--ink-3); }

/* alert / inbox */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.alert:hover { background: var(--bg-2); cursor: pointer; }
.alert__icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.alert__icon--warn { background: var(--warn-soft); color: var(--warn); }
.alert__icon--danger { background: var(--danger-soft); color: var(--accent-ink); }
.alert__icon--info { background: var(--primary-soft); color: var(--primary-soft-ink); }
.alert__icon--success { background: var(--success-soft); color: var(--success); }
.alert__body { flex: 1; min-width: 0; }
.alert__title {
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 2px;
  letter-spacing: -0.005em;
}
.alert__sub { font-size: 12.5px; color: var(--ink-3); }
.alert__meta {
  font-family: var(--font-num);
  font-size: 11px;
  color: var(--ink-3);
}

/* segmented */
.seg {
  display: inline-flex;
  padding: 2px;
  background: var(--bg-3);
  border-radius: 8px;
}
.seg__btn {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--ink-2);
  border: 1px solid transparent;
  background: transparent;
}
.seg__btn--active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* search */
.input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.input input {
  border: none;
  outline: none;
  background: transparent;
  flex: 1;
  font-size: 13px;
  min-width: 0;
}
.input--focused, .input:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--primary) 18%, transparent);
}

/* filter chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font-size: 12.5px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--surface);
  cursor: pointer;
}
.chip:hover { background: var(--bg-3); }
.chip--active {
  background: var(--primary-soft);
  color: var(--primary-soft-ink);
  border-color: transparent;
  font-weight: 600;
}
.chip__x { color: var(--ink-3); margin-left: 2px; }

/* detail panel */
.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--gap-lg);
}
.detail-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
  align-items: center;
}
.detail-row:first-child { border-top: 0; }
.detail-row__label {
  font-size: 12px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.detail-row__value {
  font-size: 14px;
}
.editable {
  padding: 4px 6px;
  margin: -4px -6px;
  border-radius: 5px;
  cursor: text;
  position: relative;
  border: 1px dashed transparent;
}
.editable:hover {
  background: var(--bg-2);
  border-color: var(--border-2);
}
.editable input,
.editable select {
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--primary);
  outline: none;
  padding: 3px 5px;
  margin: -4px -6px;
  border-radius: 5px;
  width: 100%;
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--primary) 18%, transparent);
}

/* tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.tab {
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab--active {
  color: var(--ink);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ─────────────────────── command palette ─────────────────────── */
.cmdk-backdrop {
  position: fixed;
  inset: 0;
  background: oklch(0.18 0.02 252 / 0.45);
  backdrop-filter: blur(3px);
  z-index: 50;
  display: grid;
  place-items: flex-start center;
  padding-top: 12vh;
}
html[data-palette="twilight"] .cmdk-backdrop { background: oklch(0.05 0 0 / 0.55); }
.cmdk {
  width: 560px;
  max-width: 92vw;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 70vh;
}
.cmdk__input {
  border: 0;
  outline: 0;
  font-size: 16px;
  padding: 16px 18px;
  background: transparent;
  border-bottom: 1px solid var(--border);
}
.cmdk__results { overflow-y: auto; padding: 6px; }
.cmdk__section-title {
  padding: 8px 12px 4px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-weight: 600;
}
.cmdk__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px;
}
.cmdk__item--active { background: var(--bg-3); }
.cmdk__item__kbd { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.cmdk__empty { padding: 32px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* ─────────────────────── dashboard layout ─────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--gap-lg);
}

/* ─────────────────────── roster filters ─────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.toolbar__search { flex: 1; min-width: 220px; max-width: 340px; }

/* ─────────────────────── draft board ─────────────────────── */
.draft-grid {
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  gap: var(--gap-lg);
  min-height: 600px;
}
.draft-teams {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.draft-team {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  cursor: pointer;
}
.draft-team--on-clock {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--primary) 12%, transparent);
}
.draft-team__pos {
  font-family: var(--font-num);
  font-size: 11px;
  color: var(--ink-3);
  width: 18px;
  text-align: right;
}
.draft-team__name { flex: 1; font-weight: 500; }
.draft-team__picks { font-family: var(--font-num); font-size: 11.5px; color: var(--ink-3); }

.draft-board-grid {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  grid-template-columns: 32px repeat(12, 1fr);
}
.draft-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 7px 8px;
  min-height: 56px;
  font-size: 11.5px;
  position: relative;
}
.draft-cell--header {
  background: var(--bg-2);
  font-weight: 600;
  text-align: center;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  min-height: 32px;
  padding: 8px 4px;
}
.draft-cell--rownum {
  background: var(--bg-2);
  font-family: var(--font-num);
  color: var(--ink-3);
  font-size: 11px;
  text-align: center;
  padding-top: 16px;
}
.draft-cell--filled {
  background: var(--surface);
}
.draft-cell--filled .pn { font-weight: 600; font-size: 11.5px; line-height: 1.15; }
.draft-cell--filled .pos { font-family: var(--font-num); font-size: 10px; color: var(--ink-3); }
.draft-cell--top4 { box-shadow: inset 3px 0 0 var(--accent); }
.draft-cell--child {
  background: color-mix(in oklch, var(--primary-soft) 70%, transparent);
}
.draft-cell--current {
  background: var(--primary-soft);
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  z-index: 1;
}

/* SES session */
.station-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--gap);
  margin-bottom: var(--gap-lg);
}
.station-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface);
}
.station-card__row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-top: 4px;
  color: var(--ink-3);
}
.bar {
  height: 6px;
  background: var(--bg-3);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}
.bar__fill {
  height: 100%;
  background: var(--primary);
  border-radius: inherit;
  transition: width .25s ease;
}
.bar__fill--ok { background: var(--success); }
.bar__fill--warn { background: var(--warn); }

/* Field-mode iPhone helpers */
.field-mode {
  display: flex;
  justify-content: center;
  padding: 30px 0;
}

/* Print preview */
.print-frame {
  margin: 24px auto 0;
  background: #fff;
  color: #111;
  width: 720px;
  max-width: 100%;
  border-radius: 4px;
  box-shadow: 0 30px 70px rgba(0,0,0,0.12);
  border: 1px solid var(--border);
  padding: 28px 32px;
  font-family: var(--font-body);
}

/* ─────────────────────── empty state ─────────────────────── */
.empty {
  padding: 36px 24px;
  text-align: center;
  color: var(--ink-3);
}
.empty strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: 4px; }

/* ─────────────────────── family detail (SFLL-95, Phase 4) ─────────────────────── */
.family-head {
  display: flex;
  gap: 16px;
  align-items: center;
}

.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  padding: 16px 18px;
}
.contact-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.contact-card--empty {
  border-style: dashed;
  background: var(--bg-2);
}
.contact-card__role { display: flex; }
.contact-card__name {
  font-weight: 600;
  color: var(--ink);
}
.contact-card__lines { display: flex; flex-direction: column; gap: 2px; }
.contact-card__line {
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: none;
}
.contact-card__line:hover { color: var(--primary); text-decoration: underline; }

.balance-row { padding: 4px 0 16px; }
.balance-row__current {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.balance-row__label {
  font-size: 12.5px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.balance-row__amount {
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
}
.balance-row__hint { font-size: 12.5px; }

.vol-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 4px 0 16px;
}
.vol-row__cell {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--bg-2);
}
.vol-row__label {
  font-size: 12px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.vol-row__value {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}

/* The player_head crumbs + pills come from the SFLL-109 detail page; replicate
   the small slice we need here so the family page renders standalone on main
   until that PR merges. */
.player-head__crumbs {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.player-head__crumbs a { color: var(--ink-2); text-decoration: none; }
.player-head__crumbs a:hover { color: var(--primary); }
.player-head__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

@media (max-width: 640px) {
  .vol-row { grid-template-columns: 1fr; }
  .family-head { flex-direction: column; align-items: flex-start; }
}

/* ─────────────────────── utilities ─────────────────────── */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.ml-auto { margin-left: auto; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11.5px; }
.text-muted { color: var(--ink-3); }
.text-strong { color: var(--ink); font-weight: 600; }

@media print {
  .sidebar, .topnav, .topbar, .page-header, .scroll > nav { display: none !important; }
  .print-frame { box-shadow: none; border: none; padding: 0; }
  body, html { background: #fff !important; }
}
