/* Volt tokens, same values as website/site.css — this app ships with the
   proxy rather than the marketing site, so it carries its own copy. */
:root {
  --canvas: #16181a;
  --surface: #1f2225;
  --raised: #272b2f;
  --volt: #ceff00;
  --ink: #ffffff;
  --ink2: rgba(255, 255, 255, 0.62);
  --ink3: rgba(255, 255, 255, 0.34);
  --line: rgba(255, 255, 255, 0.11);
  --bad: #ff8a7a;
  --r-card: 16px;
  --r-control: 12px;
  --s: 8px;
  --m: 16px;
  --l: 24px;
}

* { box-sizing: border-box; }

/* `color-scheme: dark` is what makes the browser paint the scrollbar, form
   controls and focus rings dark. Without it a dark page gets a bright white
   scrollbar, which `scrollbar-gutter: stable` below then reserves a strip for
   on EVERY page — including ones too short to scroll.
   The gutter itself stays: it is what stops the signup form (taller, so it
   scrolls) and the login form (shorter, so it doesn't) sitting 8px apart. */
html {
  color-scheme: dark;
  scrollbar-gutter: stable;
}

/* An author `display` rule outranks the UA stylesheet's [hidden]{display:none},
   so .signin's `display: grid` kept it painted over the signed-in app. Every
   hidden state in this app is toggled by the attribute, so make it win. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 15px/1.5 ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2 { letter-spacing: -0.02em; }

/* ---- sign in ---- */
/* Anchored to the top, not centered, so the card sits where the signed-in
   app's header will be and nothing jumps when the session check resolves. */
.signin { display: grid; place-items: start center; min-height: 100vh; padding: 12vh var(--l) var(--l); }
.signin-card { width: min(420px, 100%); }
.signin-card h1 { font-size: 22px; margin: 0 0 var(--s); }
.signin-card h1 span, .brand span { color: var(--volt); }
.signin-card p { color: var(--ink2); margin: 0 0 var(--l); }
.signin-card form { display: flex; flex-direction: column; gap: var(--m); }

/* The two ways in. Both open the hosted sign-in page, so they are the same
   width and stacked: the choice is which side of that page to land on. */
.signin-actions { display: flex; flex-direction: column; gap: var(--s); margin-bottom: var(--m); }
.signin-actions .btn { width: 100%; }

.signin-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink2); }

/* The desktop key, shown once. Monospace and wrapping, because a rep has to
   read or copy it accurately and it is longer than the box. */
.tokenbox {
  display: block; margin-bottom: var(--m);
  background: var(--surface); border: 1px solid var(--volt); border-radius: var(--r-control);
  padding: 12px 14px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; word-break: break-all; color: var(--volt);
}

input, select, textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  color: var(--ink);
  padding: 11px 13px;
  font: inherit;
}

input:focus, select:focus, textarea:focus { outline: 2px solid var(--volt); outline-offset: 1px; }
textarea { resize: vertical; }

.btn {
  border: 1px solid transparent;
  border-radius: var(--r-control);
  padding: 11px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn.primary { background: var(--volt); color: #10120f; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--ink2); border-color: var(--line); }
.btn.ghost:hover { color: var(--ink); border-color: var(--ink3); }
.btn:disabled { opacity: 0.45; cursor: default; filter: none; }

.linkish {
  background: none; border: 0; color: var(--ink3);
  font: inherit; cursor: pointer; padding: 0;
}
.linkish:hover { color: var(--ink2); }

.err { color: var(--bad); font-size: 13px; margin: 0; }
.hint { color: var(--ink3); font-size: 13px; }

/* ---- chrome ---- */
.topbar {
  display: flex; align-items: center; gap: var(--l);
  padding: var(--m) var(--l);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--canvas); z-index: 2;
}

.brand { font-weight: 600; letter-spacing: -0.01em; }
.tabs { display: flex; gap: var(--s); margin-left: auto; }
.site-link { text-decoration: none; }

.tab {
  background: none; border: 1px solid transparent; border-radius: 999px;
  color: var(--ink3); font: inherit; padding: 6px 14px; cursor: pointer;
}
.tab:hover { color: var(--ink2); }
.tab.is-on { color: var(--volt); border-color: var(--volt); }

.pane { max-width: 620px; margin: 0 auto; padding: var(--l); }
.pane-head h2 { margin: 0 0 var(--s); font-size: 20px; }
.pane-head p { color: var(--ink2); margin: 0 0 var(--l); }

/* ---- the lead ---- */
.lead {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: var(--l);
}

.lead-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--m); }

.pill {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--volt); border: 1px solid var(--volt); border-radius: 999px; padding: 3px 10px;
}
.pill.blocked { color: var(--bad); border-color: var(--bad); }

.pool { font-size: 12px; color: var(--ink3); }

.lead h2 { font-size: 26px; margin: 0 0 var(--s); }
.lead-contact { color: var(--ink2); margin: 0 0 var(--m); }
.sep { margin: 0 8px; color: var(--ink3); }

.phone {
  display: inline-block; margin-bottom: var(--l);
  color: var(--volt); font-size: 20px; font-weight: 600;
  text-decoration: none; font-variant-numeric: tabular-nums;
}
.phone:hover { text-decoration: underline; }

.note {
  background: var(--raised); border-left: 2px solid var(--volt);
  border-radius: 0 var(--r-control) var(--r-control) 0;
  padding: 10px 14px; margin-bottom: var(--l);
  color: var(--ink2); font-size: 14px;
}

.logform { display: flex; flex-direction: column; gap: var(--m); }
.logform label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink2); }
.row { display: flex; gap: var(--s); flex-wrap: wrap; }

.lead-empty { text-align: center; padding: 64px var(--l); }
.lead-empty h2 { margin: 0 0 var(--s); }
.lead-empty p { color: var(--ink2); margin: 0; }
.lead-empty-inline { color: var(--ink3); }

/* ---- book ---- */
.import { display: flex; flex-direction: column; gap: var(--s); margin-bottom: var(--l); align-items: flex-start; }
.import textarea { margin-bottom: var(--s); }

.booklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.booklist li {
  background: var(--surface); padding: 12px var(--m);
  display: flex; justify-content: space-between; gap: var(--m);
}
.booklist li:first-child { border-radius: var(--r-control) var(--r-control) 0 0; }
.booklist li:last-child { border-radius: 0 0 var(--r-control) var(--r-control); }
.booklist .who { color: var(--ink3); font-size: 13px; }

/* ---- numbers ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s); }

.tile {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: var(--m);
}
.tile .k { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink3); }
.tile .v { font-size: 26px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; }
.tile .n { font-size: 12px; color: var(--ink3); margin-top: 2px; }
/* No data is not zero. A new rep must not be shown "0%" as if it were a result. */
.tile .v.none { color: var(--ink3); font-size: 20px; }

@media (max-width: 560px) {
  .topbar { flex-wrap: wrap; gap: var(--m); }
  .tabs { margin-left: 0; width: 100%; }
}

.check { flex-direction: row !important; align-items: flex-start; gap: 10px; }
.check input { width: auto; margin-top: 2px; flex: none; }
.check a { color: var(--volt); }

.demoskip { margin-top: var(--m); padding-top: var(--m); border-top: 1px dashed var(--line); }
.demoskip .btn { width: 100%; }
.backhome { margin-top: var(--l); font-size: 13px; }
.backhome a { color: var(--ink3); text-decoration: none; }
.backhome a:hover { color: var(--ink2); }
a.brand { text-decoration: none; color: var(--ink); }

/* ---- my numbers: one thing to look at, then the breakdown ---- */
.hero-stat {
  display: flex; align-items: center; gap: var(--l);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: var(--l); margin-bottom: var(--s);
  flex-wrap: wrap;
}

.ring-wrap { position: relative; width: 132px; height: 132px; flex: none; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.ring-track { stroke: rgba(255, 255, 255, 0.08); }
/* No transition on first paint would be fine; the ease makes a saved call
   visibly move the arc, which is the whole point of a ring over a number. */
.ring-fill { stroke: var(--volt); transition: stroke-dashoffset 600ms ease; stroke-dasharray: 327; stroke-dashoffset: 327; }

.ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ring-value { font-size: 34px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.ring-unit { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink3); margin-top: 4px; }

.hero-copy { flex: 1 1 220px; }
.hero-label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink3); }
.hero-line { font-size: 20px; font-weight: 600; margin: var(--s) 0 4px; letter-spacing: -0.01em; }
.hero-sub { color: var(--ink2); font-size: 13px; margin: 0; }

/* ---- my book: contact cards ---- */
.addcontact { margin-bottom: var(--l); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--m); margin-bottom: var(--m); }
.fields label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink2); }
#paste-block { margin-top: var(--m); display: flex; flex-direction: column; gap: var(--s); align-items: flex-start; }

/* CRM line items. A list you scan down a column of, not a wall of cards. */
.rows {
  border: 1px solid var(--line); border-radius: var(--r-control);
  overflow: hidden; background: var(--surface);
}

.row-item {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 0.7fr);
  gap: var(--m);
  padding: 10px var(--m);
  border-top: 1px solid var(--line);
  font-size: 13px;
  align-items: baseline;
}
.row-item:first-child { border-top: 0; }
.row-item:not(.row-head):hover { background: var(--raised); }

.row-head {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink3); background: var(--canvas);
}

.cell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell.c-company { color: var(--ink); font-weight: 500; }
.cell.c-who, .cell.c-title, .cell.c-when { color: var(--ink2); }
.cell.c-when { text-align: right; font-variant-numeric: tabular-nums; }
.cell.c-phone a { color: var(--volt); text-decoration: none; font-variant-numeric: tabular-nums; }
.cell.c-phone a:hover { text-decoration: underline; }

/* Read off the call, rather than typed from memory. */
.row-item.is-auto .cell.c-company::before {
  content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--volt); margin-right: 7px; vertical-align: middle;
}

.history { margin-top: var(--l); }
.history-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--s); }
.history-head h3 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink3); }

@media (max-width: 620px) {
  .row-item { grid-template-columns: 1fr auto; }
  .cell.c-title { display: none; }
}

/* The license pitch on the leads page. Hidden the moment /auth/me says the
   account is licensed — a paid rep must never be sold the thing they bought. */
.crosssell {
  margin-top: var(--l);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 2px solid var(--volt);
  border-radius: var(--r-control);
  padding: var(--m);
  display: flex; align-items: center; gap: var(--m); flex-wrap: wrap;
}
.crosssell p { margin: 0; flex: 1 1 260px; color: var(--ink2); font-size: 13px; }
.crosssell strong { color: var(--ink); }
.crosssell .btn { flex: none; padding: 8px 14px; font-size: 13px; }

#when-field input[type='date'] { color-scheme: dark; }

/* ---- the book: what a rep has already closed, which is the job ---- */
.pane-wide { max-width: 860px; }

.book {
  display: flex; flex-wrap: wrap; gap: var(--l); align-items: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: var(--l);
}
.book-hero { flex: 1 1 240px; }
.book-hero .k { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink3); }
.book-figure {
  margin: var(--s) 0 4px; font-size: clamp(36px, 7vw, 52px); line-height: 1;
  font-weight: 600; letter-spacing: -0.03em; color: var(--volt);
  font-variant-numeric: tabular-nums;
}
.book-sub { font-size: 13px; color: var(--ink2); }

.book-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--m) var(--l); margin: 0; }
.book-side dt { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink3); }
.book-side dd { margin: 4px 0 0; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }

.band-title {
  margin: var(--l) 0 var(--s); font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink3);
}

.chartblock { margin: 0; }
.chartblock svg { width: 100%; height: 140px; margin-top: var(--s); }
.chartblock figcaption { display: block; margin-bottom: 2px; }
.t-bar { fill: rgba(206, 255, 0, 0.32); }
/* The best hour is the only thing on this chart worth pointing at. */
.t-bar.best { fill: var(--volt); }
.t-tick { fill: var(--ink3); font-size: 10px; }

.locked-why { display: block; margin: 0 0 var(--s); }
.tiles.locked .tile { opacity: 0.55; border-style: dashed; }

/* ---- pipeline ---- */
.deal-row { grid-template-columns: minmax(0,1.3fr) minmax(0,1fr) 72px minmax(0,0.8fr) minmax(0,0.6fr); }
.deal-row.is-churned .cell.c-company { text-decoration: line-through; color: var(--ink3); }

.stage-pick, .seat-input {
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-chip);
  color: var(--ink); font: inherit; font-size: 12px; padding: 4px 6px; width: 100%;
}
.seat-input { text-align: right; font-variant-numeric: tabular-nums; }
.cell.c-when a { color: var(--volt); text-decoration: none; }
.cell.c-when a:hover { text-decoration: underline; }

@media (max-width: 700px) {
  .deal-row { grid-template-columns: 1fr auto; }
  .deal-row .cell:nth-child(3), .deal-row .cell:nth-child(4) { display: none; }
}

/* ---- get set up ---- */
/* A checklist, top to bottom, with the one live step open in the middle of
   it. Done steps keep their mark and lose their controls. */
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s); }

.step {
  display: flex; gap: var(--m); align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: var(--m) var(--l);
}
.step-body { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--s); }
.step-body h3 { margin: 0; font-size: 16px; }
.step-body .hint { margin: 0; }
.step-body .btn { align-self: flex-start; }
.step-body form { display: flex; flex-direction: column; gap: var(--m); }
.step-body form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink2); }
.step-body form .btn { align-self: flex-start; }

.step-mark {
  flex: none; width: 22px; height: 22px; margin-top: 1px;
  border-radius: 50%; border: 1.5px solid var(--ink3);
  display: inline-flex; align-items: center; justify-content: center;
}
.step.is-done { border-color: var(--line); }
.step.is-done .step-mark { background: var(--volt); border-color: var(--volt); }
.step.is-done .step-mark::after {
  content: ''; width: 6px; height: 10px; margin-top: -3px;
  border: solid #10120f; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.step.is-done h3 { color: var(--ink2); }
/* Once signed, the form has done its job; the record line replaces it. */
/* The "open it in its own tab" hint after the box stays: the agreement says
   a signed rep can read the current version inside the app at any time. */
.step.is-done form, .step.is-done .agreement-box { display: none; }

/* The agreement, in a box you scroll. Sized so the signature controls stay
   on screen under it — the point is to read it, not to hunt for the button. */
.agreement-box {
  max-height: 360px; overflow-y: auto;
  background: var(--canvas); border: 1px solid var(--line); border-radius: var(--r-control);
  padding: var(--m) var(--l);
}
.agreement-box:focus { outline: 2px solid var(--volt); outline-offset: 1px; }

/* ---- the agreement as a document (in the box, and at /app/agreement.html) ---- */
.docpage { padding: var(--l); }
.doc { max-width: 720px; margin: 0 auto; font-size: 14px; line-height: 1.6; color: var(--ink2); }
.doc h1 { font-size: 20px; margin: 0 0 var(--s); color: var(--ink); }
.doc h2 { font-size: 15px; margin: var(--l) 0 var(--s); color: var(--ink); }
.doc p { margin: 0 0 var(--m); }
.doc ul { margin: 0 0 var(--m); padding-left: 20px; display: grid; gap: 6px; }
.doc strong { color: var(--ink); font-weight: 600; }
.doc a { color: var(--volt); }
.doc .eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink3); }
.doc .doc-head { margin-bottom: var(--l); }
.doc .doc-meta { font-size: 13px; color: var(--ink3); margin: 0; }
.doc .doc-meta strong { color: var(--ink2); }
.doc .annotation { font-size: 13px; color: var(--ink3); }

/* ---- payouts: the setup step and the Paid section ---- */
/* The country picker is a short select on its own line; the Stripe button
   sits under it like every other step's control. */
#payout-form select { max-width: 280px; }

/* Paid mirrors the book's shape — one figure with a label — so the dashboard
   reads as two numbers about money before the week's activity: what the
   book is worth, and what has actually arrived. */
.paid {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: var(--l); display: flex; flex-direction: column; gap: var(--m);
}
.paid-sofar .k { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink3); }
.paid-figure { font-size: 32px; font-weight: 600; margin: 4px 0 2px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.paid .note { margin: 0; }
/* A statement row carries a fourth cell — the accounts it came from — on its
   own line under the three columns, in the row's own grid. */
.paid .row-item { grid-template-rows: auto auto; }
.paid .cell.c-statement { grid-column: 1 / -1; white-space: normal; font-size: 12px; color: var(--ink3); }
/* The status cell is a sentence ("Paid with the August statement", or why
   it was held), so it wraps instead of ellipsizing like a company name. */
.paid .row-item:not(.row-head) .cell.c-title { white-space: normal; }
.paid .row-item.is-held .cell.c-title { color: var(--ink2); }
.paid .row-item.is-paid .cell.c-who { color: var(--volt); font-variant-numeric: tabular-nums; }
.paid .row-head .cell.c-statement { display: none; }
@media (max-width: 620px) {
  .paid .cell.c-title { display: block; grid-column: 1 / -1; white-space: normal; font-size: 12px; }
}
