/* ==========================================================================
   EL-YOX SYSTEMS — internal CRM/ERP
   Design system v3 (2026-09-26) — the "EL-YOX CRM Redesign" canvas.

   Warm off-white ground, white cards, black ink, pill controls. Colour has a job
   and never decorates:
     yellow  #F5DD1E  act on this      (retries, late, to pay, errors)
     lilac   #CBB8F5  in motion        (call booked, in progress)
     blue    #2F5BFF  committed        (proposal sent, selection)
     black   ink      settled          (won, paid, done, primary action)
     white   surface  untouched        (new, draft)
   Dark mode is a selected set of steps: neutrals flip, yellow / lilac / blue stay,
   and "settled" black becomes the light fill so it keeps the most weight.
   Headings: Plus Jakarta Sans 800. Body and tables: Geist.
   Supersedes v2 (violet console, 2026-07-30). docs/spec.md §6.
   ========================================================================== */

/* ---------------------------------------------------------------- tokens */
:root {
  /* Body face is switchable from Settings — see FONTS in app.js. Geist is the default:
     neutral, engineered, and its digits stay even across long numeric columns, which is
     what this app is mostly made of. The alternates load on demand, never up front. */
  --font: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --display: 'Plus Jakarta Sans', var(--font);
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;

  --r-xs: 6px;
  --r-sm: 8px;
  --r: 10px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-full: 999px;

  --sb-w: 248px;
  --sb-w-min: 66px;
  --topbar-h: 72px;
}

/* Alternate body faces. Only the stylesheet for the selected one is ever fetched —
   the bootstrap script in index.html injects it before first paint. */
:root[data-font='jakarta'] { --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
:root[data-font='manrope'] { --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
:root[data-font='grotesk'] { --font: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
/* Space Grotesk stops at 700 and runs wide — pull the display sizes back so headings
   and the big widget figures do not overflow their cards. */
:root[data-font='grotesk'] .page-head h1,
:root[data-font='grotesk'] .hero-fig,
:root[data-font='grotesk'] .wnum .v { letter-spacing: -.04em; }
:root[data-font='grotesk'] .hero-fig { font-size: 30px; }
:root[data-font='grotesk'] .wnum .v { font-size: 23px; }

/* Light (default) */
:root,
:root[data-theme='light'] {
  --plane: #f2f2ef;
  --surface: #ffffff;
  --surface-2: #f7f7f4;
  --surface-3: #f0f0ec;
  --surface-4: #e8e8e3;
  --wash: rgba(15, 15, 15, 0.04);
  --wash-strong: rgba(15, 15, 15, 0.07);

  --border: #e8e8e3;
  --border-strong: #dcdcd6;
  --ink: #0f0f0f;
  --ink-2: #52525b;
  --ink-3: #6b6b66;              /* 4.8:1 on the ground, 5.4:1 on white */
  --on-accent: #ffffff;
  --on-ink: #ffffff;

  /* Primary actions are black pills; the soft variants carry the blue "committed" tint. */
  --accent: #0f0f0f;
  --accent-hover: #2b2b2b;
  --accent-soft: #eef2ff;
  --accent-soft-2: #dce4ff;
  --accent-ink: #1b3fcc;
  --link: #2f5bff;

  /* The colour-with-a-job set */
  --act: #f5dd1e;       --act-ink: #0f0f0f;   --act-mute: #5e5400;
  --motion: #cbb8f5;    --motion-ink: #0f0f0f; --motion-mute: #3d2c66;
  --commit: #2f5bff;    --commit-ink: #ffffff;
  --settled: #0f0f0f;   --settled-ink: #ffffff; --settled-mute: #b4b4ae; --settled-line: #2e2e2e; --settled-accent: #f5dd1e;

  /* Chart series + ordinal ramp: blue, monotone lightness */
  --s1: #2f5bff;
  --s2: #ea580c;
  --ord-1: #a9bbff;
  --ord-2: #6f8cff;
  --ord-3: #2f5bff;
  --ord-4: #1b3fcc;

  /* Semantic. "good" is settled black; warnings are the yellow. Red stays for real errors. */
  --good: #0f0f0f;
  --good-soft: #0f0f0f;
  --good-ink: #ffffff;
  --warn: #f5dd1e;
  --warn-soft: #f5dd1e;
  --warn-ink: #0f0f0f;
  --serious: #ec835a;
  --serious-soft: #fdeee7;
  --serious-ink: #9c3d14;
  --crit: #c53030;
  --crit-soft: #fce9e9;
  --crit-ink: #9b1c1c;
  --neutral-soft: #f0f0ec;
  --neutral-ink: #52525b;

  --grid: #ecece8;
  --axis: #dcdcd6;

  --shadow-xs: none;
  --shadow-sm: none;
  --shadow: 0 1px 3px rgba(15, 15, 15, 0.05), 0 8px 24px rgba(15, 15, 15, 0.06);
  --shadow-lg: 0 2px 8px rgba(15, 15, 15, 0.06), 0 18px 44px rgba(15, 15, 15, 0.14);
  --ring: 0 0 0 3px rgba(47, 91, 255, 0.22);
}

/* Dark — steps selected for the dark surface, not an inverted flip */
:root[data-theme='dark'] {
  color-scheme: dark;

  --plane: #111113;
  --surface: #1c1c1f;
  --surface-2: #242428;
  --surface-3: #29292d;
  --surface-4: #2c2c31;
  --wash: rgba(255, 255, 255, 0.045);
  --wash-strong: rgba(255, 255, 255, 0.085);

  --border: #2c2c31;
  --border-strong: #3a3a40;
  --ink: #f2f2ef;
  --ink-2: #c4c4ca;
  --ink-3: #a3a39d;
  --on-accent: #111113;
  --on-ink: #111113;

  --accent: #f2f2ef;
  --accent-hover: #ffffff;
  --accent-soft: rgba(157, 178, 255, 0.14);
  --accent-soft-2: rgba(157, 178, 255, 0.26);
  --accent-ink: #9db2ff;
  --link: #9db2ff;

  --act: #f5dd1e;       --act-ink: #0f0f0f;   --act-mute: #5e5400;
  --motion: #cbb8f5;    --motion-ink: #0f0f0f; --motion-mute: #3d2c66;
  --commit: #2f5bff;    --commit-ink: #ffffff;
  --settled: #f2f2ef;   --settled-ink: #111113; --settled-mute: #5c5c57; --settled-line: #d5d5cf; --settled-accent: #5e5000;

  --s1: #6f8cff;
  --s2: #ea580c;
  --ord-1: #2a4ad0;
  --ord-2: #4d6dff;
  --ord-3: #7f99ff;
  --ord-4: #b3c3ff;

  --good: #f2f2ef;
  --good-soft: #f2f2ef;
  --good-ink: #111113;
  --warn: #f5dd1e;
  --warn-soft: #f5dd1e;
  --warn-ink: #0f0f0f;
  --serious: #ec835a;
  --serious-soft: rgba(236, 131, 90, 0.17);
  --serious-ink: #f2ab8c;
  --crit: #e05252;
  --crit-soft: rgba(224, 82, 82, 0.18);
  --crit-ink: #f5a3a3;
  --neutral-soft: rgba(255, 255, 255, 0.07);
  --neutral-ink: #c4c4ca;

  --grid: rgba(255, 255, 255, 0.06);
  --axis: rgba(255, 255, 255, 0.13);

  --shadow-xs: none;
  --shadow-sm: none;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 2px 10px rgba(0, 0, 0, 0.6), 0 20px 50px rgba(0, 0, 0, 0.55);
  --ring: 0 0 0 3px rgba(157, 178, 255, 0.3);
}

/* ---------------------------------------------------------------- reset */
* { margin: 0; padding: 0; box-sizing: border-box; }
/* `hidden` must win over any component's display rule (a flex .lf-check stayed visible). */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  background: var(--plane);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent-soft-2); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
svg { display: block; flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--ink-3); background-clip: content-box; }

/* =========================================================== primitives */
.i { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 14px; height: 14px; }
.i-lg { width: 18px; height: 18px; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; min-height: 38px;
  border-radius: var(--r-full);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-xs);
  transition: background .14s ease, border-color .14s ease, color .14s ease, box-shadow .14s ease, transform .1s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); font-weight: 600; }
.btn-primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn-ghost:hover { background: var(--wash); color: var(--ink); }
.btn-sm { min-height: 30px; padding: 4px 12px; font-size: 12px; }
.btn-icon { padding: 0; width: 40px; min-height: 40px; justify-content: center; }
.btn-icon.btn-sm { width: 30px; }
.btn-danger { color: var(--crit-ink); }
.btn-danger:hover { background: var(--crit-soft); border-color: var(--crit); }

/* ---- inputs ---- */
.input, select.input, textarea.input {
  width: 100%;
  padding: 8px 14px; min-height: 38px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--ink);
  font-size: 13px;
  outline: none;
  box-shadow: var(--shadow-xs);
  transition: border-color .14s ease, box-shadow .14s ease;
}
.input:hover { border-color: var(--ink-3); }
.input:focus { border-color: var(--ink); box-shadow: var(--ring); }
.input::placeholder { color: var(--ink-3); }
select.input {
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%238b8b99' fill='none' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 28px;
}
:root[data-theme='dark'] select.input {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%2371717e' fill='none' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
textarea.input { resize: vertical; min-height: 76px; line-height: 1.6; padding: 9px 11px; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 12px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.field-hint { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; line-height: 1.5; }

/* ---- badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  background: var(--neutral-soft);
  color: var(--neutral-ink);
  font-size: 11.5px; font-weight: 550; line-height: 1.5;
  white-space: nowrap;
}
.badge .i, .badge .i-sm { width: 12px; height: 12px; stroke-width: 2; }
.badge-good { background: var(--good-soft); color: var(--good-ink); }
.badge-warn { background: var(--warn-soft); color: var(--warn-ink); }
.badge-serious { background: var(--serious-soft); color: var(--serious-ink); }
.badge-crit { background: var(--crit-soft); color: var(--crit-ink); }
.badge-accent { background: var(--commit); color: var(--commit-ink); }
.badge-act { background: var(--act); color: var(--act-ink); }
.badge-motion { background: var(--motion); color: var(--motion-ink); }
.badge-settled { background: var(--settled); color: var(--settled-ink); }
.badge-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--ink-2); }
.badge-solid { background: var(--ink); color: var(--on-ink); }
.badge-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge-strike { text-decoration: line-through; opacity: .8; }

.chip-tier { font-family: var(--mono); font-size: 11px; letter-spacing: -.02em; padding: 2px 7px; }
.chip-tier.t1 { background: var(--accent-soft-2); color: var(--accent-ink); }
.chip-tier.t2 { background: var(--accent-soft); color: var(--accent-ink); }
.chip-tier.t3 { background: var(--neutral-soft); color: var(--ink-3); }

/* ---- avatars ---- */
.av {
  width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 650; letter-spacing: -.01em;
  background: var(--accent-soft); color: var(--accent-ink);
  border: 1.5px solid var(--surface);
  flex-shrink: 0; user-select: none;
}
.av-sm { width: 20px; height: 20px; font-size: 9px; }
.av-lg { width: 30px; height: 30px; font-size: 11.5px; }
.av-c0 { background: var(--accent-soft); color: var(--accent-ink); }
.av-c1 { background: #ede4fe; color: #5b21b6; }
.av-c2 { background: #fde8dc; color: #9c3d14; }
.av-c3 { background: #dcf0e3; color: #0a6b0a; }
.av-c4 { background: #e2e8fa; color: #1e3a8a; }
:root[data-theme='dark'] .av-c1 { background: rgba(139, 92, 246, .22); color: #c4b5fd; }
:root[data-theme='dark'] .av-c2 { background: rgba(234, 88, 12, .22); color: #f2ab8c; }
:root[data-theme='dark'] .av-c3 { background: rgba(12, 163, 12, .2); color: #6ee06e; }
:root[data-theme='dark'] .av-c4 { background: rgba(59, 130, 246, .22); color: #a5c4fb; }
.av-stack { display: inline-flex; align-items: center; }
.av-stack .av { margin-left: -7px; }
.av-stack .av:first-child { margin-left: 0; }
.av-more { background: var(--surface-3); color: var(--ink-2); font-size: 9.5px; font-weight: 600; }

/* ---- misc text ---- */
.hint { font-size: 12px; color: var(--ink-3); line-height: 1.6; }
.hint code {
  font-family: var(--mono); font-size: 11px;
  background: var(--surface-3); border: 1px solid var(--border);
  padding: 1px 5px; border-radius: 4px; color: var(--ink-2);
}
.num { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font); font-size: 10.5px; font-weight: 550;
  padding: 1px 5px; min-width: 18px;
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: 5px; color: var(--ink-3);
}

/* =============================================================== login */
/* Canvas "Sign in": black brand panel on the left, the form on the right. The panel is
   black in BOTH themes (it is brand, not a status), so the logo inside is always white. */
.login-screen {
  min-height: 100vh;
  display: flex; gap: 24px;
  padding: 24px;
  background: var(--plane);
}
.login-brand {
  width: min(620px, 44vw); flex-shrink: 0;
  border-radius: 28px; padding: 44px 48px;
  background: #0f0f0f; color: #ffffff;
  border: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.login-logo { height: 42px; width: auto; filter: invert(1); align-self: flex-start; }
.login-pitch { margin-top: auto; }
.login-pitch h2 { font-family: var(--display); font-size: clamp(36px, 3.8vw, 54px); font-weight: 800; letter-spacing: -.04em; line-height: .98; }
.login-pitch p { margin-top: 20px; font-size: 15px; line-height: 1.6; color: #b4b4ae; max-width: 440px; }
.login-legend { margin-top: 40px; padding-top: 28px; border-top: 1px solid #2e2e2e; }
.login-legend h3 { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #b4b4ae; margin-bottom: 14px; }
.login-legend ul { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.login-legend li { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.login-legend .sw { width: 28px; height: 18px; border-radius: 999px; flex-shrink: 0; }

.login-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; position: relative; }
.login-theme { position: absolute; top: 0; right: 0; }
.login-box { width: min(400px, 100%); margin: auto 0; padding: 40px 0 24px; }
.login-view[hidden] { display: none; }
.login-box h1 { font-family: var(--display); font-size: 40px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.login-lede { margin: 10px 0 28px; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.login-lede strong { color: var(--ink); }
.login-form { display: flex; flex-direction: column; gap: 18px; }
.lf { display: flex; flex-direction: column; gap: 7px; }
.lf-head { display: flex; align-items: baseline; justify-content: space-between; }
.lf label { font-size: 13px; font-weight: 600; }
.lf .input { min-height: 50px; padding: 0 18px; font-size: 15px; border-radius: 14px; }
.lf .input[aria-invalid='true'] { border: 2px solid var(--ink); }
.lf-pw { position: relative; }
.lf-pw .input { padding-right: 56px; }
.pw-toggle {
  position: absolute; top: 5px; right: 5px; width: 40px; height: 40px;
  border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--ink-2);
}
.pw-toggle:hover { background: var(--wash); color: var(--ink); }
.lf-err { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 500; color: var(--ink); }
.lf-err[hidden], .lf-caps[hidden] { display: none; }
.lf-err::before {
  content: '!'; width: 16px; height: 16px; border-radius: 999px; flex-shrink: 0;
  background: var(--act); color: var(--act-ink); font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.lf-caps { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.link-btn { font-size: 13px; font-weight: 600; color: var(--link); padding: 6px 0; }
.link-btn:hover { text-decoration: underline; }
.back-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 8px 0; margin-bottom: 18px; }
.back-btn:hover { color: var(--ink); }
.lf-check { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); cursor: pointer; min-height: 32px; }
.lf-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); cursor: pointer; }
.login-btn { width: 100%; justify-content: center; min-height: 52px; font-size: 15px; }
.login-btn .spin { display: none; }
.login-btn.loading .spin { display: block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-error {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 13px; font-weight: 500; line-height: 1.5;
  background: var(--act); color: var(--act-ink);
  border-radius: 16px; padding: 14px 16px; margin-bottom: 20px;
}
.login-error[hidden] { display: none; }
.login-note { margin-top: 28px; font-size: 13px; line-height: 1.6; color: var(--ink-3); }
.login-badge {
  width: 56px; height: 56px; border-radius: 999px; margin-bottom: 22px;
  display: flex; align-items: center; justify-content: center;
  background: var(--motion); color: var(--motion-ink);
}
.login-badge .i { width: 24px; height: 24px; }
.login-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; font-size: 12px; color: var(--ink-3); padding-bottom: 4px; }

.anim { opacity: 0; transform: translateY(12px); animation: rise .6s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: var(--d, 0s); }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .anim { animation: rise .01s forwards; }
  .login-btn.loading .spin { animation: none; }
  * { transition-duration: .01s !important; }
}
@media (max-width: 900px) {
  .login-screen { flex-direction: column; padding: 20px 22px; gap: 0; position: relative; }
  .login-main { position: static; }
  .login-theme { top: 16px; right: 18px; }
  .login-brand { width: auto; padding: 0; background: none; border: none; color: var(--ink); margin-bottom: 28px; }
  .login-brand .login-pitch, .login-brand .login-legend { display: none; }
  .login-logo { height: 32px; filter: none; }
  :root[data-theme='dark'] .login-logo { filter: invert(1); }
  .login-box { padding-top: 12px; }
  .login-box h1 { font-size: 34px; }
  .lf .input { font-size: 16px; min-height: 52px; }   /* 16px: iOS does not zoom on focus */
  .pw-toggle { width: 44px; height: 44px; top: 4px; right: 4px; }
  .lf-check { min-height: 44px; }
}

/* ============================================================== app shell */
/* v3: no sidebar. One top bar — logo, five sections, then search / follow-ups / theme /
   account. Each section's sub-views are pills at the top of the page (#subnav). */
.app { display: none; min-height: 100vh; }
.app.visible { display: flex; flex-direction: column; }

.topnav {
  height: var(--topbar-h); flex-shrink: 0;
  display: flex; align-items: center; gap: 16px;
  padding: 0 32px;
  background: var(--plane);
  position: sticky; top: 0; z-index: 30;
}
@supports (backdrop-filter: blur(10px)) {
  .topnav { background: color-mix(in srgb, var(--plane) 86%, transparent); backdrop-filter: blur(10px); }
}
.brand { display: flex; align-items: center; width: 180px; flex-shrink: 0; }
.brand-logo { height: 30px; width: auto; display: block; }
:root[data-theme='dark'] .brand-logo { filter: invert(1); }

.sections { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; }
.sec {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--r-full);
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
}
.sec:hover { color: var(--ink); background: var(--wash); }
.sec.active { background: var(--ink); color: var(--on-ink); font-weight: 600; padding: 11px 24px; }
.sec-dot {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--act); color: var(--act-ink);
  font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: center; justify-content: center;
}

.topnav-actions { display: flex; align-items: center; gap: 8px; width: 180px; justify-content: flex-end; flex-shrink: 0; }
.omni-trigger {
  width: 40px; height: 40px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2);
  display: flex; align-items: center; justify-content: center;
}
.omni-trigger:hover { color: var(--ink); }
.omni-trigger .kbd, .omni-trigger .omni-txt { display: none; }
.topnav-actions .btn-icon { border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2); }
.bell-wrap { position: relative; }
.bell-wrap .nav-pill {
  position: absolute; top: -3px; right: -4px;
  min-width: 16px; height: 16px; font-size: 9.5px; padding: 0 4px;
  border: 2px solid var(--plane); box-sizing: content-box;
}
.nav-pill {
  min-width: 18px; height: 17px; padding: 0 5px;
  border-radius: var(--r-full);
  background: var(--act); color: var(--act-ink);
  font-size: 10.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}

.menu-wrap { position: relative; }
.user-btn { border-radius: 999px; display: flex; }
.user-btn .av { width: 40px; height: 40px; font-size: 12px; border: none; background: var(--ink); color: var(--on-ink); }
.user-menu {
  position: absolute; top: calc(100% + 10px); right: 0; width: 260px; z-index: 50;
  background: var(--surface); border-radius: 20px; padding: 8px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
}
.user-menu[hidden] { display: none; }
.um-head { padding: 12px 12px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.um-head .user-name { display: block; font-size: 14px; font-weight: 600; }
.um-head .user-mail { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.um-head .ws-sub { display: inline-block; margin-top: 8px; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border-radius: 12px; min-height: 40px;
  font-size: 13px; font-weight: 500; color: var(--ink); text-align: left;
}
.menu-item .i { color: var(--ink-3); }
.menu-item:hover { background: var(--surface-3); }
.menu-sep { height: 1px; background: var(--border); margin: 6px 0; }
.build-stamp { font-size: 10.5px; color: var(--ink-3); padding: 6px 12px 4px; }

.main { padding: 8px 40px 90px; min-width: 0; flex: 1; width: 100%; max-width: 1520px; margin: 0 auto; }
.subnav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.subnav:empty { display: none; }
.subtab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: var(--r-full);
  font-size: 13px; font-weight: 500; color: var(--ink-2); background: var(--surface);
  transition: background .15s ease, color .15s ease;
}
.subtab:hover { color: var(--ink); }
.subtab.active { background: var(--ink); color: var(--on-ink); font-weight: 600; }
.subtab .n { font-size: 11.5px; font-variant-numeric: tabular-nums; opacity: .7; }

/* ---------------------------------------------------------- page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.page-head h1 { font-family: var(--display); font-size: 40px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.page-head .sub { color: var(--ink-2); font-size: 13px; margin-top: 10px; max-width: 66ch; line-height: 1.6; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.head-people { display: flex; align-items: center; gap: 6px; }
.head-people .av { border-color: var(--plane); }
.head-people .add-person {
  width: 24px; height: 24px; border-radius: 50%;
  border: 1px dashed var(--border-strong); color: var(--ink-3);
  display: flex; align-items: center; justify-content: center;
  transition: border-color .14s ease, color .14s ease;
}
.head-people .add-person:hover { border-color: var(--accent); color: var(--accent); }

/* ============================================================== cards */
.card {
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
  min-width: 0; position: relative;
  display: flex; flex-direction: column;
}
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; min-height: 22px; }
.card-head .ch-icon { color: var(--ink-3); }
.card-head h3 { font-size: 15px; font-weight: 600; color: var(--ink); display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 6px; row-gap: 2px; min-width: 0; }
.card-head h3 .h-note { font-size: 12px; font-weight: 400; color: var(--ink-3); }
.card-tools { margin-left: auto; display: flex; gap: 2px; opacity: 0; transition: opacity .15s ease; }
.card:hover .card-tools, .card-tools:focus-within { opacity: 1; }
.card-tool {
  width: 22px; height: 22px; border-radius: var(--r-xs);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); transition: background .13s ease, color .13s ease;
}
.card-tool:hover { background: var(--wash-strong); color: var(--ink); }
.card-tool.on { background: var(--accent-soft); color: var(--accent-ink); }
.card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; }

.panel {
  background: var(--surface); border: 1px solid transparent;
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  padding: 22px 24px; margin-bottom: 16px; min-width: 0;
}
.panel > h3 {
  font-size: 15px; font-weight: 600; color: var(--ink);
  margin-bottom: 13px; display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap;
}
.panel > h3 .h-note { font-size: 12px; font-weight: 400; color: var(--ink-3); }

.section-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3);
  margin: 22px 0 9px;
}
.section-label:first-child { margin-top: 0; }
.section-label .i { width: 13px; height: 13px; }
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ==================================================== dashboard widgets */
.widget-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .78fr) minmax(0, 1.45fr);
  gap: 12px; margin-bottom: 14px; align-items: stretch;
}
.widget-row .w-mid { display: grid; grid-template-rows: 1fr 1fr; gap: 12px; min-width: 0; }
@media (max-width: 1280px) {
  .widget-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .widget-row .w-burn { grid-column: 1 / -1; }
}
@media (max-width: 800px) {
  .widget-row { grid-template-columns: minmax(0, 1fr); }
  .widget-row .w-mid { grid-template-rows: auto auto; }
}

.wnums { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.wnum { min-width: 0; padding: 0; text-align: left; border-radius: var(--r-xs); }
.wnum .v { font-size: 25px; font-weight: 650; letter-spacing: -.03em; line-height: 1.05; display: block; }
.wnum .k { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink-2); margin-top: 4px; white-space: nowrap; }
.wnum .k .dot { width: 7px; height: 7px; border-radius: 2px; flex-shrink: 0; }
button.wnum:hover .v { color: var(--accent); }

.hero-fig { font-size: 29px; font-weight: 650; letter-spacing: -.035em; line-height: 1; }
.hero-sub { font-size: 12px; color: var(--ink-2); margin-top: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.delta .i { width: 12px; height: 12px; stroke-width: 2.2; }
.delta-up { color: var(--good-ink); }
.delta-down { color: var(--crit-ink); }
.delta-flat { color: var(--ink-3); }
.delta-note { color: var(--ink-3); font-weight: 400; font-size: 11px; }

/* stacked ordinal bar — 2px surface gaps do the separating, never a stroke */
.stackbar { display: flex; height: 34px; gap: 2px; }
.stackbar.tall { height: 58px; }
/* .grow lets the bar absorb a tall card's spare height instead of leaving dead air */
.stack-block { display: flex; flex-direction: column; justify-content: flex-end; min-height: 0; }
.stackbar.grow { height: auto; flex: 1; min-height: 58px; max-height: 148px; }
.stackbar .seg { position: relative; min-width: 3px; border-radius: 3px; transition: filter .13s ease; }
.stackbar .seg:hover { filter: brightness(1.09) saturate(1.06); }
.stackbar .seg.o1 { background: var(--ord-1); }
.stackbar .seg.o2 { background: var(--ord-2); }
.stackbar .seg.o3 { background: var(--ord-3); }
.stackbar .seg.o4 { background: var(--ord-4); }
.stackbar .seg.o0 { background: var(--surface-4); }
.stack-scale { display: flex; justify-content: space-between; margin-top: 7px; font-size: 10.5px; color: var(--ink-3); }
.stack-legend { display: flex; flex-wrap: wrap; gap: 3px 14px; margin-top: 10px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-2); }
.legend-item .swatch { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.legend-item .swatch.line { width: 14px; height: 3px; border-radius: 2px; }
.legend-item .lv { color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* sparkline — HTML bars, so it never fights SVG aspect-ratio scaling */
.spark-bars { display: flex; align-items: flex-end; gap: 2px; height: 40px; }
.spark-bars .sb { flex: 1; min-width: 0; height: 100%; display: flex; align-items: flex-end; }
.spark-bars .sb i {
  display: block; width: 100%; min-height: 2px;
  background: var(--ord-1); border-radius: 2px 2px 0 0;
  transition: height .5s cubic-bezier(.2, .7, .2, 1), filter .13s ease;
}
.spark-bars .sb.on i { background: var(--s1); }
.spark-bars .sb:hover i { filter: brightness(1.12); }

/* svg chart chrome */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .axis-line { stroke: var(--axis); stroke-width: 1; }
.chart .axis-lbl { font-size: 10px; fill: var(--ink-3); font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .ser-1 { stroke: var(--s1); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.chart .ser-2 { stroke: var(--s2); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.chart .area-1 { fill: var(--s1); opacity: .1; stroke: none; }
.chart .pt-1 { fill: var(--s1); stroke: var(--surface); stroke-width: 2; }
.chart .pt-2 { fill: var(--s2); stroke: var(--surface); stroke-width: 2; }
.chart .crosshair { stroke: var(--ink-3); stroke-width: 1; opacity: 0; pointer-events: none; }
.chart .crosshair.on { opacity: .5; }
.chart .hitband { fill: transparent; cursor: crosshair; }
.chart .end-lbl { font-size: 11px; font-weight: 600; fill: var(--ink); font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart-empty {
  color: var(--ink-3); font-size: 12.5px; padding: 28px 12px; text-align: center;
  border: 1px dashed var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface-2); line-height: 1.6;
}

.viz-tip {
  position: fixed; z-index: 100; pointer-events: none;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  box-shadow: var(--shadow-lg);
  padding: 7px 10px; font-size: 12px; line-height: 1.5;
  opacity: 0; transform: translateY(3px); transition: opacity .12s ease, transform .12s ease;
  max-width: 250px;
}
.viz-tip.show { opacity: 1; transform: translateY(0); }
.viz-tip .tip-head { font-weight: 650; margin-bottom: 3px; }
.viz-tip .tip-row { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.viz-tip .tip-row .swatch { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.viz-tip .tip-row .tv { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }

/* horizontal bars */
.hbars { display: flex; flex-direction: column; gap: 3px; }
.hbar-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) 58px; align-items: center; gap: 10px; padding: 3px 0; border-radius: var(--r-xs); }
.hbar-row.clickable { cursor: pointer; }
.hbar-row.clickable:hover { background: var(--wash); }
.hbar-row .lbl { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-row .val { font-family: var(--mono); font-size: 12px; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.hbar-row .val small { color: var(--ink-3); font-size: 10px; }
.hbar-track { height: 16px; background: var(--surface-3); border-radius: 0 5px 5px 0; position: relative; }
.hbar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--s1); border-radius: 0 5px 5px 0; min-width: 2px; transition: width .55s cubic-bezier(.2, .7, .2, 1); }
.hbar-fill.o1 { background: var(--ord-1); }
.hbar-fill.o2 { background: var(--ord-2); }
.hbar-fill.o3 { background: var(--ord-3); }
.hbar-fill.o4 { background: var(--ord-4); }
.hbar-row:hover .hbar-fill { filter: brightness(1.06); }

/* vertical bars */
.vbars { display: flex; align-items: flex-end; gap: 8px; height: 154px; padding-top: 16px; }
.vbar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.vbar .bar { width: 100%; max-width: 24px; background: var(--s1); border-radius: 4px 4px 0 0; min-height: 2px; transition: height .55s cubic-bezier(.2, .7, .2, 1), filter .13s ease; }
.vbar:hover .bar { filter: brightness(1.08); }
.vbar .v { font-family: var(--mono); font-size: 10.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.vbar .m { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }

/* ================================================================ grids */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.dash-grid > .panel, .dash-grid > .card { margin-bottom: 0; }
@media (max-width: 1040px) { .dash-grid, .grid-2 { grid-template-columns: 1fr; } }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(152px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat {
  border-radius: 20px; padding: 18px 20px; background: var(--surface); min-width: 0;
  transition: box-shadow .16s ease, transform .16s ease;
}
.stats-click .stat { cursor: pointer; }
.stats-click .stat:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat .k { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.stat .k .i { width: 14px; height: 14px; color: currentColor; }
.stat .v { font-family: var(--display); font-size: 28px; font-weight: 800; letter-spacing: -.03em; margin-top: 10px; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .v small { font-family: var(--font); font-size: 12px; color: var(--ink-3); font-weight: 600; letter-spacing: 0; }
/* Canvas colour jobs on a number: settled black for the week's cost, yellow for money or
   work waiting on you. */
.stat.st-settled { background: var(--settled); color: var(--settled-ink); }
.stat.st-settled .k, .stat.st-settled .v small { color: var(--settled-mute); }
.stat.st-act { background: var(--act); color: var(--act-ink); }
.stat.st-act .k, .stat.st-act .v small { color: var(--act-mute); }
.stat .trend { font-size: 11px; color: var(--ink-3); margin-top: 5px; }

/* =============================================================== tabs */
.viewbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--r-full); background: var(--surface);
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  transition: background .13s ease, color .13s ease, box-shadow .13s ease;
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--ink); color: var(--on-ink); font-weight: 600; }
.tab .i { width: 14px; height: 14px; }
.viewbar-right { margin-left: auto; display: flex; gap: 7px; align-items: center; }

/* ============================================================= filters */
.filters { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters .input { width: auto; min-width: 128px; }
.search-wrap { position: relative; flex: 1; min-width: 210px; display: flex; }
.search-wrap .i-search { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search-wrap .input { padding-left: 31px; }
.filter-count { font-size: 12px; color: var(--ink-3); }

/* =============================================================== table */
.table-wrap {
  border: 1px solid transparent; border-radius: var(--r-lg);
  overflow: auto; background: var(--surface); box-shadow: var(--shadow-sm);
  max-height: 76vh;
}
.table-wrap.flush { border: none; box-shadow: none; background: transparent; border-radius: 0; max-height: none; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
th {
  text-align: left; padding: 9px 13px;
  font-size: 11.5px; font-weight: 600; color: var(--ink-3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky; top: 0; background: var(--surface-2); z-index: 2;
}
.table-wrap.flush th { background: var(--surface); }
th.num, td.num { text-align: right; }
td { padding: 9px 13px; border-bottom: 1px solid var(--border); white-space: nowrap; color: var(--ink-2); vertical-align: middle; }
td.strong { color: var(--ink); font-weight: 550; }
td.wrap { white-space: normal; min-width: 220px; line-height: 1.5; }
tbody tr:last-child td { border-bottom: none; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover td { background: var(--surface-3); }
.cell-sub { display: block; font-size: 11px; color: var(--ink-3); margin-top: 1px; font-weight: 400; }
.cell-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row-more td { color: var(--ink-3); font-size: 12px; text-align: center; padding: 12px; cursor: default; }
.row-more td:hover { background: transparent; }
.table-empty { padding: 44px 20px; text-align: center; color: var(--ink-3); font-size: 13px; line-height: 1.6; }
.table-empty .i { width: 22px; height: 22px; margin: 0 auto 10px; color: var(--border-strong); }

.mini-table { width: 100%; font-size: 12px; }
.mini-table th { position: static; background: transparent; padding: 5px 8px; border-bottom: 1px solid var(--border); font-size: 11px; }
.mini-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); }
.mini-table tr:last-child td { border-bottom: none; }

.minibar-cell { width: 26%; min-width: 70px; }
.minibar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.minibar-fill { height: 100%; background: var(--ord-3); border-radius: 3px; min-width: 2px; }
.state-table .row-empty td { opacity: .42; }
.state-table .row-empty .minibar { background: transparent; }

.meter { height: 6px; border-radius: 3px; background: var(--accent-soft); overflow: hidden; min-width: 58px; }
.meter-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .5s cubic-bezier(.2, .7, .2, 1); }
.meter-fill.warn { background: var(--warn); }
.meter-fill.good { background: var(--good); }

/* ============================================================== kanban */
/* v3 (canvas board Leads): the card's fill is its stage. Columns are bare — a 3px rule in
   the stage colour under the title, no box — so the colour lives on the cards alone. */
.quick-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.qf {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px; min-height: 38px;
  background: var(--surface); border: 1px solid var(--border-strong);
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.qf:hover { color: var(--ink); }
.qf .n { font-size: 11.5px; font-variant-numeric: tabular-nums; opacity: .75; }
.qf.on { background: var(--act); border-color: var(--act); color: var(--act-ink); font-weight: 600; }
.qf-clear { border-color: transparent; background: transparent; color: var(--ink-3); }

.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.kcol { min-width: 262px; width: 262px; flex-shrink: 0; display: flex; flex-direction: column; gap: 10px; }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 0 4px 9px; border-bottom: 3px solid var(--border-strong); }
.kcol.st-injoignable .kcol-head { border-color: var(--act); }
.kcol.st-call_booked .kcol-head { border-color: var(--motion); }
.kcol.st-proposal_sent .kcol-head { border-color: var(--commit); }
.kcol.st-won .kcol-head { border-color: var(--settled); }
.kcol.st-lost .kcol-head { border-color: var(--surface-4); }
/* email stages (2026-09-26): wrong email = the address is broken (white, dashed); no reply = the
   mail sequence is running (lilac, in motion); replied = your move (yellow, act) */
.kcol.st-wrong_email .kcol-head { border-bottom-style: dashed; }
.kcol.st-no_reply .kcol-head { border-color: var(--motion); }
.kcol.st-replied .kcol-head { border-color: var(--act); }
.kcol-head .t { font-size: 14px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kcol-head .c { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.kcol-head .kmore { margin-left: auto; color: var(--ink-3); width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.kcol-head .kmore:hover { background: var(--wash-strong); color: var(--ink); }
.klink { color: var(--link); font-weight: 600; }
.kcards {
  display: flex; flex-direction: column; gap: 10px;
  min-height: 72px; max-height: calc(100vh - 300px);
  overflow-y: auto; overflow-x: hidden;
  border-radius: 18px; padding: 5px; margin: 0 -3px;   /* 5px: room for a card's focus ring */
  outline: 2px dashed transparent; outline-offset: -2px;
  transition: background .13s ease, outline-color .13s ease;
}
.kcards.dropzone { outline-color: var(--link); background: var(--accent-soft); }
.kcards:empty::after {
  content: 'Drop a lead here'; color: var(--ink-3); font-size: 12px; font-weight: 500; text-align: center;
  padding: 20px 0; width: 100%; border: 2px dashed var(--border-strong); border-radius: 18px;
}
.kcard {
  border-radius: 18px; padding: 16px; cursor: grab;
  transition: box-shadow .16s ease, transform .16s cubic-bezier(.2, .7, .3, 1), opacity .13s ease;
}
.kcard:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.kcard.dragging { opacity: .45; cursor: grabbing; transform: rotate(-1.2deg) scale(1.01); box-shadow: var(--shadow-lg); }
.kc-meta { font-size: 11px; font-variant-numeric: tabular-nums; margin-bottom: 6px; }
.kcard .n { font-weight: 600; font-size: 14px; line-height: 1.3; margin-bottom: 10px; overflow-wrap: anywhere; }
.kc-due { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 12px; }
.kc-due .i { width: 13px; height: 13px; flex-shrink: 0; }
.kc-due.overdue { font-weight: 600; }
.kcard-foot { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.kc-chip { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 4px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.kcard-foot .meta { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.kcard-foot .meta .i { width: 12px; height: 12px; }
.kcard-foot .av { margin-left: auto; }
.kcard-foot .meta + .av { margin-left: 0; }

/* stage tones — card fill, secondary text, chip */
.kcard.st-new { background: var(--surface); color: var(--ink); }
.kcard.st-new .kc-meta, .kcard.st-new .kc-due, .kcard.st-new .meta { color: var(--ink-3); }
.kcard.st-new .kc-due.overdue { color: var(--ink); }
.kcard.st-new .kc-chip { background: var(--surface-3); color: var(--ink-2); }
.kcard.st-injoignable { background: var(--act); color: var(--act-ink); }
.kcard.st-injoignable .kc-meta, .kcard.st-injoignable .kc-due, .kcard.st-injoignable .meta { color: var(--act-mute); }
.kcard.st-injoignable .kc-due.overdue { color: var(--act-ink); }
.kcard.st-injoignable .kc-chip { background: #0f0f0f; color: #ffffff; }
.kcard.st-call_booked { background: var(--motion); color: var(--motion-ink); }
.kcard.st-call_booked .kc-meta, .kcard.st-call_booked .kc-due, .kcard.st-call_booked .meta { color: var(--motion-mute); }
.kcard.st-call_booked .kc-chip { background: #ffffff; color: var(--motion-mute); }
.kcard.st-proposal_sent { background: var(--commit); color: var(--commit-ink); }
.kcard.st-proposal_sent .kc-meta, .kcard.st-proposal_sent .kc-due, .kcard.st-proposal_sent .meta { color: rgba(255, 255, 255, .92); }
.kcard.st-proposal_sent .kc-chip { background: #ffffff; color: #0f0f0f; }
.kcard.st-won { background: var(--settled); color: var(--settled-ink); }
.kcard.st-won .kc-meta, .kcard.st-won .kc-due, .kcard.st-won .meta { color: var(--settled-mute); }
.kcard.st-won .kc-chip { background: var(--act); color: var(--act-ink); }
.kcard.st-lost { background: var(--surface-4); color: var(--ink-2); }
.kcard.st-lost .kc-meta, .kcard.st-lost .kc-due, .kcard.st-lost .meta { color: var(--ink-3); }
.kcard.st-lost .kc-chip { background: var(--surface); color: var(--ink-3); }
.kcard.st-wrong_email { background: var(--surface); color: var(--ink); border: 2px dashed var(--border-strong); padding: 14px; }
.kcard.st-wrong_email .kc-meta, .kcard.st-wrong_email .kc-due, .kcard.st-wrong_email .meta { color: var(--ink-3); }
.kcard.st-wrong_email .kc-chip { background: var(--surface-3); color: var(--ink-2); }
.kcard.st-no_reply { background: var(--motion); color: var(--motion-ink); }
.kcard.st-no_reply .kc-meta, .kcard.st-no_reply .kc-due, .kcard.st-no_reply .meta { color: var(--motion-mute); }
.kcard.st-no_reply .kc-due.overdue { color: var(--motion-ink); }
.kcard.st-no_reply .kc-chip { background: #ffffff; color: var(--motion-mute); }
.kcard.st-replied { background: var(--act); color: var(--act-ink); }
.kcard.st-replied .kc-meta, .kcard.st-replied .kc-due, .kcard.st-replied .meta { color: var(--act-mute); }
.kcard.st-replied .kc-due.overdue { color: var(--act-ink); }
.kcard.st-replied .kc-chip { background: #0f0f0f; color: #ffffff; }

/* the same colours as a table badge */
.st-badge.st-new { background: var(--surface-3); color: var(--ink-2); }
.st-badge.st-injoignable { background: var(--act); color: var(--act-ink); }
.st-badge.st-call_booked { background: var(--motion); color: var(--motion-ink); }
.st-badge.st-proposal_sent { background: var(--commit); color: var(--commit-ink); }
.st-badge.st-won { background: var(--settled); color: var(--settled-ink); }
.st-badge.st-lost { background: var(--surface-4); color: var(--ink-3); }
.st-badge.st-wrong_email { background: var(--surface); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--border-strong); }
.st-badge.st-no_reply { background: var(--motion); color: var(--motion-ink); }
.st-badge.st-replied { background: var(--act); color: var(--act-ink); }

/* ============================================================== drawer */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(12, 12, 18, .38);
  opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 40;
}
@supports (backdrop-filter: blur(2px)) { .drawer-overlay { backdrop-filter: blur(2px); } }
:root[data-theme='dark'] .drawer-overlay { background: rgba(0, 0, 0, .6); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(580px, 96vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateX(102%);
  transition: transform .26s cubic-bezier(.2, .8, .2, 1);
  z-index: 41; overflow-y: auto;
  padding: 22px 24px 70px;
}
.drawer-open .drawer { transform: translateX(0); }
.drawer-open .drawer-overlay { opacity: 1; pointer-events: auto; }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
.drawer-head h2 { font-size: 18px; font-weight: 650; letter-spacing: -.022em; line-height: 1.25; }
.drawer-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.drawer-sub { color: var(--ink-3); font-size: 12.5px; line-height: 1.55; }
.drawer section { margin-top: 22px; }
.drawer section > h3 { font-size: 11.5px; font-weight: 600; color: var(--ink-3); margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.drawer section > h3::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.quick-actions { display: flex; gap: 7px; flex-wrap: wrap; margin: 14px 0 2px; }

.stages { display: flex; flex-wrap: wrap; gap: 5px; }
.stage-chip {
  padding: 7px 14px; min-height: 34px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--ink-2); font-size: 12px; font-weight: 550;
  transition: all .13s ease;
}
.stage-chip:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.stage-chip.current { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.stage-chip.done { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.stage-chip.won.current { background: var(--settled); border-color: var(--settled); color: var(--settled-ink); }
.stage-chip.call_booked.current { background: var(--motion); border-color: var(--motion); color: var(--motion-ink); }
.stage-chip.proposal_sent.current { background: var(--commit); border-color: var(--commit); color: var(--commit-ink); }
.stage-chip.lost.current { background: var(--surface-4); border-color: var(--surface-4); color: var(--ink-2); }
.stage-chip.injoignable.current { background: var(--act); border-color: var(--act); color: var(--act-ink); }
.stage-chip.wrong_email.current { background: var(--surface-3); border-color: var(--border-strong); border-style: dashed; color: var(--ink); }
.stage-chip.no_reply.current { background: var(--motion); border-color: var(--motion); color: var(--motion-ink); }
.stage-chip.replied.current { background: var(--act); border-color: var(--act); color: var(--act-ink); }

/* the mail counter in the drawer: one dot per mail, MAIL_MAX of them */
.mail-track { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.mail-dots { display: inline-flex; gap: 6px; }
.mail-dots i { width: 14px; height: 14px; border-radius: 999px; border: 2px solid var(--border-strong); display: inline-block; }
.mail-dots i.on { background: var(--ink); border-color: var(--ink); }
.mail-txt { font-size: 12.5px; color: var(--ink-2); flex: 1 1 180px; min-width: 0; }
.mail-track + .hint { margin-top: 10px; }

.activity { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.activity:last-child { border-bottom: none; }
.activity .a-icon {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3); color: var(--ink-3);
}
.activity .a-icon .i { width: 13px; height: 13px; }
.activity .a-icon.t-whatsapp, .activity .a-icon.t-call { background: var(--good-soft); color: var(--good-ink); }
.activity .a-icon.t-meeting { background: var(--accent-soft); color: var(--accent-ink); }
.activity .a-icon.t-stage_change { background: var(--warn-soft); color: var(--warn-ink); }
.activity .what { min-width: 0; flex: 1; }
.activity .what b { font-weight: 600; font-size: 12.5px; text-transform: capitalize; color: var(--ink); }
.activity .what .who { color: var(--ink-3); font-size: 11.5px; }
.activity .what p { color: var(--ink-2); margin-top: 2px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.activity .when { color: var(--ink-3); font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; padding-top: 5px; }
.activity-form { display: flex; gap: 7px; margin-top: 12px; flex-wrap: wrap; }
.activity-form select { width: 118px; flex-shrink: 0; }
.activity-form .input:not(select) { flex: 1; min-width: 150px; }

.check-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.check-row:last-child { border-bottom: none; }
.check-row select { width: 128px; margin-left: auto; flex-shrink: 0; }
.check-row .mod { text-transform: capitalize; font-weight: 550; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.check-row .mod .i { width: 14px; height: 14px; color: var(--ink-3); }


/* =============================================================== import */
.import-grid { display: grid; grid-template-columns: minmax(0, 1fr) 306px; gap: 16px; align-items: start; }
.import-grid textarea { min-height: 340px; font-family: var(--mono); font-size: 12px; }
.import-result { margin-top: 12px; font-size: 13px; color: var(--ink-2); line-height: 1.6; }
@media (max-width: 940px) { .import-grid { grid-template-columns: 1fr; } }

/* =============================================================== toast */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(90px);
  background: var(--ink); color: var(--on-ink);
  padding: 9px 16px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 550;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 8px;
  transition: transform .26s cubic-bezier(.2, .8, .2, 1);
  z-index: 110; max-width: 90vw;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* =============================================================== modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(12, 12, 18, .4);
  display: none; align-items: flex-start; justify-content: center; z-index: 50;
  padding: 7vh 16px 6vh; overflow-y: auto;
}
@supports (backdrop-filter: blur(2px)) { .modal-overlay { backdrop-filter: blur(2px); } }
:root[data-theme='dark'] .modal-overlay { background: rgba(0, 0, 0, .62); }
.modal-overlay.open { display: flex; }
.modal {
  width: min(520px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 22px 24px;
  animation: modal-in .2s cubic-bezier(.2, .8, .2, 1);
}
.modal.wide { width: min(780px, 100%); }
@keyframes modal-in { from { opacity: 0; transform: translateY(-10px) scale(.985); } to { opacity: 1; transform: none; } }
.modal h2 { font-size: 17px; font-weight: 650; letter-spacing: -.02em; margin-bottom: 4px; }
.modal .modal-sub { font-size: 12.5px; color: var(--ink-3); margin-bottom: 18px; line-height: 1.55; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.modal ol, .modal ul { margin: 0 0 4px 18px; }
.modal li { font-size: 13px; color: var(--ink-2); line-height: 1.7; padding-left: 2px; }
.modal li b { color: var(--ink); font-weight: 600; }
.modal-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.modal-row:last-of-type { border-bottom: none; }
.modal-row .mr-txt { min-width: 0; }
.modal-row .mr-t { font-size: 13px; font-weight: 550; color: var(--ink); }
.modal-row .mr-s { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.5; }

/* typeface picker (Settings) */
#st-fonts { display: flex; flex-direction: column; gap: 6px; }
.font-opt {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left; padding: 9px 11px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface);
  transition: background .13s ease, border-color .13s ease;
}
.font-opt:hover { background: var(--surface-3); border-color: var(--border-strong); }
.font-opt.on { background: var(--accent-soft); border-color: var(--accent); }
.fo-check { width: 16px; display: flex; align-items: center; justify-content: center; color: var(--accent); opacity: 0; flex-shrink: 0; }
.font-opt.on .fo-check { opacity: 1; }
.fo-txt { flex: 1; min-width: 0; }
.fo-name { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.fo-note { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.45; }
.fo-sample { font-size: 12px; color: var(--ink-2); white-space: nowrap; flex-shrink: 0; font-variant-numeric: tabular-nums; }
@media (max-width: 620px) { .fo-sample { display: none; } }

.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--r-sm); flex-shrink: 0; }
.seg button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: var(--r-xs); font-size: 12.5px; font-weight: 550; color: var(--ink-2); transition: background .13s ease, color .13s ease; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); font-weight: 600; }

/* ====================================================== command palette */
.cmd-overlay {
  position: fixed; inset: 0; background: rgba(12, 12, 18, .34);
  display: none; align-items: flex-start; justify-content: center;
  z-index: 90; padding: 11vh 16px 8vh;
}
@supports (backdrop-filter: blur(3px)) { .cmd-overlay { backdrop-filter: blur(3px); } }
:root[data-theme='dark'] .cmd-overlay { background: rgba(0, 0, 0, .58); }
.cmd-overlay.open { display: flex; }
.cmd {
  width: min(560px, 100%); max-height: 64vh;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
  animation: modal-in .18s cubic-bezier(.2, .8, .2, 1);
}
.cmd-input-row { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.cmd-input-row .i { color: var(--ink-3); }
.cmd-input { flex: 1; border: none; background: none; outline: none; font-size: 15px; color: var(--ink); min-width: 0; }
.cmd-input::placeholder { color: var(--ink-3); }
.cmd-list { overflow-y: auto; padding: 6px; }
.cmd-group-label { font-size: 10.5px; font-weight: 600; color: var(--ink-3); padding: 8px 10px 4px; }
.cmd-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-sm);
  cursor: pointer; color: var(--ink-2); font-size: 13px;
  width: 100%; text-align: left;
}
.cmd-item .i { color: var(--ink-3); }
.cmd-item .ci-main { flex: 1; min-width: 0; }
.cmd-item .ci-title { display: block; color: var(--ink); font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-item .ci-sub { display: block; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.cmd-item.sel { background: var(--accent-soft); }
.cmd-item.sel .ci-title { color: var(--accent-ink); }
.cmd-item.sel .i { color: var(--accent); }
.cmd-empty { padding: 26px; text-align: center; color: var(--ink-3); font-size: 13px; }
.cmd-foot { display: flex; align-items: center; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 11px; color: var(--ink-3); flex-wrap: wrap; }
.cmd-foot span { display: inline-flex; align-items: center; gap: 5px; }

/* ============================================================ responsive */
@media (max-width: 1100px) {
  .brand, .topnav-actions { width: auto; }
  .sec { padding: 10px 14px; }
  .sec.active { padding: 10px 16px; }
}
@media (max-width: 900px) {
  /* No backdrop blur here: a filtered parent becomes the containing block of its fixed
     children, which would pin the bottom tab bar inside the top bar. */
  .topnav { padding: 0 14px; gap: 8px; height: 64px; justify-content: space-between; backdrop-filter: none; background: var(--plane); }
  /* Phone: the sections become a bottom tab bar (canvas "· phone" boards), thumb-reachable
     and never squeezed off-screen by the icons in the top bar. */
  .sections {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    justify-content: space-around; gap: 2px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--border);
  }
  .sec, .sec.active { padding: 10px 12px; font-size: 12.5px; min-height: 44px; }
  .sec-dot { position: absolute; top: 2px; right: 0; }
  .brand, .topnav-actions { width: auto; }
  .brand-logo { height: 26px; }
  #btn-theme { display: none; }
  .main { padding: 8px 14px 100px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head h1 { font-size: 32px; }
  .head-actions { flex-wrap: wrap; }
  .drawer { padding: 18px 16px 60px; }
  .grid-2 { grid-template-columns: 1fr; }
  .hbar-row { grid-template-columns: 92px minmax(0, 1fr) 50px; }
}

/* ------------------------------------------------------- other leads */
/* Type picker for the non-ICP reservoir. Cards, not a dropdown: the counts per type ARE the
   information here — which adjacent niche is big enough to be worth porting the platform to. */
.kind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 10px; }
.kind-card {
  display: flex; flex-direction: column; gap: 2px; text-align: left;
  padding: 13px 14px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface-2); color: inherit; font: inherit; cursor: pointer;
  transition: border-color .14s ease, box-shadow .14s ease, transform .12s ease, background .14s ease;
}
.kind-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.kind-card:focus-visible { outline: none; box-shadow: var(--ring); }
.kind-card.on { border-color: transparent; background: var(--accent-soft); box-shadow: var(--ring); }
.kind-card .kc-n {
  font-size: 21px; font-weight: 650; letter-spacing: -.028em; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.kind-card.on .kc-n { color: var(--accent-ink); }
.kind-card .kc-k { font-size: 13px; font-weight: 560; margin-top: 3px; }
.kind-card .kc-m { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.kind-card .kc-note { font-size: 11px; color: var(--ink-2); margin-top: 6px; line-height: 1.4; }
.kind-card.on .kc-m, .kind-card.on .kc-note { color: var(--accent-ink); opacity: .85; }

/* ============================================================== devis ====
   v3 "Quotes" — canvas board Quotes. Module rows are pill rows with a round check (a real
   checkbox, restyled); the summary ends on a black "net payable" band. The exported devis
   is drawn separately on a canvas (dvDrawCanvas) and is NOT styled here. */
.quotes-lede { font-size: 13px; color: var(--ink-2); line-height: 1.6; max-width: 420px; }
.dv-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.dv-left { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dv-card { padding: 22px 24px; gap: 14px; }
.dv-card h3, .dv-sum-h { font-size: 15px; font-weight: 600; display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.dv-card h3 .h-note { font-size: 12px; font-weight: 400; color: var(--ink-3); }
.dv-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.dv-sticky { position: sticky; top: calc(var(--topbar-h) + 12px); padding: 22px 24px; }
.dv-sticky .section-label { margin: 18px 0 9px; }
.dv-client { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; }
.dv-client label.field { margin-bottom: 0; }
.dv-leadpick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dv-leadpick .input { flex: 1; min-width: 200px; }

.dv-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dv-presets-l { font-size: 12px; font-weight: 600; color: var(--ink-3); margin-right: 2px; }
.dv-preset {
  display: inline-flex; align-items: baseline; gap: 8px; min-height: 36px;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface);
  transition: background .15s ease, border-color .15s ease;
}
.dv-preset:hover { background: var(--surface-3); }
.dv-preset-l { font-size: 12.5px; font-weight: 600; }
.dv-preset-t { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.dv-preset-clear { border-color: transparent; background: transparent; color: var(--ink-3); font-size: 12px; font-weight: 500; }

.dv-axis + .dv-axis { margin-top: 6px; }
.dv-axis .section-label { margin: 16px 0 8px; }
.dv-row {
  display: flex; align-items: flex-start; gap: 12px; cursor: pointer;
  padding: 12px 14px; border-radius: 16px; margin-bottom: 4px; background: var(--surface);
  transition: background .15s ease;
}
.dv-row:hover { background: var(--surface-2); }
.dv-row.on { background: var(--surface-2); }
.dv-row input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex-shrink: 0; margin: 1px 0 0; cursor: pointer;
  width: 20px; height: 20px; border-radius: 999px; border: 1.5px solid var(--dash2, var(--border-strong)); background: var(--surface);
  display: grid; place-content: center; transition: background .15s ease, border-color .15s ease;
}
.dv-row input[type="checkbox"]::after {
  content: ''; width: 9px; height: 5px; border: 2px solid var(--on-ink); border-top: 0; border-right: 0;
  transform: rotate(-45deg) translate(1px, -1px); opacity: 0;
}
.dv-row input[type="checkbox"]:checked { background: var(--ink); border-color: var(--ink); }
.dv-row input[type="checkbox"]:checked::after { opacity: 1; }
.dv-row input[type="checkbox"]:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.dv-row-main { flex: 1; min-width: 0; }
.dv-row-name { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.dv-row.on .dv-row-name { font-weight: 600; color: var(--ink); }
.dv-row-blurb { display: block; font-size: 12px; color: var(--ink-3); line-height: 1.5; margin-top: 3px; }
.dv-row-price { text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.dv-row-price b { display: block; font-size: 14px; font-weight: 650; }
.dv-row-price em { display: block; font-size: 11px; color: var(--ink-3); font-style: normal; margin-top: 2px; }

.dv-extra { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 16px; background: var(--surface-2); margin-bottom: 6px; }
.dv-extra-n { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; }
.dv-extra-add { display: grid; grid-template-columns: 1fr 110px 110px auto; gap: 8px; }

.dv-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.dv-seg button {
  min-height: 36px; padding: 0 14px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--ink-2);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.dv-seg button:hover { color: var(--ink); }
.dv-seg button.on { background: var(--ink); border-color: var(--ink); color: var(--on-ink); font-weight: 600; }
.dv-check { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-size: 12px; cursor: pointer; }
.dv-check input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--ink); }
.dv-check em { display: block; color: var(--ink-3); font-style: normal; margin-top: 2px; }
.dv-tva { display: flex; align-items: center; gap: 10px; }
.dv-tva .input { width: 88px; }

.dv-warn {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 16px;
  background: var(--act); color: var(--act-ink); border-radius: 16px; padding: 12px 14px;
  font-size: 12px; line-height: 1.5;
}
.dv-warn .i { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.dv-warn em { font-style: normal; color: var(--act-mute); }
.dv-count { font-size: 12px; color: var(--ink-3); margin: 18px 0 10px; padding-top: 16px; border-top: 1px solid var(--border); }
.dv-count b { color: var(--ink); }
.dv-block { border-radius: 18px; background: var(--surface-2); padding: 14px 16px 0; margin-bottom: 12px; overflow: hidden; }
.dv-block-h { display: flex; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.dv-block-h em { font-style: normal; font-weight: 400; color: var(--ink-3); font-size: 12px; }
.dv-t-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--ink-2); padding: 4px 0; }
.dv-t-row .num { color: var(--ink); font-weight: 500; }
.dv-t-row.neg, .dv-t-row.neg .num { color: var(--ink); font-weight: 600; }
.dv-net {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin: 12px -16px 0; padding: 14px 16px;
  background: var(--settled); color: var(--settled-ink); font-size: 12px; font-weight: 600;
}
.dv-net .num { font-family: var(--display); font-size: 24px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.dv-net .num small { font-family: var(--font); font-size: 11px; font-weight: 700; letter-spacing: 0; }
.dv-lang-note { font-size: 11px; color: var(--ink-3); }

.dv-edit-head, .dv-edit-row { display: grid; grid-template-columns: 1fr 120px 120px 44px; gap: 8px; align-items: center; }
.dv-edit-head { font-size: 11px; font-weight: 600; color: var(--ink-3); padding: 0 0 6px; }
.dv-edit-head .num, .dv-edit-row .input.num { text-align: right; }
.dv-edit-list { max-height: 52vh; overflow: auto; }
.dv-edit-row { padding: 6px 0; border-top: 1px solid var(--border); }
.dv-edit-row input[type="checkbox"] { justify-self: center; width: 18px; height: 18px; accent-color: var(--ink); }
.dv-edit-n { font-size: 12.5px; }
.dv-edit-n b { font-weight: 650; }

/* Saved tab */
#dv-tabs .tab .n { font-size: 11.5px; opacity: .7; font-variant-numeric: tabular-nums; }
.dv-q-act { display: flex; gap: 6px; justify-content: flex-end; }
.dv-q-no { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dv-saved-note { margin-top: 12px; }
.pill-select.qs-sent { background-color: var(--commit); border-color: var(--commit); color: var(--commit-ink); }
.pill-select.qs-accepted { background-color: var(--settled); border-color: var(--settled); color: var(--settled-ink); }
.pill-select.qs-refused { background-color: var(--surface-4); border-color: var(--surface-4); color: var(--ink-3); }

@media (max-width: 1100px) {
  .dv-grid { grid-template-columns: minmax(0, 1fr); }
  .dv-sticky { position: static; }
}
@media (max-width: 900px) {
  .dv-client { grid-template-columns: minmax(0, 1fr); }
  .dv-extra-add { grid-template-columns: 1fr 1fr; }
  .dv-extra-add #dv-x-name { grid-column: 1 / -1; }
  .dv-card, .dv-sticky { padding: 18px; }
  .dv-row { padding: 12px; }
  .dv-seg button, .dv-preset { min-height: 44px; }
}

/* ========================================== identifiant de lead (EY-0001) */
/* Monospace et tabulaire : dans une colonne de 500 lignes, des chiffres de
   largeur variable font onduler la colonne et on perd le balayage vertical
   qui est précisément l'intérêt d'avoir un numéro. */
.lead-ref {
  font-family: var(--mono); font-size: 11.5px;
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
  color: var(--ink-3); white-space: nowrap;
}
td.lead-ref { color: var(--ink-2); font-weight: 550; }
.qm .lead-ref { color: var(--ink-2); font-weight: 600; }

.drawer-id { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lead-ref-copy {
  align-self: flex-start; cursor: pointer;
  padding: 1px 7px; border-radius: var(--r-xs);
  background: var(--surface-3); border: 1px solid var(--border);
  transition: color .13s ease, border-color .13s ease, background .13s ease;
}
.lead-ref-copy:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* ================================================================ today */
/* v3 "Today" — canvas board Main. The call tiles carry the colour system: yellow = retry
   due (act), accent = next up, plain = the rest. Everything else stays neutral. */
.today-head { display: flex; align-items: center; gap: 40px; flex-wrap: wrap; margin: 4px 0 24px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
.today-title h1 { font-family: var(--display); font-size: 48px; font-weight: 800; letter-spacing: -.04em; line-height: .95; }
.today-metrics { display: flex; gap: 32px; flex-wrap: wrap; }
.metric { display: flex; align-items: center; gap: 14px; text-align: left; border-radius: 18px; padding: 4px 8px 4px 4px; }
.metric:hover .metric-ic { background: var(--surface-3); }
.metric-ic { width: 48px; height: 48px; border-radius: 999px; background: var(--surface); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .15s ease; }
.metric-ic .i { width: 19px; height: 19px; stroke-width: 2; }
.metric-ic.act, .metric:hover .metric-ic.act { background: var(--act); color: var(--act-ink); }
.metric-txt { display: flex; flex-direction: column; gap: 4px; }
.metric-v { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.metric-v .badge { font-family: var(--font); letter-spacing: 0; }
.metric-k { font-size: 12px; color: var(--ink-3); }
.today-head .head-actions { margin-left: auto; }

.today-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; margin-bottom: 8px; }
.call-card { padding: 26px 28px; }
.call-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.call-head h2, .wk-head h2, .side-head h2 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.call-sub { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.link-quiet { font-size: 12px; color: var(--ink-2); padding: 2px 0; }
.link-quiet:hover { color: var(--ink); text-decoration: underline; }
.call-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.call-tile {
  border-radius: 18px; padding: 18px; min-height: 128px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between; gap: 16px;
  transition: transform .16s cubic-bezier(.2, .7, .3, 1), box-shadow .16s ease;
}
.call-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.ct-meta { font-size: 11px; font-variant-numeric: tabular-nums; margin-bottom: 6px; }
.ct-name { font-size: 15px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.ct-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ct-chip { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 4px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ct-actions { display: flex; gap: 6px; flex-shrink: 0; }
.ct-btn { width: 36px; height: 36px; border-radius: 999px; display: flex; align-items: center; justify-content: center; transition: transform .15s ease; }
.ct-btn:hover { transform: scale(1.06); }
.ct-btn .i { width: 15px; height: 15px; stroke-width: 2; }

.tone-plain { background: var(--surface-2); color: var(--ink); }
.tone-plain .ct-meta { color: var(--ink-3); }
.tone-plain .ct-chip { background: var(--surface); color: var(--ink-2); }
.tone-plain .ct-btn { background: var(--surface); color: var(--ink); }
.tone-next { background: var(--commit); color: var(--commit-ink); }
.tone-next .ct-meta { color: rgba(255, 255, 255, .92); }
.tone-next .ct-chip, .tone-next .ct-btn { background: #ffffff; color: #0f0f0f; }
.tone-act { background: var(--act); color: var(--act-ink); }
.tone-act .ct-meta { color: var(--act-mute); }
.tone-act .ct-chip, .tone-act .ct-btn { background: #0f0f0f; color: #ffffff; }

.call-empty { grid-column: 1 / -1; border: 2px dashed var(--border-strong); border-radius: 18px; padding: 26px 18px; text-align: center; font-size: 13px; color: var(--ink-3); line-height: 1.6; }
.call-foot { display: inline-block; margin-top: auto; padding-top: 18px; font-size: 13px; font-weight: 600; color: var(--link); }
.call-foot:hover { text-decoration: underline; }
.call-card, .side-card { display: flex; flex-direction: column; }

.today-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.week-card { background: var(--settled); color: var(--settled-ink); border-radius: var(--r-lg); padding: 24px 26px; }
.wk-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.wk-big { font-family: var(--display); font-size: 44px; font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.wk-big small { font-size: 16px; letter-spacing: 0; font-weight: 700; }
.wk-sub { font-size: 12px; color: var(--settled-mute); margin-top: 8px; }
.wk-stats { display: flex; gap: 24px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--settled-line); }
.wk-stats b { display: block; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wk-stats span { display: block; font-size: 11px; color: var(--settled-mute); margin-top: 3px; }
.wk-link { display: inline-block; margin-top: 18px; font-size: 13px; font-weight: 600; color: var(--settled-accent); }
.wk-link:hover { text-decoration: underline; }

.side-card { padding: 24px 26px; flex: 1; }
.side-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.side-note { font-size: 12px; color: var(--ink-3); }
.side-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.side-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); transition: background .15s ease; }
.side-row:hover { background: var(--surface-3); }
.side-row .av { width: 38px; height: 38px; font-size: 12px; background: var(--ink); color: var(--on-ink); border: none; }
.sr-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sr-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-meta { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-dot { width: 12px; height: 12px; border-radius: 999px; flex-shrink: 0; background: var(--surface-4); }
.stage-dot.st-call_booked { background: var(--motion); }
.stage-dot.st-proposal_sent { background: var(--commit); }
.stage-dot.st-replied { background: var(--act); }
.side-empty { font-size: 13px; color: var(--ink-3); line-height: 1.6; }

@media (max-width: 1100px) {
  .today-grid { grid-template-columns: minmax(0, 1fr); }
  .today-head { gap: 24px; }
}
@media (max-width: 900px) {
  .today-head { flex-direction: column; align-items: stretch; gap: 18px; }
  .today-title h1 { font-size: 38px; }
  .today-metrics { gap: 14px 22px; }
  .metric-v { font-size: 24px; }
  .metric-ic { width: 42px; height: 42px; }
  .today-head .head-actions { margin-left: 0; }
  .call-card, .side-card, .week-card { padding: 20px; }
  .call-grid { grid-template-columns: minmax(0, 1fr); }
  .ct-btn { width: 44px; height: 44px; }
}

/* ============================================================== clients */
/* v3 "Clients" — canvas board Clients. Card fill = client status (onboarding lilac,
   active settled black, paused white, churned closed grey); the contract card carries the
   blue "committed". Status changes are menus (.pill-select), never click-to-cycle. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.admin-chip { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; padding: 2px 9px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border-strong); color: var(--ink-2); vertical-align: 1px; }
.metric-v small { font-family: var(--font); font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--ink-3); margin-left: 4px; }
.qf.on-ink, .btn.on-ink { background: var(--ink); border-color: var(--ink); color: var(--on-ink); font-weight: 600; }

.clients-grid { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 20px; align-items: start; }
.clients-aside { padding: 20px; gap: 14px; }
.clients-aside .quick-filters { margin-bottom: 0; }
.clients-aside .qf { min-height: 32px; padding: 5px 12px; font-size: 12px; }
.clients-cards { display: flex; flex-direction: column; gap: 10px; }
.client-card { display: flex; flex-direction: column; gap: 14px; width: 100%; text-align: left; border-radius: 20px; padding: 16px; transition: transform .16s ease, box-shadow .16s ease; }
.client-card:hover { transform: translateY(-2px); }
.client-card.selected { box-shadow: 0 0 0 2px var(--ink); }
.cc-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cc-top .av { width: 40px; height: 40px; font-size: 12px; border: none; flex-shrink: 0; }
.cc-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cc-name { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-meta { font-size: 11px; font-variant-numeric: tabular-nums; }
.cc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cc-chip { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.client-card.tone-motion { background: var(--motion); color: var(--motion-ink); }
.client-card.tone-motion .cc-meta { color: var(--motion-mute); }
.client-card.tone-motion .av { background: #0f0f0f; color: #ffffff; }
.client-card.tone-motion .cc-chip { background: #ffffff; color: var(--motion-mute); }
.client-card.tone-settled { background: var(--settled); color: var(--settled-ink); }
.client-card.tone-settled .cc-meta { color: var(--settled-mute); }
.client-card.tone-settled .av { background: var(--settled-ink); color: var(--settled); }
.client-card.tone-settled .cc-chip { background: var(--act); color: var(--act-ink); }
.client-card.tone-plain { background: var(--surface-2); color: var(--ink); }
.client-card.tone-plain .cc-meta { color: var(--ink-3); }
.client-card.tone-plain .av { background: var(--ink); color: var(--on-ink); }
.client-card.tone-plain .cc-chip { background: var(--surface); color: var(--ink-2); }
.client-card.tone-closed { background: var(--surface-4); color: var(--ink-2); }
.client-card.tone-closed .cc-meta { color: var(--ink-3); }
.client-card.tone-closed .av { background: var(--surface); color: var(--ink-2); }
.client-card.tone-closed .cc-chip { background: var(--surface); color: var(--ink-3); }
.cs-motion { background: var(--motion); color: var(--motion-ink); }
.cs-settled { background: var(--settled); color: var(--settled-ink); }
.cs-plain { background: var(--surface-3); color: var(--ink-2); }
.cs-closed { background: var(--surface-4); color: var(--ink-3); }
.clients-next { border: 2px dashed var(--border-strong); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; line-height: 1.55; color: var(--ink-3); }
.clients-next b { font-size: 13px; color: var(--ink-2); }
.clients-next a { color: var(--link); font-weight: 600; margin-top: 2px; }

.client-page { padding: 24px 26px; gap: 18px; }
.client-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 60px 20px; color: var(--ink-3); font-size: 13px; line-height: 1.6; max-width: 420px; margin: 0 auto; }
.client-empty b { color: var(--ink); font-size: 16px; }
.cp-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cp-av { width: 52px; height: 52px; font-size: 15px; border: none; background: var(--ink); color: var(--on-ink); }
.cp-title { min-width: 0; flex: 1; }
.cp-name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cp-name-row h2 { font-family: var(--display); font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.cp-meta { font-size: 12px; color: var(--ink-3); margin-top: 5px; }
.cp-actions { display: flex; gap: 8px; align-items: center; }
.cp-status { width: auto; min-width: 140px; border-radius: 999px; }
.cp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cp-contract { border-radius: 20px; padding: 20px 22px; background: var(--commit); color: var(--commit-ink); display: flex; flex-direction: column; }
.cpc-head, .cpb-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.cpc-head h3, .cpb-head h3 { font-size: 15px; font-weight: 600; }
.cpb-head span { font-size: 12px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cpc-chip { font-size: 11px; font-weight: 600; background: #ffffff; color: #0f0f0f; padding: 4px 10px; border-radius: 999px; }
.cpc-nums { display: flex; gap: 28px; margin-bottom: 16px; }
.cpc-nums b { display: block; font-family: var(--display); font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.cpc-nums b small { font-family: var(--font); font-size: 12px; font-weight: 700; letter-spacing: 0; margin-left: 4px; }
.cpc-nums span { display: block; font-size: 11px; color: rgba(255, 255, 255, .92); margin-top: 6px; }
.cpc-scope { border-top: 1px solid rgba(255, 255, 255, .28); padding-top: 14px; font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
.cpc-foot { margin-top: auto; padding-top: 12px; font-size: 11px; color: rgba(255, 255, 255, .92); }
.cp-box { border-radius: 20px; padding: 20px 22px; border: 1px solid var(--border); display: flex; flex-direction: column; min-width: 0; }
.cp-sunk { background: var(--surface-2); border-color: transparent; }
.cpb-sub { font-size: 12px; color: var(--ink-3); margin: -8px 0 14px; line-height: 1.5; }
.cp-box .meter { height: 5px; background: var(--surface-4); margin-bottom: 10px; }
.cp-box .meter-fill { background: var(--ink); }
.dep-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.dep-name { flex: 1; font-size: 13px; font-weight: 500; }
.dep-name.is-live { color: var(--ink-3); }

/* A status menu that looks like the canvas pill but is a real <select>. */
.pill-select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  font-family: var(--font); font-size: 12px; font-weight: 600;
  min-height: 32px; min-width: 112px; padding: 0 30px 0 14px; border-radius: 999px;
  border: 1px solid var(--border-strong); background-color: var(--surface); color: var(--ink-2);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%23808080' fill='none' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
}
.pill-select:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.pill-select.ts-in_progress { background-color: var(--motion); border-color: var(--motion); color: var(--motion-ink); }
.pill-select.ts-done { background-color: var(--settled); border-color: var(--settled); color: var(--settled-ink); }
.pill-select.ts-skipped { background-color: var(--surface-4); border-color: var(--surface-4); color: var(--ink-3); }

.months { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.month { border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--border-strong); background: var(--surface); min-width: 0; }
.m-label { font-size: 13px; font-weight: 600; }
.m-amt { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.month .pill-select { min-width: 0; width: 100%; min-height: 30px; }
.month.ps-late { background: var(--act); border-color: var(--act); color: var(--act-ink); }
.month.ps-late .m-amt { color: var(--act-mute); }
.month.ps-late .pill-select { background-color: #0f0f0f; border-color: #0f0f0f; color: #ffffff; }
.month.ps-paid { background: var(--settled); border-color: var(--settled); color: var(--settled-ink); }
.month.ps-paid .m-amt { color: var(--settled-mute); }
.month.ps-paid .pill-select { background-color: var(--settled-ink); border-color: var(--settled-ink); color: var(--settled); }
.month-add { align-items: center; justify-content: center; flex-direction: row; gap: 6px; border: 2px dashed var(--border-strong); background: transparent; color: var(--ink-3); font-size: 12px; font-weight: 600; min-height: 92px; }
.month-add:hover { color: var(--ink); border-color: var(--ink-3); }

.log-form { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.log-field { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; }
.log-field .input { border-radius: 999px; }
.log-list { display: flex; flex-direction: column; }
.log-row { display: flex; align-items: baseline; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 13px; }
.log-date { width: 76px; flex-shrink: 0; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.log-what { flex: 1; min-width: 0; }
.log-empty { border: 2px dashed var(--border-strong); border-radius: 16px; padding: 16px; text-align: center; font-size: 12px; color: var(--ink-3); }

@media (max-width: 1100px) {
  .clients-grid { grid-template-columns: minmax(0, 1fr); }
  .cp-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .client-page { padding: 20px; }
  .cp-actions { width: 100%; }
  .cp-status { flex: 1; min-height: 44px; }
  .pill-select { min-height: 44px; }
  .months { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================== team */
/* v3 "Team" — canvas board Team. One card per member: who, how they are paid, what is owed
   this week, the rates that compute it. */
#team-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
#team-list > .table-empty { grid-column: 1 / -1; }
.member-card { background: var(--surface); border-radius: var(--r-lg); padding: 22px 24px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.member-card.inactive { opacity: .6; }
.mc-head { display: flex; align-items: flex-start; gap: 12px; }
.mc-head .av-lg { width: 42px; height: 42px; font-size: 13px; border: none; flex-shrink: 0; }
.mc-id { flex: 1; min-width: 0; }
.mc-name { font-size: 17px; font-weight: 600; letter-spacing: -.01em; margin-bottom: 6px; }
.mc-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.mc-role { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.mc-tools { display: flex; gap: 6px; flex-shrink: 0; }
.mc-owed { border-radius: 18px; padding: 16px 18px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.mc-owed-k { font-size: 11px; color: var(--ink-3); }
.mc-owed-v { font-family: var(--display); font-size: 32px; font-weight: 800; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.mc-owed-v small { font-family: var(--font); font-size: 13px; font-weight: 700; letter-spacing: 0; }
.mc-owed-n { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.mc-owed-n b { color: var(--ink); font-weight: 700; }
.mc-owed.is-settled { background: var(--settled); color: var(--settled-ink); }
.mc-owed.is-settled .mc-owed-k, .mc-owed.is-settled .mc-owed-n { color: var(--settled-mute); }
.mc-owed.is-settled .mc-owed-n b { color: var(--settled-ink); }
.mc-rates-h { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.mc-rates-h span { text-transform: none; letter-spacing: 0; font-weight: 400; }
.rate-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.rate-l { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; display: flex; flex-direction: column; gap: 1px; }
.rate-l span { font-size: 11px; color: var(--ink-3); font-weight: 400; }
.rate-q { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rate-in { width: 96px; flex-shrink: 0; min-height: 36px; border-radius: 999px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

.act-box {
  display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px;
  background: var(--act); color: var(--act-ink); border-radius: 18px; padding: 16px 18px;
  font-size: 13px; line-height: 1.55;
}
.act-box > .i { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.act-box-h { font-weight: 700; margin-bottom: 4px; }
.act-box ul { margin: 0; padding-left: 18px; }
.act-box li { margin: 2px 0; }

@media (max-width: 900px) {
  #team-list { grid-template-columns: minmax(0, 1fr); }
  .member-card { padding: 20px; }
  .rate-in { min-height: 44px; }
  .mc-tools .btn-icon { width: 44px; min-height: 44px; }
}

/* ============================================================ phone pass */
/* Global phone rules (v3 phase 6). 16px text in every field: below that, iOS Safari zooms
   the page on focus and the layout jumps. Taller controls for thumbs. The drawer takes the
   full width — at 96vw the 4% sliver of page behind it only invites a mis-tap. */
@media (max-width: 900px) {
  .input, select.input, textarea.input, .pill-select { font-size: 16px; }
  .input, select.input { min-height: 44px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  .btn-icon { width: 44px; min-height: 44px; }
  .btn-icon.btn-sm { width: 36px; min-height: 36px; }
  .tab, .subtab, .qf { min-height: 40px; }
  .filters .input { min-width: 0; flex: 1 1 140px; }
  .drawer { width: 100vw; border-left: none; }
  .modal { padding: 20px; border-radius: 22px; }
  .modal .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 14px 16px; }
  .stat .v { font-size: 22px; }
}

/* ============================================= add / remove client (2026-09-26) */
.field-opt { font-style: normal; font-weight: 400; color: var(--ink-3); margin-left: 4px; }
.btn-danger-solid { background: var(--crit); border-color: var(--crit); color: #ffffff; }
.btn-danger-solid:hover { background: var(--crit-ink); border-color: var(--crit-ink); }
.btn-danger-solid:disabled { background: var(--surface-3); border-color: var(--border-strong); color: var(--ink-3); opacity: 1; }
.rm-list { margin: 4px 0 14px; padding-left: 18px; font-size: 13px; line-height: 1.7; }
.client-empty .btn { margin-top: 8px; }
.modal .lf-check { margin: -4px 0 12px; }
.field .lf-err { display: flex; margin-top: 6px; }
.field .field-hint { display: block; margin-top: 6px; font-size: 12px; font-weight: 400; color: var(--ink-3); line-height: 1.5; }
/* review fixes (2026-09-26) */
.field-wrap { margin-bottom: 12px; min-width: 0; }
.field-wrap > label.field { margin-bottom: 0; }
.grid-2 > .field-wrap { margin-bottom: 12px; }
.modal-err {
  display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 12px;
  background: var(--act); color: var(--act-ink); border-radius: 14px; padding: 10px 14px;
  font-size: 13px; font-weight: 500; line-height: 1.5;
}
/* White on #e05252 is 3.6:1 in dark mode — too faint for the one button that deletes. */
:root[data-theme='dark'] .btn-danger-solid { background: #b42828; border-color: #b42828; color: #ffffff; }
:root[data-theme='dark'] .btn-danger-solid:hover { background: #9b1c1c; border-color: #9b1c1c; }
:root[data-theme='dark'] .btn-danger-solid:disabled { background: var(--surface-3); border-color: var(--border-strong); color: var(--ink-3); }
@media (max-width: 900px) {
  .cp-actions { flex-wrap: wrap; }
  .cp-actions .cp-status { flex: 1 1 100%; min-width: 0; }
  .cp-actions .btn { flex: 1 1 auto; justify-content: center; }
}
.money-val { min-height: 0; font-variant-numeric: tabular-nums; }
.money-val:empty { display: none; }

/* ======================================================== creatives tracker */
/* Creative production (2026-09-26). One row per creative sold; the number, the status pill
   and the segmented bar carry the colour — the rows themselves stay neutral so the inputs
   in them stay readable. */
.cp-wide { grid-column: 1 / -1; }
.creatives-box { gap: 0; container: crbox / inline-size; }   /* the rows follow the box, not the screen */
.cr-bar { display: flex; gap: 3px; height: 10px; border-radius: 999px; overflow: hidden; margin: 2px 0 12px; }
.cr-seg { height: 100%; border-radius: 999px; min-width: 6px; }
.seg-settled { background: var(--settled); }
.seg-commit { background: var(--commit); }
.seg-act { background: var(--act); }
.seg-motion { background: var(--motion); }
.seg-plain { background: var(--surface-4); }
.cr-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 12px; color: var(--ink-2); }
.cr-key { display: inline-flex; align-items: center; gap: 7px; }
.cr-key .sw { width: 10px; height: 10px; border-radius: 999px; display: inline-block; }
.cr-list { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.cr-row {
  display: grid; align-items: center; gap: 10px;
  grid-template-columns: 30px minmax(0, 1.6fr) 150px 150px minmax(0, 1.25fr) 36px;
  padding: 10px 12px; border-radius: 16px; background: var(--surface-2);
}
.cr-row.with-member { grid-template-columns: 30px minmax(0, 1.5fr) 150px 150px 150px minmax(0, 1.1fr) 36px; }
.cr-headrow { background: none; padding: 0 12px 2px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.cr-pos {
  width: 30px; height: 30px; border-radius: 999px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--surface); color: var(--ink-2); border: 1px solid var(--border-strong);
}
.cr-row.tone-motion .cr-pos { background: var(--motion); border-color: var(--motion); color: var(--motion-ink); }
.cr-row.tone-commit .cr-pos { background: var(--commit); border-color: var(--commit); color: var(--commit-ink); }
.cr-row.tone-act .cr-pos { background: var(--act); border-color: var(--act); color: var(--act-ink); }
.cr-row.tone-settled .cr-pos { background: var(--settled); border-color: var(--settled); color: var(--settled-ink); }
.cr-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cr-title { min-height: 38px; background: var(--surface); }
.cr-row.tone-settled .cr-title { color: var(--ink-2); }
.cr-meta { font-size: 11.5px; color: var(--ink-3); }
.cr-late { align-self: flex-start; }
.cr-cell { min-width: 0; }
.cr-cell-l { display: none; }
.cr-cell .pill-select, .cr-cell .input { width: 100%; min-width: 0; }
.cr-member, .cr-due { min-height: 36px; border-radius: 999px; background-color: var(--surface); }
.cr-link { display: flex; gap: 6px; align-items: center; min-width: 0; }
.cr-link .input { min-height: 36px; border-radius: 999px; background: var(--surface); }
.cr-del { color: var(--ink-3); }
.pill-select.crs-script, .pill-select.crs-shooting, .pill-select.crs-editing { background-color: var(--motion); border-color: var(--motion); color: var(--motion-ink); }
.pill-select.crs-review { background-color: var(--commit); border-color: var(--commit); color: var(--commit-ink); }
.pill-select.crs-changes { background-color: var(--act); border-color: var(--act); color: var(--act-ink); }
.pill-select.crs-delivered { background-color: var(--settled); border-color: var(--settled); color: var(--settled-ink); }
.cr-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 14px; }
.cr-empty { border: 2px dashed var(--border-strong); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.cr-empty p { font-size: 13px; color: var(--ink-2); line-height: 1.55; margin: 0; }
.cr-empty b { color: var(--ink); }
.cr-packs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cr-or { font-size: 12px; color: var(--ink-3); }
.cr-n { width: 110px; min-height: 38px; border-radius: 999px; }
.bought { border: 1px solid var(--border); border-radius: 16px; padding: 12px 16px 2px; margin: 0 0 14px; }
.bought legend { font-size: 12px; font-weight: 600; padding: 0 6px; color: var(--ink); }
.bought .lf-check { margin: 0 0 10px; }

.cr-fields { display: contents; }   /* wide: the four fields are cells of the row grid */
.cr-link .btn-icon { flex: none; }
.cr-late { white-space: normal; max-width: 100%; }
/* One line per creative when it fits: about 800px of box without the Editor column (1440px
   screens and up), about 955px with it (1600px and up — the box never gets wider than 990px).
   Below that the fields go on a second line, as many per line as fit. */
@container crbox (max-width: 955px) {
  .cr-row.with-member { grid-template-columns: 30px minmax(0, 1fr) 36px; align-items: start; }
  .cr-row.with-member > .cr-main { grid-column: 2; grid-row: 1; }
  .cr-row.with-member > .cr-del { grid-column: 3; grid-row: 1; }
  .cr-row.with-member > .cr-fields { display: grid; grid-column: 2; grid-row: 2; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px 10px; }
  .cr-headrow.with-member { display: none; }
  .cr-row.with-member .cr-cell-l { display: block; font-size: 11px; color: var(--ink-3); margin-bottom: 4px; }
}
@container crbox (max-width: 800px) {
  .cr-row { grid-template-columns: 30px minmax(0, 1fr) 36px; align-items: start; }
  .cr-row > .cr-main { grid-column: 2; grid-row: 1; }
  .cr-row > .cr-del { grid-column: 3; grid-row: 1; }
  .cr-row > .cr-fields { display: grid; grid-column: 2; grid-row: 2; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px 10px; }
  .cr-headrow { display: none; }
  .cr-cell-l { display: block; font-size: 11px; color: var(--ink-3); margin-bottom: 4px; }
}
/* a phone-width box: the fields use the whole row, under the title */
@container crbox (max-width: 520px) {
  .cr-row, .cr-row.with-member { grid-template-columns: 30px minmax(0, 1fr) 44px; padding: 12px; }
  .cr-row > .cr-fields, .cr-row.with-member > .cr-fields { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .cr-member, .cr-due, .cr-link .input, .cr-title, .cr-n { min-height: 44px; }
  .cr-row .cr-del, .cr-link .btn-icon { width: 44px; min-height: 44px; }
}
/* a platform client with no creatives: one quiet line, the way in if they buy some */
.cr-slim { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; border-style: dashed; }
.cr-slim-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 260px; }
.cr-slim-txt .cpb-sub { margin: 0; }
