/* Black Friday board - "Fight Night Edition". One dark theme on purpose (floor screens and phones at night).
   Tokens first; everything below uses them. The accent is the only colour that carries meaning. */
:root {
  --ink: #0A0A0B;
  --panel: #141416;
  --panel-2: #1C1C1F;
  --line: #2B2B30;
  --line-2: #3A3A40;
  --text: #F4F1EA;
  --muted: #A9A49B;
  --accent: #F5B700;
  --silver: #D7D7DB;
  --bronze: #D08A4A;
  --danger: #FF6B5E;
  --display: 'Anton', 'Barlow Condensed', Impact, sans-serif;
  --cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ink); color: var(--text); font-family: var(--body); font-size: 16px; line-height: 1.4; }
a { color: var(--text); }
a:hover { color: #fff; }
button, input { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 1320px; margin: 0 auto; padding: 32px 24px 48px; display: flex; flex-direction: column; gap: 24px; }
.accent { color: var(--accent); }
.label { font-family: var(--cond); font-weight: 600; font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.hint { font-size: 14px; color: var(--muted); margin: 0; }

/* ---- header */
.hdr { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-end; }
.hdr-title { display: flex; flex-direction: column; gap: 10px; }
.hdr-dates { font-family: var(--cond); font-weight: 600; font-size: 15px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(48px, 8vw, 104px); line-height: 0.95; letter-spacing: 0.01em; text-transform: uppercase; }
.tagline { font-family: var(--cond); font-weight: 600; font-size: 22px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); }
h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 30px; letter-spacing: 0.02em; text-transform: uppercase; }

.btn-line { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; background: transparent; border: 1px solid var(--line-2); border-radius: 6px; cursor: pointer; text-decoration: none; font-family: var(--cond); font-weight: 700; font-size: 16px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text); }
.btn-line:hover { border-color: var(--text); }
.btn-line.small { font-size: 15px; padding: 0 14px; }

.banner { padding: 14px 18px; border: 1px solid var(--accent); border-radius: 6px; font-family: var(--cond); font-weight: 600; font-size: 18px; letter-spacing: 0.06em; }

/* ---- filters */
.filters { display: flex; flex-direction: column; gap: 12px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab { min-height: 48px; padding: 0 22px; border-radius: 6px; cursor: pointer; background: transparent; border: 1px solid var(--line-2); font-family: var(--cond); font-weight: 700; font-size: 20px; letter-spacing: 0.1em; text-transform: uppercase; }
.tab[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.filter-row { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }

.picker { position: relative; }
.picker-btn { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 48px; min-width: 240px; padding: 4px 16px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 6px; cursor: pointer; text-align: left; }
.picker-btn.on { border-color: var(--accent); }
.picker-text { display: flex; flex-direction: column; }
.picker-text .label { font-size: 12px; letter-spacing: 0.16em; }
.picker-value { font-weight: 600; font-size: 16px; }
.picker-panel { position: absolute; top: 56px; left: 0; z-index: 20; width: min(320px, calc(100vw - 48px)); padding: 12px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 6px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6); display: flex; flex-direction: column; gap: 8px; }
.picker-list { display: flex; flex-direction: column; max-height: 264px; overflow-y: auto; }
.picker-item { min-height: 44px; padding: 4px 10px; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 16px; }
.picker-item:hover, .picker-item:focus-visible { background: var(--line); }
.picker-item strong { font-weight: 600; }
.picker-item span { color: var(--muted); font-size: 14px; }

input[type="text"], input[type="number"], input[type="search"] { min-height: 48px; width: 100%; padding: 0 14px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 6px; font-size: 17px; }
.picker-panel input { background: var(--ink); min-height: 44px; font-size: 16px; }
input::placeholder { color: #8C877F; }

.seg { display: flex; flex-wrap: wrap; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; }
.seg button { min-height: 48px; padding: 0 16px; border: 0; background: transparent; cursor: pointer; font-family: var(--cond); font-weight: 700; font-size: 16px; letter-spacing: 0.1em; text-transform: uppercase; }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--ink); }

/* ---- tiles */
.tiles { display: flex; flex-wrap: wrap; gap: 16px; }
.tile { flex: 1 1 240px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 20px 24px; min-width: 0; }
.tile-value { font-family: var(--display); font-size: clamp(48px, 7vw, 72px); line-height: 1; margin-top: 8px; overflow-wrap: anywhere; }
.tile-note { font-size: 14px; color: var(--muted); margin-top: 8px; }

/* ---- layout */
.cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 24px; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 16px; }
.panel-head .hint { text-align: right; }
.empty { min-height: 58px; display: flex; align-items: center; border-top: 1px solid var(--line); font-size: 15px; color: var(--muted); }

/* ---- title race */
.race { display: flex; flex-wrap: wrap; gap: 24px; }
.race-col { flex: 1 1 250px; min-width: 0; display: flex; flex-direction: column; }
.race-col-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding-bottom: 10px; border-bottom: 2px solid var(--accent); }
.race-col-title { font-family: var(--cond); font-weight: 700; font-size: 19px; letter-spacing: 0.12em; text-transform: uppercase; }
.race-col-note { font-family: var(--cond); font-weight: 600; font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.race-grid { display: grid; grid-template-columns: 28px minmax(0, 1fr) 36px 78px; column-gap: 8px; align-items: center; }
.race-head { min-height: 32px; font-family: var(--cond); font-weight: 600; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.race-head .right { text-align: right; }
.race-rows.scroll { max-height: 590px; overflow-y: auto; }
.race-row { min-height: 58px; border-top: 1px solid var(--line); }
.race-row.me { background: rgba(245, 183, 0, 0.10); box-shadow: inset 3px 0 0 var(--accent); }
.rank { font-family: var(--display); font-size: 24px; color: var(--muted); padding-left: 2px; }
.rank.r1 { color: var(--accent); }
.rank.r2 { color: var(--silver); }
.rank.r3 { color: var(--bronze); }
.who { display: flex; flex-direction: column; min-width: 0; }
.who-name { font-weight: 600; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-office { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.num { text-align: right; font-family: var(--cond); font-weight: 700; font-size: 21px; }
.num.money { color: var(--accent); }
.more-btn { align-self: flex-start; margin-top: 10px; }

/* ---- pound for pound */
.offices-scroll { overflow-x: auto; }
.offices { min-width: 560px; }
.office-row { display: grid; grid-template-columns: 34px minmax(0, 1.3fr) minmax(90px, 2fr) 150px 64px; column-gap: 14px; align-items: center; width: 100%; min-height: 54px; padding: 0; background: transparent; border: 0; border-top: 1px solid var(--line); cursor: pointer; text-align: left; }
.office-row:hover { background: var(--panel-2); }
.office-row.selected .who-name { color: var(--accent); }
.bar { display: block; height: 12px; background: var(--line); border-radius: 2px; overflow: hidden; }
.bar > span { display: block; height: 12px; background: var(--accent); }
.office-detail { text-align: right; font-family: var(--cond); font-weight: 600; font-size: 16px; color: var(--muted); white-space: nowrap; }
.office-rate { text-align: right; font-family: var(--cond); font-weight: 700; font-size: 22px; }

/* ---- log a sale */
.form-panel { border-color: var(--accent); display: flex; flex-direction: column; gap: 18px; }
.form-stack { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field-row { display: flex; flex-wrap: wrap; gap: 16px; }
.field-row .field { flex: 1 1 140px; }
.suggest { display: flex; flex-direction: column; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; }
.suggest button { min-height: 52px; padding: 6px 14px; text-align: left; background: var(--panel-2); border: 0; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 16px; }
.suggest button:hover, .suggest button:focus-visible { background: var(--line); }
.suggest strong { font-weight: 600; }
.suggest span { color: var(--muted); font-size: 14px; }
.rep-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; background: var(--panel-2); border-radius: 6px; }
.rep-card > div { min-width: 0; display: flex; flex-direction: column; }
.rep-name { font-weight: 600; font-size: 18px; }
.rep-meta { font-size: 14px; color: var(--muted); }
.rep-standing { font-family: var(--cond); font-weight: 700; font-size: 16px; letter-spacing: 0.08em; text-transform: uppercase; margin-top: 4px; color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.even .chip { flex: 1 1 0; }
.chip { min-height: 44px; padding: 0 14px; border-radius: 6px; cursor: pointer; background: transparent; border: 1px solid var(--line-2); font-weight: 600; font-size: 15px; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.chip.plain[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--ink); }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 48px; height: 48px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 6px; cursor: pointer; font-size: 24px; line-height: 1; }
.stepper output { min-width: 44px; text-align: center; font-family: var(--display); font-size: 36px; line-height: 1; }
#commInput { font-family: var(--cond); font-weight: 700; font-size: 24px; text-align: right; }
.btn-bell { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 60px; width: 100%; border: 0; border-radius: 6px; cursor: pointer; background: var(--accent); color: var(--ink); font-family: var(--display); font-size: 24px; letter-spacing: 0.06em; text-transform: uppercase; }
.btn-bell:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }
.form-error { margin: 0; color: var(--danger); font-weight: 600; }
.undo { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--accent); border-radius: 6px; font-size: 15px; }
.form-closed { padding: 14px; background: var(--panel-2); border-radius: 6px; color: var(--muted); }

/* ---- last bells */
.feed-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 64px; border-top: 1px solid var(--line); }
.feed-row > div:first-child { min-width: 0; display: flex; flex-direction: column; }
.feed-who { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-who span { font-weight: 400; color: var(--muted); }
.feed-what { font-size: 14px; color: var(--muted); }
.feed-right { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
.feed-money { font-family: var(--cond); font-weight: 700; font-size: 20px; color: var(--accent); }
.feed-ago { font-family: var(--cond); font-weight: 600; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.feed-ago.fresh { color: var(--accent); }

.foot { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 16px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 50; max-width: calc(100vw - 32px); padding: 14px 22px; border-radius: 6px; background: var(--accent); color: var(--ink); font-family: var(--cond); font-weight: 700; font-size: 18px; letter-spacing: 0.08em; text-transform: uppercase; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7); }
.toast.bad { background: var(--danger); }

/* ---- phone: Log a sale comes first, right under the title, then the filters and the board.
   The two column wrappers dissolve (display: contents) so every panel can be ordered on its own. */
@media (max-width: 900px) {
  .wrap { padding: 20px 16px 40px; gap: 18px; }
  .cols, .main, .side { display: contents; }
  .hdr { order: 0; }
  .banner { order: 1; }
  .form-panel { order: 2; }
  .filters { order: 3; }
  .tiles { order: 4; }
  .race-panel { order: 5; }
  .offices-panel { order: 6; }
  .feed-panel { order: 7; }
  .foot { order: 8; }
  .panel { padding: 18px 16px; }
  .hdr { align-items: flex-start; gap: 14px; }
  .picker, .picker-btn { width: 100%; }
  .seg { width: 100%; }
  .seg button { flex: 1 1 auto; padding: 0 10px; }
  .tab { flex: 1 1 auto; padding: 0 14px; font-size: 18px; }
  .tagline { font-size: 18px; letter-spacing: 0.18em; }
  .panel-head .hint { text-align: left; }
}
/* a narrow phone: each office becomes three short lines so the per-rep number is never off screen */
@media (max-width: 640px) {
  .offices { min-width: 0; }
  .office-row { grid-template-columns: 30px minmax(0, 1fr) auto; grid-template-areas: "rank who rate" "rank bar bar" "rank detail detail"; row-gap: 6px; column-gap: 10px; padding: 10px 0; }
  .office-row > .rank { grid-area: rank; align-self: start; }
  .office-row > .who { grid-area: who; }
  .office-row > .bar { grid-area: bar; }
  .office-row > .office-detail { grid-area: detail; text-align: left; }
  .office-row > .office-rate { grid-area: rate; }
  .who-office { white-space: normal; }
}
@media (prefers-reduced-motion: no-preference) {
  .bar > span { transition: width 0.6s ease; }
}

/* ---- admin page */
.admin-wrap { max-width: 1200px; margin: 0 auto; padding: 24px 16px 48px; display: flex; flex-direction: column; gap: 16px; }
.admin-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.admin-bar input { max-width: 320px; }
.admin-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; }
table.admin { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 15px; }
table.admin th { text-align: left; padding: 10px 12px; font-family: var(--cond); font-weight: 600; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); background: var(--panel); position: sticky; top: 0; }
table.admin td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
table.admin td.r, table.admin th.r { text-align: right; }
table.admin tr.gone td { color: var(--muted); text-decoration: line-through; }
table.admin tr.gone td.keep { text-decoration: none; }
.admin-reason { display: flex; gap: 8px; align-items: center; }
.admin-reason input { min-height: 40px; font-size: 15px; min-width: 180px; }
