/* CourtStat — press-row utility design.
   Palette: ink #14243A (press-box navy) · surface #EEF1F4 (arena gray)
   paper #FFFFFF · score #C8102E (scoreboard red) · action #2E6FB7 (steel blue)
   line #D4DAE1. Signature: scoreboard numerals — every jersey number, score,
   and stat cell is set in tabular monospace, like the LED strip on press row. */

:root {
  --ink: #14243a;
  --ink-soft: #47576c;
  --surface: #eef1f4;
  --paper: #ffffff;
  --score: #c8102e;
  --action: #2e6fb7;
  --action-dark: #24578f;
  --line: #d4dae1;
  --ok: #1c7c46;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--surface);
}

/* --- Top bar: a scorer's-table strip --- */
.topbar {
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 1.25rem;
  height: 52px;
}
.topbar .brand {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: #fff;
  text-decoration: none;
}
.topbar .brand .tick { color: var(--score); }
.topbar nav { display: flex; gap: 0.25rem; flex: 1; }
.topbar nav a {
  color: #c9d3e0;
  text-decoration: none;
  padding: 0.35rem 0.7rem;
  border-radius: 4px;
  font-size: 0.9rem;
}
.topbar nav a:hover, .topbar nav a:focus-visible { background: rgba(255,255,255,0.12); color: #fff; }
.topbar .who { font-size: 0.82rem; color: #9fb0c4; }
.topbar form { margin: 0; }

/* --- Layout --- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
h1 { font-size: 1.45rem; margin: 0 0 0.25rem; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; margin: 0 0 0.75rem; }
.sub { color: var(--ink-soft); font-size: 0.9rem; margin: 0 0 1.25rem; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.card h2 { border-bottom: 1px solid var(--line); padding-bottom: 0.55rem; margin-bottom: 0.9rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

/* --- Signature: scoreboard numerals --- */
.num, td.num, .uni {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.uni {
  display: inline-block;
  min-width: 2.1em;
  text-align: center;
  background: var(--ink);
  color: #fff;
  border-radius: 3px;
  padding: 0 0.25em;
  font-size: 0.85rem;
}
.uni.tm { background: var(--ink-soft); }
.score-strip {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--score);
  font-weight: 700;
}

/* --- Tables --- */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-soft);
  border-bottom: 2px solid var(--ink);
  padding: 0.4rem 0.55rem;
  white-space: nowrap;
}
td { padding: 0.45rem 0.55rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:hover td { background: #f6f8fa; }
tr.inactive td { color: #98a4b3; }
tr.inactive td .uni { background: #98a4b3; }
td.actions { text-align: right; white-space: nowrap; }

/* --- Forms --- */
label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 0.2rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], select {
  width: 100%;
  padding: 0.42rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 1px;
}
.field { margin-bottom: 0.8rem; }
.field-row { display: flex; gap: 0.75rem; }
.field-row .field { flex: 1; }
.check { display: flex; align-items: center; gap: 0.45rem; font-size: 0.88rem; font-weight: 400; color: var(--ink); }
.check input { width: auto; }

button, .btn {
  display: inline-block;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.45rem 0.95rem;
  border-radius: 5px;
  border: 1px solid var(--action-dark);
  background: var(--action);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .btn:hover { background: var(--action-dark); }
.btn-quiet {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-soft);
  font-weight: 500;
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
}
.btn-quiet:hover { background: var(--surface); color: var(--ink); }
.btn-danger { background: transparent; border-color: var(--line); color: var(--score); font-weight: 500; padding: 0.25rem 0.6rem; font-size: 0.8rem; }
.btn-danger:hover { background: #fbeaec; }
.inline-form { display: inline; }

/* --- Flash messages --- */
.flash { padding: 0.6rem 0.9rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.9rem; }
.flash.success { background: #e5f3ec; color: var(--ok); border: 1px solid #bfe0cf; }
.flash.error { background: #fbeaec; color: var(--score); border: 1px solid #f0c4cb; }

/* --- Status pills --- */
.pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.1rem 0.5rem;
  border-radius: 99px;
  background: var(--surface);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.pill.live { background: var(--score); color: #fff; border-color: var(--score); }
.pill.final { background: var(--ink); color: #fff; border-color: var(--ink); }

/* --- Starters --- */
.starter-count { font-family: var(--mono); font-weight: 700; }
.starter-count.bad { color: var(--score); }
.starter-count.good { color: var(--ok); }

/* --- Login --- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--ink); }
.login-card { background: var(--paper); border-radius: 10px; padding: 2rem; width: min(380px, 92vw); }
.login-card .brand { font-family: var(--mono); font-weight: 700; letter-spacing: 0.08em; font-size: 1.15rem; margin-bottom: 1.25rem; }
.login-card .brand .tick { color: var(--score); }

@media (prefers-reduced-motion: no-preference) {
  .flash { animation: slide-in 160ms ease-out; }
  @keyframes slide-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
}
