/* ============================================================
   WatchFlow Outreach Control Center — app shell + CRM
   Theme mirrors the main app's remodel-2 "Day / Night" system
   (titanium-blue accent, Absans type). Night is the default;
   [data-mode="day"] on <html> flips to the light surface set.
   ============================================================ */

@font-face {
  font-family: 'Absans';
  src: url('/fonts/absans/Absans-Regular.woff2') format('woff2'),
       url('/fonts/absans/Absans-Regular.woff') format('woff');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---- Tokens — NIGHT (default) ---- */
:root {
  --font: 'Absans', -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;

  --bg-void: #000000;
  --bg-base: #0a0c10;
  --bg-raised: #14171c;
  --bg-panel: #1a1e24;
  --bg-hover: #1f242b;
  --bg-active: #262c34;

  --border: #232830;
  --border-light: #2d333c;

  --accent: #8cc0e8;
  --accent-bright: #b3d6f0;
  --accent-deep: #6ba5d4;
  --accent-dim: rgba(140, 192, 232, .15);
  --accent-soft: rgba(140, 192, 232, .08);
  --accent-ink: #06121c;
  --gold: #c9a96e;

  --white: #ffffff;
  --off-white: #d4d8de;
  --muted: #8a9099;
  --faint: #5a606a;

  --green: #46c08a; --green-dim: rgba(70,192,138,.14);
  --red: #ef6a66;   --red-dim: rgba(239,106,102,.14);
  --amber: #e8b765; --amber-dim: rgba(232,183,101,.14);
  --blue: #6fb0f0;  --blue-dim: rgba(111,176,240,.14);
  --teal: #5fc6c0;  --teal-dim: rgba(95,198,192,.14);
  --purple: #a99be0; --purple-dim: rgba(169,155,224,.14);

  --shadow-sm: 0 1px 2px rgba(2,8,20,.5);
  --shadow: 0 1px 0 rgba(0,0,0,.4), 0 12px 32px -12px rgba(2,8,20,.7);
  --shadow-card: 0 1px 0 rgba(0,0,0,.4), 0 18px 48px -18px rgba(2,8,20,.75);
  --ring: 0 0 0 3px var(--accent-dim);

  --r-xs: 6px; --r-sm: 9px; --r: 12px; --r-lg: 16px; --r-pill: 999px;
  --dur: 140ms;
  --sidebar-w: 232px;
}

/* ---- Tokens — DAY ---- */
html[data-mode="day"] {
  --bg-void: #eef2f7;
  --bg-base: #e6ecf3;
  --bg-raised: #ffffff;
  --bg-panel: #f4f7fb;
  --bg-hover: #e7eef6;
  --bg-active: #dbe6f1;

  --border: #dce3ec;
  --border-light: #c8d3e0;

  --accent: #3f6486;
  --accent-bright: #2f4f6e;
  --accent-deep: #2f4f6e;
  --accent-dim: rgba(63,100,134,.13);
  --accent-soft: rgba(63,100,134,.06);
  --accent-ink: #ffffff;
  --gold: #b08d4f;

  --white: #0f1822;
  --off-white: #2c3a48;
  --muted: #5a6a7a;
  --faint: #92a0ad;

  --green: #1f8a5a; --green-dim: rgba(31,138,90,.10);
  --red: #c0413d;   --red-dim: rgba(192,65,61,.10);
  --amber: #b58324; --amber-dim: rgba(181,131,36,.13);
  --blue: #2f74c7;  --blue-dim: rgba(47,116,199,.10);
  --teal: #1f8a85;  --teal-dim: rgba(31,138,133,.10);
  --purple: #6a59b8; --purple-dim: rgba(106,89,184,.10);

  --shadow-sm: 0 1px 2px rgba(20,40,70,.08);
  --shadow: 0 1px 0 rgba(20,40,70,.05), 0 12px 32px -14px rgba(20,40,70,.18);
  --shadow-card: 0 1px 0 rgba(20,40,70,.05), 0 18px 48px -20px rgba(20,40,70,.20);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg-void);
  color: var(--white);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-synthesis: weight style;
  overflow-x: clip;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-bright); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
::selection { background: var(--accent-dim); }

/* ============================================================
   Shell
   ============================================================ */
.mc-shell { min-height: 100vh; }

.mc-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--bg-base);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 18px 14px 14px;
  z-index: 40;
}
.mc-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 17px; font-weight: 600; color: var(--white);
  padding: 4px 8px 18px;
}
.mc-logo small {
  display: block; font-size: 11px; font-weight: 500; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent); margin-left: 2px;
}
.mc-brand-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent);
  flex: none;
}
.mc-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.mc-nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: var(--r-sm);
  color: var(--muted); font-weight: 500; font-size: 14px;
  transition: background var(--dur), color var(--dur);
}
.mc-nav a svg { width: 19px; height: 19px; flex: none; }
.mc-nav a:hover { background: var(--bg-hover); color: var(--off-white); }
.mc-nav a.active { background: var(--accent-soft); color: var(--white); }
.mc-nav a.active svg { color: var(--accent); }
.nav-count {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink);
  font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}

.mode-toggle {
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  border-radius: var(--r-sm); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; transition: background var(--dur), color var(--dur), border-color var(--dur);
}
.mode-toggle:hover { color: var(--white); border-color: var(--border-light); background: var(--bg-hover); }
.mode-toggle svg { width: 18px; height: 18px; }
.mode-toggle .ic-day { display: none; }
html[data-mode="day"] .mode-toggle .ic-day { display: block; }
html[data-mode="day"] .mode-toggle .ic-night { display: none; }
.mode-toggle-side { width: 100%; justify-content: flex-start; gap: 10px; padding: 0 12px; height: 40px; }
.mode-toggle-lbl { font-size: 13px; font-weight: 500; }

.mc-topbar {
  display: none;
  position: sticky; top: 0; z-index: 35;
  align-items: center; justify-content: space-between;
  padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg-base) 92%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.mc-brand { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 16px; color: var(--white); }
.mc-brand-sub { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.mc-topbar-actions { display: flex; align-items: center; gap: 8px; }

.mc-main {
  margin-left: var(--sidebar-w);
  padding: 26px 30px 60px;
  max-width: 1180px;
}

.mc-bottomnav { display: none; }

/* ============================================================
   Page header
   ============================================================ */
.mc-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.mc-head h1 { font-size: 28px; }
.mc-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.mc-head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.back-link { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.back-link:hover { color: var(--accent); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: var(--r-sm);
  background: var(--bg-raised); color: var(--white);
  border: 1px solid var(--border-light); font-family: var(--font);
  font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background var(--dur), border-color var(--dur), transform var(--dur), opacity var(--dur);
}
.btn:hover { background: var(--bg-hover); border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-bright); border-color: var(--accent-bright); color: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--off-white); }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, var(--border)); background: transparent; }
.btn-danger:hover { background: var(--red-dim); border-color: var(--red); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: var(--r-xs); }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; width: 36px; height: 36px; }

/* ============================================================
   Badges + status pills
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 600; line-height: 1.4;
  background: var(--bg-panel); color: var(--off-white); border: 1px solid var(--border);
  text-transform: capitalize;
}
.badge-blue { background: var(--blue-dim); color: var(--blue); border-color: transparent; }
.badge-green { background: var(--green-dim); color: var(--green); border-color: transparent; }
.badge-amber { background: var(--amber-dim); color: var(--amber); border-color: transparent; }
.badge-red { background: var(--red-dim); color: var(--red); border-color: transparent; }
.badge-gold { background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold); border-color: transparent; }

/* quick-status pills (CRM) */
.qs { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 600; }
.qs::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.qs-new { background: var(--bg-panel); color: var(--muted); }
.qs-reached_out { background: var(--blue-dim); color: var(--blue); }
.qs-interested { background: var(--teal-dim); color: var(--teal); }
.qs-negotiating { background: var(--amber-dim); color: var(--amber); }
.qs-booked { background: var(--accent-dim); color: var(--accent); }
.qs-won { background: var(--green-dim); color: var(--green); }
.qs-lost { background: var(--red-dim); color: var(--red); }

/* ============================================================
   Inputs
   ============================================================ */
.fl { display: block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
input, select, textarea {
  font-family: var(--font); font-size: 15px; color: var(--white);
  background: var(--bg-void); border: 1px solid var(--border-light); border-radius: var(--r-sm);
  padding: 9px 12px; width: 100%; transition: border-color var(--dur), box-shadow var(--dur);
}
html[data-mode="day"] input, html[data-mode="day"] select, html[data-mode="day"] textarea { background: var(--bg-raised); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
select { appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a9099' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px;
}
label.chk { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--off-white); cursor: pointer; }
label.chk input { width: auto; }

/* ============================================================
   Cards
   ============================================================ */
.card { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.card-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-header h3 { font-size: 15px; }
.card-body { padding: 18px; }
.profile-row { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.profile-row:last-child { border-bottom: none; }
.profile-row .k { color: var(--muted); min-width: 92px; flex: none; }
.profile-row .v { color: var(--off-white); }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.empty { padding: 44px 24px; text-align: center; color: var(--muted); border: 1px dashed var(--border-light); border-radius: var(--r); background: var(--bg-raised); }

/* ============================================================
   Toast + modal
   ============================================================ */
.toast-container { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; align-items: center; pointer-events: none; }
.toast { background: var(--bg-active); color: var(--white); border: 1px solid var(--border-light); padding: 11px 18px; border-radius: var(--r-pill); font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow); animation: toastIn .22s ease; max-width: 90vw; }
.toast.err { border-color: var(--red); color: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.modal-root:empty { display: none; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(3px); z-index: 150; display: flex; align-items: center; justify-content: center; padding: 18px; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--bg-raised); border: 1px solid var(--border-light); border-radius: var(--r-lg); width: 100%; max-width: 460px; box-shadow: var(--shadow-card); max-height: 92vh; display: flex; flex-direction: column; animation: pop .2s cubic-bezier(.2,.8,.2,1); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { padding: 18px 20px 4px; }
.modal-head h3 { font-size: 18px; }
.modal-head .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.modal-body { padding: 8px 20px 4px; overflow-y: auto; }
.modal-foot { padding: 16px 20px 20px; display: flex; gap: 8px; justify-content: flex-end; }

/* ============================================================
   Dashboard
   ============================================================ */
.banner { padding: 11px 15px; border-radius: var(--r-sm); font-size: 13px; margin-bottom: 14px; border: 1px solid var(--border); background: var(--bg-raised); }
.banner.amber { background: var(--amber-dim); border-color: transparent; color: var(--amber); }
.banner.err { background: var(--red-dim); border-color: transparent; color: var(--red); }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.kpi-card { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; }
.kpi-value { font-size: 30px; font-weight: 600; letter-spacing: -.02em; }
.kpi-label { font-size: 12.5px; color: var(--off-white); margin-top: 2px; font-weight: 500; }
.kpi-note { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.kpi-card.accent { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.kpi-card.accent .kpi-value { color: var(--accent); }

.dash-cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; }
.section-title { font-size: 13px; font-weight: 600; color: var(--off-white); margin: 6px 0 12px; letter-spacing: .02em; }

.pipeline { display: flex; flex-direction: column; gap: 7px; }
.pipe-row { display: grid; grid-template-columns: 120px 1fr 36px; align-items: center; gap: 10px; cursor: pointer; padding: 4px; border-radius: var(--r-xs); }
.pipe-row:hover { background: var(--bg-hover); }
.pipe-row .l { font-size: 13px; color: var(--off-white); text-transform: capitalize; }
.pipe-track { height: 8px; border-radius: var(--r-pill); background: var(--bg-panel); overflow: hidden; }
.pipe-fill { height: 100%; border-radius: var(--r-pill); background: var(--accent); }
.pipe-row .n { font-size: 13px; font-weight: 600; text-align: right; color: var(--white); }

.upnext { display: flex; flex-direction: column; gap: 8px; }
.upnext-item { display: flex; align-items: center; gap: 11px; padding: 11px 13px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r-sm); }
.upnext-item:hover { border-color: var(--border-light); }
.upnext-when { font-size: 11.5px; color: var(--accent); font-weight: 600; min-width: 78px; flex: none; }
.upnext-main { flex: 1; min-width: 0; }
.upnext-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upnext-meta { font-size: 11.5px; color: var(--muted); }

/* ============================================================
   Discover
   ============================================================ */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.discover-filters { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r); padding: 14px; margin-bottom: 16px; }
.filter-search { width: 100%; }
.search-row { display: flex; gap: 8px; align-items: stretch; }
.search-row .filter-search { flex: 1; }
.search-row .btn { flex: none; }
.result-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 14px 0 10px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 9px; margin-top: 10px; }
/* .foll-range is still used by the Pull-accounts modal. */
.foll-range { display: inline-flex; align-items: center; gap: 6px; }
.foll-range input { width: 92px; }

.ig-lookup { background: var(--bg-raised); border: 1px solid var(--accent-dim); border-radius: var(--r); padding: 4px; margin-bottom: 14px; transition: border-color var(--dur); }
.ig-lookup.has-result { border-color: var(--accent); }
.ig-lookup-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px; }
.ig-lookup-icon { color: var(--accent); display: flex; }
.ig-lookup-icon svg { width: 20px; height: 20px; }
.ig-lookup-input { border: none; background: transparent; box-shadow: none !important; padding: 8px 4px; }
.ig-lookup-input:focus { border: none; }
.ig-lookup-clear { background: transparent; border: none; color: var(--muted); cursor: pointer; padding: 4px; width: auto; }
.ig-lookup-clear svg { width: 16px; height: 16px; }
.ig-lookup-result { padding: 0 6px; }
.ig-lookup-result.show { padding: 6px; border-top: 1px solid var(--border); margin-top: 2px; }
.ig-none { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 6px; }
.ig-none-txt strong { display: block; font-size: 13.5px; }
.ig-none-txt span { font-size: 12.5px; color: var(--muted); }
.ig-hit-head { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); padding: 4px 6px; }
.ig-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.ig-hit-list { display: flex; flex-direction: column; gap: 4px; }
.ig-hit { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 9px 11px; cursor: pointer; color: var(--white); }
.ig-hit:hover { border-color: var(--accent); background: var(--bg-hover); }
.ig-hit-main { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; }
.ig-hit-name { font-weight: 600; font-size: 13.5px; }
.ig-hit-exact { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); background: var(--accent-dim); padding: 1px 6px; border-radius: var(--r-pill); }
.ig-hit-meta { font-size: 12px; color: var(--muted); }
.ig-hit-go { width: 16px; height: 16px; color: var(--faint); flex: none; }

.result-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.result-meta .count { font-size: 13px; color: var(--muted); }

/* ============================================================
   Lead cards (shared: discover results, sheet list)
   ============================================================ */
.lead-list { display: flex; flex-direction: column; gap: 8px; }
.lead-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r);
  padding: 11px 14px; transition: border-color var(--dur), background var(--dur);
}
.lead-card:hover { border-color: var(--border-light); }
.lead-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.lead-sel { width: auto; flex: none; }
.lead-av {
  width: 42px; height: 42px; border-radius: var(--r-sm); flex: none;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; color: var(--accent);
  background: var(--accent-dim); text-transform: uppercase; letter-spacing: -.02em;
}
.lead-main { flex: 1; min-width: 0; cursor: pointer; }
.lead-name { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 7px; }
.lead-name .badge { text-transform: none; }
.lead-sub { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 2px; }
.lead-sub .dot { color: var(--faint); }
.lead-foll { color: var(--off-white); font-weight: 600; }
.lead-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.act-btn {
  width: 34px; height: 34px; border-radius: var(--r-xs); flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-panel); border: 1px solid var(--border); color: var(--off-white); cursor: pointer;
  transition: background var(--dur), color var(--dur), border-color var(--dur);
}
.act-btn:hover { background: var(--bg-hover); border-color: var(--accent); color: var(--accent); }
.act-btn svg { width: 17px; height: 17px; }
.act-btn.ig:hover { color: #e1306c; border-color: #e1306c; }
.act-btn.wa:hover { color: #25d366; border-color: #25d366; }
.qs-select { font-size: 12px; padding: 6px 26px 6px 10px; width: auto; min-width: 116px; }

@media (max-width: 720px) {
  .lead-card { flex-wrap: wrap; }
  .lead-actions { width: 100%; justify-content: flex-start; padding-top: 4px; border-top: 1px solid var(--border); margin-top: 2px; }
  .qs-select { flex: 1; }
}

/* ============================================================
   Sheets grid (CRM home)
   ============================================================ */
.sheets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.sheet-card { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; cursor: pointer; transition: border-color var(--dur), transform var(--dur); display: flex; flex-direction: column; gap: 12px; }
.sheet-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.sheet-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sheet-name { font-size: 16px; font-weight: 600; }
.sheet-desc { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.sheet-count { font-size: 12px; color: var(--off-white); font-weight: 600; background: var(--bg-panel); padding: 3px 9px; border-radius: var(--r-pill); flex: none; }
.sheet-progress { height: 8px; border-radius: var(--r-pill); background: var(--bg-panel); overflow: hidden; display: flex; }
.sheet-progress i { height: 100%; display: block; }
.sheet-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.sheet-foot .pip { display: inline-flex; align-items: center; gap: 5px; }
.sheet-foot .pip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.sheet-card.new-card { border-style: dashed; align-items: center; justify-content: center; text-align: center; color: var(--muted); min-height: 150px; }
.sheet-card.new-card:hover { color: var(--accent); }
.sheet-card.new-card svg { width: 26px; height: 26px; }

/* ============================================================
   Sheet detail / CRM board
   ============================================================ */
.seg { display: inline-flex; background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.seg button { background: transparent; border: none; color: var(--muted); font-weight: 600; font-size: 12.5px; padding: 6px 13px; border-radius: var(--r-xs); cursor: pointer; width: auto; }
.seg button.active { background: var(--bg-active); color: var(--white); }

.board { display: grid; grid-auto-flow: column; grid-auto-columns: 270px; gap: 12px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x proximity; }
.board-col { background: var(--bg-base); border: 1px solid var(--border); border-radius: var(--r); display: flex; flex-direction: column; scroll-snap-align: start; max-height: calc(100vh - 220px); }
.board-col-head { padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--border); }
.board-col-head .t { font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.board-col-head .t::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.board-col-head .c { font-size: 12px; color: var(--muted); }
.board-col-body { padding: 9px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 60px; }
.lead-mini { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px 11px; cursor: pointer; }
.lead-mini:hover { border-color: var(--accent); }
.lead-mini-top { display: flex; align-items: center; gap: 8px; }
.lead-mini .lead-av { width: 30px; height: 30px; font-size: 12px; border-radius: var(--r-xs); }
.lead-mini-name { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-mini-meta { font-size: 11.5px; color: var(--muted); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.lead-mini-actions { display: flex; gap: 5px; margin-top: 8px; }
.lead-mini-actions .act-btn { width: 30px; height: 30px; }
.col-move { display: flex; gap: 4px; margin-top: 7px; }
.col-move button { flex: 1; font-size: 11px; padding: 4px; border-radius: var(--r-xs); background: var(--bg-panel); border: 1px solid var(--border); color: var(--muted); cursor: pointer; }
.col-move button:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.col-move button:disabled { opacity: .35; cursor: default; }

/* ============================================================
   Lead detail
   ============================================================ */
.detail-grid { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: transparent; border: none; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; font-size: 13.5px; padding: 9px 12px; cursor: pointer; white-space: nowrap; width: auto; }
.tabs button.active { color: var(--white); border-bottom-color: var(--accent); }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.timeline li { padding: 11px 0 11px 16px; border-left: 2px solid var(--border); position: relative; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.timeline .t { font-size: 11.5px; color: var(--muted); }
.msg-item { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 8px; }
.msg-item.inbound { border-left: 3px solid var(--accent); }
.msg-item .head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.msg-item .body { font-size: 13px; color: var(--off-white); white-space: pre-wrap; line-height: 1.55; }
.manual-assist { background: var(--accent-soft); border: 1px solid var(--accent-dim); border-radius: var(--r-sm); padding: 11px 13px; font-size: 13px; color: var(--off-white); }
.action-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }

/* ============================================================
   Calendar
   ============================================================ */
.cal-list { display: flex; flex-direction: column; gap: 8px; }
.cal-item { display: flex; align-items: center; gap: 14px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r); padding: 13px 15px; }
.cal-date { text-align: center; flex: none; width: 56px; }
.cal-date .d { font-size: 22px; font-weight: 600; line-height: 1; }
.cal-date .m { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cal-main { flex: 1; min-width: 0; }
.cal-title { font-weight: 600; font-size: 14.5px; }
.cal-sub { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 3px; }
.cal-time { font-size: 12.5px; color: var(--accent); font-weight: 600; flex: none; }
.cal-actions { display: flex; gap: 6px; flex: none; }
.cal-av { flex: none; display: inline-flex; }
.cal-past { opacity: .72; }
.cal-day-sep { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 16px 0 8px; }

/* ---- Connect cards (Calendar & Scheduling center) ---- */
.connect-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 6px; }
.connect-card {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r);
  padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 11px;
  box-shadow: var(--shadow-card); transition: border-color var(--dur);
}
.connect-card:hover { border-color: var(--border-light); }
.connect-top { display: flex; align-items: center; gap: 12px; }
.connect-ic {
  flex: none; width: 42px; height: 42px; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); border: 1px solid var(--border); color: var(--accent);
}
.connect-ic svg { width: 22px; height: 22px; }
.connect-ic.g { color: var(--blue); background: var(--blue-dim); }
.connect-ic.z { color: var(--accent); background: var(--accent-dim); }
.connect-ic.c { color: var(--amber); background: var(--amber-dim); }
.connect-ic.p { color: var(--green); background: var(--green-dim); }
.connect-id { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.connect-title { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.connect-id .badge { align-self: flex-start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.connect-input-row { display: flex; gap: 8px; }
.connect-input-row input, .connect-input-row select { flex: 1; min-width: 0; }
.connect-input-row .btn { flex: none; }
.connect-hint { font-size: 12px; line-height: 1.5; color: var(--muted); }
.connect-hint strong { color: var(--off-white); font-weight: 600; }
.connect-hint .needs-setup {
  display: inline-block; font-size: 10.5px; font-weight: 600; padding: 0 7px; border-radius: var(--r-pill);
  background: var(--amber-dim); color: var(--amber); vertical-align: middle;
}
.connect-actions { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-top: auto; }
@media (max-width: 720px) { .connect-grid { grid-template-columns: 1fr; } }
.type-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.type-opt { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border: 1px solid var(--border-light); border-radius: var(--r-sm); cursor: pointer; font-size: 13.5px; font-weight: 500; background: var(--bg-void); }
html[data-mode="day"] .type-opt { background: var(--bg-raised); }
.type-opt:hover { border-color: var(--accent); }
.type-opt.active { border-color: var(--accent); background: var(--accent-soft); color: var(--white); }
.type-opt svg { width: 18px; height: 18px; color: var(--accent); }

/* ============================================================
   Outreach: queue + sequences
   ============================================================ */
.q-group-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 10px; }
.q-card { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r); margin-bottom: 10px; overflow: hidden; }
.q-card-head { display: flex; align-items: center; gap: 9px; padding: 12px 15px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.q-card-head .who { font-weight: 600; }
.q-card-head .meta { font-size: 12px; color: var(--muted); }
.q-contact { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 9px 15px; background: var(--bg-base); border-bottom: 1px solid var(--border); font-size: 12px; }
.q-contact-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); }
.contact-item { display: inline-flex; align-items: center; gap: 5px; }
.contact-link { color: var(--off-white); background: var(--bg-panel); padding: 4px 9px; border-radius: var(--r-pill); border: 1px solid var(--border); }
.contact-link:hover { border-color: var(--accent); color: var(--accent); }
.cl-plat { color: var(--muted); }
.contact-copy { background: transparent; border: none; color: var(--faint); font-size: 11px; cursor: pointer; width: auto; padding: 2px 4px; }
.contact-copy:hover { color: var(--accent); }
.contact-loc { color: var(--muted); }
.q-card-body { padding: 13px 15px; }
.q-subject { margin-bottom: 9px; }
.q-card-foot { display: flex; align-items: center; gap: 8px; padding: 0 15px 14px; flex-wrap: wrap; }
.q-card-foot .spacer { flex: 1; }
.seq-step { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 14px; margin-bottom: 12px; }
.seq-step-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.seq-offset { display: flex; align-items: center; gap: 8px; }
.seq-offset input { width: 70px; }
.seq-field { margin-bottom: 8px; }

/* ============================================================
   Misc chips
   ============================================================ */
.plat-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.plat-chip { font-size: 11px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--bg-panel); border: 1px solid var(--border); color: var(--off-white); }
a.plat-chip:hover { border-color: var(--accent); color: var(--accent); }
.group-chip { font-size: 10.5px; padding: 1px 7px; border-radius: var(--r-pill); background: var(--accent-dim); color: var(--accent); }
.sheet-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; padding: 1px 8px; border-radius: var(--r-pill); background: var(--accent-dim); color: var(--accent); white-space: nowrap; vertical-align: middle; }
/* A lead already filed in a sheet: de-emphasised in Discover, clicking jumps to its sheet. */
.lead-card.is-sheeted { opacity: .58; }
.lead-card.is-sheeted:hover { opacity: .92; border-color: var(--accent); }
.lead-card.is-sheeted .lead-av { background: var(--bg-panel); color: var(--muted); }

/* ============================================================
   Visual layer — gradient avatars, fit subdial, lead card grid, hero
   ============================================================ */
/* Gradient monogram avatar (deterministic hue set inline). */
.av { position: relative; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-weight: 700; letter-spacing: -.02em; text-transform: uppercase; background-size: cover; background-position: center; box-shadow: inset 0 0 0 1px rgba(255,255,255,.10), 0 2px 6px rgba(0,0,0,.18); overflow: hidden; }
.av-logo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; background: #fff; }
.av span { text-shadow: 0 1px 3px rgba(0,0,0,.35); }
.av-sm { width: 30px; height: 30px; font-size: 12px; }
.av-md { width: 44px; height: 44px; font-size: 16px; }
.av-lg { width: 60px; height: 60px; font-size: 22px; }
.av-xl { width: 84px; height: 84px; font-size: 30px; border-radius: 22px; }

/* Fit "subdial" — a chronograph-style gauge ring (the signature element). */
.fitring { --p: 0%; --c: var(--accent); width: 38px; height: 38px; border-radius: 50%; flex: none; position: relative; display: grid; place-items: center; background: conic-gradient(var(--c) var(--p), var(--bg-panel) 0); }
.fitring::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--bg-raised); }
.fitring span { position: relative; z-index: 1; font-size: 13px; font-weight: 700; color: var(--c); }
.fitring.lg { width: 52px; height: 52px; }
.fitring.lg::after { inset: 4px; }
.fitring.lg span { font-size: 17px; }
.fitring.lg .fl { position: absolute; bottom: -15px; left: 50%; transform: translateX(-50%); font-size: 8.5px; letter-spacing: .12em; margin: 0; color: var(--muted); }

/* Avatar stack (sheet cards). */
.av-stack { display: flex; }
.av-stack .av { margin-left: -10px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.10), 0 0 0 2px var(--bg-raised); }
.av-stack .av:first-child { margin-left: 0; }
.av-stack .more { margin-left: -10px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--bg-panel); box-shadow: 0 0 0 2px var(--bg-raised); }

/* Discover lead-card GRID (portrait cards). */
.lead-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.lcard { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px; display: flex; flex-direction: column; gap: 9px; cursor: pointer; position: relative; overflow: hidden; transition: border-color var(--dur), transform var(--dur), box-shadow var(--dur); }
.lcard:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-card); }
.lcard.is-sheeted { opacity: .6; }
.lcard.is-sheeted:hover { opacity: 1; border-color: var(--accent); }
.lcard-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lcard-sel { position: absolute; top: 11px; right: 11px; width: auto; z-index: 2; opacity: .35; transition: opacity var(--dur); }
.lcard:hover .lcard-sel, .lead-card.selected .lcard-sel { opacity: 1; }
.lcard-id { min-width: 0; flex: 1; }
.lcard-name { font-weight: 600; font-size: 15px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcard-handle { font-size: 12.5px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcard-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.lcard-stats { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lcard-stats .lead-foll { color: var(--off-white); font-weight: 600; }
.lcard-status { width: 100%; }
.lcard-actions { display: flex; gap: 5px; flex-wrap: wrap; border-top: 1px solid var(--border); margin-top: auto; padding-top: 10px; }
.lcard-actions .act-btn { width: 32px; height: 32px; }
.lcard-actions .act-btn svg { width: 16px; height: 16px; }
.lead-card.selected.lcard { border-color: var(--accent); box-shadow: var(--ring); }

/* Reach-tier pill (Discover grid card) — replaces the old fit ring. */
.tier-badge { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 600; line-height: 1.4; padding: 2px 8px; border-radius: var(--r-pill); white-space: nowrap; }
.tier-entry { background: var(--green-dim); color: var(--green); }
.tier-mid { background: var(--amber-dim); color: var(--amber); }
.tier-high { background: var(--blue-dim); color: var(--blue); }

/* Lead-detail hero. */
.lead-hero { display: flex; align-items: center; gap: 18px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; margin-bottom: 16px; position: relative; overflow: hidden; }
.lead-hero::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent); }
.lead-hero-id { flex: 1; min-width: 0; }
.lead-hero-name { font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
.lead-hero-sub { color: var(--muted); font-size: 13.5px; margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 9px; align-items: center; }
.lead-hero-right { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: none; }

/* Dashboard KPI icon + colored pipeline gauge. */
.kpi-card { position: relative; overflow: hidden; }
.kpi-ic { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; color: var(--accent); opacity: .5; }
.kpi-ic svg { width: 30px; height: 30px; }
.pipe-fill { background: var(--c, var(--accent)); }
.upnext-av { flex: none; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
  .mc-sidebar { display: none; }
  .mc-topbar { display: flex; }
  .mc-main { margin-left: 0; padding: 18px 16px calc(82px + env(safe-area-inset-bottom)); max-width: 100%; }
  .mc-bottomnav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 45;
    background: color-mix(in srgb, var(--bg-base) 94%, transparent);
    backdrop-filter: saturate(140%) blur(14px);
    border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .mc-bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 8px; color: var(--muted); font-size: 10.5px; font-weight: 500; border-radius: var(--r-xs); position: relative; flex: 1; }
  .mc-bottomnav a svg { width: 21px; height: 21px; }
  .mc-bottomnav a.active { color: var(--accent); }
  .mc-bottomnav .nav-count { position: absolute; top: 0; right: 50%; margin-right: -22px; min-width: 16px; height: 16px; font-size: 9.5px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-cols { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .mc-head h1 { font-size: 23px; }
  .board { grid-auto-columns: 84vw; }
  .board-col { max-height: none; }
  .type-grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi-value { font-size: 25px; }
}

/* ---- Lead Engine + Intent leads ---- */
.lg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lg-grid input, .lg-grid select { width: 100%; }
@media (max-width: 560px) { .lg-grid { grid-template-columns: 1fr; } }
.switch-row { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.switch-row input { width: auto; }
.lg-job { margin-top: 14px; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px; background: var(--bg-base); }
.lg-job-head { font-size: 13px; margin-bottom: 8px; }
.lg-bar { height: 6px; background: var(--bg-active); border-radius: 99px; overflow: hidden; }
.lg-bar > span { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.lg-log { margin: 10px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--muted); white-space: pre-wrap; word-break: break-word; max-height: 160px; overflow: auto; font-family: ui-monospace, Menlo, monospace; }
.lc-main { flex: 1; min-width: 0; cursor: pointer; }
.lc-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.lc-name { font-weight: 600; font-size: 14.5px; margin-top: 3px; }
.lc-actions { flex: none; display: flex; gap: 6px; align-items: center; }
.intent-card { align-items: flex-start; }
.intent-quote { font-size: 13px; opacity: .92; margin-top: 4px; font-style: italic; line-height: 1.45; }
.hot-badge { display: inline-block; background: var(--red-dim); color: var(--red); font-weight: 700; font-size: 10.5px; letter-spacing: .04em; padding: 2px 7px; border-radius: 99px; }
