/* ────────────────── CRM (True REST internal) ──────────────────
 * Layered on top of portal.css. Reuses tokens.
 * ─────────────────────────────────────────────────────────────── */

.crm-main {
  max-width: none;
  padding: 28px 32px 60px;
  min-width: 0;   /* allow the column to shrink so the kanban scrolls within itself */
}

/* KPI strip */
.crm-kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
.crm-kpi {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.crm-kpi-label {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}
.crm-kpi-value {
  font-family: var(--font-display, 'Geist', sans-serif);
  font-size: 26px;
  font-weight: 600;
  color: var(--brand-indigo);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.crm-kpi-delta {
  font-size: 11px;
  color: var(--text-muted);
}
.crm-kpi-delta.up { color: #059669; }
.crm-kpi-delta.down { color: #dc2626; }

/* Filter bar */
.crm-filterbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.crm-search {
  flex: 1;
  min-width: 280px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-muted);
}
.crm-search input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: var(--text-primary);
  font-family: inherit;
}
.crm-filters {
  display: flex;
  gap: 8px;
}
.crm-filters select {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12.5px;
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
}
.crm-viewtoggle {
  display: flex;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  overflow: hidden;
}
.crm-viewtoggle button {
  background: transparent;
  border: 0;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}
.crm-viewtoggle button.on {
  background: var(--brand-indigo);
  color: #fff;
}

/* ────────────── Kanban ────────────── */
.crm-kanban {
  display: grid;
  grid-template-columns: repeat(9, minmax(220px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 10px;
}
.crm-kcol {
  background: #f5f6fa;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  display: flex; flex-direction: column;
  min-height: 400px;
}
.crm-kcol-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(35,49,135,0.08);
}
.crm-kcol-head-l {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
  color: var(--brand-indigo);
}
.crm-kcol-dot {
  width: 8px; height: 8px; border-radius: 999px;
}
.crm-kcol-count {
  font-size: 10.5px;
  background: rgba(35,49,135,0.08);
  color: var(--brand-indigo);
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 600;
}
.crm-kcol-sum {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.crm-kcol-body {
  flex: 1;
  padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
}
.crm-kcol-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  padding: 20px 0;
}

.crm-kcard {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 10px;
  text-align: left;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color .12s, box-shadow .12s;
  font-family: inherit;
}
.crm-kcard:hover {
  border-color: var(--brand-magenta);
  box-shadow: 0 4px 14px -8px rgba(229,3,102,0.30);
}
.crm-kcard-row1 {
  display: flex; justify-content: space-between; align-items: center;
}
.crm-kcard-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--brand-indigo);
}
.crm-kcard-score {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}
.crm-kcard-score.hi { background: rgba(5,150,105,0.12); color: #047857; }
.crm-kcard-score.md { background: rgba(35,49,135,0.10); color: var(--brand-indigo); }
.crm-kcard-score.lo { background: rgba(148,163,184,0.18); color: #64748b; }

.crm-kcard-territory {
  font-size: 11.5px;
  color: var(--text-muted);
}
.crm-kcard-row2 {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 10.5px;
}
.crm-kcard-value {
  font-weight: 600;
  color: var(--brand-magenta);
  font-variant-numeric: tabular-nums;
}
.crm-kcard-source {
  color: var(--text-muted);
  font-size: 10px;
}
.crm-kcard-foot {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px dashed rgba(35,49,135,0.10);
  padding-top: 6px;
}
.crm-kcard-owner {
  width: 22px; height: 22px;
  border-radius: 999px;
  background: var(--brand-indigo);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  display: grid; place-items: center;
}
.crm-kcard-meta {
  display: flex; gap: 8px; align-items: center;
  color: var(--text-muted);
  font-size: 10px;
}
.crm-kcard-meta span { display: inline-flex; align-items: center; gap: 3px; }
.crm-kcard-time {
  font-variant-numeric: tabular-nums;
}
.crm-kcard-flag {
  font-size: 10px;
  color: #b45309;
  background: rgba(245,158,11,0.10);
  border-radius: 4px;
  padding: 2px 6px;
  display: inline-flex;
  gap: 4px;
  align-items: center;
  width: fit-content;
}
.crm-kcard-stale { border-left: 2px solid #f59e0b; }

/* ────────────── Drag & drop ────────────── */
.crm-kcard {
  /* user-select disabled while draggable so text isn't grabbed instead */
  user-select: none;
  -webkit-user-drag: element;
}
.crm-kcard:active { cursor: grabbing; }
.crm-kcard[draggable="true"] { cursor: grab; }
.crm-kcard[draggable="true"]:active { cursor: grabbing; }
/* Faded look while a card is being dragged (the dragImage shows the real one) */
.crm-kcol-droptarget {
  background: rgba(229,3,102,0.06) !important;
  outline: 2px dashed rgba(229,3,102,0.45);
  outline-offset: -2px;
}
.crm-kcol-droptarget .crm-kcol-empty {
  color: var(--brand-magenta);
  font-weight: 600;
  border: 1px dashed rgba(229,3,102,0.45);
  border-radius: 8px;
  padding: 14px 8px;
}
.crm-kcol-dragdim { opacity: 0.65; transition: opacity .12s; }

/* ────────────── Table ────────────── */
.crm-table-wrap {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  overflow: hidden;
}
.crm-table {
  width: 100%;
  border-collapse: collapse;
}
.crm-table thead th {
  background: #f5f6fa;
  text-align: left;
  font-size: 10.5px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
}
.crm-table tbody tr {
  cursor: pointer;
  transition: background .08s;
}
.crm-table tbody tr:hover { background: #fafafe; }
.crm-table tbody td {
  font-size: 12.5px;
  color: var(--text-primary);
  padding: 12px 12px;
  border-bottom: 1px solid rgba(35,49,135,0.06);
  vertical-align: top;
}
.crm-tname { font-weight: 600; color: var(--brand-indigo); font-size: 13px; }
.crm-tsub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.crm-stagetag {
  display: inline-block;
  font-size: 11px;
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 2px 8px;
  font-weight: 600;
}
.crm-tscore {
  font-weight: 700;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}
.crm-tscore.hi { background: rgba(5,150,105,0.12); color: #047857; }
.crm-tscore.md { background: rgba(35,49,135,0.10); color: var(--brand-indigo); }
.crm-tscore.lo { background: rgba(148,163,184,0.18); color: #64748b; }
.crm-towner {
  width: 26px; height: 26px;
  border-radius: 999px;
  background: var(--brand-indigo);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: grid; place-items: center;
}
.crm-table .mono { font-family: var(--font-mono, ui-monospace, 'SF Mono', monospace); font-variant-numeric: tabular-nums; font-size: 12px; }
.crm-table .muted { color: var(--text-muted); }

/* ────────────── Drawer ────────────── */
.crm-drawer-wrap { position: fixed; inset: 0; z-index: 80; }
.crm-drawer-backdrop {
  position: absolute; inset: 0;
  background: rgba(15,20,55,0.42);
  animation: crmFade .15s ease;
}
@keyframes crmFade { from { opacity: 0; } to { opacity: 1; } }
.crm-drawer {
  position: absolute; top: 0; bottom: 0; right: 0;
  width: min(620px, 92vw);
  background: #fff;
  display: flex; flex-direction: column;
  box-shadow: -10px 0 40px -10px rgba(15,20,55,0.20);
  animation: crmSlide .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes crmSlide { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.crm-drawer-head {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: flex-start; justify-content: space-between;
}
.crm-drawer-id {
  display: flex; gap: 12px; align-items: center;
}
.crm-drawer-avatar {
  width: 44px; height: 44px;
  background: var(--brand-indigo);
  color: #fff;
  border-radius: 999px;
  display: grid; place-items: center;
  font-size: 16px;
  font-weight: 600;
}
.crm-drawer-id h2 {
  font-size: 18px;
  margin: 0;
  color: var(--brand-indigo);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.crm-drawer-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.crm-drawer-x {
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px;
  border-radius: 6px;
}
.crm-drawer-x:hover { background: #f5f6fa; }

.crm-drawer-stages {
  display: flex;
  padding: 14px 22px;
  gap: 0;
  border-bottom: 1px solid var(--border-soft);
  overflow-x: auto;
}
.crm-dstage {
  display: flex; flex-direction: column; align-items: center;
  flex: 1;
  min-width: 60px;
  position: relative;
}
.crm-dstage:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 9px; left: 50%; right: -50%;
  height: 1.5px;
  background: rgba(35,49,135,0.12);
  z-index: 0;
}
.crm-dstage.past:not(:last-child)::after,
.crm-dstage.current:not(:last-child)::after { background: var(--brand-indigo); }
.crm-dstage-dot {
  width: 18px; height: 18px;
  border-radius: 999px;
  background: rgba(35,49,135,0.12);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: grid; place-items: center;
  position: relative; z-index: 1;
}
.crm-dstage.current .crm-dstage-dot {
  outline: 3px solid rgba(229,3,102,0.18);
}
.crm-dstage-label {
  font-size: 9.5px;
  margin-top: 6px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.15;
}
.crm-dstage.current .crm-dstage-label,
.crm-dstage.past .crm-dstage-label { color: var(--brand-indigo); font-weight: 600; }

/* Clickable stages */
.crm-dstage {
  background: transparent;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 2px;
  border-radius: 6px;
  transition: background .12s, transform .12s;
}
.crm-dstage:hover:not(:disabled) {
  background: rgba(229,3,102,0.06);
}
.crm-dstage:hover:not(:disabled) .crm-dstage-label { color: var(--brand-magenta); }
.crm-dstage:disabled { cursor: default; }
.crm-drawer-stages-hint {
  font-size: 10.5px;
  color: var(--text-muted);
  text-align: center;
  margin: -4px 22px 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}

/* Golden Record banner */
.crm-golden-banner {
  display: flex; align-items: center; gap: 12px;
  margin: 12px 22px 0;
  padding: 12px 14px;
  background: linear-gradient(90deg, rgba(229,3,102,0.10), rgba(229,3,102,0.04));
  border: 1px solid rgba(229,3,102,0.25);
  border-radius: 10px;
}
.crm-golden-banner.crm-golden-stage2 {
  background: linear-gradient(90deg, rgba(35,49,135,0.08), rgba(35,49,135,0.02));
  border-color: rgba(35,49,135,0.18);
}
.crm-golden-icon {
  width: 32px; height: 32px;
  border-radius: 999px;
  background: var(--brand-magenta);
  color: #fff;
  display: grid; place-items: center;
  font-size: 16px;
  flex-shrink: 0;
}
.crm-golden-banner.crm-golden-stage2 .crm-golden-icon { background: var(--brand-indigo); }
.crm-golden-body { flex: 1; font-size: 11.5px; color: var(--brand-indigo); }
.crm-golden-body strong { display: block; font-size: 12.5px; margin-bottom: 2px; }
.crm-golden-body div { color: var(--text-muted); line-height: 1.4; }

/* Documents tab */
.crm-docs { display: flex; flex-direction: column; gap: 14px; }
.crm-docs-summary {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--text-muted);
  padding: 8px 12px;
  background: #f5f6fa;
  border-radius: 8px;
}
.crm-docs-summary strong { color: var(--brand-indigo); font-weight: 700; }
.crm-docsec {
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  overflow: hidden;
}
.crm-docsec-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 10px 12px;
  background: #fafbfd;
  border-bottom: 1px solid var(--border-soft);
}
.crm-docsec-head strong {
  font-size: 12px;
  color: var(--brand-indigo);
}
.crm-docsec-sub {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 1px;
}
.crm-doc-locked-pill {
  font-size: 10px;
  color: var(--text-muted);
  background: rgba(148,163,184,0.18);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.crm-docsec-locked .crm-docsec-head { background: #f5f6fa; }

.crm-docrow {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
}
.crm-docrow:last-child { border-bottom: 0; }
.crm-doc-icon { font-size: 16px; flex-shrink: 0; opacity: .7; }
.crm-doc-meta { flex: 1; min-width: 0; }
.crm-doc-name {
  font-size: 12px; font-weight: 600;
  color: var(--brand-indigo);
  display: flex; align-items: center; gap: 6px;
}
.crm-doc-pulled {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #047857;
  background: rgba(5,150,105,0.10);
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 700;
}
.crm-doc-src {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 1px;
}
.crm-doc-status {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.crm-doc-st-signed,
.crm-doc-st-received,
.crm-doc-st-issued,
.crm-doc-st-on-file { background: rgba(5,150,105,0.12); color: #047857; }
.crm-doc-st-pending { background: rgba(148,163,184,0.18); color: #64748b; }
.crm-doc-st-not-sent { background: rgba(148,163,184,0.18); color: #64748b; }
.crm-doc-st-sent { background: rgba(35,49,135,0.10); color: var(--brand-indigo); }

.crm-doc-actions { display: flex; gap: 4px; flex-shrink: 0; }
.crm-doc-btn {
  background: #fff;
  border: 1px solid var(--border-soft);
  width: 24px; height: 24px;
  border-radius: 5px;
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--brand-indigo);
}
.crm-doc-btn:hover { border-color: var(--brand-magenta); color: var(--brand-magenta); }
.crm-doc-btn-action {
  width: auto; padding: 0 10px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--brand-magenta);
}

.crm-drawer-actions {
  display: flex; gap: 6px;
  padding: 12px 22px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-soft);
}
.crm-qa {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11.5px;
  color: var(--brand-indigo);
  cursor: pointer;
  display: inline-flex; gap: 5px; align-items: center;
  font-family: inherit;
}
.crm-qa:hover { background: #f5f6fa; }
.crm-qa-primary {
  background: var(--brand-magenta);
  color: #fff;
  border-color: var(--brand-magenta);
}
.crm-qa-primary:hover { background: #cc0258; color: #fff; }

.crm-drawer-tabs {
  display: flex;
  padding: 0 22px;
  gap: 0;
  border-bottom: 1px solid var(--border-soft);
}
.crm-drawer-tabs button {
  background: transparent;
  border: 0;
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-family: inherit;
  font-weight: 500;
}
.crm-drawer-tabs button.on {
  color: var(--brand-magenta);
  border-bottom-color: var(--brand-magenta);
}

.crm-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px;
}

/* Activity */
.crm-activity { display: flex; flex-direction: column; gap: 18px; }
.crm-actcomp {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.crm-actcomp textarea {
  border: 0; resize: none;
  font-family: inherit;
  font-size: 12.5px;
  outline: none;
  color: var(--text-primary);
}
.crm-actcomp-foot { display: flex; justify-content: space-between; align-items: center; }
.crm-actcomp-tags { display: flex; gap: 4px; }
.crm-actcomp-tags button {
  background: #f5f6fa;
  border: 0;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
}
.crm-actcomp-tags button:hover { background: rgba(35,49,135,0.10); color: var(--brand-indigo); }

.crm-timeline {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 12px;
  position: relative;
}
.crm-tev {
  display: flex; gap: 10px;
}
.crm-tev-icon {
  width: 22px; height: 22px;
  border-radius: 999px;
  background: rgba(35,49,135,0.08);
  color: var(--brand-indigo);
  display: grid; place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.crm-tev-body { flex: 1; }
.crm-tev-text {
  font-size: 12.5px;
  color: var(--text-primary);
  line-height: 1.45;
}
.crm-tev-meta {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 2px;
}
.crm-tev-who { font-weight: 600; color: var(--brand-indigo); }

/* Profile */
.crm-pgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
}
.crm-pgrid label {
  font-size: 10.5px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
  margin-bottom: 3px;
}
.crm-pgrid > div > div {
  font-size: 13px;
  color: var(--text-primary);
}
.crm-pgrid-full { grid-column: 1 / -1; }

/* Financials */
.crm-fin { display: flex; flex-direction: column; }
.crm-finrow {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(35,49,135,0.06);
  font-size: 13px;
  color: var(--text-primary);
}
.crm-finrow span { color: var(--text-muted); }
.crm-finrow strong { font-weight: 600; }
.crm-finrow .mono { font-family: var(--font-mono, ui-monospace, 'SF Mono', monospace); font-variant-numeric: tabular-nums; }
.crm-finrow-status { background: #f5f6fa; padding-left: 12px; padding-right: 12px; border-radius: 6px; margin-top: 4px; border-bottom: 0; }
.crm-pass { color: #059669; }
.crm-fail { color: #dc2626; }
.crm-fin-cta { display: flex; gap: 8px; margin-top: 16px; }

/* Automations (per-applicant) */
.crm-aplist { display: flex; flex-direction: column; gap: 8px; }
.crm-apnote { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.crm-aprow {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}
.crm-aplabel { font-size: 13px; color: var(--brand-indigo); font-weight: 500; }
.crm-apvia { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.crm-apstatus {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 4px;
}
.crm-aps-sent    { background: rgba(5,150,105,0.12); color: #047857; }
.crm-aps-queued  { background: rgba(35,49,135,0.10); color: var(--brand-indigo); }
.crm-aps-paused  { background: rgba(148,163,184,0.18); color: #64748b; }
.crm-aps-pending { background: rgba(245,158,11,0.16); color: #b45309; }

/* DM */
.crm-dm-thread { display: flex; flex-direction: column; gap: 14px; padding-bottom: 14px; }
.crm-dm-msg { display: flex; gap: 10px; align-items: flex-start; }
.crm-dm-av {
  width: 28px; height: 28px;
  border-radius: 999px;
  background: var(--brand-indigo);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.crm-dm-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.crm-dm-meta strong { color: var(--brand-indigo); font-weight: 600; }
.crm-dm-text { font-size: 13px; color: var(--text-primary); line-height: 1.45; }
.crm-dm-compose {
  display: flex; gap: 8px;
  border-top: 1px solid var(--border-soft);
  padding-top: 12px;
}
.crm-dm-compose input {
  flex: 1;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.crm-dm-compose input:focus { border-color: var(--brand-magenta); }

/* ────────────── Automations page ────────────── */
.crm-autlist .crm-aut-rows {
  display: flex; flex-direction: column;
}
.crm-aut-rowhead, .crm-aut-row {
  display: grid;
  grid-template-columns: 200px 1.6fr 110px 180px 80px 80px 70px;
  gap: 12px;
  padding: 12px 18px;
  align-items: center;
  font-size: 12.5px;
}
.crm-aut-rowhead {
  background: #f5f6fa;
  font-size: 10.5px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}
.crm-aut-row { border-bottom: 1px solid rgba(35,49,135,0.06); }
.crm-aut-row.off { opacity: 0.55; }
.crm-aut-row:hover { background: #fafafe; }
.crm-aut-trigger { font-weight: 600; color: var(--brand-indigo); font-size: 12.5px; }
.crm-aut-label { color: var(--text-primary); }
.crm-aut-via { color: var(--text-muted); font-size: 11.5px; }
.crm-aut-tool { color: var(--text-muted); font-size: 11.5px; }
.crm-aut-runs, .crm-aut-success { font-family: var(--font-mono, ui-monospace, 'SF Mono', monospace); }

.crm-toggle {
  width: 36px; height: 20px;
  background: rgba(35,49,135,0.20);
  border: 0;
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background .15s;
}
.crm-toggle span {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 999px;
  background: #fff;
  transition: left .15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
.crm-toggle.on { background: var(--brand-magenta); }
.crm-toggle.on span { left: 18px; }

/* ────────────── Inbox ────────────── */
.crm-inbox {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 14px;
  height: calc(100vh - 240px);
  min-height: 480px;
}
.crm-inbox-list {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.crm-inbox-search {
  display: flex; gap: 8px; align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-muted);
}
.crm-inbox-search input {
  flex: 1; border: 0; outline: none; background: transparent;
  font-size: 12.5px; font-family: inherit;
}
.crm-inbox-item {
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(35,49,135,0.06);
  text-align: left;
  padding: 12px 14px;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 3px;
  font-family: inherit;
  position: relative;
}
.crm-inbox-item.on { background: #f5f6fa; }
.crm-inbox-item:hover { background: #fafafe; }
.crm-inbox-row1 { display: flex; align-items: center; gap: 6px; }
.crm-inbox-kind {
  width: 18px; height: 18px;
  border-radius: 4px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 11px;
  flex-shrink: 0;
}
.crm-inbox-kind-channel { background: rgba(229,3,102,0.10); color: var(--brand-magenta); }
.crm-inbox-kind-applicant { background: rgba(35,49,135,0.08); color: var(--brand-indigo); }
.crm-inbox-subject {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-indigo);
  flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.crm-inbox-unread {
  background: var(--brand-magenta);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
}
.crm-inbox-last {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.crm-inbox-when {
  position: absolute;
  top: 12px; right: 14px;
  font-size: 10px;
  color: var(--text-muted);
}
.crm-inbox-pane {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.crm-inbox-pane-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
}
.crm-inbox-pane-head h3 { margin: 0; font-size: 14px; color: var(--brand-indigo); font-weight: 600; }
.crm-inbox-pane-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.crm-inbox-pane-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
}
.crm-inbox-compose {
  border-top: 1px solid var(--border-soft);
  padding: 12px 18px;
  margin: 0;
}

/* Responsive */
@media (max-width: 1280px) {
  .crm-kpis { grid-template-columns: repeat(3, 1fr); }
  .crm-aut-rowhead, .crm-aut-row { grid-template-columns: 160px 1.4fr 100px 140px 70px 70px 60px; }
}
@media (max-width: 980px) {
  .crm-kpis { grid-template-columns: repeat(2, 1fr); }
  .crm-inbox { grid-template-columns: 1fr; height: auto; }
  .crm-aut-rowhead { display: none; }
  .crm-aut-row { grid-template-columns: 1fr; gap: 4px; padding: 14px; }
}

/* ───── New from Territory Map handoff ───── */
.crm-new-banner {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, rgba(229,3,102,0.06), rgba(229,3,102,0.02));
  border: 1px solid rgba(229,3,102,0.22);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--brand-indigo);
}
.crm-new-banner-dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--brand-magenta);
  box-shadow: 0 0 0 4px rgba(229,3,102,0.18);
  animation: pulse-magenta 1.6s ease-in-out infinite;
}
@keyframes pulse-magenta {
  0%, 100% { box-shadow: 0 0 0 4px rgba(229,3,102,0.18); }
  50%      { box-shadow: 0 0 0 8px rgba(229,3,102,0.06); }
}

/* Kanban card · NEW state */
.crm-kcard-new {
  border: 1px solid rgba(229,3,102,0.4) !important;
  box-shadow: 0 0 0 3px rgba(229,3,102,0.08), 0 4px 12px -4px rgba(229,3,102,0.18) !important;
  position: relative;
}
.crm-kcard-newbadge {
  position: absolute; top: -8px; left: 10px;
  background: var(--brand-magenta);
  color: #fff;
  font-size: 9px;
  letter-spacing: 0.12em;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}

/* Table row · NEW state */
.crm-trow-new td { background: rgba(229,3,102,0.035); }
.crm-trow-new:hover td { background: rgba(229,3,102,0.07) !important; }
.crm-trow-newpip {
  display: inline-block;
  margin-left: 8px;
  background: var(--brand-magenta);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  border-radius: 3px;
  vertical-align: middle;
}


/* ─── Onboarding tab + Pending Approvals ─────────────────── */
.crm-tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--brand-magenta);
  color: #fff;
  font: 700 10px/1 var(--font-num);
  letter-spacing: 0.02em;
  box-shadow: 0 0 0 2px #fff, 0 0 8px rgba(229,3,102,0.6);
  animation: crm-tab-badge-pulse 2.4s ease-in-out infinite;
}
@keyframes crm-tab-badge-pulse {
  0%, 100% { box-shadow: 0 0 0 2px #fff, 0 0 8px rgba(229,3,102,0.6); }
  50%      { box-shadow: 0 0 0 2px #fff, 0 0 14px rgba(229,3,102,1); }
}

.crm-onboard {
  padding: 16px;
  display: flex; flex-direction: column; gap: 18px;
}

.crm-pending-band {
  position: relative;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(229,3,102,0.08) 0%, rgba(229,3,102,0.03) 100%);
  border: 1px solid rgba(229,3,102,0.35);
  padding: 18px 20px;
  overflow: hidden;
}
.crm-pending-band::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--brand-magenta);
  box-shadow: 0 0 12px rgba(229,3,102,0.6);
  animation: crm-pending-bar 2.4s ease-in-out infinite;
}
@keyframes crm-pending-bar {
  0%, 100% { box-shadow: 0 0 12px rgba(229,3,102,0.6); }
  50%      { box-shadow: 0 0 22px rgba(229,3,102,1); }
}
.crm-pending-head {
  display: flex; gap: 14px; align-items: flex-start;
  margin-bottom: 12px;
}
.crm-pending-pulse {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(229,3,102,0.12);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.crm-pending-pulse span {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand-magenta);
  box-shadow: 0 0 0 0 rgba(229,3,102,0.6);
  animation: crm-pending-dot 1.6s ease-out infinite;
}
@keyframes crm-pending-dot {
  0%   { box-shadow: 0 0 0 0 rgba(229,3,102,0.7); }
  100% { box-shadow: 0 0 0 14px rgba(229,3,102,0); }
}
.crm-pending-eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--brand-magenta);
}
.crm-pending-title {
  font: 600 14px/1.35 var(--font-sans);
  color: var(--text-primary);
  margin-top: 2px;
}
.crm-pending-actions {
  display: flex; flex-direction: column; gap: 8px;
}
.crm-pending-row {
  display: flex; align-items: center; gap: 12px;
  background: #fff;
  border: 1px solid rgba(229,3,102,0.20);
  border-radius: 10px;
  padding: 10px 14px;
}
.crm-pending-row-label {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-primary);
}
.crm-pending-step {
  font: 700 10px var(--font-num); letter-spacing: 0.08em;
  color: var(--brand-magenta);
  background: rgba(229,3,102,0.08);
  padding: 3px 8px; border-radius: 4px;
}
.crm-pending-row-btns { display: flex; gap: 6px; flex-shrink: 0; }

.crm-onboard-mirror {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(35, 49, 135, 0.04);
  border: 1px dashed rgba(35, 49, 135, 0.20);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px; line-height: 1.45;
  color: var(--text-muted);
}
.crm-onboard-mirror-icon {
  font-size: 14px; color: var(--brand-indigo); margin-top: 1px;
}
.crm-onboard-mirror strong { color: var(--brand-indigo); font-weight: 600; }

.crm-onboard-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column;
  position: relative;
}
.crm-onboard-list::before {
  content: ''; position: absolute;
  left: 16px; top: 14px; bottom: 14px; width: 2px;
  background: var(--border-soft);
  z-index: 0;
}

.crm-ob {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 32px 1fr; gap: 14px;
  padding: 12px 0;
  align-items: flex-start;
}
.crm-ob-num {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font: 700 13px var(--font-num);
  background: #fff;
  border: 2px solid var(--border-soft);
  color: var(--text-muted);
  flex-shrink: 0;
}
.crm-ob-complete .crm-ob-num {
  background: var(--stoplight-green);
  border-color: var(--stoplight-green);
  color: #fff;
}
.crm-ob-active .crm-ob-num {
  background: var(--brand-indigo);
  border-color: var(--brand-indigo);
  color: #fff;
}
.crm-ob-pending_approval .crm-ob-num {
  background: var(--brand-magenta);
  border-color: var(--brand-magenta);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(229,3,102,0.15), 0 0 14px rgba(229,3,102,0.5);
  animation: crm-ob-pulse 1.8s ease-in-out infinite;
}
@keyframes crm-ob-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(229,3,102,0.12), 0 0 14px rgba(229,3,102,0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(229,3,102,0.20), 0 0 22px rgba(229,3,102,0.8); }
}

.crm-ob-body {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.crm-ob-pending_approval .crm-ob-body {
  border-color: rgba(229,3,102,0.45);
  background: linear-gradient(135deg, #fff 0%, rgba(229,3,102,0.04) 100%);
}
.crm-ob-upcoming .crm-ob-body { background: #fafbfd; opacity: 0.78; }

.crm-ob-row {
  display: flex; align-items: center; gap: 10px;
  justify-content: space-between;
}
.crm-ob-label {
  font: 600 13px/1.3 var(--font-sans);
  color: var(--text-primary);
}
.crm-ob-sub {
  font-size: 12px; color: var(--text-muted); line-height: 1.4;
}
.crm-ob-meta {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-top: 4px;
}
.crm-ob-actor {
  font-size: 11px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
}
.crm-ob-actor-franchisee { color: var(--brand-indigo); }
.crm-ob-actor-corporate  { color: var(--brand-magenta); }
.crm-ob-actor-joint      { color: var(--text-muted); }

.crm-ob-approvalmark {
  font-size: 11px; color: var(--brand-magenta); font-weight: 500;
  display: inline-flex; align-items: center; gap: 5px;
}
.crm-ob-approvalmark .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand-magenta);
}

.crm-ob-tag {
  font: 500 10px var(--font-sans); letter-spacing: 0.04em;
  padding: 3px 8px; border-radius: 999px; flex-shrink: 0;
}
.crm-ob-tag-complete         { background: var(--stoplight-green-soft); color: var(--stoplight-green); }
.crm-ob-tag-active           { background: rgba(35,49,135,0.10); color: var(--brand-indigo); }
.crm-ob-tag-pending_approval { background: rgba(229,3,102,0.12); color: var(--brand-magenta); font-weight: 600; }
.crm-ob-tag-upcoming         { background: var(--bg-subtle); color: var(--text-muted); }

.crm-ob-history {
  margin-top: 8px;
  border-top: 1px dashed var(--border-soft);
  padding-top: 12px;
}
.crm-ob-history h4 {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 8px;
}
.crm-ob-history ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.crm-ob-history li {
  font-size: 12px; color: var(--text-body);
  display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap;
}
.crm-ob-history .ts { color: var(--text-muted); font-variant-numeric: tabular-nums; min-width: 56px; }
.crm-ob-history .who {
  background: var(--brand-indigo); color: #fff;
  padding: 1px 6px; border-radius: 4px;
  font-size: 10px; font-weight: 600;
}
.crm-ob-history .act { color: var(--brand-magenta); font-weight: 500; }
.crm-ob-history .step { color: var(--text-muted); }


/* ──────────────────────────────────────────────────────────
 * Pending Actions page + Mark-as-lost UI
 * ──────────────────────────────────────────────────────── */
.portal-sb-item { position: relative; }
.portal-sb-badge {
  margin-left: auto;
  background: var(--brand-magenta);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  box-shadow: 0 0 0 0 rgba(229, 3, 102, 0.5);
  animation: paBadgePulse 2.4s ease-in-out infinite;
}
@keyframes paBadgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229, 3, 102, 0.45); }
  50%      { box-shadow: 0 0 0 6px rgba(229, 3, 102, 0); }
}

.crm-droprow {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 22px;
  border-bottom: 1px solid var(--border-soft);
  background: #fafbfc;
  font-size: 12px;
}
.crm-drop-link {
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all .15s;
}
.crm-drop-link:hover {
  border-color: var(--brand-magenta);
  color: var(--brand-magenta);
  background: rgba(229, 3, 102, 0.04);
}
.crm-drop-link span { font-size: 10px; }
.crm-droprow-hint { color: var(--text-muted); font-size: 11px; }
.crm-droprow-confirm {
  background: rgba(229, 3, 102, 0.06);
  border-bottom-color: rgba(229, 3, 102, 0.2);
}
.crm-droprow-confirm > span { color: var(--text-strong); font-weight: 500; font-size: 13px; }
.crm-droprow-btns { display: flex; gap: 8px; }

.crm-lost-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 14px 22px;
  padding: 12px 16px;
  background: #f5f5f7;
  border: 1px solid var(--border-soft);
  border-left: 3px solid #94a3b8;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.crm-lost-banner strong { color: var(--text-strong); }

/* ── Pending Actions page ── */
.crm-pa-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 0 0 22px;
}
.crm-pa-kpi {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.crm-pa-kpi::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--brand-magenta), #ff6ba6);
  opacity: 0.6;
}
.crm-pa-kpi-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.crm-pa-kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.crm-pa-kpi-delta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.crm-pa-kpi-split {
  display: flex; gap: 14px; font-size: 18px;
}
.crm-pa-kpi-split em {
  font-style: normal;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
  margin-left: 3px;
}

.crm-pa-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}
.crm-pa-groupby {
  display: flex; gap: 6px; align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}
.crm-pa-groupby > span { margin-right: 4px; font-weight: 500; }
.crm-pa-groupby button {
  background: transparent;
  border: 1px solid var(--border-soft);
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .12s;
}
.crm-pa-groupby button:hover { border-color: var(--text-muted); color: var(--text-strong); }
.crm-pa-groupby button.on {
  background: var(--brand-magenta);
  border-color: var(--brand-magenta);
  color: #fff;
}
.crm-pa-toolbar-meta {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; color: var(--text-muted);
}
.crm-pa-livedot {
  position: relative; width: 7px; height: 7px;
  display: inline-flex; align-items: center; justify-content: center;
}
.crm-pa-livedot span {
  position: absolute;
  width: 7px; height: 7px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  animation: paBadgePulse 2s ease-in-out infinite;
}

.crm-pa-groups { display: flex; flex-direction: column; gap: 18px; }
.crm-pa-group {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  overflow: hidden;
}
.crm-pa-group-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px;
  background: linear-gradient(180deg, #fafbfc 0%, #ffffff 100%);
  border-bottom: 1px solid var(--border-soft);
}
.crm-pa-group-head h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
  margin: 0;
}
.crm-pa-group-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.crm-pa-group-count {
  background: rgba(229, 3, 102, 0.1);
  color: var(--brand-magenta);
  font-weight: 700;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  min-width: 30px;
  text-align: center;
}
.crm-pa-rows { display: flex; flex-direction: column; }

.crm-pa-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) 1.5fr 110px 130px auto;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-soft);
  transition: background .12s;
}
.crm-pa-row:last-child { border-bottom: 0; }
.crm-pa-row:hover { background: #fafbfc; }

.crm-pa-row-applicant {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
}
.crm-pa-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--brand-magenta), #ff6ba6);
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.crm-pa-row-name {
  font-size: 13px; font-weight: 600; color: var(--text-strong);
}
.crm-pa-row-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.crm-pa-row-step {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
  color: var(--text-strong);
}
.crm-pa-row-stepnum {
  font-size: 10px; font-weight: 700;
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.crm-pa-wait-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--text-muted);
}
.crm-pa-wait-pill.warm { background: rgba(245, 158, 11, 0.12); color: #b45309; }
.crm-pa-wait-pill.hot {
  background: rgba(229, 3, 102, 0.12);
  color: var(--brand-magenta);
  animation: paBadgePulse 2s ease-in-out infinite;
}

.crm-pa-row-owner { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.crm-pa-row-ownerinit {
  width: 22px; height: 22px;
  background: #e2e8f0;
  color: #475569;
  font-size: 10px; font-weight: 700;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}

.crm-pa-row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.crm-pa-empty {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 64px 30px;
  text-align: center;
}
.crm-pa-empty-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  font-size: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.crm-pa-empty h3 {
  font-size: 18px;
  color: var(--text-strong);
  margin: 0 0 8px;
}
.crm-pa-empty p {
  color: var(--text-muted); font-size: 13px;
  max-width: 480px; margin: 0 auto; line-height: 1.6;
}

.crm-pa-history {
  margin-top: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 14px 18px;
}
.crm-pa-history h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 0 0 10px;
  font-weight: 600;
}
.crm-pa-history-list { display: flex; flex-direction: column; gap: 6px; }
.crm-pa-history-row {
  display: flex; justify-content: space-between;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 5px;
  background: #fafbfc;
}
.crm-pa-history-approved { color: #059669; }
.crm-pa-history-returned { color: #b45309; }
.crm-pa-history-key { font-family: ui-monospace, monospace; color: var(--text-muted); font-size: 11px; }

@media (max-width: 1100px) {
  .crm-pa-kpis { grid-template-columns: repeat(2, 1fr); }
  .crm-pa-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .crm-pa-row-actions { grid-column: 1 / -1; justify-content: flex-end; }
}


/* ─── Audit tab in drawer ─────────────────────────────────── */
.crm-audit { padding: 16px; display: flex; flex-direction: column; gap: 14px; }

.crm-audit-launch {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(229,3,102,0.06), rgba(35,49,135,0.04));
  border: 1px solid rgba(229,3,102,0.2);
}
.crm-audit-launch-body { display: flex; flex-direction: column; gap: 3px; }
.crm-audit-launch-body strong { font-size: 14px; color: var(--text-strong); font-weight: 600; }
.crm-audit-launch-body span { font-size: 12px; color: var(--text-muted); }

.crm-audit-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-top: 4px;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 8px;
}
.crm-audit-head h4 { margin: 0; font-size: 13px; font-weight: 600; color: var(--text-strong); letter-spacing: 0.04em; text-transform: uppercase; }
.crm-audit-count { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.crm-audit-empty {
  padding: 22px 16px;
  border-radius: 10px;
  background: var(--surface-2, #f8f9fb);
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.55;
  text-align: center;
}

.crm-audit-timeline {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 10px;
  position: relative;
}
.crm-audit-timeline::before {
  content: ''; position: absolute;
  left: 13px; top: 6px; bottom: 6px; width: 2px;
  background: var(--border-soft);
  border-radius: 2px;
}
.crm-audit-event {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  position: relative;
  padding: 6px 0;
}
.crm-audit-icon {
  width: 28px; height: 28px; border-radius: 50%;
  background: #fff; border: 2px solid var(--border-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--text-muted);
  z-index: 1;
}
.crm-audit-event.crm-audit-approved .crm-audit-icon { color: #047857; border-color: #a7f3d0; background: #ecfdf5; }
.crm-audit-event.crm-audit-returned .crm-audit-icon { color: #b45309; border-color: #fde68a; background: #fffbeb; }
.crm-audit-event.crm-audit-undone .crm-audit-icon { color: var(--brand-magenta); border-color: rgba(229,3,102,0.3); background: rgba(229,3,102,0.06); }
.crm-audit-event.crm-audit-submitted .crm-audit-icon { color: #0e7490; border-color: #a5f3fc; background: #ecfeff; }
.crm-audit-event.crm-audit-stage_changed .crm-audit-icon { color: var(--brand-indigo); border-color: rgba(35,49,135,0.25); background: rgba(35,49,135,0.04); }
.crm-audit-event.crm-audit-marked_lost .crm-audit-icon { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }

.crm-audit-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.crm-audit-row1 { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.crm-audit-row1 strong { font-size: 13px; color: var(--text-strong); font-weight: 600; }
.crm-audit-target { font-size: 12px; color: var(--text-muted); }
.crm-audit-detail { font-size: 12.5px; color: var(--text); line-height: 1.45; }
.crm-audit-meta { display: flex; gap: 6px; font-size: 11px; color: var(--text-muted); }

/* ─── Onboarding workflow surface (focused modal) ─────────── */
.crm-surface-shroud {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: stretch; justify-content: center;
  padding: 32px;
  animation: crm-surface-fadein 180ms ease-out;
}
@keyframes crm-surface-fadein {
  from { opacity: 0; }
  to { opacity: 1; }
}
.crm-surface {
  width: min(1240px, 100%);
  max-height: 100%;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 30px 80px -20px rgba(15,23,42,0.5);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: crm-surface-pop 200ms cubic-bezier(0.2, 0.9, 0.3, 1.05);
}
@keyframes crm-surface-pop {
  from { transform: translateY(8px) scale(0.985); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.crm-surface-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px;
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(180deg, #fafbfc, #fff);
}
.crm-surface-head-left { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.crm-surface-eyebrow {
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--brand-magenta);
}
.crm-surface-head-left h2 {
  font-size: 24px; line-height: 1.15;
  font-weight: 600; color: var(--text-strong);
  margin: 0;
}
.crm-surface-applicant-meta {
  display: flex; gap: 8px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--text-muted);
}

.crm-surface-head-right {
  display: flex; align-items: flex-start; gap: 16px;
  flex-shrink: 0;
}
.crm-surface-stage {
  display: flex; flex-direction: column; gap: 4px; align-items: flex-end;
  min-width: 220px;
}
.crm-surface-stage-eyebrow {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600;
}
.crm-surface-stage-pill {
  display: inline-block; padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  color: #fff;
  letter-spacing: 0.02em;
}
.crm-surface-stage-bar {
  width: 100%; height: 4px;
  background: var(--border-soft); border-radius: 4px;
  overflow: hidden; margin-top: 2px;
}
.crm-surface-stage-bar span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--brand-indigo), var(--brand-magenta));
  border-radius: 4px;
  transition: width 280ms ease-out;
}
.crm-surface-stage-pct { font-size: 10.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.crm-surface-close {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--border-soft); background: #fff;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); cursor: pointer;
  transition: background 120ms, color 120ms;
}
.crm-surface-close:hover { background: #f4f5f8; color: var(--text-strong); }

.crm-surface-mirror {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 28px;
  background: rgba(35,49,135,0.04);
  border-bottom: 1px solid rgba(35,49,135,0.08);
  font-size: 12.5px; color: var(--text-muted);
}
.crm-surface-mirror strong { color: var(--brand-indigo); font-weight: 600; }
.crm-surface-mirror-icon { color: var(--brand-indigo); font-size: 14px; }

.crm-surface-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 0;
  overflow: hidden;
}
.crm-surface-checklist {
  border-right: 1px solid var(--border-soft);
  padding: 18px 22px 28px;
  overflow-y: auto;
}
.crm-surface-audit {
  padding: 18px 22px 28px;
  overflow-y: auto;
  background: #fafbfc;
}
.crm-surface-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}
.crm-surface-section-head h3 {
  margin: 0; font-size: 13px; font-weight: 600;
  color: var(--text-strong);
  letter-spacing: 0.04em; text-transform: uppercase;
}
.crm-surface-section-head span { font-size: 11.5px; color: var(--text-muted); }

.crm-surface-steps {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column;
  gap: 4px;
}
.crm-surface-step {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 120ms, border-color 120ms;
}
.crm-surface-step:hover { background: rgba(35,49,135,0.03); }
.crm-surface-step.is-focused {
  background: #fff;
  border-color: rgba(229,3,102,0.35);
  box-shadow: 0 1px 0 rgba(229,3,102,0.06), 0 4px 16px -8px rgba(229,3,102,0.2);
}
.crm-surface-step-num {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
  background: var(--surface-2, #f1f3f7); color: var(--text-muted);
  border: 1.5px solid var(--border-soft);
  flex-shrink: 0;
}
.crm-surface-step-complete .crm-surface-step-num { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.crm-surface-step-active .crm-surface-step-num { background: rgba(35,49,135,0.08); color: var(--brand-indigo); border-color: rgba(35,49,135,0.3); }
.crm-surface-step-pending_approval .crm-surface-step-num {
  background: var(--brand-magenta); color: #fff;
  border-color: var(--brand-magenta);
  box-shadow: 0 0 0 3px rgba(229,3,102,0.18);
  animation: crm-tab-badge-pulse 2.4s ease-in-out infinite;
}

.crm-surface-step-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.crm-surface-step-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.crm-surface-step-label { font-size: 14px; font-weight: 600; color: var(--text-strong); }
.crm-surface-step-tag {
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 8px; border-radius: 999px;
  flex-shrink: 0;
}
.crm-surface-step-tag-complete { background: #ecfdf5; color: #047857; }
.crm-surface-step-tag-active { background: rgba(35,49,135,0.08); color: var(--brand-indigo); }
.crm-surface-step-tag-pending_approval { background: var(--brand-magenta); color: #fff; }
.crm-surface-step-tag-upcoming { background: var(--surface-2, #f1f3f7); color: var(--text-muted); }
.crm-surface-step-sub { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.crm-surface-step-meta { display: flex; gap: 8px; font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.crm-surface-step-actor {
  padding: 1px 7px; border-radius: 999px;
  background: var(--surface-2, #f1f3f7);
  font-size: 10.5px; font-weight: 500;
}
.crm-surface-step-actor-franchisee { background: rgba(35,49,135,0.08); color: var(--brand-indigo); }
.crm-surface-step-actor-corporate { background: rgba(229,3,102,0.08); color: var(--brand-magenta); }
.crm-surface-step-actor-joint { background: #f0f9ff; color: #0369a1; }
.crm-surface-step-gate { color: var(--brand-magenta); font-weight: 500; }

.crm-surface-audit-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column;
  gap: 12px;
  position: relative;
}
.crm-surface-audit-list::before {
  content: ''; position: absolute;
  left: 13px; top: 6px; bottom: 6px; width: 2px;
  background: var(--border-soft);
  border-radius: 2px;
}
.crm-surface-audit-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
}
.crm-surface-audit-icon {
  width: 28px; height: 28px; border-radius: 50%;
  background: #fff; border: 2px solid var(--border-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--text-muted);
  z-index: 1;
}
.crm-surface-audit-item.crm-audit-approved .crm-surface-audit-icon { color: #047857; border-color: #a7f3d0; background: #ecfdf5; }
.crm-surface-audit-item.crm-audit-returned .crm-surface-audit-icon { color: #b45309; border-color: #fde68a; background: #fffbeb; }
.crm-surface-audit-item.crm-audit-undone .crm-surface-audit-icon { color: var(--brand-magenta); border-color: rgba(229,3,102,0.3); background: rgba(229,3,102,0.06); }
.crm-surface-audit-item.crm-audit-submitted .crm-surface-audit-icon { color: #0e7490; border-color: #a5f3fc; background: #ecfeff; }
.crm-surface-audit-item.crm-audit-stage_changed .crm-surface-audit-icon { color: var(--brand-indigo); border-color: rgba(35,49,135,0.25); background: rgba(35,49,135,0.04); }
.crm-surface-audit-item.crm-audit-marked_lost .crm-surface-audit-icon { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }

.crm-surface-audit-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.crm-surface-audit-row1 { display: flex; align-items: baseline; gap: 8px; justify-content: space-between; }
.crm-surface-audit-row1 strong { font-size: 13px; color: var(--text-strong); font-weight: 600; }
.crm-surface-audit-row1 span { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.crm-surface-audit-target { font-size: 11.5px; color: var(--brand-indigo); font-weight: 500; }
.crm-surface-audit-detail { font-size: 12.5px; color: var(--text); line-height: 1.45; }
.crm-surface-audit-actor { font-size: 11px; color: var(--text-muted); font-style: italic; }

.crm-surface-audit-empty {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px;
  padding: 32px 20px;
  border-radius: 10px;
  background: #fff;
  border: 1px dashed var(--border-soft);
  text-align: center;
  color: var(--text-muted);
}
.crm-surface-audit-empty-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface-2, #f1f3f7);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-muted);
  margin-bottom: 4px;
}
.crm-surface-audit-empty strong { color: var(--text-strong); font-size: 13px; font-weight: 600; }
.crm-surface-audit-empty span { font-size: 12px; line-height: 1.5; }

/* Sticky action bar */
.crm-surface-actionbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 16px 28px;
  border-top: 1px solid var(--border-soft);
  background: #fff;
  flex-shrink: 0;
}
.crm-surface-actionbar-context { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.crm-surface-actionbar-eyebrow {
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-muted);
}
.crm-surface-actionbar-label { font-size: 14px; font-weight: 600; color: var(--text-strong); }
.crm-surface-actionbar-status { font-size: 12px; }
.crm-surface-actionbar-status .pending { color: var(--brand-magenta); font-weight: 500; }
.crm-surface-actionbar-status .complete { color: #047857; font-weight: 500; }
.crm-surface-actionbar-status .active { color: var(--brand-indigo); font-weight: 500; }
.crm-surface-actionbar-status .upcoming { color: var(--text-muted); }

.crm-surface-actionbar-cta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.crm-surface-actionbar-hint { font-size: 12px; color: var(--text-muted); font-style: italic; }
.crm-surface-complete-note { font-size: 12px; color: var(--text-muted); }

.crm-surface-return-pop {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(229,3,102,0.3);
  box-shadow: 0 4px 16px -6px rgba(229,3,102,0.25);
  min-width: 380px;
}
.crm-surface-return-pop strong { font-size: 13px; color: var(--text-strong); font-weight: 600; }
.crm-surface-return-pop span { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.crm-surface-return-pop textarea {
  width: 100%;
  font: inherit; font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  resize: vertical;
  outline: none;
}
.crm-surface-return-pop textarea:focus { border-color: var(--brand-magenta); }
.crm-surface-return-pop-btns { display: flex; gap: 6px; justify-content: flex-end; }

@media (max-width: 1100px) {
  .crm-surface-grid { grid-template-columns: 1fr; }
  .crm-surface-checklist { border-right: none; border-bottom: 1px solid var(--border-soft); }
  .crm-surface-actionbar { flex-direction: column; align-items: stretch; gap: 12px; }
  .crm-surface-return-pop { min-width: unset; }
}


/* ──────────────────────────────────────────────────────────
 * PendingAuditTrail — global, cross-applicant log on Pending Actions
 * ──────────────────────────────────────────────────────── */
.crm-pa-audit {
  margin-top: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 22px 24px 26px;
  display: flex; flex-direction: column; gap: 18px;
}
.crm-pa-audit-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
}
.crm-pa-audit-head h2 { margin: 4px 0 6px; font-size: 22px; color: var(--text-strong); letter-spacing: -0.01em; }
.crm-pa-audit-sub { font-size: 13px; color: var(--text-muted); line-height: 1.55; max-width: 720px; margin: 0; }
.crm-pa-audit-sub strong { color: var(--text-strong); font-weight: 600; }
.crm-pa-audit-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted); font-variant-numeric: tabular-nums;
  padding: 6px 12px; border: 1px solid var(--border-soft); border-radius: 999px;
  background: #fafbfc;
}

.crm-pa-audit-filters {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding-bottom: 16px; border-bottom: 1px solid var(--border-soft);
}
.crm-pa-audit-filter {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--border-soft); background: #fff;
  font-size: 12px; color: var(--text); font-weight: 500;
  cursor: pointer; transition: all 0.15s ease;
}
.crm-pa-audit-filter:hover { border-color: var(--brand-indigo); }
.crm-pa-audit-filter.on {
  background: var(--brand-indigo); color: #fff; border-color: var(--brand-indigo);
}
.crm-pa-audit-filter-n {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 18px; padding: 0 6px;
  border-radius: 9px;
  background: rgba(0,0,0,0.06); color: inherit;
  font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.crm-pa-audit-filter.on .crm-pa-audit-filter-n {
  background: rgba(255,255,255,0.2); color: #fff;
}
.crm-pa-audit-filter-spacer { flex: 1; }

.crm-pa-audit-empty {
  padding: 32px 16px; text-align: center;
  color: var(--text-muted); font-size: 13px;
  background: #fafbfc; border-radius: 10px;
}

.crm-pa-audit-groups { display: flex; flex-direction: column; gap: 22px; }
.crm-pa-audit-day { display: flex; flex-direction: column; gap: 12px; }
.crm-pa-audit-daymark {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border-soft);
}
.crm-pa-audit-daycount { font-weight: 400; letter-spacing: 0.04em; }

.crm-pa-audit-rail {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 4px;
  position: relative;
}
.crm-pa-audit-rail::before {
  content: ''; position: absolute;
  left: 17px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(to bottom, var(--border-soft), transparent);
  border-radius: 2px;
}

.crm-pa-audit-row {
  display: grid; grid-template-columns: 36px 1fr;
  gap: 12px; align-items: flex-start;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background 0.15s ease;
  position: relative;
}
.crm-pa-audit-row:hover { background: #fafbfc; }
.crm-pa-audit-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: #fff; border: 2px solid var(--border-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; line-height: 1;
  z-index: 1; flex-shrink: 0;
}
.crm-pa-audit-row.crm-pa-audit-approved .crm-pa-audit-icon { color: #047857; border-color: #a7f3d0; background: #ecfdf5; }
.crm-pa-audit-row.crm-pa-audit-returned .crm-pa-audit-icon { color: #b45309; border-color: #fde68a; background: #fffbeb; }
.crm-pa-audit-row.crm-pa-audit-undone .crm-pa-audit-icon { color: var(--brand-magenta); border-color: rgba(229,3,102,0.3); background: rgba(229,3,102,0.06); }
.crm-pa-audit-row.crm-pa-audit-submitted .crm-pa-audit-icon { color: #0e7490; border-color: #a5f3fc; background: #ecfeff; }
.crm-pa-audit-row.crm-pa-audit-stage_changed .crm-pa-audit-icon { color: var(--brand-indigo); border-color: rgba(35,49,135,0.25); background: rgba(35,49,135,0.04); }
.crm-pa-audit-row.crm-pa-audit-marked_lost .crm-pa-audit-icon { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
.crm-pa-audit-row.crm-pa-audit-restored .crm-pa-audit-icon { color: #047857; border-color: #a7f3d0; background: #ecfdf5; }

/* ──────────────── Stage Manager Modal ──────────────── */
.crm-modal-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 17, 22, 0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
  animation: crm-modal-fade 0.15s ease-out;
}
@keyframes crm-modal-fade { from { opacity: 0; } to { opacity: 1; } }
.crm-modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 80px);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.crm-modal-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.crm-modal-head h2 { margin: 0 0 4px; font-size: 18px; font-weight: 600; color: #111; }
.crm-modal-sub { margin: 0; font-size: 12px; color: #6b6f76; line-height: 1.5; max-width: 540px; }
.crm-modal-x {
  background: transparent; border: 0; cursor: pointer;
  padding: 6px; border-radius: 6px;
  color: #6b6f76;
}
.crm-modal-x:hover { background: #f3f4f6; color: #111; }
.crm-modal-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 24px;
  border-top: 1px solid var(--border-soft);
  background: #fafafa;
}

.crm-stagemgr-list {
  flex: 1; overflow-y: auto;
  padding: 12px 24px;
}
.crm-stagerow {
  display: grid;
  grid-template-columns: 12px 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #fff;
  margin-bottom: 6px;
}
.crm-stagerow-system { background: #fafafa; }
.crm-stagerow-custom { border-color: #d1d5db; }
.crm-stagerow-dot { width: 10px; height: 10px; border-radius: 50%; }
.crm-stagerow-body { min-width: 0; }
.crm-stagerow-title { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.crm-stagerow-title strong { color: #111; }
.crm-stagerow-lock {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 500;
  color: #6b6f76;
  background: #eef0f3;
  padding: 2px 6px; border-radius: 4px;
}
.crm-stagerow-input {
  font-size: 13px; font-weight: 600; color: #111;
  border: 1px solid transparent;
  background: transparent;
  padding: 3px 6px; border-radius: 4px;
  width: 100%; max-width: 220px;
}
.crm-stagerow-input:hover, .crm-stagerow-input:focus {
  border-color: #d1d5db; background: #fff; outline: none;
}
.crm-stagerow-sub { font-size: 11px; color: #8a8e95; margin-top: 2px; }
.crm-stagerow-subinput {
  font-size: 11px; color: #6b6f76;
  border: 1px solid transparent;
  background: transparent;
  padding: 2px 6px; border-radius: 4px;
  width: 100%; max-width: 280px;
}
.crm-stagerow-subinput:hover, .crm-stagerow-subinput:focus {
  border-color: #d1d5db; background: #fff; outline: none;
}
.crm-stagerow-meta { font-size: 11px; color: #6b6f76; }
.crm-stagerow-count {
  background: #f1f3f5; padding: 2px 8px; border-radius: 10px;
}
.crm-stagerow-actions { display: flex; align-items: center; gap: 10px; }
.crm-stagerow-swatches { display: flex; gap: 3px; }
.crm-stagerow-swatch {
  width: 16px; height: 16px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.1);
  cursor: pointer;
  padding: 0;
}
.crm-stagerow-swatch.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--brand-magenta); }
.crm-stagerow-del { color: #b91c1c !important; }
.crm-stagerow-del:disabled { color: #d1d5db !important; cursor: not-allowed; }
.crm-stagerow-insert {
  display: flex; justify-content: center;
  margin: 2px 0;
}
.crm-stagerow-insert-btn {
  font-size: 10px; color: #8a8e95;
  background: transparent; border: 1px dashed transparent;
  padding: 3px 10px; border-radius: 4px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  opacity: 0;
  transition: opacity 0.15s, border-color 0.15s, color 0.15s;
}
.crm-stagerow-insert:hover .crm-stagerow-insert-btn,
.crm-stagerow-insert-btn:hover {
  opacity: 1; border-color: #d1d5db; color: var(--brand-magenta);
}
.crm-stagemgr-error {
  margin: 0 24px 12px;
  padding: 10px 14px;
  background: #fef2f2; border: 1px solid #fecaca;
  border-radius: 6px;
  font-size: 12px; color: #b91c1c;
}
.crm-kcol-custom {
  font-size: 8px; color: var(--brand-magenta);
  margin-left: 4px;
}

.crm-pa-audit-row-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.crm-pa-audit-row1 { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.crm-pa-audit-row1 strong { font-size: 13.5px; color: var(--text-strong); font-weight: 600; }
.crm-pa-audit-target {
  font-size: 11.5px; color: var(--text-muted);
  padding: 2px 8px; background: #f3f5f7;
  border-radius: 4px; font-family: ui-monospace, monospace;
}
.crm-pa-audit-detail { font-size: 12.5px; color: var(--text); line-height: 1.5; }
.crm-pa-audit-meta-row {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 11px; color: var(--text-muted);
}
.crm-pa-audit-applicant { color: var(--brand-indigo); font-weight: 600; }
.crm-pa-audit-archived {
  margin-left: 4px; padding: 1px 7px;
  font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase;
  background: #f3f5f7; color: #6b7280;
  border-radius: 3px; font-weight: 600;
}

.crm-pa-audit-loadmore { display: flex; justify-content: center; padding-top: 4px; }

/* ─── Inline undo on approved audit rows ─── */
.crm-pa-audit-row.crm-pa-audit-approval_undone .crm-pa-audit-icon {
  color: var(--brand-magenta); border-color: rgba(229,3,102,0.3); background: rgba(229,3,102,0.06);
}
.crm-pa-audit-actions { margin-top: 6px; }
.crm-pa-audit-undo-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  font-size: 11.5px; font-weight: 600;
  color: var(--brand-magenta);
  background: #fff;
  border: 1px solid rgba(229,3,102,0.32);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}
.crm-pa-audit-undo-btn:hover {
  background: rgba(229,3,102,0.06);
  border-color: rgba(229,3,102,0.55);
}
.crm-pa-audit-undopop {
  margin-top: 8px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(229,3,102,0.05), rgba(229,3,102,0.01));
  border: 1px solid rgba(229,3,102,0.32);
  border-radius: 8px;
  display: flex; flex-direction: column; gap: 8px;
}
.crm-pa-audit-undopop strong { font-size: 13px; color: var(--brand-magenta); font-weight: 600; }
.crm-pa-audit-undopop > span { font-size: 12px; color: var(--text); line-height: 1.5; }
.crm-pa-audit-undopop textarea {
  width: 100%;
  padding: 8px 10px;
  font-size: 12px; font-family: inherit;
  color: var(--text-strong);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  resize: vertical; min-height: 44px;
}
.crm-pa-audit-undopop textarea:focus {
  outline: none;
  border-color: var(--brand-magenta);
  box-shadow: 0 0 0 3px rgba(229,3,102,0.12);
}
.crm-pa-audit-undopop-btns { display: flex; justify-content: flex-end; gap: 8px; }

/* ─── Drawer pending bar (top of drawer when there are pending approvals) ─── */
.crm-drawer-pendingbar {
  display: flex; align-items: center; gap: 12px;
  margin: 0 22px 14px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(229,3,102,0.08), rgba(229,3,102,0.02));
  border: 1px solid rgba(229,3,102,0.28);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  width: calc(100% - 44px);
  transition: background 120ms ease, border-color 120ms ease;
}
.crm-drawer-pendingbar:hover {
  background: linear-gradient(135deg, rgba(229,3,102,0.12), rgba(229,3,102,0.04));
  border-color: rgba(229,3,102,0.45);
}
.crm-drawer-pendingbar-pulse {
  width: 10px; height: 10px; flex-shrink: 0; position: relative;
}
.crm-drawer-pendingbar-pulse span {
  position: absolute; inset: 0;
  background: var(--brand-magenta); border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(229,3,102,0.55);
  animation: crmDrawerPendingPulse 1.6s ease-out infinite;
}
@keyframes crmDrawerPendingPulse {
  0%   { box-shadow: 0 0 0 0 rgba(229,3,102,0.55); }
  70%  { box-shadow: 0 0 0 12px rgba(229,3,102,0); }
  100% { box-shadow: 0 0 0 0 rgba(229,3,102,0); }
}
.crm-drawer-pendingbar-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.crm-drawer-pendingbar-body strong { font-size: 13px; color: var(--text-strong); font-weight: 600; }
.crm-drawer-pendingbar-body span { font-size: 11.5px; color: var(--brand-magenta); font-weight: 500; }
.crm-drawer-pendingbar-count {
  flex-shrink: 0;
  min-width: 24px; height: 24px; padding: 0 7px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-magenta); color: #fff;
  font-size: 12px; font-weight: 700; border-radius: 12px;
}

/* ─── Drawer tab dot (count next to "Onboarding" tab) ─── */
.crm-drawer-tabs button { position: relative; }
.crm-drawer-tab-dot {
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 6px;
  min-width: 16px; height: 16px; padding: 0 5px;
  background: var(--brand-magenta); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1;
  border-radius: 9px;
  vertical-align: middle;
  transform: translateY(-1px);
}

/* ─── Drawer Onboarding tab — merged ladder + artifacts ─── */
.crm-onbtab { padding: 18px 22px 32px; }

.crm-onbtab-header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  margin-bottom: 16px;
}
.crm-onbtab-eyebrow {
  font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 4px;
}
.crm-onbtab-header strong { font-size: 13px; color: var(--text-strong); font-weight: 500; line-height: 1.45; }

.crm-onbtab-steps {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column;
}
.crm-onbtab-step {
  display: flex; gap: 14px;
  padding: 0 0 8px 0;
  position: relative;
}
.crm-onbtab-step-rail {
  display: flex; flex-direction: column; align-items: center;
  flex-shrink: 0; width: 28px;
}
.crm-onbtab-step-num {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  background: #fff; border: 2px solid var(--border); color: var(--text-muted);
  z-index: 1;
}
.crm-onbtab-step-spine {
  flex: 1; width: 2px; background: var(--border); margin: 4px 0;
}
.crm-onbtab-step-complete .crm-onbtab-step-num { background: var(--brand-indigo); border-color: var(--brand-indigo); color: #fff; }
.crm-onbtab-step-active .crm-onbtab-step-num   { background: #fff; border-color: var(--brand-magenta); color: var(--brand-magenta); }
.crm-onbtab-step-pending_approval .crm-onbtab-step-num {
  background: var(--brand-magenta); border-color: var(--brand-magenta); color: #fff;
}
.crm-onbtab-step-upcoming .crm-onbtab-step-num { background: #fff; border-color: var(--border); color: #b8becc; }

.crm-onbtab-step-body { flex: 1; min-width: 0; padding-bottom: 14px; }
.crm-onbtab-step-row {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  margin-bottom: 8px;
}
.crm-onbtab-step-label {
  font-size: 14px; font-weight: 600; color: var(--text-strong);
  display: inline-flex; align-items: center; gap: 8px;
}
.crm-onbtab-step-reddot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand-magenta);
  box-shadow: 0 0 0 0 rgba(229,3,102,0.55);
  animation: crmDrawerPendingPulse 1.6s ease-out infinite;
  display: inline-block;
}
.crm-onbtab-step-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.crm-onbtab-step-tag {
  flex-shrink: 0;
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em;
  border-radius: 4px;
  white-space: nowrap;
}
.crm-onbtab-step-tag-complete         { background: #ecfdf5; color: #047857; }
.crm-onbtab-step-tag-active           { background: rgba(229,3,102,0.08); color: var(--brand-magenta); }
.crm-onbtab-step-tag-pending_approval { background: var(--brand-magenta); color: #fff; }
.crm-onbtab-step-tag-upcoming         { background: #f5f6fa; color: #8b92a4; }

/* Artifacts list per step */
.crm-onbtab-artifacts {
  list-style: none; padding: 0; margin: 0 0 8px 0;
  display: flex; flex-direction: column;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #fafbfc;
  overflow: hidden;
}
.crm-onbtab-artifact {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-soft);
}
.crm-onbtab-artifact:last-child { border-bottom: 0; }
.crm-onbtab-art-icon {
  width: 24px; height: 24px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--border-soft); border-radius: 5px;
  font-size: 11px; font-weight: 700; color: var(--text-muted);
}
.crm-onbtab-art-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.crm-onbtab-art-name { font-size: 12.5px; color: var(--text-strong); font-weight: 500; line-height: 1.3; }
.crm-onbtab-art-src { font-size: 10.5px; color: var(--text-muted); display: inline-flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.crm-onbtab-art-kind {
  font-size: 9.5px; letter-spacing: 0.05em; text-transform: uppercase;
  background: #eef0f5; color: #6b7280;
  padding: 1px 5px; border-radius: 3px; font-weight: 600;
}
.crm-onbtab-art-status {
  flex-shrink: 0;
  font-size: 10.5px; font-weight: 600;
  padding: 3px 8px; border-radius: 4px;
  text-transform: capitalize;
}
.crm-onbtab-art-st-pending,
.crm-onbtab-art-st-not-sent,
.crm-onbtab-art-st-awaiting,
.crm-onbtab-art-st-open       { background: #f5f6fa; color: #8b92a4; }
.crm-onbtab-art-st-sent,
.crm-onbtab-art-st-in-window,
.crm-onbtab-art-st-in-review,
.crm-onbtab-art-st-in-progress{ background: rgba(229,3,102,0.08); color: var(--brand-magenta); }
.crm-onbtab-art-st-signed,
.crm-onbtab-art-st-issued,
.crm-onbtab-art-st-acknowledged,
.crm-onbtab-art-st-cleared,
.crm-onbtab-art-st-committed,
.crm-onbtab-art-st-complete,
.crm-onbtab-art-st-received,
.crm-onbtab-art-st-on-file,
.crm-onbtab-art-st-booked     { background: #ecfdf5; color: #047857; }
.crm-onbtab-art-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* Inline action bar for pending steps */
.crm-onbtab-actionbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(229,3,102,0.06), rgba(229,3,102,0.02));
  border: 1px solid rgba(229,3,102,0.25);
  border-radius: 8px;
}
.crm-onbtab-actionbar-msg { font-size: 12px; color: var(--text-strong); flex: 1; min-width: 0; }
.crm-onbtab-actionbar-msg strong { color: var(--brand-magenta); font-weight: 600; }
.crm-onbtab-actionbar-msg span { color: var(--text-muted); font-weight: 400; }
.crm-onbtab-actionbar-btns { display: flex; gap: 6px; flex-shrink: 0; }

.crm-onbtab-returnpop {
  padding: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  display: flex; flex-direction: column; gap: 8px;
}
.crm-onbtab-returnpop strong { font-size: 12.5px; color: #b45309; font-weight: 600; }
.crm-onbtab-returnpop textarea {
  width: 100%; resize: vertical;
  border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 10px; font-size: 12.5px; font-family: inherit;
  background: #fff;
  box-sizing: border-box;
}
.crm-onbtab-returnpop textarea:focus { outline: none; border-color: var(--brand-magenta); box-shadow: 0 0 0 3px rgba(229,3,102,0.1); }
.crm-onbtab-returnpop-btns { display: flex; justify-content: flex-end; gap: 6px; }


/* ─────────────────────────────────────────────────────────
   CFA viewer modal — full DocuSign-style envelope viewer
   ───────────────────────────────────────────────────────── */
.cfa-modal-wrap{
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15,21,30,0.62);
  backdrop-filter: blur(4px);
  display: flex; align-items: stretch; justify-content: center;
  padding: 24px;
  animation: cfaFadeIn 160ms ease-out;
}
@keyframes cfaFadeIn { from { opacity: 0 } to { opacity: 1 } }
.cfa-modal{
  width: min(960px, 100%);
  background: #f3f5f7;
  border-radius: 12px;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.32);
  animation: cfaSlideIn 200ms ease-out;
}
@keyframes cfaSlideIn { from { transform: translateY(8px); opacity: 0.6 } to { transform: none; opacity: 1 } }

/* Chrome */
.cfa-modal-chrome{
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-shrink: 0;
}
.cfa-chrome-left{ display: flex; align-items: center; gap: 14px; }
.cfa-chrome-logo{
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 13px; color: #475569;
}
.cfa-chrome-logo-mark{
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  background: linear-gradient(135deg, #ffd400 0%, #ffb800 100%);
  color: #2c2a1a; font-weight: 700; font-size: 11px; letter-spacing: 0.02em;
}
.cfa-chrome-divider{ width: 1px; height: 24px; background: var(--border); }
.cfa-chrome-meta{ font-size: 12px; line-height: 1.3; }
.cfa-chrome-name{ font-weight: 600; color: var(--text-strong); font-size: 13px; }
.cfa-chrome-env{ color: var(--text-muted); font-family: ui-monospace, monospace; font-size: 11px; }
.cfa-chrome-right{ display: flex; align-items: center; gap: 10px; }
.cfa-chrome-status{
  font-size: 11px; padding: 4px 10px; border-radius: 999px;
  font-weight: 600; letter-spacing: 0.02em;
}
.cfa-chrome-status-signed{ background: rgba(22,163,74,0.10); color: #15803d; }
.cfa-chrome-status-pending{ background: rgba(234,179,8,0.12); color: #a16207; }

/* Audit ribbon */
.cfa-modal-audit{
  background: #eef2f6;
  border-bottom: 1px solid var(--border);
  padding: 8px 20px;
  display: flex; gap: 24px; flex-wrap: wrap;
  font-size: 11px; color: #475569;
  flex-shrink: 0;
}
.cfa-modal-audit strong{
  color: #1e293b; font-weight: 600; margin-right: 6px;
  text-transform: uppercase; letter-spacing: 0.06em; font-size: 10px;
}

/* Doc body */
.cfa-modal-doc{
  flex: 1; overflow-y: auto;
  padding: 20px;
  display: flex; flex-direction: column; gap: 18px;
}
.cfa-page{
  background: #ffffff;
  border-radius: 8px;
  padding: 36px 44px;
  box-shadow: 0 1px 3px rgba(15,23,42,0.06), 0 4px 12px rgba(15,23,42,0.04);
  font-family: 'Times New Roman', Georgia, serif;
  color: #1e293b;
}
.cfa-page-head{
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 24px;
  border-bottom: 2px solid #1e293b;
  padding-bottom: 14px;
  margin-bottom: 22px;
}
.cfa-page-eyebrow{
  font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif);
  font-size: 10px; letter-spacing: 0.10em; text-transform: uppercase;
  color: #64748b; margin-bottom: 6px;
}
.cfa-page-title{
  font-size: 22px; font-weight: 700; line-height: 1.15; color: #0f172a;
  margin: 0;
}
.cfa-page-sub{
  font-size: 12px; color: #475569; margin: 6px 0 0;
  font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif);
  line-height: 1.4;
}
.cfa-page-pageno{
  font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif);
  font-size: 11px; color: #64748b; white-space: nowrap;
}

.cfa-section{ margin-bottom: 22px; }
.cfa-section:last-child{ margin-bottom: 0; }
.cfa-h2{
  font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: #0f172a; margin: 0 0 12px;
  padding-bottom: 6px; border-bottom: 1px solid #cbd5e1;
}

.cfa-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 28px;
  font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif);
}
.cfa-field-multi{ grid-column: 1 / -1; margin-top: 12px; }
.cfa-field-label{
  font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: #64748b; margin-bottom: 3px;
}
.cfa-field-value{
  font-size: 13px; color: #0f172a;
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 4px;
  min-height: 20px;
  font-weight: 500;
}
.cfa-field-mono{ font-family: ui-monospace, monospace; letter-spacing: 0.03em; }
.cfa-field-multi .cfa-field-value{
  border-bottom: none;
  background: #f8fafc;
  padding: 10px 12px;
  border-radius: 4px;
  font-weight: 400;
  line-height: 1.5;
  font-size: 12px;
}

/* PFS summary */
.cfa-pfs-summary{
  font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif);
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 14px 18px;
}
.cfa-pfs-summary-row{
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0;
  font-size: 13px; color: #1e293b;
  border-bottom: 1px dashed #e2e8f0;
}
.cfa-pfs-summary-row:last-child{ border-bottom: none; }
.cfa-pfs-summary-row strong{ font-weight: 600; }
.cfa-pfs-summary-total{
  margin-top: 4px; padding-top: 10px;
  border-top: 2px solid #1e293b !important;
  border-bottom: none !important;
  font-size: 14px;
}
.cfa-pfs-summary-total strong{
  font-size: 18px; color: var(--brand-magenta);
}

/* Tables */
.cfa-tbl{
  font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif);
  width: 100%; border-collapse: collapse;
  font-size: 12px;
}
.cfa-tbl th{
  text-align: left;
  padding: 8px 10px;
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: #475569; font-weight: 600;
  background: #f1f5f9;
  border-bottom: 1px solid #cbd5e1;
}
.cfa-tbl th:last-child{ text-align: right; }
.cfa-tbl td{
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}
.cfa-tbl td:last-child{ text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.cfa-tbl tbody tr:last-child td{ border-bottom: none; }

/* Disclosures */
.cfa-p{
  font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif);
  font-size: 12px; color: #334155; line-height: 1.55;
  margin: 0 0 12px;
}
.cfa-checks{
  font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif);
  display: flex; flex-direction: column; gap: 8px;
}
.cfa-check{ display: flex; align-items: center; gap: 10px; font-size: 12px; color: #1e293b; }
.cfa-check-box{
  width: 16px; height: 16px;
  border: 1.5px solid #94a3b8;
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.cfa-check-on{
  background: var(--brand-magenta);
  border-color: var(--brand-magenta);
  color: white;
}

/* Signatures */
.cfa-sig-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 6px;
}
.cfa-sig{ font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif); }
.cfa-sig-label{
  font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: #64748b; margin-bottom: 8px;
}
.cfa-sig-line{
  border-bottom: 2px solid #1e293b;
  height: 56px;
  display: flex; align-items: center;
  padding: 0 8px;
  position: relative;
}
.cfa-sig-mark{
  font-family: 'Brush Script MT', 'Lucida Handwriting', cursive;
  font-size: 30px;
  color: #0d4f8b;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.02em;
  transform: rotate(-2deg);
}
.cfa-sig-mark-2{ font-size: 26px; transform: rotate(-1deg); color: #4a148c; }
.cfa-sig-placeholder{
  font-style: italic; color: #94a3b8; font-size: 12px;
}
.cfa-sig-signed{
  background: linear-gradient(180deg, transparent 0%, rgba(13,79,139,0.04) 100%);
}
.cfa-sig-meta{
  display: flex; justify-content: space-between;
  margin-top: 8px;
  font-size: 11px; color: #475569;
}
.cfa-sig-stamp{
  display: inline-block;
  margin-top: 8px;
  padding: 3px 8px;
  background: rgba(22,163,74,0.10);
  color: #15803d;
  border: 1px solid rgba(22,163,74,0.25);
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 3px;
}
.cfa-fineprint{
  font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif);
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px dashed #cbd5e1;
  font-size: 11px; color: #64748b; font-style: italic;
}

/* Footer */
.cfa-modal-foot{
  background: #ffffff;
  border-top: 1px solid var(--border);
  padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-shrink: 0;
}
.cfa-modal-foot-meta{ font-size: 11px; color: var(--text-muted); }
.cfa-modal-foot-meta code{ font-family: ui-monospace, monospace; font-size: 11px; color: #475569; }
.cfa-modal-foot-actions{ display: flex; gap: 8px; }

/* CFA View button — distinct from plain eye icon */
.crm-doc-btn-cfa{
  width: auto !important;
  padding: 0 8px !important;
  height: 22px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  background: rgba(229,3,102,0.08) !important;
  border-color: rgba(229,3,102,0.25) !important;
  color: var(--brand-magenta) !important;
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
}
.crm-doc-btn-cfa:hover{
  background: rgba(229,3,102,0.14) !important;
  border-color: var(--brand-magenta) !important;
}

/* Delete-lead link in drawer drop row */
.crm-drop-link-delete{
  color: #b91c1c !important;
  margin-left: auto;
}
.crm-drop-link-delete:hover{
  background: rgba(185,28,28,0.08) !important;
}
.crm-droprow-delete{
  background: rgba(185,28,28,0.05) !important;
  border-color: rgba(185,28,28,0.25) !important;
}
.crm-droprow-delete strong{ color: #b91c1c; }


/* === Build-Out (Stage 2) === */
/* buildout.css — Stage 2 Build-Out module
   Used by both Franchisee Portal and Sales Pipeline CRM.
   Matches True REST sober editorial aesthetic with magenta accents. */

/* ──────────── Shell ──────────── */
.bo-shell{
  padding: 32px 40px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ──────────── Header ──────────── */
.bo-header{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.bo-header-eyebrow{
  font-size: 10px; letter-spacing: 0.12em;
  color: var(--brand-magenta); font-weight: 600;
  margin-bottom: 6px; text-transform: uppercase;
}
.bo-header-title{
  font-size: 26px; font-weight: 600;
  color: var(--text-strong); margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.bo-header-meta{
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  font-size: 12px; color: var(--text-muted);
  margin-top: 4px;
}
.bo-header-meta strong{ color: var(--text-strong); font-weight: 600; }
.bo-sep{ color: var(--border); }

.bo-header-corp{ background: linear-gradient(180deg, rgba(229,3,102,0.025) 0%, transparent 100%); padding: 20px 16px; border-radius: 6px; }

/* ──────────── Days-to-open countdown ──────────── */
.bo-countdown{
  text-align: center;
  padding: 12px 22px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  min-width: 120px;
}
.bo-countdown-num{
  font-size: 36px; font-weight: 700;
  color: var(--brand-magenta);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.bo-countdown-label{
  font-size: 10px; letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
}
.bo-countdown-target{
  font-size: 11px; color: var(--text-muted);
  margin-top: 4px;
}

/* ──────────── Progress band ──────────── */
.bo-progress-band{
  margin-bottom: 24px;
  padding: 12px 0;
}
.bo-progress-bar{
  height: 6px; background: var(--surface-tint);
  border-radius: 999px; overflow: hidden;
  margin-bottom: 8px;
}
.bo-progress-fill{
  height: 100%;
  background: linear-gradient(90deg, var(--brand-magenta), #ff4585);
  transition: width 400ms ease;
}
.bo-progress-meta{
  font-size: 12px; color: var(--text-muted);
}
.bo-progress-meta strong{ color: var(--text-strong); }

/* ──────────── Stall banner ──────────── */
.bo-stall-banner{
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: rgba(185,28,28,0.05);
  border: 1px solid rgba(185,28,28,0.20);
  border-radius: 6px;
  margin-bottom: 18px;
  font-size: 13px;
  color: #7f1d1d;
}
.bo-stall-banner strong{ color: #b91c1c; }

/* ──────────── Two-pane grid ──────────── */
.bo-grid{
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 28px;
  align-items: start;
}
.bo-grid-left{ position: sticky; top: 16px; }
.bo-grid-right{ display: flex; flex-direction: column; gap: 16px; }

/* ──────────── Roadmap ──────────── */
.bo-roadmap{
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 0;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}
.bo-roadmap-phase{ padding: 6px 0; }
.bo-roadmap-phase-name{
  font-size: 9.5px; letter-spacing: 0.12em;
  color: var(--text-muted); font-weight: 700;
  text-transform: uppercase;
  padding: 8px 18px 6px;
  border-top: 1px solid var(--border);
  background: var(--surface-tint);
}
.bo-roadmap-phase:first-child .bo-roadmap-phase-name{ border-top: none; }

.bo-mile{
  width: 100%;
  display: flex; gap: 14px;
  padding: 10px 18px 6px;
  background: transparent; border: none;
  text-align: left; cursor: pointer;
  font: inherit; color: inherit;
  transition: background 120ms ease;
  position: relative;
}
.bo-mile:hover{ background: var(--surface-tint); }
.bo-mile-sel{ background: rgba(229,3,102,0.04) !important; }
.bo-mile-sel::before{
  content: ''; position: absolute;
  left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--brand-magenta);
}

.bo-mile-rail{
  display: flex; flex-direction: column; align-items: center;
  flex-shrink: 0;
}
.bo-mile-dot{
  width: 22px; height: 22px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  background: #fff;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  z-index: 1;
}
.bo-mile-line{
  flex: 1;
  width: 1.5px;
  background: var(--border);
  margin-top: 2px;
  min-height: 14px;
}
.bo-mile:last-child .bo-mile-line{ display: none; }

/* state coloring of the dot */
.bo-mile-complete .bo-mile-dot{
  background: var(--brand-magenta);
  border-color: var(--brand-magenta);
  color: #fff;
}
.bo-mile-complete .bo-mile-line{ background: var(--brand-magenta); opacity: 0.5; }
.bo-mile-in_progress .bo-mile-dot{
  border-color: var(--brand-magenta);
  background: rgba(229,3,102,0.10);
  color: var(--brand-magenta);
}
.bo-mile-in_progress .bo-mile-spin{
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--brand-magenta);
  animation: boSpin 1.4s ease-in-out infinite;
}
@keyframes boSpin{ 0%,100%{opacity:0.4; transform:scale(0.8)} 50%{opacity:1; transform:scale(1.05)} }
.bo-mile-pending_approval .bo-mile-dot{
  border-color: #d97706;
  background: rgba(217,119,6,0.10);
  color: #d97706;
}
.bo-mile-blocked .bo-mile-dot{
  border-color: #b91c1c;
  background: rgba(185,28,28,0.10);
  color: #b91c1c;
}
.bo-mile-locked .bo-mile-dot{
  background: var(--surface-tint);
  border-style: dashed;
  color: #94a3b8;
}

.bo-mile-body{ flex: 1; padding-bottom: 8px; min-width: 0; }
.bo-mile-title{
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 4px;
}
.bo-mile-n{
  font-size: 10px; font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.bo-mile-label{
  font-size: 13px; font-weight: 500;
  color: var(--text-strong);
  flex: 1;
  text-wrap: pretty;
}
.bo-mile-locked .bo-mile-label{ color: var(--text-muted); }
.bo-mile-approval-tag{
  font-size: 10px; color: var(--brand-magenta);
  font-weight: 700;
}

.bo-mile-meta{
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  font-size: 11px; color: var(--text-muted);
}
.bo-mile-date{ font-variant-numeric: tabular-nums; }

/* ──────────── Status pill ──────────── */
.bo-pill{
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
}
.bo-pill-muted{ background: var(--surface-tint); color: var(--text-muted); }
.bo-pill-progress{ background: rgba(229,3,102,0.08); color: var(--brand-magenta); border-color: rgba(229,3,102,0.20); }
.bo-pill-pending{ background: rgba(217,119,6,0.10); color: #b45309; border-color: rgba(217,119,6,0.25); }
.bo-pill-complete{ background: rgba(16,185,129,0.10); color: #047857; border-color: rgba(16,185,129,0.25); }
.bo-pill-blocked{ background: rgba(185,28,28,0.08); color: #b91c1c; border-color: rgba(185,28,28,0.25); }

/* ──────────── Detail card ──────────── */
.bo-detail{
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 22px 24px;
}
.bo-detail-head{ margin-bottom: 14px; }
.bo-detail-eyebrow{
  font-size: 10px; letter-spacing: 0.10em;
  color: var(--text-muted); font-weight: 600;
  text-transform: uppercase; margin-bottom: 6px;
}
.bo-detail-title{
  font-size: 19px; font-weight: 600;
  color: var(--text-strong); margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.bo-detail-status-row{
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.bo-detail-typical{ font-size: 11px; color: var(--text-muted); }
.bo-detail-desc{
  font-size: 13px; color: var(--text-strong);
  line-height: 1.55; margin: 0 0 16px;
  text-wrap: pretty;
}
.bo-detail-notes{
  background: rgba(229,3,102,0.03);
  border-left: 2px solid var(--brand-magenta);
  padding: 10px 12px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-strong);
  border-radius: 0 4px 4px 0;
}
.bo-detail-notes-label{
  font-size: 9.5px; letter-spacing: 0.10em;
  color: var(--brand-magenta);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.bo-detail-section{ margin-bottom: 16px; }
.bo-detail-section-label{
  font-size: 10px; letter-spacing: 0.10em;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.bo-detail-deliverables{
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.bo-detail-deliverables li{
  font-size: 13px; color: var(--text-strong);
  display: flex; align-items: center; gap: 8px;
}
.bo-detail-deliverables li::before{
  content: '·';
  font-size: 18px; line-height: 0;
  color: var(--text-muted);
}
.bo-detail-vendors{
  display: flex; flex-direction: column; gap: 8px;
}
.bo-detail-vendor{
  background: var(--surface-tint);
  border-radius: 4px;
  padding: 10px 12px;
}
.bo-detail-vendor-name{
  font-size: 13px; font-weight: 600;
  color: var(--text-strong);
}
.bo-vendor-pref{
  display: inline-block;
  margin-left: 6px;
  background: rgba(229,3,102,0.10);
  color: var(--brand-magenta);
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 3px;
}
.bo-detail-vendor-meta{
  font-size: 11px; color: var(--text-muted);
  margin-top: 2px;
}
.bo-detail-vendor-contact{
  font-size: 11px; color: var(--text-muted);
  margin-top: 2px;
  font-family: ui-monospace, monospace;
}
.bo-detail-actions{
  display: flex; gap: 8px; flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}
.bo-detail-await{
  font-size: 12px; color: var(--text-muted);
  font-style: italic;
}

/* ──────────── Card (DM, docs, activity) ──────────── */
.bo-card{
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.bo-card-head{
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-tint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-strong);
  text-transform: uppercase;
}
.bo-card-body{ padding: 14px 16px; }
.bo-empty{
  padding: 14px;
  font-size: 12px; color: var(--text-muted);
  font-style: italic;
  text-align: center;
}

/* ──────────── DM ──────────── */
.bo-dm{
  display: flex; flex-direction: column; gap: 10px;
  max-height: 320px; overflow-y: auto;
}
.bo-dm-row{
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
}
.bo-dm-corp{
  background: var(--surface-tint);
  align-self: flex-start;
  max-width: 88%;
}
.bo-dm-them{
  background: rgba(229,3,102,0.05);
  align-self: flex-end;
  max-width: 88%;
  border: 1px solid rgba(229,3,102,0.15);
}
.bo-dm-who{
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.bo-dm-text{ color: var(--text-strong); }
.bo-dm-compose{
  display: flex; gap: 8px;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}
.bo-dm-compose .form-input{ flex: 1; font-size: 13px; }

/* ──────────── Docs ──────────── */
.bo-doc-list{
  display: flex; flex-direction: column;
}
.bo-doc-row{
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.bo-doc-row:last-child{ border-bottom: none; }
.bo-doc-icon{
  width: 28px; height: 32px;
  background: var(--surface-tint);
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}
.bo-doc-info{ flex: 1; min-width: 0; }
.bo-doc-name{
  font-size: 13px; font-weight: 500;
  color: var(--text-strong);
  display: flex; align-items: center; gap: 6px;
}
.bo-doc-current{
  background: rgba(16,185,129,0.10);
  color: #047857;
  font-size: 9px; font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.04em;
}
.bo-doc-meta{
  font-size: 11px; color: var(--text-muted);
  margin-top: 2px;
}

/* ──────────── Activity ──────────── */
.bo-activity{
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 12px;
  max-height: 380px; overflow-y: auto;
}
.bo-act{
  display: flex; gap: 10px;
  font-size: 12px;
}
.bo-act-dot{
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--text-muted);
  margin-top: 5px;
  flex-shrink: 0;
}
.bo-act-milestone .bo-act-dot{ background: var(--brand-magenta); }
.bo-act-submitted .bo-act-dot{ background: #d97706; }
.bo-act-returned .bo-act-dot{ background: #b91c1c; }
.bo-act-text{ color: var(--text-strong); line-height: 1.4; }
.bo-act-text strong{ font-weight: 600; }
.bo-act-ts{
  font-size: 10px; color: var(--text-muted);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* ──────────── KPI band (franchisor cohort) ──────────── */
.bo-kpi-band{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.bo-kpi{
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 18px;
}
.bo-kpi-num{
  font-size: 30px; font-weight: 700;
  color: var(--text-strong);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.bo-kpi-label{
  font-size: 11px; color: var(--text-muted);
  margin-top: 6px;
  letter-spacing: 0.02em;
}
.bo-kpi-pending{
  border-color: rgba(217,119,6,0.30);
  background: rgba(217,119,6,0.04);
}
.bo-kpi-pending .bo-kpi-num{ color: #b45309; }
.bo-kpi-blocked{
  border-color: rgba(185,28,28,0.25);
  background: rgba(185,28,28,0.03);
}
.bo-kpi-blocked .bo-kpi-num{ color: #b91c1c; }

/* ──────────── Cohort table ──────────── */
.bo-cohort{
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.bo-cohort-head{
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.bo-cohort-head h3{
  margin: 0;
  font-size: 14px; font-weight: 600;
  color: var(--text-strong);
}
.bo-cohort-legend{
  display: flex; gap: 14px;
  font-size: 11px; color: var(--text-muted);
}
.bo-leg{
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 999px;
  margin-right: 4px;
  vertical-align: middle;
}
.bo-leg-progress{ background: var(--brand-magenta); }
.bo-leg-pending{ background: #d97706; }
.bo-leg-blocked{ background: #b91c1c; }

.bo-cohort-table{
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.bo-cohort-table th{
  text-align: left;
  padding: 10px 16px;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  background: var(--surface-tint);
}
.bo-cohort-row{
  cursor: pointer;
  transition: background 120ms ease;
}
.bo-cohort-row:hover{ background: var(--surface-tint); }
.bo-cohort-row td{
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.bo-cohort-row:last-child td{ border-bottom: none; }
.bo-cohort-name{
  font-weight: 600;
  color: var(--text-strong);
}
.bo-cohort-sub{
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.bo-cohort-mile{
  font-size: 12px;
  color: var(--text-strong);
  margin-bottom: 4px;
}
.bo-cohort-mile-status{}

.bo-cohort-prog-cell{ min-width: 140px; }
.bo-cohort-progbar{
  height: 5px;
  background: var(--surface-tint);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 4px;
}
.bo-cohort-progfill{
  height: 100%;
  background: var(--brand-magenta);
}
.bo-cohort-progfill.is-blocked{ background: #b91c1c; }
.bo-cohort-prog-meta{
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.bo-cohort-days{
  font-weight: 600;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}
.bo-cohort-days-soon{ color: var(--brand-magenta); }
.bo-cohort-target{
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.bo-flag{
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
.bo-flag-blocked{ background: rgba(185,28,28,0.08); color: #b91c1c; }
.bo-flag-pending{ background: rgba(217,119,6,0.10); color: #b45309; }
.bo-flag-ok{ background: rgba(16,185,129,0.08); color: #047857; }

/* ──────────── Sidebar Stage 2 highlight ──────────── */
.portal-sb-stage2{
  position: relative;
  background: rgba(229,3,102,0.06) !important;
  border-left: 3px solid var(--brand-magenta) !important;
  padding-left: 13px !important;
  font-weight: 600 !important;
  color: var(--text-strong) !important;
}
.portal-sb-stage2:hover{
  background: rgba(229,3,102,0.10) !important;
}
.portal-sb-stage2.active{
  background: rgba(229,3,102,0.12) !important;
}
.portal-sb-stage2-tag{
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--brand-magenta);
  color: #fff;
  padding: 2px 6px;
  border-radius: 3px;
}

/* ──────────── Responsive ──────────── */
@media (max-width: 980px){
  .bo-grid{ grid-template-columns: 1fr; }
  .bo-grid-left{ position: static; }
  .bo-kpi-band{ grid-template-columns: repeat(2, 1fr); }
  .bo-shell{ padding: 20px; }
}

/* ── Deal-type toggle (applicant drawer) ── */
.crm-drawer-dealtype{ margin-top:12px; padding:12px 22px 0; border-top:1px solid var(--border,#e5e7eb); }
.crm-dt-row{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.crm-dt-label{ font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:0.04em; color:var(--text-muted,#6b7280); }
.crm-dt-toggle{ display:flex; gap:6px; }
.crm-dt-hint{ display:block; font-size:11px; color:var(--text-muted,#6b7280); margin-top:6px; }
