/* Ebury Marketing & Sales Dashboard – prototype
   Light theme, brand-matched to ebury.com (Apparat headings, Inter body,
   Elegant Blue + Warm Black, neutral greys). */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Hero colours */
  --elegant-blue:    #74B0CA;
  --elegant-blue-2:  #5C9BB8;
  --warm-black:      #231F20;

  /* Neutrals */
  --pure-white:      #FFFFFF;
  --warm-white:      #F7F4EE;
  --light-grey:      #F7F7F7;
  --grey:            #E0E0E0;
  --dark-grey:       #A3A3A3;
  --charcoal:        #737373;

  /* Semantic tokens */
  --bg-page:         var(--pure-white);
  --bg-soft:         var(--warm-white);
  --bg-surface:      var(--pure-white);
  --bg-surface-2:    var(--light-grey);
  --bg-elev:         #FAFAFA;
  --border:          var(--grey);
  --border-strong:   var(--dark-grey);
  --text-primary:    var(--warm-black);
  --text-muted:      var(--charcoal);
  --text-dim:        var(--dark-grey);

  --accent:          var(--warm-black);    /* primary CTA — black pills */
  --accent-hover:    #000000;
  --accent-blue:     var(--elegant-blue);
  --accent-blue-soft:rgba(116, 176, 202, 0.18);

  /* Status accents (light-bg friendly) */
  --success:         #047857;
  --success-bg:      #ECFDF5;
  --success-border:  #A7F3D0;
  --warning:         #92400E;
  --warning-bg:      #FFFBEB;
  --warning-border:  #FDE68A;
  --danger:          #B91C1C;
  --danger-bg:       #FEF2F2;
  --danger-border:   #FECACA;
  --indigo:          #4338CA;
  --indigo-bg:       #EEF2FF;
  --indigo-border:   #C7D2FE;
  --sky:             #075985;
  --sky-bg:          #F0F9FF;
  --sky-border:      #BAE6FD;

  --font-sans:       'Apparat', 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
  --font-display:    'Apparat', 'Inter', -apple-system, system-ui, sans-serif;

  --radius:          10px;
  --radius-sm:       6px;
  --radius-lg:       14px;
  --radius-pill:     999px;
  --shadow-sm:       0 1px 2px rgba(35, 31, 32, 0.04);
  --shadow-md:       0 6px 24px rgba(35, 31, 32, 0.08);
  --shadow-lg:       0 24px 60px rgba(35, 31, 32, 0.16);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ─── Top Nav ─────────────────────────────────── */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: var(--pure-white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topnav .brand img { height: 22px; width: auto; display: block; }
.topnav .nav-links {
  display: flex;
  gap: 4px;
  margin-left: 36px;
  flex: 1;
}
.topnav .nav-links a {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-weight: 500;
  font-size: 14px;
  transition: all 0.15s;
}
.topnav .nav-links a:hover { color: var(--text-primary); background: var(--light-grey); }
.topnav .nav-links a.active {
  color: var(--text-primary);
  background: var(--light-grey);
  font-weight: 600;
}
.topnav .nav-links a.disabled {
  color: var(--text-dim);
  cursor: not-allowed;
}

.topnav .user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  background: var(--pure-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 500;
  transition: border-color 0.15s;
}
.topnav .user:hover { border-color: var(--text-primary); }
.topnav .user .avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--warm-black);
  color: var(--pure-white);
  font-weight: 600;
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}

/* ─── Page wrapper ────────────────────────────── */
.page {
  max-width: 1480px;
  margin: 0 auto;
  padding: 36px 32px 80px;
}
.page-header { margin-bottom: 28px; }
.page-header h1 {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.page-header p {
  color: var(--text-muted);
  margin: 0;
  font-size: 15px;
}

/* ─── Sub nav ─────────────────────────────────── */
.subnav {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
  padding: 0 2px;
}
.subnav a {
  position: relative;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: -1px;
}
.subnav a:hover { color: var(--text-primary); }
.subnav a.active {
  color: var(--text-primary);
  border-bottom-color: var(--warm-black);
  font-weight: 600;
}
.subnav .count {
  background: var(--light-grey);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  padding: 1px 9px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}
.subnav a.active .count {
  background: var(--warm-black);
  border-color: var(--warm-black);
  color: var(--pure-white);
}

/* ─── KPI cards ───────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.kpi {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}
.kpi:hover { border-color: var(--border-strong); }
.kpi .label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.kpi .label .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.kpi .value {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text-primary);
}
.kpi .delta { font-size: 12px; margin-top: 8px; color: var(--text-muted); }
.kpi .delta.up { color: var(--success); }
.kpi .delta.down { color: var(--danger); }
.kpi.accent {
  background: var(--accent-blue-soft);
  border-color: var(--elegant-blue);
}

/* ─── Filter bar ──────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.select, .search input, .btn-ghost-sm {
  background: var(--pure-white);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.select {
  padding-right: 30px;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='none' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M3 5l3 3 3-3'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}
.select:hover, .search input:hover { border-color: var(--text-primary); }
.select:focus, .search input:focus {
  border-color: var(--warm-black);
  box-shadow: 0 0 0 3px rgba(35, 31, 32, 0.08);
}

.search { position: relative; flex: 1; max-width: 320px; min-width: 200px; }
.search input { width: 100%; padding-left: 34px; }
.search::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>") no-repeat;
}

.toolbar .spacer { flex: 1; }
.btn-ghost-sm {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--pure-white);
}
.btn-ghost-sm:hover { border-color: var(--text-primary); }

.toggle-group {
  display: inline-flex;
  background: var(--light-grey);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}
.toggle-group button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
}
.toggle-group button.active {
  background: var(--warm-black);
  color: var(--pure-white);
}

/* Date filter chip */
.date-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--pure-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 12px;
  color: var(--text-muted);
}
.date-filter::before {
  content: '';
  width: 14px; height: 14px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2'/><line x1='16' y1='2' x2='16' y2='6'/><line x1='8' y1='2' x2='8' y2='6'/><line x1='3' y1='10' x2='21' y2='10'/></svg>") no-repeat;
}
.date-filter input[type="date"] {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  padding: 4px 0;
  outline: none;
  width: 130px;
}
.date-filter .lbl { color: var(--text-muted); font-size: 12px; }
.date-filter .clear-date {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
}
.date-filter .clear-date:hover { color: var(--danger); }

/* ─── Table ───────────────────────────────────── */
.table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.table-scroll { overflow-x: auto; }
table.leads {
  width: 100%;
  border-collapse: collapse;
  min-width: 1280px;
  font-size: 13px;
}
table.leads thead th {
  background: var(--light-grey);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: left;
  padding: 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.leads tbody td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-primary);
}
table.leads tbody tr {
  transition: background 0.12s;
  cursor: pointer;
  background: var(--pure-white);
}
table.leads tbody tr:hover { background: var(--light-grey); }
table.leads tbody tr:last-child td { border-bottom: 0; }

table.leads tbody tr.flash-accept { animation: flashAccept 0.7s ease-out forwards; }
table.leads tbody tr.flash-reject { animation: flashReject 0.7s ease-out forwards; }
@keyframes flashAccept {
  0% { background: var(--success-bg); }
  60% { background: var(--success-bg); }
  100% { background: transparent; opacity: 0; transform: translateX(20px); }
}
@keyframes flashReject {
  0% { background: var(--danger-bg); }
  60% { background: var(--danger-bg); }
  100% { background: transparent; opacity: 0; transform: translateX(-20px); }
}

.status-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
}
.status-dot.green  { background: #16A34A; box-shadow: 0 0 0 3px rgba(22,163,74,0.15); }
.status-dot.yellow { background: #F59E0B; box-shadow: 0 0 0 3px rgba(245,158,11,0.15); }
.status-dot.red    { background: #DC2626; box-shadow: 0 0 0 3px rgba(220,38,38,0.15); }

.cell-name { font-weight: 600; color: var(--text-primary); }
.cell-email, .cell-id { color: var(--text-muted); font-family: 'SF Mono', Menlo, monospace; font-size: 12px; }
.cell-msg {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
}
.cell-time { color: var(--text-muted); white-space: nowrap; font-size: 12px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--light-grey);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.pill.campaign  { background: var(--accent-blue-soft); border-color: var(--elegant-blue); color: #1E5A7A; }
.pill.country   { background: var(--light-grey); }
.pill.sf {
  background: rgba(0, 161, 224, 0.10);
  border-color: rgba(0, 161, 224, 0.35);
  color: #0276B5;
  font-family: 'SF Mono', monospace;
  font-size: 11px;
}

.flag {
  display: inline-block;
  width: 18px;
  text-align: center;
  margin-right: 4px;
}

a.orbis-link {
  color: var(--warm-black);
  font-family: 'SF Mono', monospace;
  font-size: 12px;
  cursor: pointer;
  border-bottom: 1px dashed transparent;
  transition: border-color 0.15s;
}
a.orbis-link:hover { border-bottom-color: var(--warm-black); }

/* ─── Buttons ─────────────────────────────────── */
.actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-accept {
  background: var(--warm-black);
  color: var(--pure-white);
}
.btn-accept:hover { background: #000; }
.btn-reject {
  background: var(--pure-white);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-reject:hover { border-color: var(--text-primary); }

/* Salesforce-flavoured action buttons */
.btn-sf {
  background: var(--warm-black);
  color: var(--pure-white);
  border: none;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  white-space: nowrap;
}
.btn-sf:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-sf:hover:not(:disabled) { background: #000; }
.btn-sf-ghost {
  background: var(--pure-white);
  color: var(--text-primary);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  white-space: nowrap;
}
.btn-sf-ghost:hover { border-color: var(--text-primary); }

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state .big { font-size: 38px; margin-bottom: 8px; }
.empty-state strong { color: var(--text-primary); display: block; margin-bottom: 4px; font-weight: 600; }

/* ─── Drawer ──────────────────────────────────── */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(35, 31, 32, 0.35);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 100;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0; right: 0;
  width: 480px;
  max-width: 92vw;
  height: 100vh;
  background: var(--pure-white);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 101;
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px;
  border-bottom: 1px solid var(--border);
}
.drawer-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}
.drawer-header .lead-id { color: var(--text-muted); font-size: 12px; font-family: 'SF Mono', monospace; }
.drawer-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 24px;
  padding: 4px 8px;
  line-height: 1;
}
.drawer-close:hover { color: var(--text-primary); }
.drawer-body { padding: 26px; overflow-y: auto; flex: 1; }
.drawer-section { margin-bottom: 26px; }
.drawer-section h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 10px;
  font-weight: 600;
}
.kv {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 6px 12px;
  font-size: 13px;
}
.kv .k { color: var(--text-muted); }
.kv .v { color: var(--text-primary); word-break: break-word; }
.message-box {
  background: var(--light-grey);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.55;
}

/* AI workflow stepper */
.stepper { position: relative; padding-left: 8px; }
.step {
  position: relative;
  padding: 0 0 18px 28px;
  border-left: 2px solid var(--border);
  margin-left: 8px;
}
.step:last-child { border-left-color: transparent; padding-bottom: 0; }
.step::before {
  content: '';
  position: absolute;
  left: -9px;
  top: 0;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--pure-white);
  border: 2px solid var(--text-muted);
}
.step.done::before    { background: var(--warm-black); border-color: var(--warm-black); }
.step.green::before   { background: #16A34A; border-color: #16A34A; }
.step.yellow::before  { background: #F59E0B; border-color: #F59E0B; }
.step.red::before     { background: #DC2626; border-color: #DC2626; }
.step .step-title { font-weight: 600; font-size: 13px; margin-bottom: 4px; color: var(--text-primary); }
.step .step-desc  { color: var(--text-muted); font-size: 12.5px; }

.drawer-footer {
  padding: 18px 26px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.drawer-footer .btn { padding: 10px 20px; font-size: 13px; }

/* ─── Toast ───────────────────────────────────── */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--pure-white);
  border: 1px solid var(--border);
  border-left: 3px solid var(--warm-black);
  color: var(--text-primary);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  box-shadow: var(--shadow-md);
  min-width: 280px;
  animation: toastIn 0.25s ease-out, toastOut 0.3s ease-in 3.5s forwards;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.danger  { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }
.toast .ico { font-size: 14px; font-weight: 700; }
@keyframes toastIn  { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }

/* ─── Confidence bar ──────────────────────────── */
.confidence { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.confidence .bar {
  flex: 1;
  height: 6px;
  background: var(--light-grey);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.confidence .bar > span {
  display: block;
  height: 100%;
  background: var(--warm-black);
}
.confidence .pct { color: var(--text-muted); font-family: 'SF Mono', monospace; }

/* ─── Campaign / Source combined cell ─────────── */
.cell-campaign { line-height: 1.3; }
.cell-campaign .camp {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.cell-campaign .src {
  display: flex;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  align-items: center;
}
.cell-campaign .src .dot-sep { width: 2px; height: 2px; background: var(--text-dim); border-radius: 50%; display: inline-block; }
.cell-campaign .src-icon { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; margin-right: 4px; }
.cell-campaign .src-google   { background: linear-gradient(135deg, #4285F4 25%, #EA4335 25% 50%, #FBBC05 50% 75%, #34A853 75%); }
.cell-campaign .src-bing     { background: #008373; }
.cell-campaign .src-linkedin { background: #0A66C2; }

.tag-paid {
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 3px;
  text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--indigo-bg); color: var(--indigo);
}
.tag-organic {
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 3px;
  text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--success-bg); color: var(--success);
}

/* ─── Salesforce lifecycle pills (9 states) ───── */
.pill.lc-client          { background: var(--success-bg); border-color: var(--success-border); color: var(--success); }
.pill.lc-prospect        { background: var(--indigo-bg);  border-color: var(--indigo-border);  color: var(--indigo); }
.pill.lc-prospect-sales  { background: var(--accent-blue-soft); border-color: var(--elegant-blue); color: #1E5A7A; }
.pill.lc-prospect-lapsed { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning); }
.pill.lc-prospect-disq   { background: var(--danger-bg);  border-color: var(--danger-border);  color: var(--danger); }
.pill.lc-lead-sales      { background: var(--sky-bg);     border-color: var(--sky-border);     color: var(--sky); }
.pill.lc-lead-lapsed     { background: var(--light-grey); border-color: var(--border);         color: var(--charcoal); }
.pill.lc-lead-disq       { background: var(--danger-bg);  border-color: var(--danger-border);  color: #DC2626; }
.pill.lc-not-in-sf       { background: var(--pure-white); border-color: var(--border);         color: var(--text-dim); }
.pill.lc-pill::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* Editable status select on Sales — pill-shaped dropdown */
.status-select {
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 22px 4px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'><path fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M3 5l3 3 3-3'/></svg>");
  background-repeat: no-repeat;
  background-position: right 7px center;
  transition: filter 0.15s;
  max-width: 200px;
}
.status-select:focus { outline: none; box-shadow: 0 0 0 3px rgba(35,31,32,0.08); }
.status-select option { background: var(--pure-white); color: var(--text-primary); }

/* ─── Assign cell ─────────────────────────────── */
.assign-form { display: flex; gap: 6px; align-items: center; }
.assign-form select {
  background: var(--pure-white);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 6px 26px 6px 10px;
  font-size: 12px;
  font-family: inherit;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'><path fill='none' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M3 5l3 3 3-3'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  cursor: pointer;
  min-width: 160px;
}
.assign-form select:focus { border-color: var(--warm-black); outline: none; }

.assignee {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}
.assignee .av {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--warm-black);
  color: var(--pure-white);
  font-size: 10px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.assignee .meta { line-height: 1.25; }
.assignee .meta .name { color: var(--text-primary); font-weight: 500; }
.assignee .meta .team { color: var(--text-muted); font-size: 11px; }
.unassigned { color: var(--text-dim); font-style: italic; font-size: 12px; }

.cell-acct { font-family: 'SF Mono', Menlo, monospace; font-size: 12px; color: var(--text-primary); }

/* Salesforce cloud mini-icon */
.sf-cloud {
  width: 14px; height: 10px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 17'><path d='M9.5.5a5.5 5.5 0 014.95 3.05 4.5 4.5 0 015.55 4.4 4.4 4.4 0 01-.42 1.85 4 4 0 01-1.6 7.7H4.5a4 4 0 01-1.86-7.55A5 5 0 019.5.5z'/></svg>") no-repeat center / contain;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 17'><path d='M9.5.5a5.5 5.5 0 014.95 3.05 4.5 4.5 0 015.55 4.4 4.4 4.4 0 01-.42 1.85 4 4 0 01-1.6 7.7H4.5a4 4 0 01-1.86-7.55A5 5 0 019.5.5z'/></svg>") no-repeat center / contain;
  display: inline-block;
}

/* ─── Modal ───────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(35, 31, 32, 0.45);
  backdrop-filter: blur(2px);
  z-index: 150;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--pure-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 480px;
  max-width: 92vw;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease-out;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { margin: 0; font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.modal-header .sub { color: var(--text-muted); font-size: 12.5px; margin-top: 3px; }
.modal-body { padding: 20px 24px; }
.modal-body label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}
.modal-body textarea {
  width: 100%;
  min-height: 110px;
  background: var(--pure-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  padding: 12px;
  resize: vertical;
  outline: none;
}
.modal-body textarea:focus { border-color: var(--warm-black); box-shadow: 0 0 0 3px rgba(35,31,32,0.08); }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.recipient-card {
  background: var(--light-grey);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--pure-white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn-sf-ghost .spinner { border-color: rgba(35,31,32,0.2); border-top-color: var(--warm-black); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Funnel ──────────────────────────────────── */
.funnel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 30px;
  margin-bottom: 24px;
}
.funnel-card .funnel-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text-primary);
}
.funnel-card .funnel-sub {
  margin: 0 0 28px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Pyramid: bands on the LEFT (centered, narrowing top to bottom),
   stage labels on the RIGHT, paired up via 2-column grid. */
.pyramid {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(240px, 1fr);
  gap: 14px 36px;
  align-items: center;
}
.pyramid .band {
  height: 56px;
  background: var(--warm-black);
  color: var(--pure-white);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 auto;            /* centers band horizontally inside the grid cell */
  padding: 0 22px;
  min-width: 80px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}
.pyramid .band.apex {
  background: var(--elegant-blue);
  color: #15425A;
  border-radius: 8px;
  height: 64px;
  font-size: 22px;
}
.pyramid .band .pct {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  opacity: 0.7;
}
.pyramid .label {
  border-left: 2px solid var(--border);
  padding-left: 18px;
}
.pyramid .label .name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  letter-spacing: -0.005em;
}
.pyramid .label .sub {
  color: var(--text-muted);
  font-size: 12.5px;
  margin-top: 4px;
  line-height: 1.45;
}
.pyramid .label.apex { border-left-color: var(--elegant-blue); }
.pyramid .label.apex .name { color: #15425A; }


/* ─── Yes/No toggle pill ─────────────────────── */
.yn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
}
.yn.yes {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success-border);
}
.yn.no {
  background: var(--pure-white);
  color: var(--text-dim);
  border-color: var(--border);
}
.yn:hover { filter: brightness(0.95); }
.yn::before {
  content: '';
  width: 10px; height: 10px;
  display: inline-block;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}
.yn.yes::before {
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='2 6 5 9 10 3'/></svg>") no-repeat center / 10px;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='2 6 5 9 10 3'/></svg>") no-repeat center / 10px;
}
.yn.no::before {
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><line x1='3' y1='3' x2='9' y2='9' stroke='black' stroke-width='2' stroke-linecap='round'/><line x1='9' y1='3' x2='3' y2='9' stroke='black' stroke-width='2' stroke-linecap='round'/></svg>") no-repeat center / 10px;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><line x1='3' y1='3' x2='9' y2='9' stroke='black' stroke-width='2' stroke-linecap='round'/><line x1='9' y1='3' x2='3' y2='9' stroke='black' stroke-width='2' stroke-linecap='round'/></svg>") no-repeat center / 10px;
}

/* ─── Money cells ─────────────────────────────── */
.cell-money {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-primary);
  font-size: 13px;
  white-space: nowrap;
}
.cell-money.muted { color: var(--text-dim); font-weight: 400; }

.section-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin: 28px 0 14px;
  color: var(--text-primary);
}

/* ─── Footer note ─────────────────────────────── */
.proto-note {
  text-align: center;
  color: var(--text-dim);
  font-size: 11px;
  margin-top: 40px;
}

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
