/* ------------------------------------------------------------------ base */
/* ---------------------------------------------------------- Rundown Analytics ----
   Navy carries the brand; amber is the one warm note. Chosen to sit behind
   ANY school's colours -- a client's crimson, scarlet or royal blue appears
   inside their reports, and the site chrome must never fight it.
   -------------------------------------------------------------------- */
:root {
  --ink: #131A26;
  --ink-2: #3D4757;
  --muted: #6E7889;
  --line: #E1E5EC;
  --line-2: #EDF0F4;
  --paper: #F7F8FA;
  --card: #ffffff;

  --brand: #16233D;          /* navy: nav, primary buttons */
  --brand-2: #24344F;        /* navy hover */
  --accent: #B07407;         /* amber: labels, links, active marks */
  --accent-dark: #8C5C05;
  --accent-wash: #FDF6E8;

  --good: #1F7A4D;
  --bad: #B3261E;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(19, 26, 38, .05), 0 4px 14px rgba(19, 26, 38, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
               Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 720px; }

/* ---------------------------------------------------------------- header */
header.site {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
header.site .inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; max-width: 1080px; margin: 0 auto;
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand .name {
  font-weight: 700; font-size: 16px; letter-spacing: -0.005em; color: var(--brand);
}
.brand .tag { font-size: 12.5px; color: var(--muted); }
nav.site a {
  color: var(--ink-2); font-size: 13.5px; font-weight: 500; margin-left: 18px;
}
nav.site a:hover { color: var(--accent); text-decoration: none; }

/* ------------------------------------------------------------------ hero */
.hero { padding: 64px 0 40px; }
.hero h1 {
  font-size: 40px; line-height: 1.12; letter-spacing: -0.025em;
  margin: 0 0 14px; font-weight: 700; max-width: 16ch;
}
.hero p.lede {
  font-size: 17px; color: var(--ink-2); margin: 0 0 26px; max-width: 54ch;
}

/* ------------------------------------------------------------------ card */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
/* ...but inside a grid the gap already does that, and the margin would
   knock every card after the first out of alignment. */
.grid .card + .card, .grid > .card { margin-top: 0; }
.card h2 {
  font-size: 13px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted); font-weight: 700; margin: 0 0 14px;
}
.card h3 { font-size: 15px; margin: 0 0 4px; font-weight: 650; }

.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 820px) {
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 30px; }
}

/* ----------------------------------------------------------------- stats */
.stat { text-align: left; }
.stat .n {
  font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1;
}
.stat .l {
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-weight: 600; margin-top: 2px;
}
.stat.alert .n { color: var(--bad); }

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-block; border: 1px solid transparent; border-radius: 7px;
  padding: 9px 16px; font-size: 14px; font-weight: 600; cursor: pointer;
  background: var(--brand); color: #fff; font-family: inherit;
  transition: background .12s ease;
}
.btn:hover { background: var(--brand-2); text-decoration: none; color: #fff; }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: var(--paper); color: var(--ink); }
.btn.small { padding: 5px 11px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------------------- dropzone */
.drop {
  display: block;  /* it is a <label>, which is inline by default */
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 40px 24px; text-align: center; background: var(--paper);
  transition: border-color .15s ease, background .15s ease;
  cursor: pointer;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-wash); }
.drop .big { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.drop .small { font-size: 13px; color: var(--muted); }
.drop input[type=file] { display: none; }
.filename {
  margin-top: 14px; font-size: 13.5px; color: var(--ink-2);
  display: none;
}
.filename.show { display: block; }

/* --------------------------------------------------------------- tables */
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted); font-weight: 700;
  padding: 7px 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td {
  padding: 9px 10px; border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
table.data tr:last-child td { border-bottom: none; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .dim { color: var(--muted); }
.scroll-x { overflow-x: auto; }

.pill {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 20px;
}
.pill.ok { background: #e8f4ee; color: var(--good); }
.pill.fail { background: #fdecea; color: var(--bad); }
.pill.wait { background: #f2f0ec; color: var(--muted); }

/* ---------------------------------------------------------------- forms */
label.field { display: block; margin-bottom: 14px; }
label.field .lab {
  display: block; font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted); margin-bottom: 5px;
}
input[type=text], input[type=password], textarea, select {
  width: 100%; padding: 9px 11px; font-size: 14px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 7px; background: #fff;
  color: var(--ink);
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
input[type=color] {
  width: 46px; height: 34px; padding: 2px; border: 1px solid var(--line);
  border-radius: 7px; background: #fff; cursor: pointer; vertical-align: middle;
}
textarea { resize: vertical; min-height: 62px; }
.checks { display: grid; gap: 7px; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; }
.check input { margin-top: 3px; }
.check .desc { color: var(--muted); font-size: 12.5px; display: block; }
.hint { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }

/* -------------------------------------------------------------- notices */
.notice {
  border-radius: 8px; padding: 12px 14px; font-size: 14px; margin-bottom: 18px;
  border: 1px solid;
}
.notice.error { background: #fdecea; border-color: #f3c9c5; color: #8c1d18; }
.notice.ok { background: #e8f4ee; border-color: #bfdfcd; color: #14532d; }
.notice.info { background: #f4f2ef; border-color: var(--line); color: var(--ink-2); }

/* ----------------------------------------------------------------- misc */
code.key {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; background: #f4f2ef; padding: 3px 7px; border-radius: 5px;
  border: 1px solid var(--line); word-break: break-all;
}
.section-title {
  font-size: 22px; font-weight: 700; letter-spacing: -0.015em; margin: 0 0 4px;
}
.section-sub { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.spacer { height: 26px; }
footer.site {
  margin-top: 56px; padding: 24px 0 40px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted);
}
.swatch {
  display: inline-block; width: 13px; height: 13px; border-radius: 3px;
  vertical-align: -2px; margin-right: 6px; border: 1px solid rgba(0,0,0,.12);
}
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }

/* ------------------------------------------------- copyable upload link */
a.key-link {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; background: #f4f2ef; padding: 3px 7px; border-radius: 5px;
  border: 1px solid var(--line); word-break: break-all; color: var(--ink-2);
  display: inline-block; text-decoration: none;
}
a.key-link:hover {
  border-color: var(--brand); color: var(--brand);
  background: #fff; text-decoration: none;
}
.copy-btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  border-radius: 6px; padding: 3px 9px; font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit; margin-left: 6px; vertical-align: 1px;
}
.copy-btn:hover { border-color: var(--brand); color: var(--brand); }
.copy-btn.done { border-color: var(--good); color: var(--good); }
.link-cell { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ tabs */
nav.tabs {
  display: flex; gap: 2px; margin: 0 0 18px;
  border-bottom: 1px solid var(--line);
}
nav.tabs .tab {
  padding: 9px 16px; font-size: 14px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  text-decoration: none;
}
nav.tabs .tab:hover { color: var(--ink); text-decoration: none; }
nav.tabs .tab.on { color: var(--brand); border-bottom-color: var(--accent); }

/* ------------------------------------------- sortable + filterable tables */
table.sortable th { padding-bottom: 5px; }
table.sortable th a.sort {
  color: inherit; text-decoration: none; white-space: nowrap;
  display: inline-block;
}
table.sortable th a.sort:hover { color: var(--ink); text-decoration: none; }
table.sortable th a.sort.on { color: var(--brand); }
table.sortable th .arrow {
  font-size: 9px; margin-left: 4px; vertical-align: 1px; color: var(--accent);
}
table.sortable tr.filters td {
  padding: 0 6px 8px; border-bottom: 1px solid var(--line);
}
table.sortable tbody td { white-space: nowrap; }
table.sortable tr.filters input {
  width: 100%; min-width: 88px; padding: 4px 7px; font-size: 12.5px;
  border: 1px solid var(--line); border-radius: 5px; background: var(--paper);
}
table.sortable tr.filters input:focus {
  background: #fff; border-color: var(--accent); box-shadow: none;
}
/* A number filter only ever holds a threshold -- it does not need the
   width a name does, and the saved pixels keep more columns on screen. */
table.sortable tr.filters td.num input { text-align: right; min-width: 52px; }

/* ------------------------------------------------------- column picker */
details.colpick {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px;
}
details.colpick > summary {
  cursor: pointer; font-size: 13px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .09em; list-style: none;
}
details.colpick > summary::-webkit-details-marker { display: none; }
details.colpick > summary::before {
  content: "▸"; display: inline-block; margin-right: 8px; font-size: 10px;
  color: var(--accent); transition: transform .12s ease;
}
details.colpick[open] > summary::before { transform: rotate(90deg); }
details.colpick > summary .count {
  text-transform: none; letter-spacing: 0; font-weight: 500;
  color: var(--muted); margin-left: 6px;
}
.colgrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 4px 14px; margin-top: 14px;
}
.colbox {
  display: flex; align-items: center; gap: 7px; font-size: 13.5px;
  padding: 3px 0; cursor: pointer;
}
.colbox input { margin: 0; }
.pill.warn { background: var(--accent-wash); color: var(--accent-dark); }

/* ------------------------------------------------- one row of selections */
/* Six controls that must stay on one line. nowrap alone would overflow, so
   every select is also allowed to shrink below its content width; the ones
   holding a year, a month or a day need far less room than a stadium name. */
.btn-row.pickers { flex-wrap: nowrap; }
.btn-row.pickers select { min-width: 0; flex: 1 1 auto; max-width: 230px; }
.btn-row.pickers select.narrow { flex: 0 1 auto; max-width: 96px; }
.btn-row.pickers .btn { flex: 0 0 auto; }

/* The filter row submits on Enter. HTML only does implicit submission when the
   form has a submit button, so there is one -- parked off-screen, out of the
   tab order, rather than removed. */
.offscreen-submit {
  position: absolute; left: -9999px; width: 1px; height: 1px;
}
