/* Vista Vehicle Sourcing Lead Book. Same brand as the website: Satoshi, lime green, rounded tiles. Dark or light
   (follows the device until you pick one with the switch in the menu). On phones the menu becomes a bar along the
   bottom and the side menu slides in from the left. */
:root {
  --bg: #0b0b0c; --panel: #141416; --panel-2: #1b1b1e; --panel-3: #222226; --line: #26262b; --line-2: #34343a;
  --fg: #f2f2f3; --muted: #9a9aa2; --faint: #6d6d75;
  --accent: #1f6fd6; --accent-ink: #fff; --accent-text: #5b9cf0; --accent-soft: rgb(47 127 224 / 0.16);
  --bad: #ff6b6b; --bad-soft: rgb(255 107 107 / 0.13); --warn: #f2b544; --warn-soft: rgb(242 181 68 / 0.14);
  --ok: #4fd18b; --ok-soft: rgb(79 209 139 / 0.13); --info: #7fa8ff; --info-soft: rgb(127 168 255 / 0.13);
  --shadow: 0 1px 0 rgb(255 255 255 / 0.03) inset, 0 8px 24px rgb(0 0 0 / 0.25);
  --font: "Satoshi", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r: 18px; --r-sm: 12px; --side-w: 264px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) {
  --bg: #f3f4f1; --panel: #ffffff; --panel-2: #f6f7f4; --panel-3: #eceee9; --line: #e3e5df; --line-2: #d3d6ce;
  --fg: #131512; --muted: #5f645c; --faint: #8b9086;
  --accent: #1f6fd6; --accent-ink: #fff; --accent-text: #1559b0; --accent-soft: rgb(31 111 214 / 0.1);
  --bad: #d63b3b; --bad-soft: rgb(214 59 59 / 0.1); --warn: #b07613; --warn-soft: rgb(214 150 30 / 0.13);
  --ok: #1d8a52; --ok-soft: rgb(29 138 82 / 0.1); --info: #2f62d8; --info-soft: rgb(47 98 216 / 0.09);
  --shadow: 0 1px 2px rgb(16 24 8 / 0.05), 0 6px 20px rgb(16 24 8 / 0.05);
  color-scheme: light;
} }
:root[data-theme="light"] {
  --bg: #f3f4f1; --panel: #ffffff; --panel-2: #f6f7f4; --panel-3: #eceee9; --line: #e3e5df; --line-2: #d3d6ce;
  --fg: #131512; --muted: #5f645c; --faint: #8b9086;
  --accent: #1f6fd6; --accent-ink: #fff; --accent-text: #1559b0; --accent-soft: rgb(31 111 214 / 0.1);
  --bad: #d63b3b; --bad-soft: rgb(214 59 59 / 0.1); --warn: #b07613; --warn-soft: rgb(214 150 30 / 0.13);
  --ok: #1d8a52; --ok-soft: rgb(29 138 82 / 0.1); --info: #2f62d8; --info-soft: rgb(47 98 216 / 0.09);
  --shadow: 0 1px 2px rgb(16 24 8 / 0.05), 0 6px 20px rgb(16 24 8 / 0.05);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ph { font-size: 1.15em; line-height: 1; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 0.86em; }
.muted { color: var(--muted); font-style: normal; }
.bad { color: var(--bad); }
.hint { color: var(--muted); font-size: 0.85rem; }
.empty { color: var(--muted); font-size: 0.9rem; padding: 6px 2px; }
.eyebrow { color: var(--muted); font-size: 0.78rem; font-weight: 500; letter-spacing: 0.02em; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--panel); font-weight: 700; font-size: 0.875rem; white-space: nowrap; transition: background 150ms, border-color 150ms, transform 150ms; }
.btn:hover { border-color: var(--faint); }
.btn:active { transform: scale(0.97); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { border-color: var(--accent); filter: brightness(1.05); }
.btn--ghost { background: transparent; }
.btn--sm { min-height: 32px; padding: 5px 12px; font-size: 0.8rem; }
.btn--block { width: 100%; }
.btn--danger { color: var(--bad); }
.btn--complete { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.btn--complete:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn--done { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--muted); }
.icon-btn:hover { background: var(--panel-2); color: var(--fg); }
.link, .link-btn { border: 0; background: none; padding: 4px 0; color: var(--accent-text); font-weight: 700; font-size: 0.85rem; display: inline-flex; align-items: center; gap: 6px; }
.link:hover, .link-btn:hover { text-decoration: underline; }

/* ---- form fields ---- */
.f { display: grid; gap: 6px; font-size: 0.8rem; font-weight: 500; color: var(--muted); }
.f input, .f select, .f textarea, .composer textarea { width: 100%; min-height: 42px; padding: 9px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel-2);
  color: var(--fg); font-size: 0.95rem; font-weight: 500; transition: border-color 150ms, background 150ms; }
.f textarea, .composer textarea { min-height: 76px; resize: vertical; }
.f input:hover, .f select:hover, .f textarea:hover { border-color: var(--line-2); }
.f input:focus, .f select:focus, .f textarea:focus, .composer textarea:focus { outline: none; border-color: var(--accent-text); background: var(--panel); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } }

/* ---- sign in ---- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(60% 50% at 50% 0%, var(--accent-soft), transparent 70%), var(--bg); }
.auth__card { width: min(400px, 100%); display: grid; gap: 16px; padding: 28px; border-radius: 24px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.auth__card .brand { margin-bottom: 8px; }
.auth__msg { min-height: 1.2em; color: var(--bad); font-size: 0.85rem; }
.auth__msg.ok { color: var(--ok); }
.auth .link { justify-self: center; color: var(--muted); }

/* ---- brand ---- */
.brand { display: flex; align-items: center; gap: 12px; }
.brand__logo { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; flex: none; }
.brand h1 { font-size: 1.05rem; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.1; }
.brand span { color: var(--muted); font-size: 0.78rem; }

/* ---- layout: menu down the side, the page on the right ---- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 16px; padding: 20px 14px calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; overscroll-behavior: contain; }
.side > .brand { padding: 2px 6px 4px; }
.side__new { width: 100%; }
.side__links { display: grid; gap: 2px; }
.side__foot { margin-top: auto; display: grid; gap: 2px; padding-top: 12px; border-top: 1px solid var(--line); }
.nav { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 8px 10px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-weight: 500; text-align: left; font-size: 0.92rem; }
.nav .ph { font-size: 1.25rem; }
.nav:hover { background: var(--panel-2); color: var(--fg); }
.nav[aria-current="page"] { background: var(--accent-soft); color: var(--fg); font-weight: 700; }
.nav[aria-current="page"] .ph, .nav[aria-current="page"] .nav__num { color: var(--accent-text); }
.nav__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav__count { min-width: 24px; padding: 1px 7px; border-radius: 999px; background: var(--panel-3); color: var(--muted); font-size: 0.75rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.nav--alert .nav__count { background: var(--bad); color: #fff; }
.nav__num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; border: 1px solid var(--line-2); font-size: 0.72rem; font-weight: 700; flex: none; color: var(--muted); }
.nav__heading { padding: 14px 10px 4px; color: var(--faint); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }

/* search */
.search { position: relative; }
.search > .ph { position: absolute; left: 13px; top: 50%; translate: 0 -50%; color: var(--faint); pointer-events: none; }
.search input { width: 100%; min-height: 42px; padding: 9px 12px 9px 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); font-size: 0.9rem; }
.search input:focus { outline: none; border-color: var(--accent-text); }
.search__results { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); display: grid; padding: 6px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 16px 40px rgb(0 0 0 / 0.3); }
.hit { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: 10px; background: transparent; text-align: left; }
.hit:hover { background: var(--panel-2); }
.hit strong { display: block; font-size: 0.9rem; }
.hit span span { color: var(--muted); font-size: 0.78rem; }
.hit__none { padding: 10px; color: var(--muted); font-size: 0.85rem; }

/* the page */
.main { min-width: 0; padding: 0 clamp(16px, 3vw, 36px) 48px; }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 20px 0 16px; background: linear-gradient(var(--bg) 75%, transparent); }
.top__menu { display: none; }
.top__title { flex: 1; min-width: 0; }
.top__title h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); font-weight: 900; letter-spacing: -0.01em; line-height: 1.15; }
.view { display: grid; gap: 18px; align-content: start; }
.notice { padding: 40px 24px; border-radius: var(--r); border: 1px dashed var(--line-2); text-align: center; display: grid; gap: 8px; justify-items: center; }
.notice h2 { font-size: 1.15rem; font-weight: 700; }
.notice p { color: var(--muted); max-width: 52ch; }
.section-h { margin-top: 6px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }

/* ---- cards ---- */
.card { min-width: 0; display: grid; gap: 14px; align-content: start; padding: 18px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card__head h3 { display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 700; }
.card__head h3 .ph { color: var(--accent-text); }
.card__note { color: var(--muted); font-size: 0.82rem; }
.card__note b { color: var(--fg); }
.grid { display: grid; gap: 18px; }
.grid--dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid--dash { grid-template-columns: minmax(0, 1fr); } }

/* headline numbers */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { display: grid; gap: 6px; align-content: start; padding: 16px 18px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); text-align: left; transition: border-color 150ms, transform 150ms; }
button.kpi:hover { border-color: var(--line-2); transform: translateY(-1px); }
.kpi__label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.82rem; font-weight: 500; }
.kpi__label .ph { font-size: 1.1rem; color: var(--faint); }
.kpi__value { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.kpi__sub { color: var(--muted); font-size: 0.8rem; }
.kpi--accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.kpi--accent .kpi__label, .kpi--accent .kpi__sub, .kpi--accent .kpi__label .ph { color: rgb(255 255 255 / 0.75); }
.kpi--alert .kpi__value { color: var(--bad); }

/* avatars, labels */
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; flex: none; background: var(--panel-3); color: var(--fg); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em; }
.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; white-space: nowrap; background: var(--panel-3); color: var(--muted); }
.pill--new { background: var(--info-soft); color: var(--info); }
.pill--contacted, .pill--searching { background: var(--panel-3); color: var(--fg); }
.pill--finance, .pill--approved { background: var(--warn-soft); color: var(--warn); }
.pill--delivered, .pill--done { background: var(--ok-soft); color: var(--ok); }
.pill--unwound, .pill--dead { background: var(--bad-soft); color: var(--bad); }
.state { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.state--overdue { background: var(--bad); color: #fff; }
.state--today { background: var(--warn-soft); color: var(--warn); }
.state--tomorrow, .state--later { background: var(--info-soft); color: var(--info); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 0.76rem; font-weight: 700; white-space: nowrap; background: var(--panel-2); color: var(--muted); }
.chip--overdue { background: var(--bad-soft); color: var(--bad); }
.chip--today { background: var(--warn-soft); color: var(--warn); }
.chip--tomorrow, .chip--later { background: var(--info-soft); color: var(--info); }
.chip--none { background: transparent; border: 1px dashed var(--line-2); font-weight: 500; }

/* lists of people */
.rows, .tasks { display: grid; }
.row { display: grid; grid-template-columns: auto minmax(0, 1.4fr) minmax(0, auto) minmax(0, 1fr); align-items: center; gap: 12px; width: 100%; padding: 10px 8px; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; border-radius: 0; }
.rows > .row:first-child { border-top: 0; }
.row:hover { background: var(--panel-2); border-radius: 12px; }
.row:hover + .row { border-top-color: transparent; }
.row__main { display: grid; min-width: 0; }
.row__main strong { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__main span { color: var(--muted); font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__meta { color: var(--muted); font-size: 0.82rem; white-space: nowrap; }
.row__end { justify-self: end; text-align: right; font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* a task: who, when, what, status, Complete */
.task { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 8px 6px; border-top: 1px solid var(--line); }
.tasks > .task:first-child { border-top: 0; }
.task__open { display: grid; grid-template-columns: auto minmax(0, 1.3fr) minmax(56px, auto) minmax(0, 1fr); align-items: center; gap: 12px; min-width: 0; padding: 4px; border: 0; border-radius: 12px; background: transparent; text-align: left; }
.task__open:hover { background: var(--panel-2); }
.task__who { display: grid; min-width: 0; }
.task__who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task__who span { color: var(--muted); font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task__when { font-weight: 700; font-size: 0.86rem; font-variant-numeric: tabular-nums; }
.task--overdue .task__when { color: var(--bad); }
.task__what { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 0.88rem; }
.task__what > .ph { color: var(--faint); }
.task__what > span { display: grid; min-width: 0; }
.task__what b { font-weight: 700; }
.task__what span span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view--overview .task__open { grid-template-columns: auto minmax(0, 1fr) auto; }
.view--overview .task__what, .view--overview .task .state { display: none; }

/* pipeline at a glance */
.funnel { display: grid; gap: 4px; }
.funnel__row { display: grid; grid-template-columns: minmax(0, 170px) minmax(0, 1fr) 32px; align-items: center; gap: 12px; padding: 7px 6px; border: 0; border-radius: 10px; background: transparent; text-align: left; }
.funnel__row:hover { background: var(--panel-2); }
.funnel__label { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; font-weight: 500; white-space: nowrap; overflow: hidden; }
.funnel__bar { height: 10px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.funnel__bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width 600ms cubic-bezier(0.23, 1, 0.32, 1); }
.funnel__row b { text-align: right; font-variant-numeric: tabular-nums; }

/* bar charts */
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; height: 220px; align-items: end; }
.bars__col { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 6px; height: 100%; text-align: center; }
.bars__value { font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; min-height: 1.2em; }
.bars__track { position: relative; display: flex; align-items: end; justify-content: center; }
.bars__fill { width: min(44px, 100%); min-height: 3px; border-radius: 10px 10px 4px 4px; background: var(--panel-3); transition: height 700ms cubic-bezier(0.23, 1, 0.32, 1); }
.bars__col.is-now .bars__fill { background: var(--accent); }
.bars__label { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.bars--dense .bars__value { writing-mode: vertical-rl; rotate: 180deg; min-height: 3em; }

/* segmented filters */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); justify-self: start; }
.seg button { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 5px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 0.84rem; font-weight: 700; }
.seg button:hover { color: var(--fg); }
.seg button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.seg button span { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--panel-3); color: var(--muted); font-size: 0.72rem; }
.seg button[aria-pressed="true"] span { background: rgb(128 128 128 / 0.25); color: inherit; }
.seg--tasks button[data-taskfilter="overdue"] span { background: var(--bad); color: #fff; }

/* analytics */
.afilter { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.afilter__date { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.82rem; font-weight: 500; }
.afilter__date input { min-height: 36px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: 0.85rem; }
.afilter__shown { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.82rem; }
.sources { display: grid; gap: 4px; }
.srow { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto auto auto; align-items: center; gap: 14px; padding: 8px 4px; border-top: 1px solid var(--line); font-size: 0.88rem; }
.sources > .srow:first-child { border-top: 0; }
.srow__bar { height: 8px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.srow__bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.srow .mono { color: var(--muted); white-space: nowrap; }
@media (max-width: 720px) { .srow { grid-template-columns: 1fr auto; } .srow__bar, .srow .mono:nth-of-type(n+2) { display: none; } }

/* ---- the customer page and side panel ---- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgb(0 0 0 / 0.45); backdrop-filter: blur(2px); }
.drawer { position: fixed; z-index: 50; top: 0; right: 0; bottom: 0; width: min(560px, 100%); display: flex; flex-direction: column; background: var(--bg); border-left: 1px solid var(--line);
  box-shadow: -20px 0 60px rgb(0 0 0 / 0.3); overflow-y: auto; overscroll-behavior: contain; animation: drawer-in 320ms cubic-bezier(0.23, 1, 0.32, 1); }
.drawer > * { flex-shrink: 0; }
.drawer--full { width: 100%; border-left: 0; animation-name: page-in; }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } }
@keyframes page-in { from { transform: translateY(14px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .drawer { animation: none; } }
body.drawer-open { overflow: hidden; }
.panel-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; background: var(--bg); border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 1.25rem; font-weight: 900; }
.panel-body { display: grid; gap: 16px; padding: 20px; align-content: start; flex: 1; }
.panel-body form { display: grid; gap: 16px; }
.panel-foot { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--panel); border-top: 1px solid var(--line); }

.lead-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; padding: 18px clamp(16px, 3vw, 36px); border-bottom: 1px solid var(--line); background: var(--panel); }
.lead-head__who { flex: 1; display: flex; align-items: center; gap: 14px; min-width: 220px; }
.lead-head__who .avatar { width: 52px; height: 52px; border-radius: 16px; font-size: 1.05rem; background: var(--accent); color: var(--accent-ink); }
.lead-head__who h2 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); font-weight: 900; line-height: 1.15; }
.lead-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.action { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); color: var(--fg); font-weight: 700; font-size: 0.85rem; text-decoration: none; }
.action:hover { border-color: var(--accent-text); color: var(--accent-text); }
.lead-stage { padding: 18px clamp(16px, 3vw, 36px); border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; }
.progress { display: flex; align-items: center; gap: 0; margin: 0; padding: 0; list-style: none; min-width: 560px; }
.progress li { flex: 1; display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 0.82rem; font-weight: 700; }
.progress li:not(:last-child)::after { content: ""; flex: 1; height: 2px; margin: 0 8px; border-radius: 2px; background: var(--line-2); }
.progress li span { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; border: 2px solid var(--line-2); font-size: 0.78rem; flex: none; }
.progress em { font-style: normal; white-space: nowrap; }
.progress li.is-done { color: var(--muted); }
.progress li.is-done span { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.progress li.is-done::after { background: var(--accent-text); }
.progress li.is-now { color: var(--fg); }
.progress li.is-now span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 4px var(--accent-soft); }
.progress--closed { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.88rem; }

.lead-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 18px; padding: 18px clamp(16px, 3vw, 36px) 28px; align-items: start; flex: 1; }
@media (max-width: 960px) { .lead-body { grid-template-columns: minmax(0, 1fr); } .lead-col--side { order: -1; } }
.lead-col { display: grid; gap: 18px; min-width: 0; }
.lead-col--side { position: sticky; top: 18px; }
@media (max-width: 960px) { .lead-col--side { position: static; } }
.stage-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.stage-select { position: relative; flex: 1; min-width: 220px; }
.stage-select select { width: 100%; min-height: 44px; padding: 9px 40px 9px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel-2); font-weight: 700; appearance: none; -webkit-appearance: none; }
.stage-select .ph { position: absolute; right: 14px; top: 50%; translate: 0 -50%; pointer-events: none; color: var(--muted); }
.stage-select--delivered select, .stage-select--done select { border-color: var(--ok); color: var(--ok); }
.stage-select--dead select, .stage-select--unwound select { border-color: var(--bad); color: var(--bad); }
.card--form { gap: 14px; }
.sub-h { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.sub-h__note { letter-spacing: 0; text-transform: none; font-weight: 500; color: var(--muted); }
.verified { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--ok-soft); color: var(--ok); font-size: 0.85rem; font-weight: 700; }
.addr-list { display: grid; gap: 12px; }
.addr-row { display: grid; gap: 10px; padding: 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.addr-row .f input { background: var(--panel); }
.addr-row__head { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; font-weight: 700; }
[data-addaddr] { justify-self: start; }

/* tasks on a customer's page */
.dtasks { display: grid; gap: 8px; }
.dtask { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.dtask--overdue { border-color: var(--bad); background: var(--bad-soft); }
.dtask__icon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--panel); color: var(--accent-text); }
.dtask__body { display: grid; gap: 4px; min-width: 0; }
.dtask__when { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.85rem; }
.dtask__body p { font-size: 0.88rem; overflow-wrap: anywhere; }
.dtask__actions { display: flex; align-items: center; gap: 2px; }
.dtask--editing { grid-template-columns: minmax(0, 1fr); background: var(--panel); }
.row-actions { display: flex; gap: 8px; }
.add-task summary { list-style: none; justify-self: start; }
.add-task summary::-webkit-details-marker { display: none; }
.add-task[open] summary { margin-bottom: 12px; }
.task-form { display: grid; gap: 12px; }
@media (max-width: 560px) { .dtask { grid-template-columns: auto minmax(0, 1fr); } .dtask__actions { grid-column: 1 / -1; justify-content: flex-end; } }

/* activity feed */
.composer { display: grid; gap: 8px; }
.composer__bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.feed { display: grid; gap: 2px; position: relative; }
.feed__day { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; color: var(--faint); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.feed__day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.feed__item { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 8px 0; position: relative; }
.feed__item::before { content: ""; position: absolute; left: 16px; top: 42px; bottom: -6px; width: 2px; background: var(--line); }
.feed__item:last-child::before, .feed__item:has(+ .feed__day)::before { display: none; }
.feed__icon { position: relative; z-index: 1; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 999px; background: var(--panel-3); color: var(--muted); }
.feed__item--note .feed__icon { background: var(--accent-soft); color: var(--accent-text); }
.feed__item--done .feed__icon { background: var(--ok-soft); color: var(--ok); }
.feed__body { display: grid; gap: 2px; min-width: 0; }
.feed__what { color: var(--muted); font-size: 0.76rem; font-weight: 500; }
.feed__body p { font-size: 0.9rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.feed__item--note .feed__body p { padding: 10px 12px; border-radius: 4px 14px 14px 14px; background: var(--panel-2); border: 1px solid var(--line); }
.feed__item--stage .feed__body p, .feed__item--done .feed__body p { color: var(--muted); }

/* toast */
.toast { position: fixed; z-index: 70; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); translate: -50% 0; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 999px;
  background: var(--fg); color: var(--bg); font-weight: 700; font-size: 0.88rem; box-shadow: 0 12px 30px rgb(0 0 0 / 0.3); animation: toast-in 260ms cubic-bezier(0.23, 1, 0.32, 1); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---- phones and small tablets ---- */
.tabbar, .menu-scrim { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); height: auto; transform: translateX(-104%); transition: transform 320ms cubic-bezier(0.23, 1, 0.32, 1); box-shadow: 20px 0 60px rgb(0 0 0 / 0.35); }
  body.menu-open .side { transform: none; }
  .menu-scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 55; background: rgb(0 0 0 / 0.45); }
  .top { padding: calc(12px + env(safe-area-inset-top, 0px)) 0 12px; }
  .top__menu { display: inline-grid; margin-left: -8px; color: var(--fg); font-size: 1.2rem; }
  .top .btn span { display: none; }
  .top .btn { width: 44px; padding: 0; }
  .main { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .tabbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; z-index: 30; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    padding: 6px; border-radius: 22px; background: color-mix(in srgb, var(--panel) 88%, transparent); border: 1px solid var(--line-2); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 10px 30px rgb(0 0 0 / 0.3); }
  .tab { position: relative; display: grid; justify-items: center; gap: 2px; padding: 7px 2px; border: 0; border-radius: 16px; background: transparent; color: var(--muted); font-size: 0.68rem; font-weight: 700; }
  .tab .ph { font-size: 1.35rem; }
  .tab[aria-current="page"] { background: var(--accent-soft); color: var(--fg); }
  .tab[aria-current="page"] .ph { color: var(--accent-text); }
  .tab__badge { position: absolute; top: 3px; left: calc(50% + 6px); min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 0.66rem; line-height: 18px; }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .lead-head { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
  .lead-head__back span { display: none; }
  .lead-head__back { width: 44px; padding: 0; }
  .lead-head__actions { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .action { flex: none; }
}
@media (max-width: 640px) {
  .kpis { gap: 10px; }
  .kpi { padding: 14px; }
  .row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .row__end { display: none; }
  .row .row__end:has(.pill) { display: block; }
  .row:has(.row__end .pill) .row__meta { display: none; }
  .task { grid-template-columns: minmax(0, 1fr) auto; }
  .task .state { display: none; }
  .task__open, .view--overview .task__open { grid-template-columns: auto minmax(0, 1fr); row-gap: 4px; }
  .task__when { grid-column: 2; font-size: 0.8rem; }
  .task__what { grid-column: 2; }
  .btn--complete span { display: none; }
  .btn--complete { width: 40px; padding: 0; }
  .funnel__row { grid-template-columns: minmax(0, 1fr) 30%  28px; }
  .card { padding: 14px; }
  .panel-foot .btn { flex: 1; }
}
