/* ============================================================
   Roster — a warm relationship CRM for realtors
   Pipeline-first direction · Attio × Folk × HubSpot
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  /* Canvas + ink */
  --canvas: #f6f7fa;
  --canvas-wash: radial-gradient(1200px 620px at 88% -8%, #fef0ec 0%, rgba(254,240,236,0) 55%),
                 radial-gradient(1000px 560px at -6% 4%, #eef0fd 0%, rgba(238,240,253,0) 52%);
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --ink: #16181d;
  --ink-soft: #3b3f48;
  --muted: #6b7280;
  --muted-2: #98a0ad;
  --line: #ecedf2;
  --line-2: #e3e5ec;

  /* Brand */
  --coral: #f0654f;
  --coral-ink: #c5402b;
  --coral-soft: #fdeae6;
  --teal: #0f766e;
  --teal-soft: #d8efec;
  --indigo: #5b5bd6;

  /* Stages */
  --lead: #6366f1;
  --buyer: #0ea5e9;
  --seller: #f59e0b;
  --contract: #8b5cf6;
  --past: #10b981;

  /* Engagement */
  --engaged: #10b981;
  --cooling: #f59e0b;
  --cold: #94a3b8;

  /* Status */
  --green: #16a34a;
  --green-soft: #dcfce7;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --red: #dc2626;

  /* Depth */
  --r-sm: 9px;
  --r: 13px;
  --r-lg: 18px;
  --r-pill: 999px;
  --shadow-card: 0 1px 2px rgba(22,24,29,.04), 0 4px 14px rgba(22,24,29,.05);
  --shadow-lift: 0 10px 30px rgba(22,24,29,.12), 0 2px 6px rgba(22,24,29,.06);
  --shadow-pop: 0 18px 50px rgba(22,24,29,.18), 0 4px 10px rgba(22,24,29,.08);
  --ring: 0 0 0 3px rgba(91,91,214,.18);

  --t-fast: 120ms cubic-bezier(.4,0,.2,1);
  --t: 200ms cubic-bezier(.4,0,.2,1);
  --t-slow: 360ms cubic-bezier(.22,1,.36,1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 14px;
  line-height: 1.45;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  background: var(--canvas-wash);
  pointer-events: none;
  z-index: 0;
}
::selection { background: rgba(240,101,79,.18); }

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

/* default inline-icon size — components override with their own svg rule */
svg { width: 16px; height: 16px; flex: 0 0 auto; vertical-align: middle; }
/* charts/sparklines opt out of the cap (they carry their own height attr) */
svg.chart { width: 100%; height: auto; flex: initial; }

/* scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #d7dae2; border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #c2c7d2; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- App shell ---------- */
.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 248px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ---------- Sidebar ---------- */
.sidebar {
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  background: linear-gradient(178deg, #ffffff 0%, #fcfcfe 100%);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 8px 18px;
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--coral) 0%, #e0492f 100%);
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(240,101,79,.34), inset 0 1px 0 rgba(255,255,255,.3);
  flex: 0 0 auto;
}
.brand-mark svg { width: 19px; height: 19px; }
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: -.4px; }
.brand-name span { color: var(--coral); }
.brand-sub { font-size: 10.5px; color: var(--muted-2); font-weight: 600; letter-spacing: .3px; text-transform: uppercase; margin-top: 1px; }

.nav-group { margin-top: 6px; }
.nav-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase;
  color: var(--muted-2); padding: 14px 10px 7px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--ink-soft);
  font-weight: 600; font-size: 13.5px;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
  position: relative;
}
.nav-item svg { width: 18px; height: 18px; flex: 0 0 auto; opacity: .8; }
.nav-item:hover { background: #f3f4f8; color: var(--ink); }
.nav-item.active { background: linear-gradient(180deg, #fff 0%, #fdf2ef 100%); color: var(--coral-ink); box-shadow: var(--shadow-card); }
.nav-item.active svg { opacity: 1; color: var(--coral); }
.nav-item.active::before {
  content: ''; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--coral);
}
.nav-item .count {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: #eef0f4; color: var(--muted); padding: 1px 8px; border-radius: var(--r-pill);
}
.nav-item.active .count { background: var(--coral-soft); color: var(--coral-ink); }

.sidebar-spacer { flex: 1; }

.agent-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 9px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line);
  margin-top: 12px;
}
.agent-chip .av { flex: 0 0 auto; }
.agent-chip-info { overflow: hidden; }
.agent-chip-name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-chip-mail { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-chip .dot-ok { width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-left: auto; box-shadow: 0 0 0 3px var(--green-soft); flex: 0 0 auto; }

/* ---------- Avatars ---------- */
.av {
  display: inline-grid; place-items: center;
  border-radius: 50%;
  font-weight: 700; color: #fff;
  letter-spacing: -.2px;
  flex: 0 0 auto;
  user-select: none;
}
.av-xs { width: 26px; height: 26px; font-size: 10px; }
.av-sm { width: 32px; height: 32px; font-size: 11.5px; }
.av-md { width: 38px; height: 38px; font-size: 13px; }
.av-lg { width: 56px; height: 56px; font-size: 19px; }
.av-xl { width: 72px; height: 72px; font-size: 25px; }

/* ---------- Main column ---------- */
.main { display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 15px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.72);
  backdrop-filter: saturate(160%) blur(12px);
  flex: 0 0 auto;
}
.page-title { font-size: 21px; font-weight: 800; letter-spacing: -.5px; }
.page-sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.searchbox {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: var(--r-pill); padding: 8px 14px; width: 264px;
  transition: box-shadow var(--t), border-color var(--t);
}
.searchbox:focus-within { border-color: #c6c8f0; box-shadow: var(--ring); background: #fff; }
.searchbox svg { width: 15px; height: 15px; color: var(--muted-2); flex: 0 0 auto; }
.searchbox input { border: none; background: none; outline: none; width: 100%; font-size: 13px; color: var(--ink); }
.searchbox input::placeholder { color: var(--muted-2); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 10px;
  font-weight: 700; font-size: 13px;
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast), border-color var(--t-fast);
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--coral) 0%, #e44e36 100%);
  color: #fff; box-shadow: 0 2px 6px rgba(228,78,54,.32), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn-primary:hover { box-shadow: 0 5px 16px rgba(228,78,54,.4), inset 0 1px 0 rgba(255,255,255,.25); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); color: var(--ink-soft); border: 1px solid var(--line-2); box-shadow: var(--shadow-card); }
.btn-ghost:hover { border-color: #d2d5de; background: var(--surface-2); }
.btn-teal { background: linear-gradient(180deg, #12877d 0%, var(--teal) 100%); color: #fff; box-shadow: 0 2px 6px rgba(15,118,110,.3); }
.btn-teal:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(15,118,110,.38); }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 9px; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-card);
  color: var(--ink-soft); transition: var(--t-fast);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--surface-2); border-color: #d2d5de; }

/* ---------- View scroller ---------- */
.view-wrap { flex: 1; overflow-y: auto; overflow-x: hidden; }
.view { display: none; padding: 24px 28px 60px; animation: viewIn var(--t-slow); }
.view.active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Generic cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-card);
}
.card-pad { padding: 20px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: 16px; font-weight: 800; letter-spacing: -.3px; margin: 0; }
.section-head .hint { font-size: 12.5px; color: var(--muted); }
.section-head .right { margin-left: auto; }

/* ---------- Pills / chips ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 700; letter-spacing: .1px;
}
.pill .pdot { width: 6px; height: 6px; border-radius: 50%; }
.tag-chip {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 700;
  background: #f1f2f6; color: var(--ink-soft); border: 1px solid var(--line-2);
}
.consent-express { background: var(--teal-soft); color: var(--teal); }
.consent-implied { background: #eef1ff; color: var(--indigo); }

.eng { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; }
.eng .pdot { width: 7px; height: 7px; border-radius: 50%; }
.eng-engaged { color: var(--engaged); }
.eng-engaged .pdot { background: var(--engaged); box-shadow: 0 0 0 3px rgba(16,185,129,.16); }
.eng-cooling { color: var(--cooling); }
.eng-cooling .pdot { background: var(--cooling); box-shadow: 0 0 0 3px rgba(245,158,11,.16); }
.eng-cold { color: var(--cold); }
.eng-cold .pdot { background: var(--cold); box-shadow: 0 0 0 3px rgba(148,163,184,.16); }

/* ============================================================
   DASHBOARD
   ============================================================ */
.dash-grid { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
.dash-left { display: flex; flex-direction: column; gap: 20px; }
.dash-right { display: flex; flex-direction: column; gap: 20px; }

/* Hero greeting */
.greeting { display: flex; align-items: center; gap: 16px; margin-bottom: 4px; }
.greeting h1 { font-size: 25px; font-weight: 800; letter-spacing: -.6px; margin: 0; }
.greeting p { color: var(--muted); font-size: 13.5px; margin: 2px 0 0; }

/* Metric tiles */
.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.metric {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 17px 18px; box-shadow: var(--shadow-card);
  position: relative; overflow: hidden;
  transition: transform var(--t), box-shadow var(--t);
}
.metric:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.metric.hero-metric { background: linear-gradient(150deg, #fff 0%, #fff7f5 100%); border-color: #f7d9d1; }
.metric .m-label { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .2px; display: flex; align-items: center; gap: 6px; }
.metric .m-label svg { width: 14px; height: 14px; }
.metric .m-value { font-size: 30px; font-weight: 800; letter-spacing: -1px; margin-top: 6px; line-height: 1; }
.metric .m-value .unit { font-size: 16px; font-weight: 700; color: var(--muted); margin-left: 2px; }
.metric .m-foot { font-size: 11.5px; color: var(--muted); margin-top: 7px; display: flex; align-items: center; gap: 5px; }
.metric .m-up { color: var(--green); font-weight: 700; }
.opens-note {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--muted-2); margin-top: 7px;
  background: #f4f5f8; padding: 3px 9px; border-radius: var(--r-pill);
}
.opens-note svg { width: 12px; height: 12px; }

/* Deliverability panel */
.deliver-panel { padding: 20px; }
.deliver-top { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.deliver-top .shield {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--green-soft); display: grid; place-items: center; color: var(--green);
}
.deliver-top .shield svg { width: 22px; height: 22px; }
.deliver-title { font-size: 15px; font-weight: 800; }
.deliver-domain { font-size: 12.5px; color: var(--muted); }
.rep-badge {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  background: var(--green-soft); color: var(--green);
  padding: 5px 12px; border-radius: var(--r-pill); font-weight: 800; font-size: 12px;
}
.rep-badge .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(22,163,74,.5); } 50% { box-shadow: 0 0 0 5px rgba(22,163,74,0); } }
.deliver-read { font-size: 12.5px; color: var(--ink-soft); margin: 13px 0 16px; padding: 10px 13px; background: var(--surface-2); border-radius: 10px; border: 1px solid var(--line); }
.deliver-read b { color: var(--green); }

.auth-row { display: flex; gap: 8px; margin-bottom: 16px; }
.auth-chip {
  flex: 1; display: flex; align-items: center; gap: 8px;
  padding: 9px 11px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line);
  font-size: 12px; font-weight: 700;
}
.auth-chip .check { width: 18px; height: 18px; border-radius: 50%; background: var(--green); display: grid; place-items: center; flex: 0 0 auto; }
.auth-chip .check svg { width: 11px; height: 11px; color: #fff; }
.auth-chip .a-name { color: var(--ink); }
.auth-chip .a-val { margin-left: auto; font-size: 10.5px; color: var(--muted-2); font-weight: 600; text-transform: uppercase; }

.deliver-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.dstat { text-align: center; padding: 11px 6px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.dstat .ds-val { font-size: 19px; font-weight: 800; letter-spacing: -.5px; }
.dstat .ds-label { font-size: 10.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.dstat .ds-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }

/* Chart card */
.chart-card { padding: 20px; }
.chart-meta { display: flex; align-items: baseline; gap: 10px; margin-bottom: 2px; }
.chart-big { font-size: 28px; font-weight: 800; letter-spacing: -1px; }
.chart-delta { font-size: 12.5px; font-weight: 700; color: var(--green); display: inline-flex; align-items: center; gap: 3px; }
.chart-svg-wrap { margin-top: 10px; }
.spark-x { display: flex; justify-content: space-between; margin-top: 7px; font-size: 10.5px; color: var(--muted-2); font-weight: 600; }

/* Smart groups mini */
.smart-mini { display: flex; flex-direction: column; gap: 9px; }
.smart-row {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2);
  cursor: pointer; transition: var(--t-fast);
}
.smart-row:hover { border-color: #d6d9e2; background: #fff; transform: translateX(2px); box-shadow: var(--shadow-card); }
.smart-row .sicon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; }
.smart-row .sicon svg { width: 18px; height: 18px; }
.smart-row .s-name { font-weight: 700; font-size: 13px; }
.smart-row .s-desc { font-size: 11.5px; color: var(--muted); }
.smart-row .s-count { margin-left: auto; font-size: 20px; font-weight: 800; letter-spacing: -.5px; }
.smart-row .s-bar { width: 100%; height: 5px; border-radius: 3px; background: #eceef3; margin-top: 5px; overflow: hidden; }
.smart-row .s-bar i { display: block; height: 100%; border-radius: 3px; }

/* Running / schedule */
.running-list { display: flex; flex-direction: column; gap: 10px; }
.run-row { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.run-row:last-child { border-bottom: none; }
.run-row .ricon { width: 34px; height: 34px; border-radius: 10px; background: var(--coral-soft); color: var(--coral-ink); display: grid; place-items: center; flex: 0 0 auto; }
.run-row .ricon svg { width: 17px; height: 17px; }
.run-row .r-name { font-weight: 700; font-size: 13px; }
.run-row .r-meta { font-size: 11.5px; color: var(--muted); }
.run-row .on-badge { margin-left: auto; font-size: 11px; font-weight: 800; color: var(--green); background: var(--green-soft); padding: 3px 10px; border-radius: var(--r-pill); }
.run-row .sched-badge { margin-left: auto; font-size: 11px; font-weight: 800; color: var(--amber); background: var(--amber-soft); padding: 3px 10px; border-radius: var(--r-pill); }

.followups { display: flex; flex-direction: column; gap: 2px; }
.fu-row { display: flex; align-items: center; gap: 11px; padding: 10px 8px; border-radius: 10px; cursor: pointer; transition: var(--t-fast); }
.fu-row:hover { background: var(--surface-2); }
.fu-text { min-width: 0; }
.fu-name { font-weight: 700; font-size: 13px; }
.fu-why { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fu-row .fu-go { margin-left: auto; color: var(--muted-2); width: 16px; height: 16px; flex: 0 0 auto; }

/* ============================================================
   PIPELINE BOARD
   ============================================================ */
.board-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.seg {
  display: inline-flex; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 10px; padding: 3px; box-shadow: var(--shadow-card);
}
.seg button { padding: 6px 13px; border-radius: 8px; font-weight: 700; font-size: 12.5px; color: var(--muted); transition: var(--t-fast); }
.seg button.active { background: var(--ink); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.seg button:not(.active):hover { color: var(--ink); }

.filter-chips { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.fchip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--ink-soft); box-shadow: var(--shadow-card);
  transition: var(--t-fast);
}
.fchip svg { width: 14px; height: 14px; }
.fchip:hover { border-color: #d2d5de; }
.fchip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(258px, 1fr);
  gap: 16px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 14px;
}
.lane { display: flex; flex-direction: column; border-radius: var(--r-lg); min-height: 200px; }
.lane-head {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 14px; border-radius: var(--r-lg) var(--r-lg) 0 0;
  position: sticky; top: 0; z-index: 2;
  backdrop-filter: blur(6px);
}
.lane-head .ldot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.lane-head .l-name { font-weight: 800; font-size: 13px; letter-spacing: -.2px; }
.lane-head .l-count { font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: var(--r-pill); background: rgba(255,255,255,.7); }
.lane-head .l-add { margin-left: auto; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: inherit; opacity: .55; transition: var(--t-fast); }
.lane-head .l-add:hover { opacity: 1; background: rgba(255,255,255,.6); }
.lane-head .l-add svg { width: 15px; height: 15px; }
.lane-body { display: flex; flex-direction: column; gap: 10px; padding: 12px; flex: 1; }
.lane.drag-over .lane-body { outline: 2px dashed currentColor; outline-offset: -6px; border-radius: var(--r-lg); }

.kcard {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 13px; box-shadow: var(--shadow-card);
  cursor: pointer; transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
  position: relative;
}
.kcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: #dfe2ea; }
.kcard.dragging { opacity: .4; }
.kcard.lift { box-shadow: var(--shadow-pop); transform: rotate(-1.5deg) scale(1.02); }
.kcard-top { display: flex; align-items: center; gap: 10px; }
.kcard-top .kc-name { font-weight: 700; font-size: 13.5px; letter-spacing: -.2px; line-height: 1.2; }
.kcard-top .kc-stage-edge { position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; }
.kcard-meta { display: flex; align-items: center; gap: 8px; margin-top: 9px; font-size: 11px; color: var(--muted); }
.kcard-meta .dotsep { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); }
.kcard-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 9px; }
.kcard-tags .tag-chip { font-size: 10px; padding: 1px 7px; }
.kcard-foot { display: flex; align-items: center; gap: 7px; margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--line-2); }
.kcard-foot .kf-touch { font-size: 11px; color: var(--muted); }
.kcard-foot .kf-actions { margin-left: auto; display: flex; gap: 4px; opacity: 0; transition: var(--t-fast); }
.kcard:hover .kf-actions { opacity: 1; }
.kc-mini-btn { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--muted); transition: var(--t-fast); }
.kc-mini-btn:hover { color: var(--coral); border-color: #f3c8bf; background: var(--coral-soft); }
.kc-mini-btn svg { width: 14px; height: 14px; }
.kc-followup { position: absolute; top: 11px; right: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 3px var(--coral-soft); }

/* ============================================================
   CONTACTS TABLE (alt list view)
   ============================================================ */
.table-card { padding: 0; overflow: hidden; }
.ctable { width: 100%; border-collapse: collapse; font-size: 13px; }
.ctable thead th {
  text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted-2); padding: 13px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2);
  position: sticky; top: 0;
}
.ctable tbody td { padding: 12px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ctable tbody tr { cursor: pointer; transition: background var(--t-fast); }
.ctable tbody tr:hover { background: #fafbfd; }
.ctable tbody tr:last-child td { border-bottom: none; }
.ct-name { display: flex; align-items: center; gap: 11px; }
.ct-name .cn-text b { font-weight: 700; display: block; }
.ct-name .cn-text small { color: var(--muted); font-size: 11.5px; }
.ct-stage-pill { font-size: 11px; }
.empty-cell { color: var(--muted-2); }

/* ============================================================
   CONTACT DRAWER
   ============================================================ */
.scrim {
  position: fixed; inset: 0; background: rgba(20,22,28,.42);
  backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity var(--t); z-index: 40;
}
.scrim.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 480px; max-width: 94vw;
  background: var(--surface); box-shadow: var(--shadow-pop); z-index: 50;
  transform: translateX(100%); transition: transform var(--t-slow);
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer-hero { padding: 22px 24px 18px; position: relative; color: #fff; flex: 0 0 auto; }
.drawer-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.12), rgba(0,0,0,.32)); z-index: 0; }
.drawer-hero > * { position: relative; z-index: 1; }
.drawer-close { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border-radius: 9px; background: rgba(255,255,255,.18); display: grid; place-items: center; color: #fff; z-index: 2; transition: var(--t-fast); }
.drawer-close:hover { background: rgba(255,255,255,.3); }
.drawer-close svg { width: 17px; height: 17px; }
.dh-top { display: flex; align-items: center; gap: 14px; }
.dh-top .av { box-shadow: 0 4px 14px rgba(0,0,0,.25); border: 2px solid rgba(255,255,255,.55); }
.dh-name { font-size: 20px; font-weight: 800; letter-spacing: -.4px; }
.dh-stage { font-size: 12.5px; font-weight: 700; opacity: .92; margin-top: 1px; }
.dh-contacts { display: flex; gap: 16px; margin-top: 14px; font-size: 12.5px; font-weight: 600; }
.dh-contacts a { display: flex; align-items: center; gap: 6px; opacity: .94; }
.dh-contacts svg { width: 14px; height: 14px; }
.dh-actions { display: flex; gap: 8px; margin-top: 16px; }
.dh-actions .btn { backdrop-filter: blur(4px); }
.btn-onhero { background: rgba(255,255,255,.95); color: var(--ink); box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.btn-onhero:hover { background: #fff; transform: translateY(-1px); }
.btn-onhero-ghost { background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.3); }
.btn-onhero-ghost:hover { background: rgba(255,255,255,.26); }

.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px 40px; }
.drawer-tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; margin-bottom: 18px; }
.drawer-tabs button { flex: 1; padding: 7px; border-radius: 8px; font-weight: 700; font-size: 12.5px; color: var(--muted); transition: var(--t-fast); }
.drawer-tabs button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-card); }

.d-block { margin-bottom: 22px; }
.d-block-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted-2); margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.d-block-title svg { width: 14px; height: 14px; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px; }
.field.full { grid-column: 1 / -1; }
.field .f-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted-2); }
.field .f-val { font-size: 13px; font-weight: 600; color: var(--ink); margin-top: 3px; }
.field .f-val.empty { color: var(--muted-2); font-weight: 500; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

.note-box { background: #fffaf3; border: 1px solid #f4e3c9; border-radius: 12px; padding: 13px 15px; font-size: 13px; line-height: 1.55; color: var(--ink-soft); position: relative; }
.note-box::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; background: var(--seller); border-radius: 3px; }
.note-add { display: flex; gap: 8px; margin-top: 10px; }
.note-add input { flex: 1; border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; font-size: 13px; outline: none; transition: var(--t-fast); }
.note-add input:focus { border-color: #c6c8f0; box-shadow: var(--ring); }

/* Timeline */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: linear-gradient(var(--line-2), transparent); }
.tl-item { position: relative; padding: 0 0 16px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: -22px; top: 3px; width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 3px solid var(--buyer); }
.tl-dot.coral { border-color: var(--coral); }
.tl-text { font-size: 13px; font-weight: 600; color: var(--ink); }
.tl-text small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; margin-top: 1px; }

/* ============================================================
   EMAIL BUILDER
   ============================================================ */
.builder { display: grid; grid-template-columns: 1fr 392px; gap: 22px; align-items: start; }
.builder-main { display: flex; flex-direction: column; gap: 18px; }

.steps { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.step {
  display: flex; align-items: center; gap: 9px; padding: 8px 14px; border-radius: var(--r-pill);
  font-weight: 700; font-size: 12.5px; color: var(--muted); background: var(--surface); border: 1px solid var(--line-2);
  transition: var(--t-fast); cursor: pointer;
}
.step .s-num { width: 20px; height: 20px; border-radius: 50%; background: #eceef3; color: var(--muted); display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.step.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.step.active .s-num { background: var(--coral); color: #fff; }
.step.done { color: var(--teal); border-color: var(--teal-soft); background: var(--teal-soft); }
.step.done .s-num { background: var(--teal); color: #fff; }
.step-arrow { color: var(--muted-2); }

.compose-card { padding: 20px; }
.fieldset { margin-bottom: 16px; }
.fieldset:last-child { margin-bottom: 0; }
.flbl { font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 6px; display: block; }
.finput {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line-2); border-radius: 11px;
  font-size: 13.5px; outline: none; background: var(--surface); transition: var(--t-fast); color: var(--ink);
}
.finput:focus { border-color: #c6c8f0; box-shadow: var(--ring); }
.from-field { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 9px 13px; }
.from-field .fr-label { font-size: 12px; color: var(--muted); font-weight: 700; }
.from-field .fr-val { font-weight: 700; font-size: 13.5px; }
.from-field .verified { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--green); }
.from-field .verified svg { width: 13px; height: 13px; }

.compose-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.toolbar-grp { display: flex; gap: 4px; align-items: center; }
.tbtn { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--ink-soft); border: 1px solid var(--line-2); background: var(--surface); transition: var(--t-fast); }
.tbtn:hover { background: var(--surface-2); border-color: #d2d5de; }
.tbtn svg { width: 15px; height: 15px; }
.merge-select { padding: 7px 11px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); font-size: 12px; font-weight: 600; color: var(--ink-soft); outline: none; cursor: pointer; }
.btn-ai { background: linear-gradient(125deg, #6f6ff0 0%, #5b5bd6 100%); color: #fff; box-shadow: 0 2px 8px rgba(91,91,214,.35); margin-left: auto; }
.btn-ai:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(91,91,214,.45); }
.btn-ai.thinking { pointer-events: none; }
.btn-ai .ai-spin { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.body-area { width: 100%; min-height: 270px; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 13px; font-size: 13.5px; line-height: 1.65; resize: vertical; outline: none; background: var(--surface); transition: var(--t-fast); color: var(--ink); }
.body-area:focus { border-color: #c6c8f0; box-shadow: var(--ring); }

.tpl-list { display: flex; flex-direction: column; gap: 8px; }
.tpl-item { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); cursor: pointer; transition: var(--t-fast); }
.tpl-item:hover { border-color: var(--coral); background: var(--coral-soft); transform: translateX(2px); }
.tpl-item .tpl-ic { width: 34px; height: 34px; border-radius: 9px; background: #eef1ff; color: var(--indigo); display: grid; place-items: center; flex: 0 0 auto; }
.tpl-item .tpl-ic svg { width: 17px; height: 17px; }
.tpl-item .tpl-name { font-weight: 700; font-size: 13px; }
.tpl-item .tpl-cat { font-size: 11px; color: var(--muted); }
.tpl-item .tpl-go { margin-left: auto; color: var(--muted-2); }

/* Phone preview */
.preview-rail { position: sticky; top: 0; }
.phone-frame {
  background: linear-gradient(170deg, #1c1f26, #0e1014); border-radius: 34px; padding: 12px;
  box-shadow: var(--shadow-pop), inset 0 0 0 1px rgba(255,255,255,.06); width: 100%;
}
.phone-notch { width: 110px; height: 6px; border-radius: 5px; background: #34384012; background: rgba(255,255,255,.18); margin: 2px auto 8px; }
.phone-screen { background: #f1f2f6; border-radius: 24px; overflow: hidden; min-height: 480px; }
.mail-bar { background: #fff; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.mail-sender { display: flex; align-items: center; gap: 9px; }
.mail-sender .ms-name { font-weight: 700; font-size: 12.5px; }
.mail-sender .ms-time { margin-left: auto; font-size: 10.5px; color: var(--muted); }
.mail-sender .ms-mail { font-size: 11px; color: var(--muted); }
.mail-subject { font-weight: 800; font-size: 14.5px; margin-top: 11px; letter-spacing: -.2px; color: var(--ink); line-height: 1.3; }
.mail-body { padding: 16px 16px 20px; font-size: 12.5px; line-height: 1.62; color: var(--ink-soft); white-space: pre-wrap; }
.mail-cta { display: inline-block; margin: 6px 0 14px; background: var(--coral); color: #fff !important; font-weight: 700; padding: 9px 18px; border-radius: 9px; font-size: 12.5px; }
.mail-foot { border-top: 1px solid var(--line); padding: 13px 16px; font-size: 10px; color: var(--muted-2); line-height: 1.5; background: #fafbfd; }
.mail-foot a { color: var(--indigo); font-weight: 600; }
.preview-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; text-align: center; margin: 14px 0 10px; }

/* ============================================================
   REVIEW & SEND
   ============================================================ */
.review-grid { display: grid; grid-template-columns: 1fr 360px; gap: 22px; align-items: start; }
.review-main { display: flex; flex-direction: column; gap: 18px; }

.recap-card { padding: 20px; }
.recap-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.recap-head .rh-ic { width: 40px; height: 40px; border-radius: 11px; background: var(--coral-soft); color: var(--coral-ink); display: grid; place-items: center; }
.recap-head .rh-ic svg { width: 20px; height: 20px; }
.recap-line { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.recap-line:last-child { border-bottom: none; }
.recap-line .rl-k { color: var(--muted); font-weight: 600; }
.recap-line .rl-v { font-weight: 700; }

.eligible-bar { display: flex; gap: 0; border-radius: 11px; overflow: hidden; margin: 4px 0 6px; height: 36px; border: 1px solid var(--line); }
.eligible-bar .eb { display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 800; color: #fff; }
.eligible-legend { display: flex; gap: 16px; font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.eligible-legend span { display: inline-flex; align-items: center; gap: 6px; }
.eligible-legend i { width: 9px; height: 9px; border-radius: 3px; }

.preflight { display: flex; flex-direction: column; gap: 9px; }
.pf-row { display: flex; align-items: center; gap: 11px; padding: 10px 13px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.pf-row .pf-check { width: 22px; height: 22px; border-radius: 50%; background: var(--green); display: grid; place-items: center; flex: 0 0 auto; }
.pf-row .pf-check svg { width: 13px; height: 13px; color: #fff; }
.pf-row .pf-note { margin-left: auto; font-size: 11.5px; color: var(--muted); font-weight: 500; }

.casl-foot { background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: 11px; padding: 13px 15px; font-size: 11.5px; color: var(--muted); line-height: 1.55; }
.casl-foot b { color: var(--ink-soft); }

/* Toggle switch */
.switch { position: relative; width: 44px; height: 25px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: #d4d7e0; border-radius: var(--r-pill); transition: var(--t); }
.switch .track::before { content: ''; position: absolute; left: 3px; top: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: var(--t); }
.switch input:checked + .track { background: linear-gradient(180deg, var(--teal) 0%, #0c655e 100%); }
.switch input:checked + .track::before { transform: translateX(19px); }
.switch.coral input:checked + .track { background: linear-gradient(180deg, var(--coral) 0%, #e44e36 100%); }

/* A/B test */
.ab-card { padding: 20px; transition: var(--t); }
.ab-head { display: flex; align-items: center; gap: 12px; }
.ab-head .ab-ic { width: 38px; height: 38px; border-radius: 11px; background: #eef1ff; color: var(--indigo); display: grid; place-items: center; }
.ab-head .ab-ic svg { width: 19px; height: 19px; }
.ab-head .ab-title { font-weight: 800; font-size: 14px; }
.ab-head .ab-desc { font-size: 12px; color: var(--muted); }
.ab-head .switch { margin-left: auto; }
.ab-body { margin-top: 16px; display: none; }
.ab-body.open { display: block; animation: viewIn var(--t); }
.ab-variants { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ab-variant { border: 1.5px solid var(--line-2); border-radius: 12px; padding: 13px; transition: var(--t-fast); }
.ab-variant .av-badge { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 7px; font-weight: 800; font-size: 12px; }
.ab-variant.a .av-badge { background: #eef1ff; color: var(--indigo); }
.ab-variant.b { border-color: var(--teal); background: var(--teal-soft); }
.ab-variant.b .av-badge { background: var(--teal); color: #fff; }
.ab-variant .av-subj { font-size: 12.5px; font-weight: 600; margin-top: 9px; color: var(--ink-soft); line-height: 1.4; }
.ab-winner { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 800; color: var(--teal); }
.ab-config { display: flex; align-items: center; gap: 14px; margin-top: 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.ab-config b { color: var(--ink); }
.ab-slider-wrap { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 200px; }

/* ⭐ BATCH SEND */
.batch-card { padding: 0; overflow: hidden; border: 1.5px solid var(--line); transition: var(--t); }
.batch-card.on { border-color: #bfe6e1; box-shadow: 0 0 0 3px rgba(15,118,110,.07), var(--shadow-card); }
.batch-head { display: flex; align-items: center; gap: 13px; padding: 18px 20px; }
.batch-head .bh-ic { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(145deg, var(--teal-soft), #c4e8e2); color: var(--teal); display: grid; place-items: center; flex: 0 0 auto; }
.batch-head .bh-ic svg { width: 22px; height: 22px; }
.batch-head .bh-title { font-weight: 800; font-size: 14.5px; display: flex; align-items: center; gap: 7px; }
.batch-head .bh-desc { font-size: 12px; color: var(--muted); margin-top: 1px; }
.batch-head .switch { margin-left: auto; }
.batch-recommend { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 800; color: var(--teal); background: var(--teal-soft); padding: 2px 8px; border-radius: var(--r-pill); }

.batch-body { display: none; padding: 4px 20px 20px; border-top: 1px solid var(--line); }
.batch-body.open { display: block; animation: viewIn var(--t); }
.batch-control { margin-top: 16px; }
.batch-control .bc-label { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); margin-bottom: 9px; }
.batch-control .bc-cur { color: var(--teal); font-weight: 800; }

.segmented { display: flex; gap: 6px; flex-wrap: wrap; }
.segmented button {
  flex: 1; min-width: 54px; padding: 9px 6px; border-radius: 10px; font-weight: 700; font-size: 12.5px;
  background: var(--surface-2); border: 1.5px solid var(--line-2); color: var(--muted); transition: var(--t-fast);
}
.segmented button:hover { border-color: #c2e3de; color: var(--ink); }
.segmented button.active { background: var(--teal); color: #fff; border-color: var(--teal); box-shadow: 0 3px 8px rgba(15,118,110,.28); }

.batch-estimate {
  margin-top: 18px; padding: 16px 18px; border-radius: 13px;
  background: linear-gradient(135deg, #f0faf8 0%, #e6f5f2 100%); border: 1px solid #c9e8e3;
  display: flex; align-items: center; gap: 14px;
}
.batch-estimate .be-ic { width: 40px; height: 40px; border-radius: 11px; background: #fff; display: grid; place-items: center; color: var(--teal); flex: 0 0 auto; box-shadow: var(--shadow-card); }
.batch-estimate .be-ic svg { width: 20px; height: 20px; }
.batch-estimate .be-line { font-size: 12.5px; color: var(--ink-soft); }
.batch-estimate .be-line b { color: var(--teal); }
.batch-estimate .be-big { font-size: 17px; font-weight: 800; color: var(--ink); letter-spacing: -.3px; margin-top: 1px; }
.batch-estimate .be-big em { font-style: normal; color: var(--teal); }

.warmup-note { display: flex; align-items: center; gap: 9px; margin-top: 13px; font-size: 11.5px; color: var(--muted); padding: 10px 13px; background: var(--surface-2); border-radius: 10px; }
.warmup-note svg { width: 16px; height: 16px; color: var(--amber); flex: 0 0 auto; }

/* "?" tooltip */
.qmark {
  width: 18px; height: 18px; border-radius: 50%; background: var(--teal-soft); color: var(--teal);
  display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; cursor: help; position: relative; vertical-align: middle;
}
.qmark .tip {
  position: absolute; bottom: calc(100% + 11px); left: 50%; transform: translateX(-50%) translateY(4px);
  width: 290px; background: var(--ink); color: #fff; padding: 13px 15px; border-radius: 12px;
  font-size: 12px; font-weight: 500; line-height: 1.55; box-shadow: var(--shadow-pop);
  opacity: 0; pointer-events: none; transition: var(--t); z-index: 20; text-transform: none; letter-spacing: 0;
}
.qmark .tip::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 7px solid transparent; border-top-color: var(--ink); }
.qmark:hover .tip { opacity: 1; transform: translateX(-50%); }
.qmark .tip b { color: #ffd9cf; }

/* Send sticky footer */
.send-rail { position: sticky; top: 0; display: flex; flex-direction: column; gap: 16px; }
.send-summary-card { padding: 20px; }
.send-stat { display: flex; justify-content: space-between; font-size: 13px; padding: 8px 0; }
.send-stat .ss-k { color: var(--muted); }
.send-stat .ss-v { font-weight: 700; }
.send-final { margin-top: 8px; }
.send-mode-line { font-size: 11.5px; color: var(--muted); text-align: center; margin-top: 10px; }

/* ============================================================
   SEQUENCES
   ============================================================ */
.seq-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.seq-card { padding: 0; overflow: hidden; transition: var(--t); display: flex; flex-direction: column; }
.seq-card.on { border-color: #c7ead0; }
.seq-card-head { padding: 18px 20px 16px; display: flex; align-items: flex-start; gap: 13px; }
.seq-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: 0 0 auto; box-shadow: var(--shadow-card); }
.seq-ic svg { width: 22px; height: 22px; }
.seq-card.on .seq-ic { background: linear-gradient(145deg, var(--green-soft), #c6f0d4); color: var(--past); }
.seq-card:not(.on) .seq-ic { background: var(--surface-2); color: var(--muted); }
.seq-info { flex: 1; min-width: 0; }
.seq-name { font-weight: 800; font-size: 15px; letter-spacing: -.2px; }
.seq-desc { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin-top: 3px; }
.seq-status-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: var(--r-pill); margin-top: 9px; }
.seq-status-chip.on { background: var(--green-soft); color: var(--green); }
.seq-status-chip.off { background: #eef0f4; color: var(--muted); }
.seq-toggle-wrap { flex: 0 0 auto; }

.seq-steps { padding: 4px 20px 6px; }
.seq-step { display: flex; gap: 13px; padding: 11px 0; position: relative; }
.seq-step:not(:last-child)::before { content: ''; position: absolute; left: 17px; top: 34px; bottom: -2px; width: 2px; background: var(--line-2); }
.seq-step .ss-day { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; flex: 0 0 auto; text-align: center; line-height: 1; }
.seq-step .ss-day b { font-size: 13px; font-weight: 800; }
.seq-step .ss-day small { font-size: 8.5px; color: var(--muted); text-transform: uppercase; font-weight: 700; }
.seq-step .ss-subj { font-weight: 700; font-size: 12.5px; line-height: 1.3; }
.seq-step .ss-note { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.seq-card-foot { margin-top: auto; padding: 14px 20px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; background: var(--surface-2); }
.seq-card-foot .enrolled { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.seq-card-foot .enrolled b { color: var(--ink); }

/* ============================================================
   ANALYTICS
   ============================================================ */
.an-row { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; margin-bottom: 20px; }
.bars-wrap { display: flex; align-items: flex-end; gap: 14px; height: 200px; padding-top: 18px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 40px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, var(--coral) 0%, #f3866f 100%); position: relative; transition: height var(--t-slow); min-height: 4px; }
.bar:hover { filter: brightness(1.05); }
.bar .bar-val { position: absolute; top: -19px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 800; color: var(--ink); white-space: nowrap; }
.bar-x { font-size: 10.5px; color: var(--muted); font-weight: 600; text-align: center; }

.camp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.camp-table thead th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted-2); padding: 12px 14px; border-bottom: 1px solid var(--line); }
.camp-table thead th.num { text-align: right; }
.camp-table tbody td { padding: 13px 14px; border-bottom: 1px solid var(--line); }
.camp-table tbody td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.camp-table tbody tr:last-child td { border-bottom: none; }
.camp-table tbody tr:hover { background: #fafbfd; }
.camp-name-cell b { font-weight: 700; display: block; }
.camp-name-cell small { color: var(--muted); font-size: 11.5px; }
.status-pill { font-size: 11px; }
.status-sent { background: var(--green-soft); color: var(--green); }
.status-scheduled { background: var(--amber-soft); color: var(--amber); }
.status-draft { background: #eef0f4; color: var(--muted); }
.ab-flag { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 800; color: var(--teal); background: var(--teal-soft); padding: 1px 7px; border-radius: var(--r-pill); margin-left: 6px; }
.clickrate-cell { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.cr-mini-bar { width: 46px; height: 6px; border-radius: 3px; background: #eceef3; overflow: hidden; }
.cr-mini-bar i { display: block; height: 100%; background: var(--coral); border-radius: 3px; }

/* ============================================================
   SETTINGS / DELIVERABILITY
   ============================================================ */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.supp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.supp-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); }
.supp-table tr:last-child td { border-bottom: none; }
.supp-reason { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: var(--r-pill); }
.reason-bounce { background: var(--amber-soft); color: var(--amber); }
.reason-unsub { background: #eef0f4; color: var(--muted); }
.reason-complaint { background: #fde8e6; color: var(--red); }

.pref-preview { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.pref-banner { background: linear-gradient(135deg, var(--coral) 0%, #e44e36 100%); color: #fff; padding: 20px; }
.pref-banner h3 { margin: 0; font-size: 17px; font-weight: 800; }
.pref-banner p { margin: 4px 0 0; font-size: 12.5px; opacity: .92; }
.pref-body { padding: 20px; }
.pref-opt { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.pref-opt:last-of-type { border-bottom: none; }
.pref-opt .po-text b { font-weight: 700; font-size: 13px; display: block; }
.pref-opt .po-text small { color: var(--muted); font-size: 11.5px; }
.pref-opt .switch { margin-left: auto; }
.pref-unsub { margin-top: 14px; text-align: center; }
.pref-unsub a { font-size: 12px; color: var(--muted); text-decoration: underline; }

.hygiene-note { display: flex; gap: 12px; padding: 14px 16px; background: linear-gradient(135deg, #f0faf8, #e6f5f2); border: 1px solid #c9e8e3; border-radius: 13px; margin-bottom: 16px; }
.hygiene-note .hn-ic { width: 36px; height: 36px; border-radius: 10px; background: #fff; color: var(--teal); display: grid; place-items: center; flex: 0 0 auto; box-shadow: var(--shadow-card); }
.hygiene-note .hn-ic svg { width: 18px; height: 18px; }
.hygiene-note .hn-text { font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }
.hygiene-note .hn-text b { color: var(--ink); }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 11px; padding: 13px 18px;
  background: var(--ink); color: #fff; border-radius: 13px; box-shadow: var(--shadow-pop);
  font-size: 13px; font-weight: 600; transform: translateY(20px); opacity: 0;
  animation: toastIn var(--t-slow) forwards; max-width: 460px;
}
@keyframes toastIn { to { transform: none; opacity: 1; } }
.toast.out { animation: toastOut var(--t) forwards; }
@keyframes toastOut { to { transform: translateY(20px); opacity: 0; } }
.toast .t-ic { width: 24px; height: 24px; border-radius: 7px; background: var(--green); display: grid; place-items: center; flex: 0 0 auto; }
.toast .t-ic svg { width: 14px; height: 14px; }
.toast.teal .t-ic { background: var(--teal); }
.toast.coral .t-ic { background: var(--coral); }

/* ---------- Modal ---------- */
.modal-scrim { position: fixed; inset: 0; background: rgba(20,22,28,.46); backdrop-filter: blur(3px); display: none; place-items: center; z-index: 60; padding: 24px; }
.modal-scrim.open { display: grid; animation: viewIn var(--t); }
.modal { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); width: 440px; max-width: 100%; overflow: hidden; animation: modalIn var(--t-slow); }
@keyframes modalIn { from { transform: scale(.96) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { padding: 20px 22px 0; }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 800; }
.modal-head p { margin: 5px 0 0; font-size: 13px; color: var(--muted); }
.modal-body { padding: 18px 22px; }
.modal-foot { padding: 14px 22px 20px; display: flex; gap: 10px; justify-content: flex-end; }
.enrol-list { display: flex; flex-direction: column; gap: 8px; }
.enrol-opt { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border: 1.5px solid var(--line-2); border-radius: 12px; cursor: pointer; transition: var(--t-fast); }
.enrol-opt:hover { border-color: var(--coral); background: var(--coral-soft); }
.enrol-opt.sel { border-color: var(--coral); background: var(--coral-soft); }
.enrol-opt .eo-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--green-soft); color: var(--past); display: grid; place-items: center; flex: 0 0 auto; }
.enrol-opt .eo-ic svg { width: 17px; height: 17px; }
.enrol-opt .eo-name { font-weight: 700; font-size: 13px; }
.enrol-opt .eo-meta { font-size: 11.5px; color: var(--muted); }
.enrol-opt .eo-radio { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); flex: 0 0 auto; transition: var(--t-fast); }
.enrol-opt.sel .eo-radio { border-color: var(--coral); background: var(--coral); box-shadow: inset 0 0 0 3px #fff; }

/* responsive guard */
@media (max-width: 1280px) {
  .app { grid-template-columns: 216px 1fr; }
  .dash-grid { grid-template-columns: 1fr 320px; }
  .builder { grid-template-columns: 1fr 340px; }
  .review-grid, .send-rail { grid-template-columns: 1fr; }
  .review-grid { grid-template-columns: 1fr; }
  .seq-grid { grid-template-columns: 1fr; }
  .an-row { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .metric-row { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .builder { grid-template-columns: 1fr; }
}
