/* Client-facing attribution portal. Brand tokens mirrored from the ops console
   (app/css/tokens.css) rather than reinvented: a client seeing this and a
   landing page on the same day should see one company.

   Single-theme on purpose. The e1even brand is a dark one, and a light variant
   would be a second design to keep correct for no one's benefit. */
:root {
  --black:  #0a0a0a;
  --black2: #111111;
  --black3: #161616;
  --white:  #f2f2f0;
  --muted:  #8a8a8a;
  --muted2: #2a2a2a;
  --border: #1e1e1e;
  --accent: #c8f135;
  --accent2:#a8d420;
  --cyan:   #35e8c8;
  --amber:  #f0c430;
  --danger: #ff5c5c;

  --font-display: "Bebas Neue", sans-serif;
  --font-body: "Syne", sans-serif;
  --font-mono: "Space Mono", monospace;

  --wrap: 1180px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2 { margin: 0; font-weight: 600; }
strong { font-weight: 700; }

/* ── gate ─────────────────────────────────────────────────────────── */

.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate-card {
  width: 100%; max-width: 420px; background: var(--black2);
  border: 1px solid var(--border); border-radius: 10px; padding: 32px;
}
.brand {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .28em;
  text-transform: uppercase; color: var(--accent);
}
.gate-title { font-family: var(--font-display); font-size: 40px; line-height: 1; margin: 10px 0 14px; }
.gate-msg { color: var(--muted); font-size: 14px; margin: 0; }
.gate-form { margin-top: 20px; display: grid; gap: 10px; }
.gate-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
}
.gate-input {
  width: 100%; background: var(--black); border: 1px solid var(--muted2);
  border-radius: 6px; color: var(--white); font-family: var(--font-mono);
  font-size: 13px; padding: 10px 12px;
}
.gate-input:focus, .btn:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.gate-hint { color: var(--muted); font-size: 12.5px; margin: 4px 0 0; }

.btn {
  background: var(--accent); color: #0a0a0a; border: 0; border-radius: 6px;
  font-family: var(--font-body); font-size: 13px; font-weight: 700;
  padding: 10px 16px; cursor: pointer;
}
.btn:hover { background: var(--accent2); }
.btn-quiet {
  background: transparent; color: var(--muted); border: 1px solid var(--border);
  font-weight: 400;
}
.btn-quiet:hover { background: var(--black3); color: var(--white); }

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

main { max-width: var(--wrap); margin: 0 auto; padding: 28px 24px 64px; }
.top {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 20px; flex-wrap: wrap; padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.client-name { font-family: var(--font-display); font-size: 42px; line-height: 1; margin-top: 6px; }
.top-right { display: flex; align-items: center; gap: 10px; }
.range { display: flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.range button {
  background: transparent; border: 0; color: var(--muted); cursor: pointer;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em;
  padding: 8px 12px;
}
.range button + button { border-left: 1px solid var(--border); }
.range button[aria-pressed="true"] { background: var(--accent); color: #0a0a0a; font-weight: 700; }
.range button:hover:not([aria-pressed="true"]) { color: var(--white); background: var(--black3); }

/* ── figures ──────────────────────────────────────────────────────── */

.figs {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px; background: var(--border); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden; margin: 24px 0 34px;
}
.fig { background: var(--black2); padding: 16px 18px; }
.fig-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--muted);
}
.fig-value {
  font-family: var(--font-display); font-size: 34px; line-height: 1;
  margin-top: 8px; font-variant-numeric: tabular-nums;
}
.fig-note { font-family: var(--font-mono); font-size: 10px; color: var(--muted); margin-top: 6px; }
.pos { color: var(--accent); }
.neg { color: var(--danger); }
.dim { color: var(--muted); }

/* ── blocks ───────────────────────────────────────────────────────── */

.block { margin-bottom: 40px; }
.block-head { margin-bottom: 14px; }
.block-head h2 { font-family: var(--font-display); font-size: 24px; line-height: 1.1; }
.block-sub { color: var(--muted); font-size: 13.5px; margin: 6px 0 0; max-width: 68ch; }

.scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .11em;
  text-transform: uppercase; color: var(--muted); font-weight: 400;
  text-align: left; padding: 10px 12px; background: var(--black2);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody td { padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--black2); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 28px; color: var(--muted); font-size: 13.5px; text-align: center; }

/* Rank marker on the earning table: position is information here, so it is
   numbered. Nothing else in this page is. */
.rank { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.top-earner .rank { color: var(--accent); }

/* ── lead ledger ──────────────────────────────────────────────────── */

.filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.filters input[type="search"] {
  background: var(--black2); border: 1px solid var(--border); border-radius: 6px;
  color: var(--white); font-family: var(--font-body); font-size: 13px;
  padding: 8px 12px; min-width: 220px;
}
.chip {
  background: transparent; border: 1px solid var(--border); border-radius: 999px;
  color: var(--muted); cursor: pointer; font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; padding: 6px 12px;
}
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #0a0a0a; font-weight: 700; }

td.ctrl { background: rgba(200, 241, 53, 0.035); }
input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
.in {
  background: var(--black); border: 1px solid var(--muted2); border-radius: 4px;
  color: var(--white); font-family: var(--font-mono); font-size: 12px;
  padding: 5px 7px; text-align: right;
}
.in.amount { width: 104px; }
.in.bps { width: 62px; }
.in.date { width: 124px; text-align: left; }
.in:disabled { opacity: .3; cursor: not-allowed; }
.saving { border-color: var(--amber) !important; }
.saved { border-color: var(--accent) !important; }
.failed { border-color: var(--danger) !important; }

.est { font-family: var(--font-mono); font-size: 10px; color: var(--amber); }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 12px; color: var(--muted); font-size: 12.5px; }

/* ── footer + toast ───────────────────────────────────────────────── */

.foot { border-top: 1px solid var(--border); padding-top: 18px; color: var(--muted); font-size: 12.5px; }
.foot p { margin: 0 0 6px; }
.foot-est { color: var(--amber); }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--black3); border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 16px; font-size: 13px; z-index: 20;
}
.toast.bad { border-color: var(--danger); color: var(--danger); }

@media (max-width: 640px) {
  .client-name { font-size: 32px; }
  .fig-value { font-size: 28px; }
  main { padding: 20px 14px 48px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ── reconciliation progress ──────────────────────────────────────── */
/* Deliberately sits directly under the figures: the numbers above are
   computed over every lead, so how much of the book has been ruled on is
   part of reading them, not a footnote. */
.progress { margin: -14px 0 34px; }
.prog-bar {
  height: 4px; background: var(--muted2); border-radius: 2px;
  overflow: hidden; margin-bottom: 10px;
}
.prog-bar span {
  display: block; height: 100%; background: var(--accent);
  /* Any real progress must be visible. 1 of 985 rounds to 0%, and a
     zero-width fill reads as "nothing saved" rather than "barely started". */
  min-width: 3px;
}
.prog-text { color: var(--muted); font-size: 13px; margin: 0; max-width: 76ch; }
.prog-text strong { color: var(--white); }
.prog-done { color: var(--accent); }
.linkish {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--accent); font-family: inherit; font-size: inherit;
  text-decoration: underline; text-underline-offset: 2px;
}
.mark {
  background: transparent; border: 1px solid var(--border); border-radius: 4px;
  color: var(--muted); cursor: pointer; font-family: var(--font-body);
  font-size: 11.5px; padding: 4px 8px; white-space: nowrap;
}
.mark:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.mark:disabled { opacity: .5; cursor: default; }
.ok { font-family: var(--font-mono); font-size: 10px; color: var(--accent); letter-spacing: .06em; }

/* ── operator bar ─────────────────────────────────────────────────── */
/* Present only for an e1even key. A client never renders this because
   /client/me returns only their own client, so the roster never arrives. */
.opbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--black2); border: 1px solid var(--border);
  border-left: 3px solid var(--cyan); border-radius: 6px;
  padding: 10px 14px; margin: 18px 0 -6px;
}
.opbar-tag {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--cyan);
}
.opbar-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
}
.opbar-select {
  background: var(--black); border: 1px solid var(--muted2); border-radius: 5px;
  color: var(--white); font-family: var(--font-body); font-size: 13px; padding: 6px 10px;
}
.opbar-note { color: var(--muted); font-size: 12px; }
.conf { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.conf span { font-family: var(--font-mono); font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
