/* ==========================================================================
   Ribak CRM — design tokens
   ========================================================================== */
:root {
  color-scheme: light;
  --ground: #EEF2F1;
  --surface: #FFFFFF;
  --surface-2: #F5F8F7;
  --surface-3: #E8EEEC;
  --ink: #12201D;
  --ink-2: #4E605B;
  --muted: #7F918C;
  --line: #D9E1DE;
  --line-strong: #B9C6C1;

  --accent: #0F7A84;
  --accent-hover: #0B646C;
  --accent-ink: #FFFFFF;
  --accent-soft: #D9EEF0;
  --accent-soft-ink: #0B5B62;

  /* funnel ramp: new → subscribed, one hue, light → deep */
  --f0: #6FC6CE;
  --f1: #4FB0B9;
  --f2: #329AA4;
  --f3: #17848E;
  --f4: #0B6D77;
  --f5: #05565E;
  --f6: #033F46;

  --active-fill: #CDE6E9;
  --active-line: #8FC5CB;

  --lost: #CF4F3B;
  --lost-hover: #B4402E;
  --lost-soft: #F9E1DC;
  --lost-soft-ink: #92311F;
  --warn: #B87A00;
  --warn-soft: #FBEFD1;
  --warn-soft-ink: #7A5000;
  --good: #1B7F4F;
  --good-soft: #D8F0E2;
  --good-soft-ink: #135B39;

  --shadow-pop: 0 2px 6px rgba(18, 32, 29, .08), 0 18px 48px rgba(18, 32, 29, .16);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;

  --font: 'Rubik', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --font-figures: 'Karantina', 'Rubik', system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0E1514;
    --surface: #161F1E;
    --surface-2: #1C2726;
    --surface-3: #243130;
    --ink: #E9F0EE;
    --ink-2: #A8B8B3;
    --muted: #778A85;
    --line: #26332F;
    --line-strong: #3A4A46;

    --accent: #3FB6C0;
    --accent-hover: #5CC7D0;
    --accent-ink: #06272A;
    --accent-soft: #163E42;
    --accent-soft-ink: #9EDDE3;

    --f0: #1C626A;
    --f1: #23757E;
    --f2: #2B8893;
    --f3: #349CA7;
    --f4: #45B0BA;
    --f5: #62C5CE;
    --f6: #8AD8DF;

    --active-fill: #223F42;
    --active-line: #3D7A80;

    --lost: #E0654F;
    --lost-hover: #EB7C68;
    --lost-soft: #43221D;
    --lost-soft-ink: #F3A697;
    --warn: #E0A526;
    --warn-soft: #3E2F0E;
    --warn-soft-ink: #F1C76A;
    --good: #3FBF7B;
    --good-soft: #17362A;
    --good-soft-ink: #8FE0B5;

    --shadow-pop: 0 2px 6px rgba(0, 0, 0, .35), 0 18px 48px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0E1514;
  --surface: #161F1E;
  --surface-2: #1C2726;
  --surface-3: #243130;
  --ink: #E9F0EE;
  --ink-2: #A8B8B3;
  --muted: #778A85;
  --line: #26332F;
  --line-strong: #3A4A46;

  --accent: #3FB6C0;
  --accent-hover: #5CC7D0;
  --accent-ink: #06272A;
  --accent-soft: #163E42;
  --accent-soft-ink: #9EDDE3;

  --f0: #1C626A;
  --f1: #23757E;
  --f2: #2B8893;
  --f3: #349CA7;
  --f4: #45B0BA;
  --f5: #62C5CE;
  --f6: #8AD8DF;

  --active-fill: #223F42;
  --active-line: #3D7A80;

  --lost: #E0654F;
  --lost-hover: #EB7C68;
  --lost-soft: #43221D;
  --lost-soft-ink: #F3A697;
  --warn: #E0A526;
  --warn-soft: #3E2F0E;
  --warn-soft-ink: #F1C76A;
  --good: #3FBF7B;
  --good-soft: #17362A;
  --good-soft-ink: #8FE0B5;

  --shadow-pop: 0 2px 6px rgba(0, 0, 0, .35), 0 18px 48px rgba(0, 0, 0, .5);
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  font-feature-settings: 'kern';
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body.has-modal, body.has-drawer { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 17px; font-weight: 600; letter-spacing: -.005em; text-wrap: balance; }
h3 { font-size: 14px; font-weight: 600; color: var(--ink-2); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
small { font-size: 12px; }
.muted { color: var(--muted); }
.good { color: var(--good); font-weight: 500; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ==========================================================================
   Top bar
   ========================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  max-width: 1360px; margin: 0 auto; padding: 0 20px;
  height: 58px; display: flex; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 26px; height: 26px; fill: var(--accent); }
.brand__name span { font-weight: 300; color: var(--ink-2); }

.nav { display: flex; gap: 4px; margin-inline-start: 6px; }
.nav a {
  position: relative; padding: 8px 12px; border-radius: 8px;
  color: var(--ink-2); font-weight: 500; font-size: 14.5px;
  display: inline-flex; align-items: center; gap: 6px;
}
.nav a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.nav a.is-on { color: var(--accent-soft-ink); background: var(--accent-soft); }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 12px; font-weight: 600; line-height: 20px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.nav a.is-on .badge { background: var(--accent-soft-ink); color: var(--accent-soft); }
.topbar__actions { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }

.sample-banner {
  max-width: 1360px; margin: 14px auto 0; padding: 10px 14px 10px 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--warn-soft); color: var(--warn-soft-ink);
  border-radius: var(--radius); font-size: 14px;
  width: calc(100% - 40px);
}

.mode-note { max-width: 1360px; margin: 12px auto -4px; width: calc(100% - 40px); font-size: 12.5px; color: var(--muted); text-align: start; }

/* Login / setup gate */
body.is-locked .nav, body.is-locked .topbar__actions .btn, body.is-locked #logout, body.is-locked .sample-banner, body.is-locked .mode-note { display: none !important; }
.view--gate { display: grid; place-items: center; min-height: calc(100vh - 58px); padding-top: 0; padding-bottom: 40px; }
.gate { width: 100%; display: grid; place-items: center; }
.gate__card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px 26px 24px; display: flex; flex-direction: column; gap: 14px; }
.gate__title { font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.gate__text { color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }
.gate__text b { color: var(--ink); }
.gate__list { margin: 0; padding: 0 18px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.7; }
.gate__err { color: var(--lost); font-size: 14px; }
.gate code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--surface-3); padding: 1px 6px; border-radius: 4px; direction: ltr; unicode-bidi: embed; }
.gate .btn--primary { height: 40px; }

/* ==========================================================================
   Controls
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--danger { background: var(--lost); border-color: var(--lost); color: #fff; }
.btn--danger:hover { background: var(--lost-hover); border-color: var(--lost-hover); }
.btn--danger-ghost { color: var(--lost); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn--ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--ink); }
.btn--lost { color: var(--lost); }
.btn--lost:hover { background: var(--lost-soft); color: var(--lost-soft-ink); }
.btn--sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn[disabled] { opacity: .5; cursor: default; }

.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center;
  border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

.input {
  width: 100%; height: 38px; padding: 0 11px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 14.5px;
  transition: border-color .12s, box-shadow .12s;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--muted); }
textarea.input { height: auto; padding: 9px 11px; line-height: 1.45; resize: vertical; }
select.input { padding-inline-end: 30px; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237F918C' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 10px center; }
.input--sm { height: 34px; font-size: 14px; width: auto; }
.input--search { min-width: 220px; }
input[type="date"].input { font-variant-numeric: tabular-nums; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field__label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field__hint { font-size: 12.5px; color: var(--muted); }
.field__warn { font-size: 12.5px; color: var(--warn-soft-ink); background: var(--warn-soft); padding: 5px 9px; border-radius: 6px; }
.form { display: flex; flex-direction: column; gap: 14px; }

.chips { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-3); border-radius: 9px; }
.chip {
  height: 28px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent;
  color: var(--ink-2); font-size: 13.5px; font-weight: 500; cursor: pointer;
}
.chip:hover { color: var(--ink); }
.chip.is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; user-select: none; }
.switch input { appearance: none; -webkit-appearance: none; width: 34px; height: 20px; border-radius: 10px; background: var(--line-strong); position: relative; cursor: pointer; margin: 0; transition: background .15s; }
.switch input::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(-14px); }

.choices { display: flex; flex-direction: column; gap: 4px; }
.choice { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 14.5px; }
.choice:hover { background: var(--surface-2); }
.choice:has(input:checked) { border-color: var(--lost); background: var(--lost-soft); color: var(--lost-soft-ink); }
.choice input { accent-color: var(--lost); margin: 0; }
.more { margin-top: 2px; }
.more summary { cursor: pointer; color: var(--ink-2); font-size: 13.5px; padding: 6px 0; }
.more[open] summary { margin-bottom: 6px; }

.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px;
  background: var(--surface-3); color: var(--ink-2); font-size: 12.5px; font-weight: 500; white-space: nowrap;
}
.tag--won { background: var(--accent-soft); color: var(--accent-soft-ink); }
.tag--active { background: var(--accent-soft); color: var(--accent-soft-ink); }
.tag--lost { background: var(--lost-soft); color: var(--lost-soft-ink); }
.tag--warn { background: var(--warn-soft); color: var(--warn-soft-ink); }
.won-tag { color: var(--accent-soft-ink); font-weight: 600; font-size: 13.5px; }

.stage-chip { display: inline-block; padding: 2px 8px 2px 8px; border-radius: 6px; font-size: 12.5px; font-weight: 500;
  color: var(--ink); background: var(--surface-3); border-inline-start: 3px solid var(--c, var(--f0)); }

/* ==========================================================================
   Layout
   ========================================================================== */
.view { max-width: 1360px; margin: 0 auto; padding: 18px 20px 60px; }
.view--pipeline { max-width: none; padding-inline: 20px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar__note { font-size: 13px; }
.toolbar > [data-export] { margin-inline-start: auto; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 16px; }
.panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.panel__head p { font-size: 13.5px; margin-top: 2px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2 > .panel { margin-bottom: 0; }
.grid-2 { margin-bottom: 16px; }

.empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 14px; }

.legend { list-style: none; margin: 0; padding: 0; display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend--sm { font-size: 12.5px; gap: 10px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw--adv { background: var(--f2); }
.sw--act { background: var(--active-fill); border: 1px solid var(--active-line); }
.sw--lost { background: var(--lost); }
.sw--won { background: var(--f6); }

/* ==========================================================================
   KPI tiles
   ========================================================================== */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi__label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.kpi__value { font-family: var(--font-figures); font-size: 44px; line-height: 1; font-weight: 700; letter-spacing: .01em; color: var(--ink); margin-top: 4px; }
.kpi__sub { font-size: 12.5px; color: var(--muted); min-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi--won .kpi__value { color: var(--f4); }
.kpi--alert .kpi__value { color: var(--lost); }
.kpi--alert .kpi__sub { color: var(--lost); font-weight: 500; }

/* ==========================================================================
   The leak funnel
   ========================================================================== */
.panel--funnel { padding-bottom: 12px; }
.funnel { display: flex; flex-direction: column; }
.funnel__row { display: grid; grid-template-columns: 190px 1fr; grid-template-rows: auto auto; column-gap: 16px; align-items: center; }
.funnel__label { display: flex; flex-direction: column; padding: 6px 0; }
.funnel__name { font-weight: 600; font-size: 14.5px; }
.funnel__meta { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.funnel__track { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 6px 0; cursor: default; }
.funnel__bar { height: 34px; display: flex; border-radius: 6px; overflow: hidden; min-width: 4px; background: var(--surface-3); transition: width .4s cubic-bezier(.2, .7, .2, 1); }
.funnel__seg { display: block; height: 100%; }
.funnel__seg--adv { background: var(--f2); }
.funnel__row[style*="--i:0"] .funnel__seg--adv { background: var(--f0); }
.funnel__row[style*="--i:1"] .funnel__seg--adv { background: var(--f1); }
.funnel__row[style*="--i:2"] .funnel__seg--adv { background: var(--f2); }
.funnel__row[style*="--i:3"] .funnel__seg--adv { background: var(--f3); }
.funnel__row[style*="--i:4"] .funnel__seg--adv { background: var(--f4); }
.funnel__row[style*="--i:5"] .funnel__seg--adv { background: var(--f5); }
.funnel__seg--act { background: var(--active-fill); background-image: repeating-linear-gradient(135deg, transparent 0 5px, var(--active-line) 5px 6px); }
.funnel__seg--lost { background: var(--lost); }
.funnel__seg--won { background: var(--f6); }
.funnel__seg + .funnel__seg { border-inline-start: 2px solid var(--surface); }
.funnel__count { font-family: var(--font-figures); font-size: 26px; font-weight: 700; line-height: 1; color: var(--ink); flex-shrink: 0; }
.funnel__conv { grid-column: 2; display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; padding: 0 0 2px 0; height: 20px; }
.funnel__conv-arrow { color: var(--muted); }
.funnel__conv.is-low { color: var(--lost); font-weight: 500; }
.funnel__leak { color: var(--lost); font-weight: 400; }
.funnel__row:hover .funnel__bar { filter: brightness(1.05); }

/* ==========================================================================
   Horizontal bars
   ========================================================================== */
.hbars { display: flex; flex-direction: column; gap: 6px; }
.hbar { display: grid; grid-template-columns: minmax(150px, 1.3fr) 2fr 84px; align-items: center; gap: 12px; padding: 3px 0; }
.hbar__label { font-size: 13.5px; display: flex; flex-direction: column; line-height: 1.25; }
.hbar__label small { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.hbar__track { height: 14px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.hbar__fill { display: block; height: 100%; border-radius: 4px; transition: width .4s cubic-bezier(.2, .7, .2, 1); }
.hbar__fill--lost { background: var(--lost); }
.hbar__fill--accent { background: var(--accent); }
.hbar__value { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar__value small { color: var(--muted); font-weight: 400; margin-inline-start: 4px; }

/* ==========================================================================
   SVG chart
   ========================================================================== */
.chart-wrap { direction: ltr; }
.chart { width: 100%; height: auto; display: block; font-family: var(--font); }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-axis { stroke: var(--line-strong); stroke-width: 1; }
.ch-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.ch-val { fill: var(--ink-2); font-size: 11.5px; font-weight: 500; }
.ch-won { fill: var(--f6); }
.ch-active { fill: var(--active-fill); stroke: var(--active-line); stroke-width: 1; }
.ch-lost { fill: var(--lost); }
.ch-col:hover rect:first-child { fill: var(--surface-2); }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 9px 10px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 12.5px; font-weight: 500; color: var(--muted); border-bottom-color: var(--line-strong); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: end; font-variant-numeric: tabular-nums; }
.table .w-meter { width: 90px; }
.table__total td { font-weight: 600; border-top: 1px solid var(--line-strong); }
.meter { display: block; height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.meter__fill { display: block; height: 100%; border-radius: 4px; }
.meter__fill--accent { background: var(--accent); }

.pace-attempts { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; }
.pace-attempts__head b { font-size: 18px; }
.pace-attempts__list { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.table--leads tbody tr { cursor: pointer; }
.table--leads tbody tr:hover td { background: var(--surface-2); }
.table--leads td { padding: 10px 10px; }
.table-wrap--leads { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 4px 8px; }
.td-name { max-width: 280px; }
.td-name b { display: block; font-weight: 500; }
.td-name small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.td-phone { white-space: nowrap; font-variant-numeric: tabular-nums; direction: ltr; text-align: end; }
.td-phone a { color: var(--ink); }
.wa-mini { font-size: 12px; color: var(--accent); margin-inline-start: 6px; }
.th-btn { background: none; border: 0; padding: 0; cursor: pointer; color: inherit; font: inherit; }
th.is-sorted .th-btn { color: var(--ink); font-weight: 600; }
th.is-sorted .th-btn::after { content: ' ↕'; color: var(--accent); }

/* ==========================================================================
   Due list
   ========================================================================== */
.due-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.due { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.due:hover { background: var(--surface-2); }
.due__main { display: flex; flex-direction: column; min-width: 0; }
.due__main b { font-weight: 500; }
.due__main span { font-size: 12.5px; }
.due__contact { display: flex; gap: 6px; }

.contact { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 7px; font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.contact:hover { text-decoration: none; }
.contact--tel { background: var(--surface-3); color: var(--ink); font-variant-numeric: tabular-nums; direction: ltr; }
.contact--wa { background: #DDF5E4; color: #0B6B37; }
:root[data-theme="dark"] .contact--wa { background: #163C28; color: #7FE0A6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .contact--wa { background: #163C28; color: #7FE0A6; } }

/* ==========================================================================
   Pipeline board
   ========================================================================== */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(258px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x proximity; min-height: calc(100vh - 170px); }
.col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-lg); display: flex; flex-direction: column; min-width: 0; scroll-snap-align: start; --c: var(--f0); }
.col[style*="--stage:1"] { --c: var(--f1); }
.col[style*="--stage:2"] { --c: var(--f2); }
.col[style*="--stage:3"] { --c: var(--f3); }
.col[style*="--stage:4"] { --c: var(--f4); }
.col[style*="--stage:5"] { --c: var(--f5); }
.col[style*="--stage:6"] { --c: var(--f6); }
.col--lost { --c: var(--lost); }
.col__head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface-2); border-radius: var(--radius-lg) var(--radius-lg) 0 0; z-index: 1; }
.col__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex-shrink: 0; }
.col__title { font-size: 14px; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col__count { font-family: var(--font-figures); font-size: 22px; line-height: 1; font-weight: 700; color: var(--ink-2); }
.col__body { padding: 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.col__empty { color: var(--muted); font-size: 13px; text-align: center; padding: 24px 0; border: 1px dashed var(--line-strong); border-radius: var(--radius); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 12px 10px; display: flex; flex-direction: column; gap: 7px; cursor: pointer; border-inline-start: 3px solid var(--c); transition: box-shadow .12s, border-color .12s; }
.card:hover { box-shadow: 0 2px 10px rgba(18, 32, 29, .08); border-color: var(--line-strong); border-inline-start-color: var(--c); }
.card.is-late { border-inline-start-color: var(--lost); }
.card.is-today { border-inline-start-color: var(--warn); }
.card--lost { opacity: .85; }
.card__top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.card__name { font-weight: 600; font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__source { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.card__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card__phone { color: var(--ink-2); font-size: 13.5px; font-variant-numeric: tabular-nums; direction: ltr; }
.card__wa { font-size: 12.5px; font-weight: 500; }
.card__row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; }
.card__notes { font-size: 13px; color: var(--ink-2); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__actions { display: flex; gap: 4px; flex-wrap: wrap; padding-top: 4px; border-top: 1px solid var(--line); margin-top: 2px; }
.card__actions .btn--primary { flex: 1; justify-content: center; min-width: 0; }
.card__actions .btn--primary { overflow: hidden; text-overflow: ellipsis; }

/* ==========================================================================
   Drawer (lead detail)
   ========================================================================== */
.drawer { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(10, 20, 18, .35); opacity: 0; transition: opacity .18s; }
.drawer__panel { position: absolute; top: 0; bottom: 0; inset-inline-end: 0; width: min(480px, 100%); background: var(--surface); box-shadow: var(--shadow-pop); transform: translateX(-100%); transition: transform .22s cubic-bezier(.2, .7, .2, 1); overflow-y: auto; display: flex; flex-direction: column; }
.drawer.is-open { pointer-events: auto; }
.drawer.is-open .drawer__backdrop { opacity: 1; }
.drawer.is-open .drawer__panel { transform: none; }
.drawer__head { display: flex; align-items: flex-start; gap: 10px; padding: 18px 20px 12px; }
.drawer__head .icon-btn { order: 2; margin-inline-start: auto; flex-shrink: 0; }
.drawer__name { font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.drawer__sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; margin-top: 6px; }
.drawer__contact { display: flex; gap: 8px; align-items: center; padding: 0 20px 14px; flex-wrap: wrap; }
.drawer__contact .btn { margin-inline-start: auto; }
.drawer__stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.drawer__stats > div { padding: 10px 12px; display: flex; flex-direction: column; text-align: center; }
.drawer__stats > div + div { border-inline-start: 1px solid var(--line); }
.drawer__stats b { font-family: var(--font-figures); font-size: 26px; line-height: 1; font-weight: 700; }
.drawer__stats span { font-size: 12px; color: var(--muted); margin-top: 3px; }
.drawer__actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 14px 20px 6px; }
.drawer__actions .btn--primary { flex: 1; }
.drawer__fields { display: flex; flex-direction: column; gap: 12px; padding: 10px 20px 16px; }
.drawer__timeline { padding: 14px 20px; border-top: 1px solid var(--line); flex: 1; }
.drawer__timeline h3 { margin-bottom: 10px; }
.drawer__foot { padding: 10px 20px 20px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.note-form { display: flex; gap: 6px; margin-bottom: 14px; }
.note-form .input { height: 34px; }

.stepper { list-style: none; margin: 0; padding: 14px 20px 10px; display: grid; grid-template-columns: repeat(6, 1fr); position: relative; }
.stepper::before { content: ''; position: absolute; top: 20px; inset-inline: calc(20px + 8.33%); height: 2px; background: var(--line); }
.stepper__step { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; position: relative; }
.stepper__dot { width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); box-sizing: border-box; }
.stepper__label { font-size: 11px; color: var(--muted); line-height: 1.2; }
.stepper__step.is-done .stepper__dot { background: var(--f3); border-color: var(--f3); }
.stepper__step.is-done .stepper__label { color: var(--ink-2); }
.stepper__step.is-current .stepper__dot { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.stepper__step.is-current .stepper__label { color: var(--ink); font-weight: 600; }
.stepper__step.is-won .stepper__dot { background: var(--f5); border-color: var(--f5); }
.stepper__step.is-won .stepper__label { color: var(--ink); font-weight: 600; }
.stepper__step.is-lost .stepper__dot { background: var(--lost); border-color: var(--lost); }
.stepper__step.is-lost .stepper__label { color: var(--lost); font-weight: 600; }

.tl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tl__item { display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding: 0 0 14px; position: relative; }
.tl__item::before { content: ''; position: absolute; top: 14px; bottom: -2px; inset-inline-start: 6px; width: 2px; background: var(--line); }
.tl__item:last-child::before { display: none; }
.tl__dot { width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); margin-top: 3px; box-sizing: border-box; position: relative; z-index: 1; }
.tl__item--advanced .tl__dot, .tl__item--created .tl__dot { background: var(--f3); border-color: var(--f3); }
.tl__item--lost .tl__dot { background: var(--lost); border-color: var(--lost); }
.tl__item--restored .tl__dot { background: var(--good); border-color: var(--good); }
.tl__item--attempt .tl__dot { background: var(--warn); border-color: var(--warn); }
.tl__item--note .tl__dot { background: var(--surface); border-color: var(--accent); }
.tl__body { display: flex; flex-direction: column; gap: 1px; }
.tl__text { font-size: 14px; }
.tl__item--note .tl__text { color: var(--ink-2); }
.tl__note { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.tl__time { font-size: 12px; color: var(--muted); }

/* ==========================================================================
   Modal
   ========================================================================== */
.modal-root { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10, 20, 18, .45); opacity: 0; transition: opacity .15s; }
.modal { position: relative; width: min(440px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); transform: translateY(8px) scale(.98); opacity: 0; transition: transform .15s, opacity .15s; }
.modal--wide { width: min(640px, 100%); }
.modal-root.is-open .modal-backdrop { opacity: 1; }
.modal-root.is-open .modal { transform: none; opacity: 1; }
.modal-root.is-closing .modal-backdrop, .modal-root.is-closing .modal { opacity: 0; }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 0; }
.modal__head h2 { font-size: 18px; }
.modal__body { padding: 14px 20px 18px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 18px; }
.modal__text { font-size: 14.5px; color: var(--ink-2); margin-bottom: 12px; }
.modal__text b { color: var(--ink); }
.data-menu { display: flex; flex-direction: column; gap: 8px; }
.data-menu .btn { justify-content: flex-start; cursor: pointer; }

/* ==========================================================================
   Toast & tooltip
   ========================================================================== */
.toast-host { position: fixed; bottom: 20px; inset-inline-start: 50%; transform: translateX(50%); z-index: 60; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--ground); padding: 10px 16px; border-radius: 9px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-pop); opacity: 0; transform: translateY(8px); transition: opacity .18s, transform .18s; max-width: min(90vw, 420px); text-align: center; }
.toast.is-in { opacity: 1; transform: none; }
.toast--good { background: var(--f5); color: #fff; }
.toast--warn { background: var(--warn); color: #fff; }

.tip { position: fixed; z-index: 70; pointer-events: none; background: var(--ink); color: var(--ground); padding: 9px 12px; border-radius: 8px; font-size: 13px; line-height: 1.4; max-width: 280px; opacity: 0; transition: opacity .1s; box-shadow: var(--shadow-pop); direction: rtl; }
.tip.is-on { opacity: 1; }
.tip strong { display: block; font-weight: 600; margin-bottom: 4px; }
.tip__row { display: flex; justify-content: space-between; gap: 16px; }
.tip__row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.tip__sub { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, .18); color: rgba(255, 255, 255, .8); font-size: 12px; }

/* ==========================================================================
   Empty hero
   ========================================================================== */
.hero-empty { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); padding: 36px 24px; text-align: center; margin-bottom: 16px; }
.hero-empty h2 { font-size: 20px; margin-bottom: 6px; }
.hero-empty p { color: var(--ink-2); max-width: 46ch; margin: 0 auto 16px; }
.hero-empty__actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }


/* ==========================================================================
   Triage — sorting a contact list into the pipeline, one card at a time
   ========================================================================== */
.view--triage { max-width: 760px; }
.triage { display: flex; flex-direction: column; gap: 18px; }
.triage__intro h1 { font-size: 26px; font-weight: 600; letter-spacing: -.015em; }
.triage__intro p { color: var(--ink-2); margin-top: 6px; max-width: 52ch; }

.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 220px; padding: 32px 24px; cursor: pointer; text-align: center;
  border: 2px dashed var(--line-strong); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--ink-2);
  transition: border-color .15s, background .15s, color .15s;
}
.drop:hover { border-color: var(--accent); color: var(--ink); }
.drop.is-over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-soft-ink); border-style: solid; }
.drop__icon { color: var(--accent); }
.drop__title { font-size: 17px; font-weight: 600; color: var(--ink); }
.drop__sub { font-size: 13.5px; }

.triage__paste summary { cursor: pointer; color: var(--ink-2); font-size: 14px; padding: 6px 0; }
.triage__paste[open] summary { margin-bottom: 8px; }
.triage__paste textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; direction: ltr; text-align: left; }
.triage__paste .btn { margin-top: 8px; }
.triage__privacy { font-size: 12.5px; color: var(--muted); text-align: center; max-width: 46ch; margin: 0 auto; line-height: 1.5; }

/* progress */
.progress { display: flex; flex-direction: column; gap: 6px; }
.progress__bar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.progress__bar span { display: block; height: 100%; border-radius: 4px; background: var(--f3); transition: width .35s cubic-bezier(.2,.7,.2,1); }
.progress__meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.progress__meta b { font-family: var(--font-figures); font-size: 22px; line-height: 1; color: var(--ink); }
.streak { margin-inline-start: auto; padding: 2px 9px; border-radius: 20px; background: var(--warn-soft); color: var(--warn-soft-ink); font-weight: 600; font-size: 12.5px; }

/* the deck */
.deck { position: relative; }
.deck__ghost { position: absolute; inset-inline: 0; top: 0; height: 100%; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.deck__ghost--1 { transform: translateY(7px) scale(.985); opacity: .7; }
.deck__ghost--2 { transform: translateY(14px) scale(.97); opacity: .45; }

.tcard {
  position: relative; z-index: 1;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  padding: 20px; display: flex; flex-direction: column; gap: 18px;
  box-shadow: 0 1px 2px rgba(18,32,29,.06), 0 12px 28px rgba(18,32,29,.07);
  animation: card-in .22s cubic-bezier(.2,.7,.2,1);
}
@keyframes card-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.tcard.is-out-won  { animation: out-won .17s ease-in forwards; }
.tcard.is-out-lost { animation: out-lost .17s ease-in forwards; }
.tcard.is-out-skip { animation: out-skip .17s ease-in forwards; }
@keyframes out-won  { to { opacity: 0; transform: translateX(-60px) rotate(-3deg); } }
@keyframes out-lost { to { opacity: 0; transform: translateX(60px) rotate(3deg); } }
@keyframes out-skip { to { opacity: 0; transform: translateY(-24px) scale(.97); } }

.tcard__id { display: flex; flex-direction: column; gap: 10px; }
.tcard__name {
  border: 0; border-bottom: 1px dashed transparent; background: transparent; color: var(--ink);
  font: 600 24px/1.2 var(--font); letter-spacing: -.012em; padding: 2px 0; width: 100%;
}
.tcard__name:hover { border-bottom-color: var(--line-strong); }
.tcard__name:focus { outline: none; border-bottom-color: var(--accent); }
.tcard__name::placeholder { color: var(--muted); font-weight: 400; }
.tcard__contact { display: flex; gap: 8px; flex-wrap: wrap; }

.tcard__section { display: flex; flex-direction: column; gap: 8px; }
.tcard__label { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.chips--wrap { display: flex; flex-wrap: wrap; gap: 6px; background: transparent; padding: 0; }
.chips--wrap .chip { height: 32px; border: 1px solid var(--line-strong); background: var(--surface); }
.chips--wrap .chip:hover { border-color: var(--muted); }
.chips--wrap .chip.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-soft-ink); box-shadow: none; }
.chip--lost:hover { border-color: var(--lost); color: var(--lost); }
.tcard__infl { display: flex; }
.tcard__infl .input { max-width: 260px; }
.is-hidden { display: none !important; }

.stages { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; transition: opacity .15s; }
.stages.is-dim { opacity: .35; pointer-events: none; }
.stagebtn {
  display: flex; align-items: center; gap: 10px; text-align: start;
  min-height: 48px; padding: 8px 12px; cursor: pointer;
  border: 1px solid var(--line-strong); border-inline-start: 4px solid var(--c, var(--f0));
  border-radius: 10px; background: var(--surface); color: var(--ink);
  font-size: 14.5px; font-weight: 500;
  transition: background .12s, border-color .12s, transform .08s;
}
.stagebtn:hover { background: var(--surface-2); border-color: var(--muted); border-inline-start-color: var(--c, var(--f0)); }
.stagebtn:active { transform: scale(.985); }
.stagebtn span { min-width: 0; }
.stagebtn--lost { --c: var(--lost); grid-column: 1 / -1; color: var(--lost); }
.stagebtn--lost:hover { background: var(--lost-soft); color: var(--lost-soft-ink); }
kbd {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px;
  border-radius: 5px; background: var(--surface-3); color: var(--muted);
  font: 500 12px/1 var(--font); font-variant-numeric: tabular-nums; flex-shrink: 0;
}
.tcard__reasons { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.tcard__reasons .btn { align-self: flex-start; }

.triage__foot { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.triage__foot .btn[disabled] { opacity: .4; }

/* the finish */
.triage--done { position: relative; min-height: 60vh; justify-content: center; }
.confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.done { position: relative; z-index: 1; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.done__mark {
  width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-soft-ink); font-size: 30px; font-weight: 600;
}
.done h1 { font-size: 26px; font-weight: 600; letter-spacing: -.015em; }
.done__stats { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.done__stats > div {
  min-width: 118px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); display: flex; flex-direction: column; gap: 2px;
}
.done__stats b { font-family: var(--font-figures); font-size: 34px; line-height: 1; }
.done__stats span { font-size: 12.5px; color: var(--muted); }
.done__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

@media (max-width: 700px) {
  .stages { grid-template-columns: 1fr; }
  .tcard { padding: 16px; }
  .tcard__name { font-size: 21px; }
  .deck__ghost { display: none; }
}


/* ==========================================================================
   Outcomes, churn and influencers
   ========================================================================== */
.tag--churn { background: var(--warn-soft); color: var(--warn-soft-ink); }

.outcomes { display: flex; flex-direction: column; gap: 4px; }
.outcome { display: grid; grid-template-columns: minmax(150px, 1.1fr) 2fr 92px; align-items: center; gap: 12px; padding: 7px 8px; border-radius: 8px; color: var(--ink); }
.outcome:hover { background: var(--surface-2); text-decoration: none; }
.outcome__label { font-size: 14px; }
.outcome__track { height: 14px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.outcome__fill { display: block; height: 100%; border-radius: 4px; background: var(--muted); transition: width .4s cubic-bezier(.2,.7,.2,1); }
.outcome--won .outcome__fill { background: var(--f6); }
.outcome--active .outcome__fill { background: var(--f2); }
.outcome--warn .outcome__fill { background: var(--warn); }
.outcome--churn .outcome__fill { background: var(--warn); opacity: .75; }
.outcome--lost .outcome__fill { background: var(--lost); }
.outcome__value { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: end; }
.outcome__value small { color: var(--muted); font-weight: 400; margin-inline-start: 5px; }

.stagebtn--churn { --c: var(--warn); grid-column: 1 / -1; color: var(--warn-soft-ink); }
.stagebtn--churn:hover { background: var(--warn-soft); }

.board--infl { grid-auto-columns: minmax(230px, 1fr); min-height: 0; }
.col--infl { --c: var(--muted); }
.col--wishlist { --c: var(--f0); }
.col--reached  { --c: var(--f1); }
.col--talking  { --c: var(--f3); }
.col--active   { --c: var(--f6); }
.col--done     { --c: var(--muted); }
.col--rejected { --c: var(--lost); }
.icard__stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 8px 0 2px; border-top: 1px solid var(--line); }
.icard__stats > div { display: flex; flex-direction: column; align-items: center; text-align: center; }
.icard__stats b { font-family: var(--font-figures); font-size: 20px; line-height: 1; }
.icard__stats span { font-size: 10.5px; color: var(--muted); margin-top: 2px; }

@media (max-width: 700px) {
  .outcome { grid-template-columns: 1fr auto; grid-template-rows: auto auto; row-gap: 4px; }
  .outcome__label { grid-column: 1; grid-row: 1; }
  .outcome__value { grid-column: 2; grid-row: 1; }
  .outcome__track { grid-column: 1 / -1; grid-row: 2; }
  .board--infl { grid-auto-columns: 86vw; }
}

/* pulling collaborators out of the lead list */
.pull-list { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; margin-bottom: 14px; padding-inline-end: 4px; }
.pull { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.pull:hover { background: var(--surface-2); }
.pull:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pull > input { margin-top: 3px; accent-color: var(--accent); flex-shrink: 0; }
.pull__body { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.pull__body b { font-weight: 600; font-size: 14.5px; }
.pull__body small { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pull__body .input { height: 30px; font-size: 13px; }
.pull__opt { margin-bottom: 10px; align-items: flex-start; }
.pull__opt span { line-height: 1.4; }


/* ==========================================================================
   Call script — read and typed with a phone against your ear
   ========================================================================== */
body.has-script { overflow: hidden; }
.callview {
  position: fixed; inset: 0; z-index: 35; background: var(--ground);
  display: grid; grid-template-rows: auto auto 1fr auto;
  opacity: 0; transition: opacity .14s ease-out;
}
.callview.is-open { opacity: 1; }

/* top */
.callview__top {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 10px 14px 12px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.callview__who { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.callview__who > b { font-size: 17px; font-weight: 600; letter-spacing: -.01em; line-height: 1.1; }
.callview__tags { display: flex; gap: 6px; flex-wrap: wrap; }
.callview__tags .contact { height: 27px; padding: 0 9px; font-size: 12.5px; }
.callview__done { margin-inline-start: auto; text-align: center; line-height: 1.15; flex-shrink: 0; }
.callview__done b { font-family: var(--font-figures); font-size: 26px; display: block; }
.callview__done span { font-size: 11px; color: var(--muted); }
.callview__line { position: absolute; inset-inline: 0; bottom: -1px; height: 2px; background: var(--line); }
.callview__line span { display: block; height: 100%; width: 0; background: var(--f4); transition: width .3s cubic-bezier(.2,.7,.2,1); }

/* the four stages */
.rail { display: flex; gap: 2px; padding: 8px 10px; background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; }
.rail__step {
  flex: 1 1 0; min-width: 88px; display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 4px 6px 6px; border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 12px;
}
.rail__dot { width: 100%; height: 3px; border-radius: 2px; background: var(--line); transition: background .18s; }
.rail__step.is-done { color: var(--ink-2); }
.rail__step.is-done .rail__dot { background: var(--f3); }
.rail__step.is-on { color: var(--ink); font-weight: 600; }
.rail__step.is-on .rail__dot { background: var(--accent); }
.rail__step:hover { color: var(--ink); }

/* the sheet */
.callview__scroll { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.sheet { max-width: 720px; margin: 0 auto; padding: 22px 16px 32px; display: flex; flex-direction: column; gap: 18px; }
.sheet__title { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .04em; }
.sheet__note { font-size: 13.5px; line-height: 1.5; color: var(--warn-soft-ink); background: var(--warn-soft); padding: 10px 13px; border-radius: 9px; }

.says { display: flex; flex-direction: column; gap: 10px; }
.say {
  font-size: 19px; line-height: 1.62; text-wrap: pretty; cursor: pointer; user-select: none;
  padding: 13px 17px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--line); border-inline-start: 3px solid var(--accent);
  transition: opacity .16s, border-color .16s, background .16s;
}
.say:hover { border-color: var(--line-strong); border-inline-start-color: var(--accent); }
.say.is-said { opacity: .42; border-inline-start-color: var(--f3); background: var(--surface-2); }

.records { display: flex; flex-direction: column; gap: 12px; }
.ask {
  display: flex; flex-direction: column; gap: 9px;
  padding: 16px 17px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
}
.ask:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ask__q { font-size: 16px; font-weight: 600; line-height: 1.4; text-wrap: pretty; }
.ask__key { color: var(--warn); font-style: normal; margin-inline-start: 5px; }
.ask__hint { font-size: 12.5px; color: var(--muted); margin-top: -5px; line-height: 1.4; }
.ask__warn { font-size: 13.5px; font-weight: 500; color: var(--lost); }

.write {
  width: 100%; border: 0; border-bottom: 2px solid var(--line-strong); background: transparent;
  color: var(--ink); font: 400 17px/1.5 var(--font); padding: 8px 2px; resize: none; min-height: 48px;
  transition: border-color .15s;
}
.write:focus { outline: none; border-bottom-color: var(--accent); }
.write::placeholder { color: var(--muted); font-size: 15.5px; }

.picks { display: flex; flex-wrap: wrap; gap: 7px; }
.pick {
  min-height: 42px; padding: 0 16px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-size: 15.5px; font-weight: 500; transition: background .12s, border-color .12s, color .12s;
}
.pick:hover { border-color: var(--muted); background: var(--surface-2); }
.pick.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.end { margin-top: 6px; padding: 20px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-strong); }
.end h2 { font-size: 17px; margin-bottom: 14px; }
.end__actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.end__hint { font-size: 12.5px; color: var(--muted); }

/* controls stay put */
.callview__bottom { display: flex; gap: 10px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
.callview__bottom .btn { flex: 1; }
.callview__bottom .btn[disabled] { opacity: .35; }
.btn--lg { height: 48px; padding: 0 20px; font-size: 15.5px; border-radius: 10px; justify-content: center; }

/* what the sales call turned up, kept on the lead card */
.drawer__script { padding: 14px 20px; border-top: 1px solid var(--line); }
.drawer__script h3 { margin-bottom: 10px; }
.learned { margin: 0 0 12px; display: flex; flex-direction: column; gap: 9px; }
.learned dt { font-size: 12.5px; color: var(--muted); }
.learned dd { margin: 2px 0 0; font-size: 14.5px; color: var(--ink); line-height: 1.45; }

@media (max-width: 700px) {
  .callview__top { padding: 8px 12px 10px; gap: 10px; }
  .callview__who > b { font-size: 16px; }
  .callview__done b { font-size: 22px; }
  .rail__step { min-width: 0; font-size: 11px; }
  .rail__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .sheet { padding: 16px 12px 26px; gap: 14px; }
  .say { font-size: 17.5px; padding: 12px 14px; }
  .ask { padding: 14px; }
  .end__actions { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Dashboard — the day, and the one conversion that matters
   ========================================================================== */
.day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 14px; }
.day__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.day__head h2 { font-size: 18px; }
.day__cells { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.day__cell { display: flex; flex-direction: column; gap: 1px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.day__cell b { font-family: var(--font-figures); font-size: 48px; line-height: .95; color: var(--ink); }
.day__cell span { font-size: 14.5px; font-weight: 500; }
.day__cell small { font-size: 12px; color: var(--muted); margin-top: 3px; }

.conv {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  border-inline-start: 4px solid var(--line-strong); padding: 18px 20px; margin-bottom: 14px;
}
.conv--good { border-inline-start-color: var(--f5); }
.conv--warn { border-inline-start-color: var(--warn); }
.conv--bad { border-inline-start-color: var(--lost); }
.conv h2 { font-size: 15px; color: var(--ink-2); font-weight: 500; }
.conv__big { font-family: var(--font-figures); font-size: 62px; line-height: 1; margin: 4px 0 6px; }
.conv--good .conv__big { color: var(--f5); }
.conv--warn .conv__big { color: var(--warn); }
.conv--bad .conv__big { color: var(--lost); }
.conv__body { font-size: 15.5px; line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }
.conv__body b { color: var(--ink); font-weight: 600; }
.conv__note { margin-top: 8px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }

.week { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; margin-bottom: 14px; }
.week__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.week__clock { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.week__clock.is-tight { color: var(--warn-soft-ink); background: var(--warn-soft); padding: 3px 9px; border-radius: 6px; font-weight: 500; }
.week__cells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wcell { display: flex; flex-direction: column; gap: 2px; padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); }
.wcell:hover { background: var(--surface-2); text-decoration: none; border-color: var(--line-strong); }
.wcell b { font-family: var(--font-figures); font-size: 38px; line-height: 1; }
.wcell span { font-size: 13.5px; line-height: 1.35; }
.wcell small { font-size: 12px; color: var(--muted); margin-top: 3px; }
.wcell.is-hot { border-color: var(--warn); background: var(--warn-soft); }
.wcell.is-hot b, .wcell.is-hot span { color: var(--warn-soft-ink); }
.wcell.is-hot small { color: var(--warn-soft-ink); opacity: .85; }

.week__parked { margin-top: 10px; font-size: 12.5px; color: var(--muted); }

.more-data { margin-top: 22px; }
.more-data > summary { cursor: pointer; color: var(--muted); font-size: 13.5px; padding: 10px 0; border-top: 1px solid var(--line); }
.more-data > summary:hover { color: var(--ink); }
.more-data[open] > summary { margin-bottom: 12px; }

.outcomes { display: flex; flex-direction: column; gap: 4px; }
.outcome { display: grid; grid-template-columns: minmax(150px, 1.1fr) 2fr 92px; align-items: center; gap: 12px; padding: 7px 8px; border-radius: 8px; color: var(--ink); }
.outcome:hover { background: var(--surface-2); text-decoration: none; }
.outcome__label { font-size: 14px; }
.outcome__track { height: 14px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.outcome__fill { display: block; height: 100%; border-radius: 4px; background: var(--muted); transition: width .4s cubic-bezier(.2,.7,.2,1); }
.outcome--won .outcome__fill { background: var(--f6); }
.outcome--active .outcome__fill { background: var(--f2); }
.outcome--warn .outcome__fill { background: var(--warn); }
.outcome--churn .outcome__fill { background: var(--warn); opacity: .75; }
.outcome--lost .outcome__fill { background: var(--lost); }
.outcome__value { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: end; }
.outcome__value small { color: var(--muted); font-weight: 400; margin-inline-start: 5px; }

@media (max-width: 700px) {
  .day__cells { grid-template-columns: repeat(2, 1fr); }
  .week__cells { grid-template-columns: 1fr; }
  .day__cell b { font-size: 40px; }
  .conv__big { font-size: 50px; }
  .outcome { grid-template-columns: 1fr auto; grid-template-rows: auto auto; row-gap: 4px; }
  .outcome__label { grid-column: 1; grid-row: 1; }
  .outcome__value { grid-column: 2; grid-row: 1; }
  .outcome__track { grid-column: 1 / -1; grid-row: 2; }
}

/* reasons that take a lead out of the conversion rate say so */
.choice--disq .choice__mark { margin-inline-start: auto; color: var(--muted); font-style: normal; font-size: 15px; }
.choice--disq:has(input:checked) { border-color: var(--warn); background: var(--warn-soft); color: var(--warn-soft-ink); }
.choice--disq:has(input:checked) .choice__mark { color: var(--warn-soft-ink); }
.disq-warn {
  font-size: 13.5px; line-height: 1.55; padding: 11px 13px; border-radius: 9px;
  background: var(--warn-soft); color: var(--warn-soft-ink);
}
.disq-warn b { display: block; margin-bottom: 3px; }
.chip--disq { border-style: dashed; }

/* ==========================================================================
   Moving a lead without dragging it
   ========================================================================== */
.menu {
  position: fixed; z-index: 70; min-width: 210px; max-width: min(300px, 92vw);
  padding: 5px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; gap: 1px;
  animation: menu-in .12s cubic-bezier(.2, .7, .2, 1);
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }
.menu__item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 11px; border: 0; border-radius: 8px; background: transparent;
  color: var(--ink); font: 500 14.5px/1.3 var(--font); text-align: start; cursor: pointer;
}
.menu__item:hover:not([disabled]) { background: var(--surface-2); }
.menu__item.is-current { background: var(--accent-soft); color: var(--accent-soft-ink); }
.menu__item.is-danger { color: var(--lost); }
.menu__item.is-danger:hover { background: var(--lost-soft); }
.menu__item[disabled] { cursor: default; }
.menu__item span { flex: 1; min-width: 0; }
.menu__item small { font-size: 11.5px; color: var(--muted); }
.menu__swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.menu__sep { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }

.card__move {
  width: 26px; height: 26px; flex-shrink: 0; display: inline-grid; place-items: center;
  border: 1px solid transparent; border-radius: 7px; background: transparent;
  color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.card__move:hover { background: var(--accent-soft); color: var(--accent-soft-ink); border-color: var(--accent); }
.card:hover .card__move { color: var(--ink-2); }

/* the drawer's stepper doubles as the stage picker */
.stepper__hit {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 100%; padding: 2px 0; border: 0; background: transparent; cursor: pointer;
}
.stepper__hit[disabled] { cursor: default; }
.stepper__hit:hover:not([disabled]) .stepper__dot { border-color: var(--accent); transform: scale(1.15); }
.stepper__hit:hover:not([disabled]) .stepper__label { color: var(--ink); }
.stepper__dot { transition: transform .12s, border-color .12s; }

/* ==========================================================================
   Copy buttons — every phone number is one click from the clipboard
   ========================================================================== */
.copy {
  display: inline-grid; place-items: center; width: 26px; height: 26px; flex-shrink: 0;
  border: 1px solid transparent; border-radius: 6px; background: transparent;
  color: var(--muted); cursor: pointer; vertical-align: middle;
  transition: background .12s, color .12s, border-color .12s;
}
.copy:hover { background: var(--surface-3); color: var(--ink); border-color: var(--line); }
.copy.is-copied { background: var(--accent-soft); color: var(--accent-soft-ink); border-color: var(--accent); }
.copy.is-copied svg { display: none; }
.copy.is-copied::after { content: '\2713'; font-size: 14px; font-weight: 700; }

.card__phone-wrap { display: inline-flex; align-items: center; gap: 2px; min-width: 0; }
.td-phone .copy { margin-inline: 2px; }
.toolbar [data-copy-all][disabled] { opacity: .45; cursor: default; }

/* a card already dealt with today sinks and steps back visually */
.card.is-handled { opacity: .55; }
.card.is-handled:hover { opacity: 1; }
.tag--done { background: var(--accent-soft); color: var(--accent-soft-ink); }
.col__waiting { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.col__head { flex-wrap: wrap; }

/* the waiting area for follow-ups due after this week */
.col--future { --c: var(--muted); background: var(--surface-3); }
.col--future .col__head { background: var(--surface-3); }
.card--future { border-inline-start-color: var(--c); }
.future__when {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  padding: 7px 10px; border-radius: 8px; background: var(--surface-2);
}
.future__when b { font-size: 14px; font-weight: 600; }
.future__when span { font-size: 12.5px; color: var(--muted); }

/* ==========================================================================
   Dragging cards between columns
   ========================================================================== */
.board.is-dnd { touch-action: none; cursor: grabbing; }
.board.is-dnd .card { cursor: grabbing; }
body.is-dragging-card { user-select: none; -webkit-user-select: none; }

.card.is-dragging { opacity: .25; }
.drag-ghost {
  position: fixed; top: 0; inset-inline-start: 0; z-index: 60;
  pointer-events: none; margin: 0; will-change: transform;
  box-shadow: 0 10px 34px rgba(18, 32, 29, .34);
  border-color: var(--accent);
}
.col.is-drop-target { background: var(--accent-soft); border-color: var(--accent); }
.col.is-drop-target .col__head { background: var(--accent-soft); }
.col.is-drop-target .col__body { outline: 2px dashed var(--accent); outline-offset: -6px; border-radius: var(--radius); }
.card.just-dropped { animation: dropped .22s cubic-bezier(.2, .7, .2, 1); }
@keyframes dropped { from { transform: scale(.97); box-shadow: 0 6px 18px rgba(18, 32, 29, .22); } }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
  .funnel__row { grid-template-columns: 140px 1fr; column-gap: 10px; }
  .funnel__name { font-size: 13.5px; }
  .hbar { grid-template-columns: minmax(120px, 1.2fr) 2fr 70px; }
}
@media (max-width: 700px) {
  .topbar__inner { height: auto; padding: 8px 14px; flex-wrap: wrap; gap: 8px; }
  .brand { order: 1; }
  .topbar__actions { order: 2; }
  .nav { order: 3; width: 100%; margin: 0; justify-content: stretch; }
  .nav a { flex: 1; justify-content: center; }
  .topbar__actions .btn--primary { padding: 0 12px; }
  .view { padding: 14px 14px 60px; }
  .sample-banner, .mode-note { width: calc(100% - 28px); }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .kpi { padding: 12px 12px 10px; }
  .kpi__value { font-size: 36px; }
  .panel { padding: 14px 14px; }
  .funnel__row { grid-template-columns: 1fr; row-gap: 0; }
  .funnel__label { flex-direction: row; align-items: baseline; gap: 8px; padding-bottom: 0; }
  .funnel__conv { grid-column: 1; margin-bottom: 6px; }
  .funnel__count { font-size: 22px; }
  .hbar { grid-template-columns: 1fr auto; grid-template-rows: auto auto; row-gap: 4px; }
  .hbar__label { grid-column: 1; grid-row: 1; }
  .hbar__value { grid-column: 2; grid-row: 1; }
  .hbar__track { grid-column: 1 / -1; grid-row: 2; }
  .board { grid-auto-columns: 86vw; min-height: 0; }
  .drawer__panel { width: 100%; }
  .stepper__label { font-size: 10px; }
  .toolbar > [data-export] { margin-inline-start: 0; }
  .input--search { min-width: 0; flex: 1 1 100%; }
}

/* Influencers whose handle turns up on leads but who are not on the board yet. */
.strays { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; }
.strays b { display: block; margin-bottom: 2px; }
.strays__row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.radio { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; cursor: pointer; }
.radio input { margin-top: 3px; }

/* ---- magnet: cold leads from an influencer's link --------------------- */
.cold-note { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 9px 12px; margin-bottom: 12px; color: var(--ink-2); font-size: 13.5px; }
.panel--intro { padding: 16px 18px; }
.panel--intro h2 { font-size: 18px; margin-bottom: 4px; }
.panel--intro p { max-width: 70ch; }
.panel__note { color: var(--muted); font-size: 12.5px; padding: 10px 14px 2px; }
.mfunnel { display: grid; gap: 8px; padding: 4px 0 2px; }
.mfunnel__row { display: grid; grid-template-columns: 7.5rem 1fr auto 3rem; align-items: center; gap: 10px; }
.mfunnel__label { font-size: 13.5px; color: var(--ink-2); }
.mfunnel__bar { background: var(--line); border-radius: 999px; height: 10px; overflow: hidden; }
.mfunnel__bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.mfunnel__n { font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .mfunnel__row { grid-template-columns: 5.5rem 1fr auto 2.6rem; gap: 7px; } }
.day__scope { font-size: 12.5px; padding: 0 2px 10px; margin-top: -4px; }
.called { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 12px; }
.called h2 { font-size: 20px; margin-bottom: 12px; }
.called__bar { background: var(--line); border-radius: 999px; height: 12px; overflow: hidden; }
.called__bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.called__sub { color: var(--ink-2); font-size: 13.5px; margin-top: 10px; }
.badge--cold { background: var(--accent-soft, var(--line-strong)); }
.table tr.is-now td { background: var(--accent-soft); }
.table .warn { color: var(--warn, #B4690E); }
.tag--week { background: var(--accent-soft); color: var(--accent-soft-ink); }
.drawer__week { font-size: 13px; margin-top: 4px; }
.linkish { background: none; border: 0; padding: 0 4px; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }

/* Customers who buy now and then — parked, but not lost. */
.col--occasional .col__dot { background: var(--warn); }
.card--occasional { border-inline-start: 3px solid var(--warn); }
