/* =========================================================================
   CALL COCKPIT — styles.css
   Bespoke cold-call instrument cluster. Blue-tinted near-black,
   Archivo + Spline Sans Mono, signal-green / amber / crimson / indigo.
   ========================================================================= */

/* ---- 2.1 Palette + tokens ---- */
:root {
  --bg:        #0A0B12;
  --surface:   #11131C;
  --elevated:  #1A1D2A;
  --border:    #272B3A;

  --green:     #22FF7A;
  --amber:     #F5A623;
  --red:       #FF4455;
  --indigo:    #5B6BFF;
  --indigo-text: #7C89FF;   /* lighter indigo for small text — clears AA on --surface */

  --text:      #E8EAF2;
  --text-2:    #9298AD;
  --text-3:    #737A96;     /* ≈4.6:1 on --surface — clears WCAG AA for normal text */

  --green-10:  rgba(34,255,122,0.10);
  --green-20:  rgba(34,255,122,0.20);
  --amber-15:  rgba(245,166,35,0.15);
  --amber-20:  rgba(245,166,35,0.20);
  --red-15:    rgba(255,68,85,0.15);
  --red-20:    rgba(255,68,85,0.20);
  --indigo-15: rgba(91,107,255,0.15);
  --neutral-15: rgba(146,152,173,0.12);

  --font-ui: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-num: "Spline Sans Mono", "SF Mono", ui-monospace, "JetBrains Mono", monospace;

  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --maxw: 560px;
  --radius: 10px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: contain;
}

body {
  min-height: 100dvh;
  max-width: var(--maxw);
  margin: 0 auto;
  position: relative;
}

.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

button { font-family: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- App shell / views ---- */
#app {
  padding-top: var(--safe-t);
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 8px);
  min-height: 100dvh;
}
.view { display: none; }
.view.active { display: flex; flex-direction: column; min-height: calc(100dvh - var(--tabbar-h) - var(--safe-b) - var(--safe-t)); }

.view-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 16px 18px 12px;
  position: sticky; top: var(--safe-t); z-index: 5;
  background: linear-gradient(to bottom, var(--bg) 70%, transparent);
}
.brand { font-size: 18px; font-weight: 600; letter-spacing: 0.06em; margin: 0; color: var(--text); }
.head-date { font-size: 13px; color: var(--text-3); }

.view-body { padding: 0 18px 24px; flex: 1; }

/* ---- Instrument label primitive ---- */
.ilabel {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-3);
  margin: 0 0 8px;
}

/* =========================================================================
   DASHBOARD
   ========================================================================= */
.section { margin-bottom: 22px; }

/* pipeline shelf */
.shelf {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.shelf::-webkit-scrollbar { display: none; }
.bubble {
  flex: 0 0 auto; display: flex; flex-direction: column; gap: 3px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 9px 12px; min-width: 70px;
  text-align: left;
}
.bubble:active { background: var(--elevated); }
.bubble-top { display: flex; align-items: center; gap: 6px; }
.bubble-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.bubble-label { font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-2); }
.bubble-count { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 500; color: var(--text); }

/* stat grid */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--indigo);
  border-radius: var(--radius); padding: 14px;
  text-align: left;
}
.stat-card:active { background: var(--elevated); }
.stat-card--wide { grid-column: 1 / -1; }
.stat-card.stripe-amber { border-left-color: var(--amber); }
.stat-card.stripe-green { border-left-color: var(--green); }
/* A single 1px top highlight reads as intentional crafted edge-lighting —
   replaces the old near-invisible (1.5% opacity) scanline texture. */
.stat-card::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; pointer-events: none;
  background: rgba(255,255,255,0.06);
}
.stat-val { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-weight: 500; font-size: 42px; line-height: 1; color: var(--indigo); }
.stat-card.stripe-amber .stat-val { color: var(--amber); }
.stat-card.stripe-green .stat-val { color: var(--green); }
.stat-lbl { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-top: 6px; }

/* goal ring */
.goal-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; width: 100%; text-align: left;
}
.goal-card:active { background: var(--elevated); }
.ring-wrap { flex: 0 0 auto; position: relative; width: 110px; height: 110px; }
.ring-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
}
.ring-frac { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 500; color: var(--text); }
.ring-pct { font-family: var(--font-num); font-size: 12px; color: var(--text-3); }
.goal-meta .ilabel { margin-bottom: 4px; }
.goal-meta-sub { font-size: 13px; color: var(--text-2); }

/* revenue chips */
.rev-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.rev-chip {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 11px 12px; text-align: left;
}
.rev-chip .ilabel { margin-bottom: 5px; }
.rev-val { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 19px; font-weight: 500; color: var(--green); }
.mrr-readout {
  margin-top: 10px; display: flex; align-items: baseline; justify-content: space-between;
  background: var(--indigo-15); border: 1px solid rgba(91,107,255,0.3);
  border-radius: var(--radius); padding: 10px 14px;
}
.mrr-readout .ilabel { margin: 0; color: var(--text-2); }
.mrr-val { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 500; color: var(--indigo-text); }

/* funnel */
.funnel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.fn-row { margin-bottom: 12px; }
.fn-row:last-child { margin-bottom: 0; }
.fn-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 5px; }
.fn-label { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-2); }
.fn-right { display: flex; align-items: baseline; gap: 10px; }
.fn-count { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 17px; font-weight: 500; color: var(--text); }
.fn-conv { font-family: var(--font-num); font-size: 12px; color: var(--text-3); min-width: 38px; text-align: right; }
.fn-bar-track { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.fn-bar-fill { height: 100%; background: var(--indigo); border-radius: 4px; transition: width .3s ease-out; }

/* recent activity */
.feed { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.feed-row {
  display: flex; align-items: center; gap: 11px; padding: 11px 14px;
  min-height: 56px; border-bottom: 1px solid var(--border); width: 100%; text-align: left; background: none;
}
.feed-row:last-child { border-bottom: none; }
.feed-row:active { background: var(--elevated); }
.feed-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.feed-body { flex: 1; min-width: 0; }
.feed-name { font-size: 15px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-sub { font-size: 12px; color: var(--text-3); }
.feed-right { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.feed-amt { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 14px; color: var(--green); }
.feed-chip {
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 5px; color: var(--text-2); background: var(--neutral-15);
}
.feed-time { font-family: var(--font-num); font-size: 11px; color: var(--text-3); }
.feed-unattached { font-size: 10px; color: var(--amber); margin-top: 1px; }

.empty { color: var(--text-3); font-size: 14px; text-align: center; padding: 26px 14px; }

/* =========================================================================
   DIAL
   ========================================================================= */
#view-dial { padding: 0; }
.subject-bar {
  position: sticky; top: var(--safe-t); z-index: 6;
  display: flex; align-items: center; gap: 10px;
  background: var(--elevated); border-bottom: 1px solid var(--border);
  padding: 10px 14px; min-height: 56px;
}
.subject-main { flex: 1; min-width: 0; background: none; border: none; text-align: left; padding: 8px 0; align-self: stretch; min-height: 56px; display: flex; flex-direction: column; justify-content: center; }
.subject-text { display: block; font-size: 16px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subject-text.placeholder { color: var(--text-3); font-weight: 500; }
.subject-sub { display: block; font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subject-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.call-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--green); color: #06210F; font-weight: 700; font-size: 13px;
  padding: 9px 14px; border-radius: 999px; letter-spacing: 0.04em;
}
.call-pill:active { filter: brightness(0.92); }
.subject-clear {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}

/* quick log strip */
.quicklog {
  position: sticky; top: calc(var(--safe-t) + 56px); z-index: 5;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 8px 10px;
}
.ql {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  background: none; border: none; padding: 6px 2px; border-radius: 8px;
  min-height: 48px; min-width: 48px;
}
.ql:active { background: var(--elevated); }
.ql.flash { background: var(--elevated); }
.ql-dot { width: 22px; height: 22px; border-radius: 50%; }
.ql-lbl { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: var(--text-2); }
.d-neutral { background: transparent; border: 2px solid var(--text-3); }
.d-amber { background: var(--amber); }
.d-red { background: var(--red); }
.d-green { background: var(--green); }

/* outcome slabs */
.slabs {
  flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 12px 14px; align-content: stretch;
}
.slab {
  position: relative; display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  min-height: 72px; padding: 12px 14px 12px 18px;
  border: 1px solid var(--border); border-left: 4px solid var(--text-3);
  border-radius: var(--radius); background: var(--surface);
  transition: transform .08s ease-out, background .08s ease-out;
}
.slab.press { transform: scale(0.97); }
.slab-lbl { font-size: 17px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--text); }
.slab-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.s-neutral { border-left-color: var(--text-3); }
.s-neutral.press { background: var(--neutral-15); }
.s-amber { border-left-color: var(--amber); background: var(--amber-15); }
.s-amber .slab-lbl { color: #FFD89B; }
.s-amber.press { background: var(--amber-20); }
.s-red { border-left-color: var(--red); background: var(--red-15); }
.s-red .slab-lbl { color: #FFB3BB; }
.s-red.press { background: var(--red-20); }
.s-booked { border-left-color: var(--green); background: var(--green-20); }
.s-booked .slab-lbl { color: var(--green); }
.s-booked.press { background: rgba(34,255,122,0.32); }
.s-sale { border: 1px solid var(--green); border-left: 4px solid var(--green); background: var(--green); }
.s-sale .slab-lbl { color: #06210F; }
.s-sale .slab-sub { color: #0A3A1C; }
.s-sale.press { filter: brightness(0.9); transform: scale(0.97); }

.dial-foot { padding: 4px 16px 14px; }
.note-toggle { background: none; border: none; color: var(--text-3); font-size: 13px; padding: 12px 0; min-height: 44px; }
.note-wrap { margin: 6px 0; }
.note-input {
  width: 100%; background: var(--elevated); border: 1px solid var(--border);
  border-radius: 8px; padding: 11px 12px; color: var(--text); font-size: 15px;
}
.session-tally { font-size: 13px; color: var(--text-2); margin: 8px 0 0; }

/* =========================================================================
   LEADS
   ========================================================================= */
.leads-controls { padding: 0 18px 8px; position: sticky; top: calc(var(--safe-t) + 48px); z-index: 4; background: var(--bg); }
.search-input {
  width: 100%; background: var(--elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; color: var(--text); font-size: 15px;
  margin: 8px 0;
}
.search-input::placeholder { color: var(--text-3); }
.chips { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 500; color: var(--text-2);
}
/* Generic active fallback FIRST so any active chip is always visually distinct,
   even a status value with no specific override below. */
.chip.active { background: var(--indigo-15); border-color: var(--indigo); color: var(--text); }
.chip.active[data-status="all"] { background: var(--indigo-15); border-color: var(--indigo); color: var(--text); }
.chip.active[data-status="callback"], .chip.active[data-status="attempting"] { background: var(--amber-15); border-color: rgba(245,166,35,0.5); }
.chip.active[data-status="new"] { background: var(--neutral-15); border-color: var(--text-3); }
.chip.active[data-status="booked"], .chip.active[data-status="won"] { background: var(--green-10); border-color: rgba(34,255,122,0.4); }
.chip.active[data-status="lost"] { background: var(--red-15); border-color: rgba(255,68,85,0.4); }

.lead-row {
  display: flex; gap: 0; align-items: stretch;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 9px; overflow: hidden;
}
.lead-statusbar { width: 4px; flex: 0 0 auto; }
.lead-main { flex: 1; min-width: 0; position: relative; }
.lead-top { display: flex; align-items: center; padding: 12px 64px 12px 14px; gap: 10px; min-height: 72px; }
.lead-info { flex: 1; min-width: 0; }
.lead-name { font-size: 16px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-biz { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-meta2 { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.lead-trade { font-size: 10px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text-2); background: var(--neutral-15); padding: 2px 7px; border-radius: 5px; }
.lead-city { font-size: 12px; color: var(--text-3); }
.lead-ago { font-family: var(--font-num); font-size: 11px; color: var(--text-3); }
.lead-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.lead-callbtn { width: 48px; height: 48px; border-radius: 50%; background: var(--green-10); border: 1px solid rgba(34,255,122,0.3); color: var(--green); display: flex; align-items: center; justify-content: center; }
.lead-callbtn:active { background: var(--green-20); }
.lead-lastdot { width: 9px; height: 9px; border-radius: 50%; }

.lead-expand { max-height: 0; overflow: hidden; transition: max-height .25s ease-out; }
.lead-expand.open { max-height: 720px; }
.lead-expand-inner { padding: 4px 14px 14px; border-top: 1px solid var(--border); }
.lead-notes { font-size: 13px; color: var(--text-2); margin: 10px 0; white-space: pre-wrap; }
.lead-hist-lbl { margin: 12px 0 6px; }
.lead-hist { display: flex; flex-direction: column; gap: 4px; }
.lead-hist-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.lead-hist-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.lead-hist-out { color: var(--text-2); flex: 1; }
.lead-hist-time { font-family: var(--font-num); font-size: 11px; color: var(--text-3); }
.status-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.sc {
  font-size: 11px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase;
  padding: 12px 14px; min-height: 44px; display: inline-flex; align-items: center;
  border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: var(--text-2);
}
.sc.on { color: var(--text); }
.lead-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 6px; }
.la-btn { padding: 11px 0; border-radius: 8px; border: 1px solid var(--border); background: var(--elevated); color: var(--text); font-size: 14px; font-weight: 600; text-align: center; }
.la-btn.call { color: var(--green); border-color: rgba(34,255,122,0.3); }
.la-btn:active { background: var(--surface); }

/* =========================================================================
   FAB + ICON BUTTON (Leads / Income primary CTAs)
   ========================================================================= */
.fab {
  position: fixed;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px);
  right: max(16px, calc((100vw - var(--maxw)) / 2 + 16px));
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--green); color: #06210F;
  font-size: 28px; font-weight: 400; line-height: 1;
  border: none; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(34,255,122,0.3);
  z-index: 10;
}
.fab:active { filter: brightness(0.88); transform: scale(0.95); }
.icon-btn {
  background: none; border: none; color: var(--text-2);
  padding: 6px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px;
}
.icon-btn:active { color: var(--text); background: var(--elevated); }

/* =========================================================================
   INCOME
   ========================================================================= */
.sum-strip { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 9px; margin-bottom: 12px; }
.sum-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--green); border-radius: var(--radius); padding: 12px;
}
.sum-card .ilabel { margin-bottom: 5px; }
.sum-val { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 19px; font-weight: 500; color: var(--green); }

.ledger-month { margin-top: 18px; }
.ledger-head { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 6px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.ledger-mlbl { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); }
.ledger-mtot { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 500; color: var(--green); }
.inc-row { display: flex; align-items: center; gap: 11px; padding: 11px 4px; border-bottom: 1px solid rgba(39,43,58,0.5); }
.inc-date { font-family: var(--font-num); font-size: 12px; color: var(--text-3); flex: 0 0 auto; width: 44px; }
.inc-body { flex: 1; min-width: 0; }
.inc-label { font-size: 15px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inc-lead { font-size: 12px; color: var(--text-2); }
.kind-pill { font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 8px; border-radius: 5px; flex: 0 0 auto; margin-left: 4px; }
.kind-setup { color: var(--green); background: var(--green-10); }
.kind-mrr { color: var(--indigo-text); background: var(--indigo-15); }
.kind-deposit { color: var(--amber); background: var(--amber-15); }
.kind-other { color: var(--text-2); background: var(--neutral-15); }
.inc-amt { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 500; color: var(--green); flex: 0 0 auto; }
.inc-del { background: none; border: none; color: var(--text-3); font-size: 18px; padding: 0 4px; flex: 0 0 auto; }

/* =========================================================================
   DATA / SETTINGS
   ========================================================================= */
.data-section { margin-bottom: 24px; }
.data-section > .ilabel { margin-bottom: 10px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.field input[type=text], .field input[type=number], .field select {
  width: 100%; background: var(--elevated); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 14px; color: var(--text); font-size: 15px;
}
.stepper { display: flex; align-items: center; gap: 0; }
.stepper button { width: 52px; height: 52px; font-size: 24px; background: var(--elevated); border: 1px solid var(--border); color: var(--text); }
.stepper button:first-child { border-radius: 8px 0 0 8px; }
.stepper button:last-child { border-radius: 0 8px 8px 0; }
.stepper input { width: 90px; text-align: center; border-radius: 0; border-left: none; border-right: none; font-family: var(--font-num); font-size: 20px; }

.data-btn {
  width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 15px 16px; color: var(--text); font-size: 15px; font-weight: 600;
  margin-bottom: 9px; display: flex; align-items: center; justify-content: space-between;
}
.data-btn:active { background: var(--elevated); }
.data-btn .db-sub { font-size: 12px; color: var(--text-3); font-weight: 400; margin-top: 2px; }
.data-btn .db-left { display: flex; flex-direction: column; }
.data-btn.danger { border-color: rgba(255,68,85,0.4); color: var(--red); }
.wipe-confirm { margin-top: 8px; }
.wipe-confirm input { width: 100%; background: var(--bg); border: 1px solid var(--red); border-radius: 8px; padding: 12px; color: var(--text); font-size: 15px; letter-spacing: 0.1em; }
.wipe-go { width: 100%; margin-top: 8px; padding: 14px; border-radius: 8px; background: var(--red); border: none; color: #fff; font-weight: 700; opacity: 0.4; pointer-events: none; }
.wipe-go.armed { opacity: 1; pointer-events: auto; }

.health { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.health-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; }
.health-k { color: var(--text-2); }
.health-v { font-family: var(--font-num); color: var(--text); }
.gauge { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.gauge-fill { height: 100%; background: var(--indigo); border-radius: 3px; }
.gauge-fill.warn { background: var(--amber); }

/* =========================================================================
   TAB BAR
   ========================================================================= */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0;
  width: 100%; max-width: var(--maxw); z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: var(--safe-b);
  height: calc(var(--tabbar-h) + var(--safe-b));
}
.goal-fill { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: rgba(91,107,255,0.12); }
.goal-fill-inner { display: block; height: 100%; width: 0%; background: var(--indigo); transition: width .3s ease-out; }
.goal-fill-inner.hit { background: var(--green); }
.goal-fill-inner.flash { animation: goalflash .5s ease-out; }
@keyframes goalflash { 0%,100% { background: var(--green); } 50% { background: #B6FFD0; box-shadow: 0 0 8px var(--green); } }

.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; border: none; color: var(--text-3); padding-top: 6px; height: var(--tabbar-h);
}
.tab-ico { width: 22px; height: 22px; }
.tab-lbl { font-size: 10px; font-weight: 600; letter-spacing: 0.02em; }
.tab.active { color: var(--text); }
.tab.active::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 2px; background: var(--indigo); border-radius: 0 0 2px 2px;
}
.tab-badge {
  position: absolute; top: 4px; right: 50%; margin-right: -22px;
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--amber); color: #2A1A00; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}

/* =========================================================================
   TOAST
   ========================================================================= */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(140%);
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px); z-index: 30;
  background: var(--elevated); color: var(--text); border: 1px solid var(--border);
  border-radius: 999px; padding: 11px 20px; font-size: 14px; font-weight: 600;
  box-shadow: 0 6px 24px rgba(0,0,0,0.5); max-width: 90%; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: transform .2s ease-out, opacity .2s ease-out;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast .tnum { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

/* =========================================================================
   SHEETS / SCRIM
   ========================================================================= */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 40; opacity: 0; transition: opacity .2s ease-out; }
.scrim.show { opacity: 1; }
.sheet {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(100%);
  bottom: 0; width: 100%; max-width: var(--maxw); z-index: 41;
  background: var(--elevated); border-radius: 16px 16px 0 0; border-top: 1px solid var(--border);
  padding: 8px 18px calc(18px + var(--safe-b)); max-height: 88dvh; overflow-y: auto;
  transition: transform .24s ease-out;
}
.sheet.show { transform: translateX(-50%) translateY(0); }
.sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 4px auto 12px; }
.sheet-title { font-size: 18px; font-weight: 700; margin: 0 0 4px; }
.sheet-title small { font-size: 13px; font-weight: 400; color: var(--text-2); }
.sheet-content .field:first-of-type { margin-top: 8px; }

.seg { display: flex; gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { flex: 1; padding: 14px 4px; min-height: 44px; background: var(--bg); border: none; border-right: 1px solid var(--border); color: var(--text-2); font-size: 13px; font-weight: 600; }
.seg button:last-child { border-right: none; }
.seg button.on { background: var(--indigo-15); color: var(--text); }

.sheet-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.sbtn { padding: 15px; border-radius: 10px; border: none; font-size: 16px; font-weight: 700; }
.sbtn.primary { background: var(--green); color: #06210F; }
.sbtn.neutral { background: var(--elevated); border: 1px solid var(--border); color: var(--text); }
.sbtn.full { grid-column: 1 / -1; }
.sbtn.danger { background: var(--red); color: #fff; }
.sbtn.del-link { grid-column: 1/-1; background: none; border: 1px solid rgba(255,68,85,0.4); color: var(--red); }

.amount-input {
  width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 18px; color: var(--green); font-family: var(--font-num); font-size: 30px; font-weight: 500;
  text-align: right;
}
.amount-wrap { position: relative; }
.amount-prefix { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-family: var(--font-num); font-size: 22px; }

/* sheet picker list */
.picker-search { margin-bottom: 10px; }
.picker-list { display: flex; flex-direction: column; gap: 2px; max-height: 50dvh; overflow-y: auto; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 12px 8px; background: none; border: none; border-radius: 8px; text-align: left; width: 100%; }
.pick-row:active { background: var(--surface); }
.pick-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.pick-info { flex: 1; min-width: 0; }
.pick-name { font-size: 15px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-biz { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-phone { font-family: var(--font-num); font-size: 12px; color: var(--text-3); flex: 0 0 auto; }
.pick-overdue { color: var(--amber); }
.pick-create { color: var(--indigo); font-weight: 600; }
.anon-toggle {
  width: 100%; margin-top: 10px; background: none; border: 1px dashed var(--border);
  border-radius: 8px; color: var(--text-2); font-size: 14px; font-weight: 600;
  padding: 13px 12px; min-height: 48px;
}
.anon-toggle:active { background: var(--surface); }
.anon-wrap { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; margin-top: 8px; }
.anon-wrap input { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 13px 11px; min-height: 48px; color: var(--text); font-size: 14px; }
.anon-go { background: var(--indigo); border: none; border-radius: 8px; color: #fff; font-weight: 700; padding: 0 16px; min-height: 48px; }
.picker-divider { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; margin: 6px 0 4px; }

/* status dot colors (shared) */
.st-new { background: var(--text-3); }
.st-attempting { background: var(--amber); }
.st-callback { background: var(--amber); }
.st-booked { background: var(--green); }
.st-won { background: var(--green); }
.st-lost { background: var(--red); }
.out-no_answer { background: var(--text-3); }
.out-voicemail { background: var(--amber); }
.out-callback { background: var(--amber); }
.out-not_interested { background: var(--red); }
.out-booked { background: var(--green); }
.out-sale { background: var(--green); }

/* =========================================================================
   ONBOARDING
   ========================================================================= */
.onboard { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; flex-direction: column; }
.ob-track { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.ob-track::-webkit-scrollbar { display: none; }
.ob-card { flex: 0 0 100%; scroll-snap-align: start; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 40px 32px; }
.ob-num { font-family: var(--font-num); font-size: 54px; color: var(--indigo); }
.ob-h { font-size: 26px; font-weight: 700; margin: 14px 0 10px; }
.ob-p { font-size: 16px; color: var(--text-2); line-height: 1.5; }
.ob-foot { padding: 20px 32px calc(28px + var(--safe-b)); display: flex; align-items: center; justify-content: space-between; }
.ob-dots { display: flex; gap: 7px; }
.ob-d { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.ob-d.on { background: var(--indigo); }
.ob-skip { background: var(--green); color: #06210F; border: none; border-radius: 999px; padding: 12px 26px; font-weight: 700; font-size: 15px; }

/* =========================================================================
   SHORT-SCREEN FIT (landscape / small devices)
   On very short viewports the 6 outcome slabs can push BOOKED/SALE below the
   fold. Trim slab height, padding and label size so all six stay reachable
   without scrolling the Dial view.
   ========================================================================= */
@media (max-height: 620px) {
  .slabs { gap: 7px; padding: 8px 14px; }
  .slab { min-height: 54px; padding: 8px 12px 8px 16px; }
  .slab-lbl { font-size: 15px; }
  .slab-sub { font-size: 11px; margin-top: 1px; }
  .ql { min-height: 42px; }
  .ql-dot { width: 18px; height: 18px; }
  .subject-bar { min-height: 48px; padding: 7px 14px; }
  .subject-main { min-height: 48px; }
  .dial-foot { padding: 2px 16px 10px; }
}

/* =========================================================================
   MOTION PREFS
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .slab.press, .s-sale.press { transform: none; }
}
