/* =====================================================
   Space — App Shell Styles
   Sidebar, top-bar, main content, tabs, iframe viewer
   ===================================================== */

/* ---------- Top-level layout ---------- */
.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
aside.nav {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  border-right: 1px solid var(--navy-line);
  padding: 28px 18px 20px;
  overflow-y: auto;
  z-index: 20;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 28px;
  padding: 0 6px;
}
.brand-logo {
  width: 100%;
  max-width: 240px;
  max-height: 88px;
  object-fit: contain;
  display: block;
  margin-left: -4px;
}
.brand-text {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--white);
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.1;
  padding-left: 2px;
}
.brand-text .brand-name {
  display: block;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--white);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}
.brand-text .brand-dot {
  color: var(--sky);
  margin-left: 1px;
}
.brand-text small {
  display: block;
  font-size: 0.64rem;
  letter-spacing: 0.22em;
  color: var(--sky);
  font-weight: 600;
  margin-top: 0;
}

.nav-section-title {
  font-family: var(--font-heading);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin: 22px 0 8px 10px;
  font-weight: 600;
}

nav ul.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
nav ul.nav-list li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--light-grey);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.15s ease;
  text-decoration: none;
  position: relative;
}
nav ul.nav-list li a:hover {
  background: var(--sky-soft);
  color: var(--white);
  text-decoration: none;
}
nav ul.nav-list li a.active {
  background: var(--sky-soft);
  color: var(--white);
}
nav ul.nav-list li a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px; bottom: 8px;
  width: 3px;
  background: var(--sky);
  border-radius: 0 3px 3px 0;
}
.nav-icon {
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 22px;
  letter-spacing: 0.05em;
}
nav ul.nav-list li a:hover .nav-icon,
nav ul.nav-list li a.active .nav-icon { color: var(--sky); }

.nav-badge {
  margin-left: auto;
  font-size: 0.66rem;
  font-weight: 700;
  background: var(--amber-soft);
  color: var(--amber);
  padding: 2px 8px;
  border-radius: 999px;
}
.nav-badge.soon { background: rgba(159,176,200,0.12); color: var(--muted); }
.nav-badge.live { background: rgba(35,190,146,0.14); color: var(--ok); text-transform: uppercase; }

.nav-footer {
  position: sticky;
  bottom: 0;
  margin-top: 24px;
  padding: 16px 6px;
  border-top: 1px solid var(--navy-line);
  background: var(--navy-deep);
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.5;
}
.nav-footer .version {
  color: var(--sky);
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.1em;
}

/* ---------- Main content area ---------- */
main.content {
  min-width: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  border-bottom: 1px solid var(--navy-line);
  background: var(--navy-deep);
  position: sticky; top: 0; z-index: 10;
}
.topbar .crumbs {
  font-size: 0.82rem;
  color: var(--muted);
  font-family: var(--font-heading);
  letter-spacing: 0.06em;
}
.topbar .crumbs strong {
  color: var(--white);
  font-weight: 600;
}
.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.topbar-actions .status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 12px rgba(255,255,255,0.15);
}
.topbar-actions .status-dot.ok {
  background: var(--success);
  box-shadow: 0 0 12px rgba(78,203,113,0.6);
}
.topbar-actions .status-dot.warn {
  background: var(--amber);
  box-shadow: 0 0 12px rgba(245,182,66,0.6);
}
.topbar-actions .status-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-right: 8px;
}

.view {
  flex: 1;
  padding: 40px 48px 80px;
  max-width: 1240px;
  width: 100%;
}

/* Hero block for main pages */
.hero {
  padding-bottom: 36px;
  border-bottom: 1px solid var(--navy-line);
  margin-bottom: 40px;
}
.hero .eyebrow {
  font-family: var(--font-heading);
  color: var(--sky);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.76rem;
  font-weight: 600;
  margin-bottom: 14px;
}
.hero h1 { max-width: 840px; margin-bottom: 12px; }
.hero .lede {
  font-size: 1.1rem;
  color: var(--light-grey);
  max-width: 820px;
}
.hero-meta {
  display: flex;
  gap: 28px;
  margin-top: 24px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.82rem;
}
.hero-meta div strong {
  display: block;
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 0.88rem;
  margin-bottom: 2px;
}

/* ---------- Grid helpers ---------- */
.grid {
  display: grid;
  gap: 18px;
}
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
}

/* Metric tile */
.tile {
  background: var(--navy);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  transition: all 0.2s ease;
}
.tile:hover { border-color: var(--sky); transform: translateY(-2px); }
.tile .tile-label {
  font-family: var(--font-heading);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.68rem;
  font-weight: 600;
  margin-bottom: 10px;
}
.tile .tile-value {
  font-family: var(--font-heading);
  font-size: 2.1rem;
  color: var(--white);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 8px;
}
.tile .tile-sub {
  font-size: 0.82rem;
  color: var(--muted);
}
.tile .tile-delta.up    { color: var(--success); }
.tile .tile-delta.down  { color: var(--danger); }
.tile .tile-delta.flat  { color: var(--muted); }

/* ---------- Health chip ---------- */
.health-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.health-chip::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.health-chip.green { background: var(--success-soft); color: var(--success); }
.health-chip.amber { background: var(--amber-soft);   color: var(--amber); }
.health-chip.red   { background: var(--danger-soft);  color: var(--danger); }
.health-chip.grey  { background: rgba(159,176,200,0.1); color: var(--muted); }

/* ---------- Phase A · Subscription tier pill ----------
   Four tiers ranked Launch < Accelerate < Professional < Enterprise. Navy
   palette for internal docs (Kyle brand spec). */
.tier-pill {
  display: inline-block;
  vertical-align: middle;
  margin-left: 10px;
  padding: 4px 12px;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 0.52em;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.tier-pill.tier-launch       { background: rgba(56,182,255,0.10); color: var(--sky);       border-color: rgba(56,182,255,0.25); }
.tier-pill.tier-accelerate   { background: rgba(95,158,255,0.12); color: #9ec2ff;          border-color: rgba(95,158,255,0.30); }
.tier-pill.tier-professional { background: rgba(145,111,255,0.15); color: #c4a9ff;         border-color: rgba(145,111,255,0.35); }
.tier-pill.tier-enterprise   { background: rgba(255,200,90,0.15);  color: #ffd97a;         border-color: rgba(255,200,90,0.35); }
.tier-pill.tier-none         { background: rgba(159,176,200,0.10); color: var(--muted);    border-color: rgba(159,176,200,0.25); }

/* ---------- Phase A follow-up · "+ Note" button on hero tier pill ----------
   Posts to customer.<id>.deal-health. Sized to match the tier pill so the
   two read as a paired control. */
.tier-note-btn {
  display: inline-block;
  vertical-align: middle;
  margin-left: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 0.52em;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  background: rgba(56,182,255,0.08);
  color: var(--sky);
  border: 1px solid rgba(56,182,255,0.25);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.tier-note-btn:hover { background: rgba(56,182,255,0.18); border-color: rgba(56,182,255,0.45); }

.deal-health-composer {
  position: fixed;
  inset: 0;
  background: rgba(9, 14, 28, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
  z-index: 9000;
}
.deal-health-composer-inner {
  width: min(560px, 92vw);
  background: var(--navy);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-md);
  padding: 18px 20px 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
}
.deal-health-composer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.deal-health-composer-head strong {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--white);
  letter-spacing: 0.04em;
}
.deal-health-composer-head .close-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}
.deal-health-composer textarea {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--light-grey);
  background: #0c1628;
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-sm);
  resize: vertical;
  min-height: 90px;
}
.deal-health-composer textarea:focus {
  outline: none;
  border-color: var(--sky);
  box-shadow: 0 0 0 2px rgba(56,182,255,0.15);
}
.deal-health-composer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  gap: 12px;
}
.deal-health-composer-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.8rem;
}
.deal-health-composer-row .primary {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  background: var(--sky);
  color: var(--navy);
  border: none;
  font-weight: 700;
  cursor: pointer;
}
.deal-health-composer-row .primary:disabled { opacity: 0.55; cursor: not-allowed; }
.deal-health-composer-status {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  min-height: 1em;
}

/* ---------- Phase A · Meta-chip colour variants ----------
   hero-meta now carries coloured renewal state. Only the strong line changes
   colour — the label stays muted so the chip doesn't shout. */
.hero-meta div.meta-renewal strong { color: var(--white); }
.hero-meta div.meta-renewal.green  strong { color: var(--success); }
.hero-meta div.meta-renewal.amber  strong { color: var(--amber); }
.hero-meta div.meta-renewal.red    strong { color: var(--danger); }
.hero-meta div.meta-renewal.grey   strong { color: var(--muted); }

/* ---------- Tabbed viewer (for embedded reports) ---------- */
.viewer-frame {
  width: 100%;
  height: calc(100vh - 140px);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-lg);
  background: var(--navy-deep);
  overflow: hidden;
}
.viewer-frame iframe {
  width: 100%; height: 100%;
  border: 0;
  display: block;
}

/* ---------- Customers table ---------- */
.customers-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--navy);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.customers-table th, .customers-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--navy-line);
  font-size: 0.88rem;
}
.customers-table th {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.68rem;
  color: var(--muted);
  background: var(--navy-deep);
  font-weight: 600;
}
.customers-table tbody tr:hover { background: var(--sky-soft); cursor: pointer; }
.customers-table td .account-name {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--white);
}
.customers-table td .account-sub {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--navy-deep);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--sky), var(--teal));
  border-radius: 3px;
}

/* ---------- Placeholder / Coming-soon panel ---------- */
.coming-soon {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
  border: 1px dashed var(--navy-line);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  text-align: center;
}
.coming-soon .phase {
  font-family: var(--font-heading);
  color: var(--amber);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 14px;
}
.coming-soon h2 { max-width: 700px; margin: 0 auto 16px; }
.coming-soon p { max-width: 620px; margin: 0 auto 14px; color: var(--muted); }
.coming-soon .scope-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  max-width: 900px;
  margin: 30px auto 0;
  text-align: left;
}
.coming-soon .scope-list li {
  list-style: none;
  padding: 12px 16px;
  background: var(--navy-deep);
  border: 1px solid var(--navy-line);
  border-radius: 10px;
  font-size: 0.82rem;
  color: var(--light-grey);
}

/* ---------- Toolbar for embedded views ---------- */
.report-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
}
.report-toolbar .meta {
  font-size: 0.8rem;
  color: var(--muted);
}
.report-toolbar .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- Section heading with actions ---------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 40px 0 16px;
  flex-wrap: wrap;
}
.section-head h2 { margin: 0; }
.section-head .section-actions {
  display: flex;
  gap: 8px;
}

/* =========================================================
   Phase 4 — per-customer detail page
   ========================================================= */

/* Two-column layout: main (2fr) + sidebar (1fr) */
.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 22px;
  align-items: start;
}
@media (max-width: 1100px) {
  .detail-grid { grid-template-columns: 1fr; }
}

.panel {
  background: var(--navy-card);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.panel h3 {
  margin: 0 0 14px;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}
.panel h3 .muted { color: var(--muted); font-weight: 500; font-size: 0.85rem; }
.panel + .panel { margin-top: 18px; }

/* Health-signal row: chip + signal name + note + next action */
.signal-row {
  display: grid;
  grid-template-columns: 90px 100px 1fr;
  gap: 14px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--navy-line);
}
.signal-row:last-child { border-bottom: 0; }
.signal-row .signal-name {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  color: var(--muted);
  padding-top: 4px;
}
.signal-row .signal-note {
  font-size: 0.88rem;
  color: var(--light-grey);
  line-height: 1.5;
}
.signal-row .signal-next {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
}

/* Source chip — tiny pill indicating where a timeline/contact row came from */
.source-chip {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(159,176,200,0.12);
  color: var(--muted);
}
.source-chip.email    { background: rgba(56,182,255,0.14);  color: var(--sky); }
.source-chip.teams    { background: rgba(110,72,255,0.14);  color: #b7a6ff; }
.source-chip.intercom { background: rgba(35,190,146,0.14);  color: var(--ok); }
.source-chip.sharepoint { background: rgba(255,193,7,0.14); color: var(--amber); }
.source-chip.zoho     { background: rgba(224,83,80,0.14);   color: var(--red); }
.source-chip.clickup  { background: rgba(32,105,135,0.28);  color: #7cc4df; }

/* Timeline list */
.timeline-list { display: grid; gap: 14px; }
.timeline-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--navy-line);
}
.timeline-item:last-child { border-bottom: 0; padding-bottom: 0; }
.timeline-item .when {
  font-size: 0.78rem;
  color: var(--muted);
  padding-top: 2px;
}
.timeline-item .who {
  font-size: 0.75rem;
  color: var(--muted);
  display: block;
  margin-top: 2px;
}
.timeline-item .body {
  color: var(--light-grey);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-top: 6px;
  white-space: pre-wrap;
  word-break: break-word;
}
.timeline-item .head {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Contact row */
.contact-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--navy-line);
  align-items: center;
}
.contact-row:last-child { border-bottom: 0; }
.contact-row .contact-name { color: var(--white); font-weight: 600; font-size: 0.92rem; }
.contact-row .contact-meta { color: var(--muted); font-size: 0.78rem; margin-top: 2px; }
.contact-row .contact-right { text-align: right; }
.contact-row .contact-right .when { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 3px; }

/* Task row */
.task-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--navy-line);
}
.task-row:last-child { border-bottom: 0; }
.task-row .task-title { color: var(--white); font-size: 0.9rem; }
.task-row .task-meta  { color: var(--muted); font-size: 0.76rem; margin-top: 2px; }
.task-row .task-status {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(159,176,200,0.12);
  color: var(--muted);
  white-space: nowrap;
}
.task-row .task-status.open        { background: rgba(56,182,255,0.14); color: var(--sky); }
.task-row .task-status.in_progress { background: rgba(255,193,7,0.14);  color: var(--amber); }
.task-row .task-status.done        { background: rgba(35,190,146,0.14); color: var(--ok); }

.empty-hint {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 18px 0;
  text-align: center;
}

/* Back link in the topbar */
.back-link {
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
}
.back-link:hover { color: var(--sky); }

/* ─── Onboarding checklist (Phase 4.2) ────────────────────────────────── */
.onboarding-bar {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
  margin: 4px 0 14px;
}
.onboarding-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--sky), var(--ok));
  transition: width 300ms ease;
}
.onboarding-stages {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.onboarding-stage {
  border: 1px solid var(--navy-line);
  border-radius: 10px;
  background: rgba(255,255,255,0.015);
  overflow: hidden;
}
.onboarding-stage[open] {
  background: rgba(56,182,255,0.04);
  border-color: rgba(56,182,255,0.25);
}
.onboarding-stage summary {
  display: grid;
  grid-template-columns: 28px 1fr auto auto 120px;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  cursor: pointer;
  list-style: none;
  font-family: "Montserrat", sans-serif;
  font-size: 0.9rem;
  color: var(--white);
}
.onboarding-stage summary::-webkit-details-marker { display: none; }
.onboarding-stage summary::before {
  content: "▸";
  color: var(--muted);
  font-size: 0.7rem;
  transition: transform 180ms ease;
  grid-column: 1;
  justify-self: center;
}
.onboarding-stage[open] summary::before { transform: rotate(90deg); }
.onboarding-stage-num {
  display: none; /* replaced by ::before triangle in summary */
}
.onboarding-stage-label {
  font-weight: 600;
  letter-spacing: 0.2px;
}
.onboarding-stage-count {
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.onboarding-stage-bar {
  display: block;
  height: 5px;
  width: 100%;
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
  overflow: hidden;
}
.onboarding-stage-bar > span {
  display: block;
  height: 100%;
  background: var(--sky);
  transition: width 240ms ease;
}
.onboarding-items {
  list-style: none;
  margin: 0;
  padding: 4px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.onboarding-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  padding: 7px 8px;
  border-radius: 8px;
}
.onboarding-item:hover { background: rgba(255,255,255,0.03); }
.onboarding-item-text {
  color: var(--light-grey);
  font-size: 0.86rem;
  line-height: 1.35;
}
.onboarding-item[data-status="done"] .onboarding-item-text {
  color: var(--muted);
  text-decoration: line-through;
}
.onboarding-item-when {
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 2px;
}
.onboarding-tick {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 5px;
  border: 1.5px solid var(--muted);
  background: transparent;
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: background 120ms ease, border-color 120ms ease;
}
.onboarding-tick:hover { border-color: var(--sky); }
.onboarding-tick.in_progress {
  background: rgba(255,193,7,0.15);
  border-color: var(--amber);
}
.onboarding-tick.in_progress::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 2px;
  background: var(--amber);
}
.onboarding-tick.done {
  background: var(--ok);
  border-color: var(--ok);
}
.onboarding-tick.done::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid var(--navy);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.onboarding-tick.skipped {
  background: rgba(255,255,255,0.06);
  border-color: var(--muted);
  border-style: dashed;
}

/* ─── Handover pack form (Phase 4.3) ──────────────────────────────────── */
.handover-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 18px;
}
.handover-section {
  border: 1px solid var(--navy-line);
  border-radius: 10px;
  padding: 12px 16px 14px;
  background: rgba(255,255,255,0.015);
  margin: 0;
}
.handover-section legend {
  font-family: "Montserrat", sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--sky);
  padding: 0 8px;
}
.handover-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
}
.handover-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.handover-field:has(textarea) { grid-column: 1 / -1; }
.handover-field-label {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.2px;
}
.handover-form input[type="text"],
.handover-form input[type="number"],
.handover-form textarea {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--navy-line);
  border-radius: 7px;
  color: var(--white);
  padding: 8px 10px;
  font: inherit;
  font-size: 0.85rem;
  transition: border-color 120ms ease, background 120ms ease;
}
.handover-form input:focus,
.handover-form textarea:focus {
  outline: none;
  border-color: var(--sky);
  background: rgba(56,182,255,0.05);
}
.handover-form textarea { resize: vertical; min-height: 54px; }

.handover-attachments {
  border-top: 1px solid var(--navy-line);
  padding-top: 14px;
  margin-top: 4px;
}
.handover-attachments-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.handover-attachment {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--navy-line);
  border-radius: 7px;
  margin-bottom: 6px;
  background: rgba(255,255,255,0.02);
}
.handover-attachment-name {
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 500;
}
.handover-attachment-meta {
  color: var(--muted);
  font-size: 0.72rem;
}
.handover-upload {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  cursor: pointer;
  color: var(--sky);
  font-size: 0.82rem;
}
.handover-upload input[type="file"] { display: none; }
.handover-upload span {
  display: inline-block;
  padding: 6px 12px;
  border: 1px dashed rgba(56,182,255,0.45);
  border-radius: 7px;
  background: rgba(56,182,255,0.05);
}
.handover-upload:hover span {
  border-color: var(--sky);
  background: rgba(56,182,255,0.1);
}
.handover-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--navy-line);
}

/* =============================================================
   Section notes — Phase 6.1
   A compact <details> widget dropped at the bottom of every
   panel. Threads are scoped by section_id (e.g.
   "customer.gleeds-llp.health"). Keeps the page quiet when
   empty, expands to show the full thread + add form.
   ============================================================= */
/* =============================================================
   Panel sign-off (Phase 6.2)
   -------------------------------------------------------------
   Compact chip slotted into each panel's <h3>. Two states:
     · unsigned  → single "Mark reviewed" button
     · signed    → tick + attribution text + Revoke button
   Positioned at the right edge of the header via flexbox on
   .panel-h3-with-signoff.
   ============================================================= */
.panel-h3-with-signoff {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.panel-h3-with-signoff .muted {
  flex: 1;           /* let the counter/summary take the middle */
  margin-right: auto;
}
.panel-signoff {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.2;
  padding: 2px 0;
  flex-shrink: 0;
}
.panel-signoff.busy { opacity: 0.5; pointer-events: none; }
.panel-signoff-sign,
.panel-signoff-revoke {
  background: transparent;
  border: 1px solid var(--navy-line);
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}
.panel-signoff-sign:hover {
  color: var(--light-grey);
  border-color: var(--muted);
  background: rgba(255,255,255,0.03);
}
.panel-signoff.is-signed {
  color: #34c759;
  padding: 3px 10px 3px 8px;
  background: rgba(52, 199, 89, 0.09);
  border: 1px solid rgba(52, 199, 89, 0.3);
  border-radius: 999px;
}
.panel-signoff-tick {
  color: #34c759;
  font-weight: 700;
  font-size: 0.82rem;
}
.panel-signoff-label { color: #34c759; }
.panel-signoff-revoke {
  border: none;
  padding: 2px 6px;
  background: transparent;
  color: #34c759;
  opacity: 0.7;
  font-size: 0.68rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.panel-signoff-revoke:hover {
  opacity: 1;
  background: transparent;
}
/* Signed panels get a subtle left rail so they read as "done" at a glance */
.panel:has(.panel-signoff.is-signed) {
  border-left: 3px solid rgba(52, 199, 89, 0.4);
}

.board-notes-panel {
  margin-top: 28px;
}
.board-notes-panel .panel-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--white);
  margin: 0 0 8px;
  letter-spacing: 0.02em;
}

.panel-notes {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--navy-line);
}
.panel-notes[open] { padding-bottom: 6px; }
.panel-notes > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--muted);
  user-select: none;
  padding: 4px 2px;
  border-radius: 4px;
  transition: color 0.15s ease;
}
.panel-notes > summary:hover { color: var(--light-grey); }
.panel-notes > summary::-webkit-details-marker { display: none; }
.panel-notes > summary::before {
  content: "▸";
  display: inline-block;
  width: 10px;
  transition: transform 0.15s ease;
  color: var(--muted-soft);
}
.panel-notes[open] > summary::before { transform: rotate(90deg); }
.panel-notes .notes-count {
  padding: 1px 8px;
  border-radius: 10px;
  background: var(--navy-line);
  color: var(--light-grey);
  font-size: 0.68rem;
  font-weight: 600;
}
.panel-notes .notes-count.has-open {
  background: var(--amber);
  color: var(--navy-deep);
}

.notes-list {
  margin: 12px 0 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.note-item {
  background: var(--navy-deep);
  border: 1px solid var(--navy-line);
  border-left: 3px solid var(--sky);
  border-radius: 6px;
  padding: 8px 12px;
}
.note-item.resolved {
  border-left-color: var(--muted-soft);
  opacity: 0.7;
}
.note-item.ask-claude {
  border-left-color: var(--amber);
}
.note-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.72rem;
  color: var(--muted);
}
.note-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.note-author {
  color: var(--light-grey);
  font-weight: 600;
  font-size: 0.78rem;
}
.note-claude-chip {
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.note-body {
  font-size: 0.84rem;
  color: var(--light-grey);
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.note-resolution {
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 4px;
  background: rgba(78, 203, 113, 0.06);
  border-left: 2px solid var(--success);
  font-size: 0.76rem;
  color: var(--muted);
  font-style: italic;
}
.note-resolution strong { color: var(--success); font-style: normal; }
.note-actions {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.note-actions button {
  padding: 3px 9px;
  font-size: 0.7rem;
  border-radius: 4px;
  border: 1px solid var(--navy-line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}
.note-actions button:hover {
  border-color: var(--success);
  color: var(--success);
}

.note-form {
  background: var(--navy);
  border: 1px solid var(--navy-line);
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 6px;
}
.note-form textarea {
  width: 100%;
  min-height: 50px;
  padding: 6px 8px;
  background: var(--navy-deep);
  border: 1px solid var(--navy-line);
  border-radius: 4px;
  color: var(--white);
  font-family: inherit;
  font-size: 0.82rem;
  line-height: 1.45;
  resize: vertical;
}
.note-form textarea:focus {
  outline: none;
  border-color: var(--sky);
}
.note-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}
.note-form-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  cursor: pointer;
}
.note-form-row label input[type="checkbox"] {
  accent-color: var(--sky);
  cursor: pointer;
}
.note-form-row button {
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--sky);
  color: var(--navy-deep);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
}
.note-form-row button:hover:not(:disabled) { filter: brightness(1.08); }
.note-form-row button:disabled { opacity: 0.4; cursor: not-allowed; }

.notes-empty {
  padding: 8px 4px;
  color: var(--muted);
  font-style: italic;
  font-size: 0.78rem;
}

/* =============================================================
   Claude chat drawer — Phase 5.1
   Slide-in right-hand panel triggered by "Ask Claude about this
   account". The conversation lives in the claude_queue table so
   it survives page refresh and a Claude session can post back
   via PATCH /api/claude-queue/:id.
   ============================================================= */
.claude-drawer-scrim {
  position: fixed;
  inset: 0;
  background: rgba(8, 14, 28, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 900;
}
.claude-drawer-scrim.open {
  opacity: 1;
  pointer-events: auto;
}
.claude-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(520px, 100vw);
  background: var(--navy-deep);
  border-left: 1px solid var(--navy-line);
  transform: translateX(100%);
  transition: transform 0.28s ease;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  box-shadow: -12px 0 40px rgba(0,0,0,0.5);
}
.claude-drawer.open { transform: translateX(0); }

.claude-drawer-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--navy-line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  background: var(--navy);
}
.claude-drawer-head h3 {
  margin: 0 0 4px;
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--white);
  letter-spacing: 0.3px;
}
.claude-drawer-head .sub {
  font-size: 0.72rem;
  color: var(--muted);
}
.claude-drawer-close {
  background: transparent;
  border: 1px solid var(--navy-line);
  color: var(--muted);
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.claude-drawer-close:hover {
  color: var(--white);
  border-color: var(--sky);
  background: var(--sky-soft);
}

.claude-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.claude-drawer-body::-webkit-scrollbar { width: 8px; }
.claude-drawer-body::-webkit-scrollbar-track { background: transparent; }
.claude-drawer-body::-webkit-scrollbar-thumb {
  background: var(--navy-line);
  border-radius: 4px;
}

.claude-empty {
  padding: 30px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-style: italic;
}
.claude-empty strong { color: var(--light-grey); font-style: normal; }

.claude-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 92%;
}
.claude-msg-author {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-weight: 600;
}
.claude-msg-body {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.86rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.claude-msg.user { align-self: flex-end; align-items: flex-end; }
.claude-msg.user .claude-msg-body {
  background: var(--sky);
  color: var(--navy-deep);
  border-bottom-right-radius: 2px;
  font-weight: 500;
}
.claude-msg.claude { align-self: flex-start; }
.claude-msg.claude .claude-msg-body {
  background: var(--navy-soft);
  color: var(--light-grey);
  border: 1px solid var(--navy-line);
  border-bottom-left-radius: 2px;
}
.claude-msg.status .claude-msg-body {
  background: transparent;
  border: 1px dashed var(--navy-line);
  color: var(--muted);
  font-size: 0.78rem;
  font-style: italic;
  padding: 8px 12px;
}
.claude-msg.status.running .claude-msg-body {
  border-color: var(--amber);
  color: var(--amber);
}
.claude-msg.status.failed .claude-msg-body {
  border-color: var(--danger);
  color: var(--danger);
  font-style: normal;
}
.claude-msg-when {
  font-size: 0.68rem;
  color: var(--muted-soft);
  margin-top: 2px;
}

/* Proposed action cards (Phase 5.3) */
.claude-actions {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.claude-action {
  background: var(--navy);
  border: 1px solid var(--navy-line);
  border-left: 3px solid var(--sky);
  border-radius: 8px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}
.claude-action-type {
  display: inline-block;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--sky);
  background: var(--sky-soft);
  padding: 2px 7px;
  border-radius: 10px;
  margin-bottom: 4px;
}
.claude-action-summary {
  font-size: 0.82rem;
  color: var(--light-grey);
  line-height: 1.4;
}
.claude-action-detail {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 3px;
}
.claude-action-buttons {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.claude-action-buttons button {
  padding: 6px 10px;
  font-size: 0.72rem;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--navy-line);
  background: transparent;
  color: var(--muted);
  transition: all 0.15s ease;
  font-family: inherit;
  font-weight: 500;
}
.claude-action-buttons button.approve {
  background: var(--success);
  color: var(--navy-deep);
  border-color: var(--success);
  font-weight: 600;
}
.claude-action-buttons button.approve:hover { filter: brightness(1.1); }
.claude-action-buttons button.dismiss:hover {
  border-color: var(--danger);
  color: var(--danger);
}
.claude-action.approved {
  border-left-color: var(--success);
  opacity: 0.75;
}
.claude-action.approved .claude-action-buttons { display: none; }
.claude-action.dismissed {
  border-left-color: var(--muted-soft);
  opacity: 0.55;
}
.claude-action-status {
  font-size: 0.68rem;
  color: var(--muted);
  font-style: italic;
}

.claude-drawer-foot {
  padding: 12px 22px 18px;
  border-top: 1px solid var(--navy-line);
  background: var(--navy);
}
.claude-input {
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  background: var(--navy-deep);
  color: var(--white);
  border: 1px solid var(--navy-line);
  border-radius: 8px;
  resize: vertical;
  font-family: inherit;
  font-size: 0.86rem;
  line-height: 1.45;
}
.claude-input:focus {
  outline: none;
  border-color: var(--sky);
  box-shadow: 0 0 0 3px var(--sky-soft);
}
.claude-foot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  gap: 8px;
}
.claude-foot-hint {
  font-size: 0.7rem;
  color: var(--muted);
}
.claude-send {
  padding: 7px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--sky);
  color: var(--navy-deep);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.15s ease;
}
.claude-send:hover:not(:disabled) { filter: brightness(1.08); }
.claude-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* =============================================================
   Sync banner (Phase 6.3)
   -------------------------------------------------------------
   Fixed top-right card that appears when any ↻ Refresh button
   kicks off /api/sync/all. Shows one row per source with a
   live status tick, then auto-reloads the page when every row
   reports OK.
   ============================================================= */
.sync-banner {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  min-width: 280px;
  max-width: 360px;
  background: var(--navy-deep);
  border: 1px solid var(--navy-line);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--light-grey);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.sync-banner.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.sync-banner.has-error { border-color: rgba(255, 107, 107, 0.6); }
.sync-banner.done .sync-spinner { display: none; }
.sync-banner-inner { display: flex; flex-direction: column; gap: 10px; }
.sync-banner-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sync-banner-title {
  font-size: 0.88rem;
  color: var(--light-grey);
  flex-shrink: 0;
}
.sync-banner-sub {
  color: var(--muted);
  font-size: 0.72rem;
  margin-left: auto;
  font-weight: 400;
}
.sync-spinner {
  width: 12px; height: 12px;
  border: 2px solid var(--navy-line);
  border-top-color: var(--sky);
  border-radius: 50%;
  animation: sync-spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes sync-spin {
  to { transform: rotate(360deg); }
}
.sync-banner-rows {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.sync-row {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  padding: 4px 0;
}
.sync-row[data-state="running"] .sync-row-status { color: var(--muted); }
.sync-row[data-state="ok"]      .sync-row-status { color: #34c759; font-weight: 700; }
.sync-row[data-state="fail"]    .sync-row-status { color: #ff6b6b; font-weight: 700; }
.sync-row-label { color: var(--light-grey); }
.sync-row-detail { color: var(--muted); font-size: 0.72rem; }
.sync-row[data-state="fail"] .sync-row-detail { color: #ff6b6b; }

/* =========================================================
   Task modal (Phase 6.4)
   ---------------------------------------------------------
   Opened by #btn-new-task on customer-detail. Submit enqueues
   an action.execute.clickup.create row for a Cowork session
   to turn into a real ClickUp task.

   Centred card — smaller footprint than the Claude drawer
   because the form is short (title + description + 3 meta
   selects). Scrim shares the .claude-drawer-scrim colour so
   both overlays feel like the same app.
   ========================================================= */
.task-modal-scrim {
  position: fixed;
  inset: 0;
  background: rgba(8, 14, 28, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 1100;
}
.task-modal-scrim.open {
  opacity: 1;
  pointer-events: auto;
}
.task-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%) scale(0.98);
  width: min(520px, calc(100vw - 32px));
  background: var(--navy-deep);
  border: 1px solid var(--navy-line);
  border-radius: 10px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
}
.task-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.task-modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--navy-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--navy);
  border-radius: 10px 10px 0 0;
}
.task-modal-head h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 0.98rem;
  color: var(--white);
  letter-spacing: 0.3px;
}
.task-modal-close {
  background: transparent;
  border: 1px solid var(--navy-line);
  color: var(--muted);
  width: 26px; height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  transition: all 0.15s ease;
}
.task-modal-close:hover {
  color: var(--white);
  border-color: var(--sky);
  background: var(--sky-soft);
}
.task-modal-body {
  padding: 18px 20px 6px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}
.task-modal-body label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--muted);
}
.task-modal-body label span em {
  color: #ff6b6b;
  font-style: normal;
  margin-left: 2px;
}
.task-modal-body input[type="text"],
.task-modal-body input[type="date"],
.task-modal-body textarea,
.task-modal-body select {
  background: var(--navy);
  border: 1px solid var(--navy-line);
  color: var(--white);
  padding: 8px 10px;
  border-radius: 6px;
  font: inherit;
  font-size: 0.85rem;
  transition: border-color 0.15s ease;
}
.task-modal-body input[type="text"]:focus,
.task-modal-body input[type="date"]:focus,
.task-modal-body textarea:focus,
.task-modal-body select:focus {
  outline: none;
  border-color: var(--sky);
}
.task-modal-body textarea { resize: vertical; min-height: 64px; }
.task-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.task-modal-foot {
  padding: 14px 20px 16px;
  border-top: 1px solid var(--navy-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}
.task-modal-hint {
  font-size: 0.72rem;
  color: var(--muted);
}
.task-modal.busy .task-modal-body { opacity: 0.6; pointer-events: none; }
.task-modal.busy #task-submit { opacity: 0.6; cursor: wait; }

/* Toast (success banner shared with future actions) */
.aim-toast {
  position: fixed;
  top: 18px;
  right: 18px;
  background: var(--navy-deep);
  border: 1px solid rgba(52, 199, 89, 0.55);
  color: var(--white);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  z-index: 1300;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.aim-toast.show { opacity: 1; transform: translateY(0); }
.aim-toast.error { border-color: rgba(255, 107, 107, 0.6); }

/* Small responsive tweak */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  aside.nav { position: static; height: auto; }
  main.content { }
  .view { padding: 24px; }
  .topbar { padding: 14px 20px; }
  .signal-row { grid-template-columns: 80px 1fr; }
  .signal-row .signal-name { grid-column: 1 / 2; grid-row: 1; }
  .signal-row .signal-note { grid-column: 1 / 3; }
  .timeline-item { grid-template-columns: 1fr; }
  .onboarding-stage summary { grid-template-columns: 28px 1fr auto auto; }
  .onboarding-stage-bar { display: none; }
  .handover-grid { grid-template-columns: 1fr; }
  .claude-drawer { width: 100vw; }
  .claude-action { grid-template-columns: 1fr; }
  .claude-action-buttons { justify-content: flex-end; }
  .leads-drill-in { width: 96vw; max-height: 94vh; border-radius: var(--radius-md); }
  .drill-grid { grid-template-columns: 1fr; }
  .drill-grid > .drill-section { border-right: 0; border-bottom: 1px solid var(--navy-line); }
  .drill-grid > .drill-section:last-child { border-bottom: 0; }
}

/* ==========================================================================
   Sales · Leads — Phase 8A
   ========================================================================== */

/* --- Toolbar --- */
.leads-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--navy);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  margin-bottom: 14px;
}
.leads-toolbar-left, .leads-toolbar-right {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.leads-select {
  display: inline-flex; flex-direction: column; gap: 3px;
  font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); font-family: var(--font-heading); font-weight: 600;
}
.leads-select select {
  background: var(--navy-deep); color: var(--white);
  border: 1px solid var(--navy-line); border-radius: var(--radius-md);
  padding: 8px 12px; font-family: var(--font-body); font-size: 0.9rem;
  letter-spacing: normal; text-transform: none; font-weight: 500;
  min-width: 260px; cursor: pointer;
}
.leads-select select:focus { outline: none; border-color: var(--sky); }
.leads-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem; color: var(--light-grey); cursor: pointer;
  background: var(--navy-deep); border: 1px solid var(--navy-line);
  padding: 6px 12px; border-radius: 999px; user-select: none;
}
.leads-toggle:hover { border-color: var(--sky); }
.leads-toggle input { accent-color: var(--sky); cursor: pointer; }

/* --- Leads table --- */
.leads-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--navy);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-size: 0.85rem;
}
.leads-table th, .leads-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--navy-line);
  vertical-align: middle;
}
.leads-table th {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.66rem;
  color: var(--muted);
  background: var(--navy-deep);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.leads-table th:hover { color: var(--sky); }
.leads-table th.num { text-align: center; }
.leads-table th.sort-active { color: var(--sky); }
.leads-table th.sort-active::after {
  content: " ↑";
  font-size: 0.7rem;
  opacity: 0.85;
}
.leads-table th.sort-active.sort-desc::after { content: " ↓"; }

.leads-table tbody tr { transition: background 0.12s ease; }
.leads-table tbody tr:hover { background: var(--sky-soft); cursor: pointer; }
.leads-table tbody tr.is-flagged { opacity: 0.78; }
.leads-table tbody tr.is-flagged:hover { opacity: 1; }

.leads-table .lead-name {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--white);
  display: inline-flex; align-items: center; gap: 6px;
}
.leads-table .lead-company {
  font-family: var(--font-heading);
  font-weight: 500;
  color: var(--white);
}
.leads-table .lead-sub {
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 2px;
}
.leads-table .lead-sub-cell {
  font-size: 0.82rem;
  color: var(--light-grey);
  white-space: nowrap;
}

.heat-cell {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
}
.heat-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.intent-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--sky);
  margin-right: 6px;
  vertical-align: middle;
}

.flag-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 2px rgba(224, 91, 91, 0.25);
}

.blocker-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--amber-soft);
  color: var(--amber);
  white-space: nowrap;
}

/* --- Status pills --- */
.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-heading);
  letter-spacing: 0.04em;
  background: rgba(159,176,200,0.14);
  color: var(--muted);
  white-space: nowrap;
}
.status-pill.status-qualified_not_contacted { background: var(--sky-soft);     color: var(--sky); }
.status-pill.status-awaiting_response       { background: var(--amber-soft);   color: var(--amber); }
.status-pill.status-discovery_call          { background: rgba(140,100,255,0.14); color: #b4a2ff; }
.status-pill.status-platform_demo           { background: rgba(140,100,255,0.18); color: #c2b2ff; }
.status-pill.status-onsite_demo             { background: rgba(140,100,255,0.22); color: #d1c4ff; }
.status-pill.status-proposal_review         { background: rgba(78,203,113,0.16); color: var(--success); }
.status-pill.status-quote_issued            { background: rgba(78,203,113,0.22); color: #7cdd97; }
.status-pill.status-customer                { background: var(--success-soft);  color: var(--success); font-weight: 700; }
.status-pill.status-lost_deal               { background: var(--danger-soft);   color: var(--danger); }
.status-pill.status-not_interested          { background: var(--danger-soft);   color: var(--danger); }
.status-pill.status-stalled                 { background: rgba(159,176,200,0.18); color: var(--muted); }
.status-pill.status-on_hold                 { background: rgba(159,176,200,0.18); color: var(--muted); }
/* Phase 10.4 — overnight pipeline states. Sky blue = clean drafts ready, amber = flagged for review. */
.status-pill.status-ready_for_outreach           { background: var(--sky-soft);   color: var(--sky); font-weight: 700; }
.status-pill.status-ready_for_outreach_flagged   { background: var(--amber-soft); color: var(--amber); font-weight: 700; }

/* --- Heat legend --- */
.leads-legend {
  font-size: 0.75rem;
  color: var(--light-grey);
  margin: 14px 0 0;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.heat-swatch {
  display: inline-block;
  width: 14px; height: 10px;
  border-radius: 3px;
  margin-left: 8px;
}

/* --- Drill-in side panel --- */
.leads-drill-scrim {
  position: fixed; inset: 0;
  background: rgba(16, 27, 51, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 900;
  backdrop-filter: blur(2px);
}
.leads-drill-scrim.open { opacity: 1; pointer-events: auto; }

.leads-drill-in {
  position: fixed;
  top: 50%; left: 50%;
  width: min(1100px, 94vw);
  max-height: 90vh;
  background: var(--navy);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, -48%) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.18s ease;
  z-index: 1000;
  overflow-x: hidden;
  overflow-y: auto;
}
.leads-drill-in.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}
body.drill-open { overflow: hidden; }

.drill-head {
  position: relative;
  padding: 26px 32px 18px;
  border-bottom: 1px solid var(--navy-line);
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
}
.drill-close {
  position: absolute;
  top: 18px; right: 20px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--navy-line);
  background: var(--navy-deep);
  color: var(--light-grey);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: all 0.15s ease;
}
.drill-close:hover { border-color: var(--sky); color: var(--white); }

.drill-eyebrow {
  font-family: var(--font-heading);
  color: var(--sky);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.drill-name-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
}
.drill-name-row h2 { margin: 0 0 4px; font-size: 1.65rem; }
.drill-role { color: var(--muted); font-size: 0.92rem; }
.drill-score { text-align: right; }
.drill-score-num {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
}
.drill-score-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-top: 2px;
}
.drill-pills {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 14px 0 8px;
}
.drill-contacts {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
}
.drill-contacts a { color: var(--sky); }

.drill-blocker, .drill-flag {
  margin: 0 32px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap;
  margin-top: 18px;
}
.drill-blocker { background: var(--amber-soft); border: 1px solid rgba(245,182,66,0.3); }
.drill-flag    { background: var(--danger-soft); border: 1px solid rgba(224,91,91,0.3); }
.blocker-note, .flag-reason { flex: 1; min-width: 220px; font-size: 0.88rem; color: var(--light-grey); }
.flag-meta { width: 100%; font-size: 0.75rem; color: var(--muted); margin-top: 4px; }

.drill-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.15fr 1fr;
  gap: 0;
  padding: 0;
}
.drill-grid > .drill-section {
  padding: 22px 24px;
  border-right: 1px solid var(--navy-line);
}
.drill-grid > .drill-section:last-child { border-right: 0; }

.drill-section h4 {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sky);
  margin: 0 0 14px;
}
.drill-section h5 {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 16px 0 8px;
}

.drill-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.drill-metrics > div {
  background: var(--navy-deep);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  text-align: center;
}
.drill-metrics strong {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  display: block;
  line-height: 1.1;
}
.drill-metrics span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-top: 4px;
  display: block;
}
.drill-note { font-size: 0.82rem; color: var(--muted); margin: 8px 0 0; }
.drill-note em { color: var(--light-grey); font-style: normal; font-weight: 600; margin-right: 4px; }

.signal-list, .history-list, .task-list, .project-list, .linkedin-posts {
  list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px;
}
.signal-list li {
  background: var(--navy-deep);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}
.signal-head { font-size: 0.88rem; color: var(--light-grey); }
.signal-sub { font-size: 0.72rem; color: var(--muted); margin-top: 3px; }

.history-list li {
  background: var(--navy-deep);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.history-list .hist-date { font-size: 0.72rem; color: var(--muted); margin-left: auto; }
.history-list .hist-note { width: 100%; font-size: 0.82rem; color: var(--light-grey); margin-top: 4px; }

.task-list li {
  background: var(--navy-deep);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  font-size: 0.86rem; color: var(--light-grey);
}
.task-list li.task-done { opacity: 0.6; text-decoration: line-through; }
.task-list .task-due { font-size: 0.72rem; color: var(--amber); }

.project-list li {
  background: transparent;
  border: 0;
  padding: 4px 0;
  font-size: 0.86rem;
  color: var(--light-grey);
  list-style: disc;
  margin-left: 18px;
}

.drill-kv { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.drill-kv td, .drill-kv th { padding: 6px 4px; border-bottom: 1px solid var(--navy-line); text-align: left; }
.drill-kv td { color: var(--muted); width: 44%; font-weight: normal; }
.drill-kv th { color: var(--white); font-weight: 600; }
.drill-kv tr:last-child td, .drill-kv tr:last-child th { border-bottom: 0; }

/* Campaign match cards */
.drill-campaign-card {
  background: var(--navy-deep);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.drill-campaign-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 6px;
}
.drill-campaign-head strong { font-family: var(--font-heading); color: var(--white); }
.drill-campaign-score { font-family: var(--font-heading); font-weight: 700; font-size: 1rem; }
.drill-campaign-reason { font-size: 0.82rem; color: var(--light-grey); }

/* LinkedIn posts */
.linkedin-post-card {
  background: var(--navy-deep);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.lp-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}
.lp-kind { font-family: var(--font-heading); font-weight: 700; color: var(--sky); }
.lp-eng { margin-left: auto; font-size: 0.72rem; }
.lp-text { font-size: 0.86rem; color: var(--light-grey); line-height: 1.45; }
.lp-link { display: inline-block; margin-top: 6px; font-size: 0.76rem; color: var(--sky); }

/* Outreach drafts */
.drill-outreach {
  padding: 22px 32px 32px;
  border-top: 1px solid var(--navy-line);
}
.outreach-tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.outreach-tab {
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--navy-line);
  background: var(--navy-deep);
  color: var(--muted);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.outreach-tab:hover { border-color: var(--sky); color: var(--light-grey); }
.outreach-tab.active {
  background: linear-gradient(135deg, var(--sky) 0%, var(--sky-deep) 100%);
  color: var(--white);
  border-color: var(--sky);
}
.outreach-panel {
  background: var(--navy-deep);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-md);
  padding: 18px;
}
.outreach-text {
  display: block;
  width: 100%;
  margin: 0 0 14px;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--light-grey);
  background: #0c1628;
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-sm);
  resize: vertical;
  white-space: pre-wrap;
  word-wrap: break-word;
  box-sizing: border-box;
}
.outreach-text:focus {
  outline: none;
  border-color: var(--sky);
  box-shadow: 0 0 0 2px rgba(56, 182, 255, 0.15);
}
.outreach-text::placeholder { color: var(--muted); }
.outreach-actions {
  display: flex; align-items: center; gap: 12px;
}
.outreach-copied {
  font-size: 0.8rem;
  font-weight: 600;
}

/* =======================================================
   Sales · Leads — Phase 8B.1
   Live/mock source pill + "Add lead" modal
   ======================================================= */

/* Source-indicator pill states */
#leads-source-pill {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  vertical-align: middle;
}
#leads-source-pill[data-source="live"] {
  background: rgba(34, 197, 94, 0.18);
  color: #22C55E;
  border-color: rgba(34, 197, 94, 0.45);
}
#leads-source-pill[data-source="mock"] {
  background: rgba(234, 179, 8, 0.18);
  color: #EAB308;
  border-color: rgba(234, 179, 8, 0.45);
}
#leads-source-pill[data-source="pending"] {
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
  border-color: rgba(148, 163, 184, 0.28);
}

/* Add-lead modal — reuses the centered-floating chrome from .leads-drill-in,
   then narrows + pads a tighter form layout on top. */
.leads-drill-in.addlead-modal {
  width: min(640px, 94vw);
  max-height: 86vh;
}

.addlead-form {
  padding: 18px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.addlead-form .addlead-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.addlead-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.01em;
}
.addlead-form label span em {
  color: #EF4444;
  font-style: normal;
  margin-left: 2px;
}
.addlead-form input,
.addlead-form select {
  background: var(--navy-deep);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-sm, 8px);
  color: var(--white);
  padding: 9px 12px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.addlead-form input:focus,
.addlead-form select:focus {
  outline: none;
  border-color: var(--sky);
  background: rgba(56, 182, 255, 0.06);
}
.addlead-form input::placeholder { color: rgba(148, 163, 184, 0.55); }

.addlead-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #FCA5A5;
  padding: 10px 12px;
  border-radius: var(--radius-sm, 8px);
  font-size: 0.82rem;
}

.addlead-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

@media (max-width: 760px) {
  .addlead-form .addlead-row { grid-template-columns: 1fr; }
}

/* =======================================================
   Sales · Leads — Phase 8B.2
   Apollo enrichment + social signals
   ----------------------------------------------------- */

/* Apollo credit pill — hidden until we have a real snapshot, then shows
   colour-coded remaining credits. States: ok / warn / danger. */
#apollo-credit-pill {
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  vertical-align: middle;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}
#apollo-credit-pill[data-state="ok"] {
  background: rgba(56, 182, 255, 0.14);
  color: #38b6ff;
  border-color: rgba(56, 182, 255, 0.45);
}
#apollo-credit-pill[data-state="warn"] {
  background: rgba(234, 179, 8, 0.14);
  color: #EAB308;
  border-color: rgba(234, 179, 8, 0.45);
}
#apollo-credit-pill[data-state="danger"] {
  background: rgba(239, 68, 68, 0.14);
  color: #FCA5A5;
  border-color: rgba(239, 68, 68, 0.45);
}

/* Source pill in the drill header — differentiates Apollo-sourced and
   social-signal-sourced leads from manually-added ones. */
.pill.source-pill {
  background: rgba(56, 182, 255, 0.14);
  color: #38b6ff;
  border: 1px solid rgba(56, 182, 255, 0.45);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
}
/* Success variant for "✓ Enriched" */
.pill.success {
  background: rgba(34, 197, 94, 0.16);
  color: #4ADE80;
  border: 1px solid rgba(34, 197, 94, 0.45);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  font-weight: 700;
}

/* Tiny source dot shown inline with each lead's name in the table. */
.source-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: middle;
  transform: translateY(-1px);
}
.source-dot--apollo { background: #38b6ff; box-shadow: 0 0 0 1px rgba(56, 182, 255, 0.35); }
.source-dot--social { background: #c084fc; box-shadow: 0 0 0 1px rgba(192, 132, 252, 0.35); }

/* "?" after an obfuscated name so users know there's more info coming. */
.name-hint {
  display: inline-block;
  margin-left: 4px;
  color: var(--muted);
  font-size: 0.65em;
  font-weight: 500;
  border: 1px solid var(--navy-line, rgba(148, 163, 184, 0.28));
  border-radius: 50%;
  width: 18px;
  height: 18px;
  line-height: 16px;
  text-align: center;
  cursor: help;
  vertical-align: middle;
}

/* "📧 Email hidden" / "🔗 LinkedIn hidden" — grey locked chips that sit
   where the clickable contact links would normally live. */
.contact-locked {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  background: rgba(148, 163, 184, 0.1);
  border: 1px dashed rgba(148, 163, 184, 0.35);
  padding: 3px 9px;
  border-radius: 999px;
}

/* The "Pull further info" CTA row in the drill header. */
.drill-enrich-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(148, 163, 184, 0.18);
}
.drill-enrich-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.drill-enrich-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}
.credit-tag {
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.drill-enrich-status {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
}

/* ------------------------------------------------------------------
   Zoho dedupe badges — Phase 8B.5
   Shown inline with the lead name in the table and as a pill in the
   drill-in header. Status-colour maps to the match verdict so Kyle
   can scan the list and see at a glance which leads are already
   represented in Zoho (and by whom).
   ------------------------------------------------------------------ */
.zoho-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 8px;
  white-space: nowrap;
  vertical-align: middle;
  border: 1px solid transparent;
}
.zoho-badge--existing {
  background: rgba(56, 182, 255, 0.12);
  color: #7dd3fc;
  border-color: rgba(56, 182, 255, 0.4);
}
.zoho-badge--dupe {
  background: rgba(239, 68, 68, 0.14);
  color: #FCA5A5;
  border-color: rgba(239, 68, 68, 0.45);
}
.zoho-badge--account {
  background: rgba(34, 197, 94, 0.14);
  color: #86EFAC;
  border-color: rgba(34, 197, 94, 0.4);
}
.zoho-badge--unchecked {
  background: rgba(148, 163, 184, 0.08);
  color: var(--muted);
  border-color: rgba(148, 163, 184, 0.25);
  font-style: italic;
  font-weight: 500;
}
.zoho-badge--netnew {
  background: rgba(132, 204, 22, 0.12);
  color: #BEF264;
  border-color: rgba(132, 204, 22, 0.35);
}
/* In the drill-in, drop the margin so pills align cleanly with others. */
.drill-pills .zoho-badge { margin-left: 0; }

/* Zoho section inside the drill-in — renders account card, owner, and
   the list of existing contacts / direct matches from the dedupe JSON. */
.drill-zoho {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(56, 182, 255, 0.28);
  border-radius: 10px;
  background: rgba(56, 182, 255, 0.04);
}
.drill-zoho[data-state="dupe"] {
  border-color: rgba(239, 68, 68, 0.38);
  background: rgba(239, 68, 68, 0.05);
}
.drill-zoho[data-state="netnew"] {
  border-color: rgba(132, 204, 22, 0.32);
  background: rgba(132, 204, 22, 0.04);
}
.drill-zoho[data-state="unchecked"] {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(148, 163, 184, 0.04);
}
.drill-zoho-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.92rem;
}
.drill-zoho-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}
.drill-zoho-contacts {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
}
.drill-zoho-contacts li {
  padding: 5px 0;
  border-top: 1px dashed rgba(148, 163, 184, 0.18);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.drill-zoho-contacts li:first-child { border-top: none; }
.drill-zoho-contacts .zcontact-name { font-weight: 500; }
.drill-zoho-contacts .zcontact-meta { color: var(--muted); font-size: 0.78rem; }

/* "LinkedIn profile matched · activity not captured" — the softer copy
   that replaces the previous "No recent LinkedIn activity captured"
   when we do have a profile URL but no posts. */
.linkedin-empty {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 10px 12px;
  border: 1px dashed rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.04);
}
.linkedin-empty a {
  color: #38b6ff;
  text-decoration: none;
}
.linkedin-empty a:hover { text-decoration: underline; }
.linkedin-empty-actions {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.linkedin-empty-actions .btn.sm {
  padding: 4px 10px;
  font-size: 0.8rem;
}
.drill-chrome-enrich-status {
  font-size: 0.78rem;
  color: var(--muted);
}
.linkedin-empty-sub {
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--muted);
  opacity: 0.8;
}

/* =========================================================================
   Phase B · Billing panel (customer-detail.html)
   Internal palette only (navy/sky). Kept compact — this panel lives below
   Tasks on the left column so it needs to read well without dominating.
   ========================================================================= */
.billing-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
}
.billing-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(148, 163, 184, 0.08);
  color: var(--light-grey);
  white-space: nowrap;
}
.billing-chip.primary {
  background: rgba(56, 182, 255, 0.12);
  border-color: rgba(56, 182, 255, 0.35);
  color: #9ad7ff;
}
.billing-chip.ok {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
  color: #86efac;
}
.billing-chip.muted {
  background: rgba(148, 163, 184, 0.08);
  color: var(--muted);
}
.billing-chip.year {
  background: rgba(27, 42, 74, 0.6);
  border-color: rgba(56, 182, 255, 0.28);
  color: #c7d8f0;
}

.billing-sparkline-wrap {
  background: rgba(27, 42, 74, 0.35);
  border: 1px solid var(--navy-line);
  border-radius: 8px;
  padding: 10px 12px 6px;
  margin: 0 0 12px;
  overflow-x: auto;
}
.billing-sparkline {
  display: block;
  width: 100%;
  height: auto;
  min-height: 92px;
}
.billing-sparkline .billing-bar {
  fill: #38b6ff;
  fill-opacity: 0.78;
  transition: fill-opacity 0.12s ease;
}
.billing-sparkline .billing-bar:hover { fill-opacity: 1; }
.billing-sparkline .billing-bar-lbl {
  fill: var(--muted);
  font-size: 9px;
  font-family: inherit;
}

.billing-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  font-size: 0.82rem;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--navy-line);
  margin: 0 0 12px;
}
.billing-meta strong { color: var(--light-grey); font-weight: 600; }
.billing-meta .muted { margin-right: 4px; }

.billing-methods-head {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 8px;
}
.billing-methods-head strong { color: var(--light-grey); font-weight: 600; }
.billing-method-row { padding: 4px 0 8px; }
.billing-method-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
  margin: 0 0 4px;
}
.billing-method-name { color: var(--light-grey); }
.billing-method-val  { color: var(--muted); font-variant-numeric: tabular-nums; }
.billing-method-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  overflow: hidden;
}
.billing-method-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #38b6ff 0%, #206987 100%);
  border-radius: 999px;
}

/* =========================================================================
   Phase C · Platform usage panel (customer-detail.html)
   Shows live signal from the AIM Platform API. Navy palette.
   ========================================================================= */
.usage-headline {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  margin: 0 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(27, 42, 74, 0.4);
  color: var(--light-grey);
}
.usage-headline.green {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: #bbf7d0;
}
.usage-headline.amber {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fde68a;
}
.usage-headline.red {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fecaca;
}
.usage-headline.grey {
  background: rgba(148, 163, 184, 0.08);
  color: var(--muted);
}

.usage-pace { margin: 0 0 14px; }
.usage-pace-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
  margin: 0 0 6px;
}
.usage-pace-head strong { color: var(--light-grey); font-weight: 600; }
.usage-pace-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  overflow: hidden;
}
.usage-pace-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}
.usage-pace-fill.green { background: linear-gradient(90deg, #22c55e, #16a34a); }
.usage-pace-fill.amber { background: linear-gradient(90deg, #f59e0b, #d97706); }
.usage-pace-fill.red   { background: linear-gradient(90deg, #ef4444, #b91c1c); }
.usage-pace-expected {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 16px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 2px;
  pointer-events: none;
}

.usage-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 0 0 14px;
}
.usage-stat {
  background: rgba(27, 42, 74, 0.38);
  border: 1px solid var(--navy-line);
  border-radius: 8px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
}
.usage-stat-val {
  font-size: 1.25rem;
  font-weight: 700;
  color: #9ad7ff;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.usage-stat-lbl {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.usage-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  font-size: 0.82rem;
  padding: 0 0 4px;
}
.usage-meta strong { color: var(--light-grey); font-weight: 600; }
.usage-meta .muted { margin-right: 4px; }

/* =====================================================
   Row menu (Phase G — comments-everywhere)
   ===================================================== */
.row-menu-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid transparent;
  background: rgba(12, 22, 40, 0.55);
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease, background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  z-index: 2;
}
[data-row-menu-mounted="1"]:hover .row-menu-btn,
.row-menu-btn:focus,
.row-menu-btn.is-open {
  opacity: 1;
}
.row-menu-btn:hover {
  background: rgba(56,182,255,0.16);
  color: var(--sky);
  border-color: rgba(56,182,255,0.35);
}
/* Table-row host: keep the cell relatively positioned so the button anchors
   to its last-cell instead of the page. Push the cell right-edge down so the
   kebab doesn't collide with existing content. */
td.row-menu-host-cell {
  position: relative;
  padding-right: 34px;
}
td.row-menu-host-cell .row-menu-btn {
  top: 50%;
  transform: translateY(-50%);
  right: 6px;
}

.row-menu-popover {
  position: absolute;
  z-index: 9100;
  min-width: 200px;
  background: var(--navy);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-sm);
  padding: 4px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.row-menu-popover button {
  background: transparent;
  border: none;
  color: var(--light-grey);
  text-align: left;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.row-menu-popover button:hover {
  background: rgba(56,182,255,0.10);
  color: var(--white);
}

.row-menu-modal {
  position: fixed;
  inset: 0;
  background: rgba(9, 14, 28, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
  z-index: 9200;
}
.row-menu-modal-inner {
  width: min(520px, 92vw);
  background: var(--navy);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-md);
  padding: 18px 20px 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
}
.row-menu-modal-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}
.row-menu-modal-head strong {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--white);
  letter-spacing: 0.04em;
}
.row-menu-modal-sub {
  color: var(--muted);
  font-size: 0.78rem;
  flex: 1;
}
.row-menu-modal-head .close-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}
.row-menu-modal-label {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 10px 0 4px;
}
.row-menu-modal-body input[type="text"],
.row-menu-modal-body textarea,
.row-menu-modal-body select {
  width: 100%;
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--light-grey);
  background: #0c1628;
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-sm);
}
.row-menu-modal-body textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
.row-menu-modal-body input[type="text"]:focus,
.row-menu-modal-body textarea:focus,
.row-menu-modal-body select:focus {
  outline: none;
  border-color: var(--sky);
  box-shadow: 0 0 0 2px rgba(56,182,255,0.15);
}
.row-menu-modal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  gap: 12px;
  flex-wrap: wrap;
}
.row-menu-modal-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.8rem;
}
.row-menu-modal-inline {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.row-menu-modal-inline select {
  width: auto;
  min-width: 100px;
}
.row-menu-modal-row .primary {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  background: var(--sky);
  color: var(--navy);
  border: none;
  font-weight: 700;
  cursor: pointer;
}
.row-menu-modal-row .primary:disabled { opacity: 0.55; cursor: not-allowed; }
.row-menu-modal-status {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  min-height: 1em;
}

/* ---------- Follow-up panel (Phase G) ---------- */
.followup-panel {
  background: var(--navy-deep);
  border: 1px solid var(--navy-line);
  border-radius: 10px;
  padding: 16px;
}
.followup-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.followup-title {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--white);
  font-size: 1rem;
}
.followup-sub {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 2px;
}
.followup-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.followup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 820px) { .followup-grid { grid-template-columns: 1fr; } }
.followup-bucket-head {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--navy-line);
}
.followup-bucket-head.owes    { color: var(--danger); border-color: rgba(255,93,93,0.25); }
.followup-bucket-head.waiting { color: var(--amber);  border-color: rgba(255,179,71,0.25); }
.followup-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.followup-row {
  background: rgba(11,21,40,0.6);
  border: 1px solid var(--navy-line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.82rem;
}
.followup-row-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.followup-subject { color: var(--white); font-weight: 500; }
.followup-subject a { color: var(--white); text-decoration: none; }
.followup-subject a:hover { color: var(--sky); }
.followup-row-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
}
.followup-chip {
  background: rgba(56,182,255,0.12);
  color: var(--sky);
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 500;
}
.followup-age { margin-left: auto; color: var(--muted); }
.followup-snippet {
  margin-top: 6px;
  color: var(--light-grey);
  font-size: 0.76rem;
  line-height: 1.4;
  opacity: 0.85;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.followup-dismiss {
  background: transparent;
  border: 1px solid var(--navy-line);
  color: var(--muted);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.followup-dismiss:hover { border-color: var(--danger); color: var(--danger); }
.followup-empty {
  color: var(--muted);
  font-size: 0.82rem;
  padding: 14px 4px;
  text-align: center;
  font-style: italic;
}

/* =========================================================================
   Phase D SSO scaffolding — topbar scope toggle + user chip
   ========================================================================= */
.scope-toggle {
  display: inline-flex;
  border: 1px solid var(--navy-line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(27,42,74,0.35);
}
.scope-btn {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  line-height: 1;
  letter-spacing: 0.01em;
  font-family: inherit;
}
.scope-btn + .scope-btn { border-left: 1px solid var(--navy-line); }
.scope-btn:hover { color: var(--sky); background: rgba(56,182,255,0.08); }
.scope-btn.active {
  background: var(--sky);
  color: var(--navy);
  font-weight: 600;
}

.topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px 3px 4px;
  border: 1px solid var(--navy-line);
  border-radius: 20px;
  background: rgba(27,42,74,0.35);
  font-size: 0.78rem;
  color: var(--light);
}
.topbar-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--sky);
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}
.topbar-user-name {
  font-weight: 500;
  white-space: nowrap;
}
.topbar-user-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  display: none;
}
.topbar-user-logout {
  margin-left: 6px;
  background: transparent;
  border: 1px solid var(--navy-line);
  color: var(--muted);
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
}
.topbar-user-logout:hover {
  color: var(--light);
  border-color: var(--sky);
}
.topbar-user-badge {
  background: rgba(255,176,32,0.18);
  color: var(--amber);
  border: 1px solid rgba(255,176,32,0.35);
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ─────────────────────────────────────────────────────────────
   Phase 6.5 — Success milestones, usage chart, reviews
   ───────────────────────────────────────────────────────────── */

/* Milestones -------------------------------------------------- */
.milestones-body { display:flex; flex-direction:column; gap:10px; margin-top:10px; }
.milestone-row {
  border:1px solid rgba(255,255,255,0.08);
  border-radius:8px;
  padding:10px 12px;
  background:rgba(255,255,255,0.02);
  transition:background 0.15s;
}
.milestone-row[data-state="done"] {
  background:rgba(40,180,99,0.08);
  border-color:rgba(40,180,99,0.25);
}
.milestone-row[data-state="skipped"] {
  opacity:0.6;
}
.milestone-row-head {
  display:flex; flex-wrap:wrap; align-items:center; gap:10px;
  font-size:0.85rem;
}
.milestone-row-head strong { font-weight:600; }
.milestone-group { font-size:0.72rem; text-transform:uppercase; letter-spacing:0.04em; }
.milestone-due { font-size:0.75rem; }
.milestone-desc { font-size:0.78rem; margin-top:4px; }
.milestone-actions { display:flex; gap:6px; margin-top:8px; flex-wrap:wrap; }
.milestone-actions .btn.ghost { background:transparent; border:1px solid rgba(255,255,255,0.15); }

/* Usage chart -------------------------------------------------- */
.usage-chart-wrap { margin-bottom:16px; }
.usage-chart-head {
  display:flex; justify-content:space-between; align-items:baseline;
  font-size:0.82rem; margin-bottom:6px;
}
.usage-chart-svg {
  width:100%; height:auto; display:block;
  background:rgba(255,255,255,0.02);
  border-radius:8px;
  padding:6px 0;
}
.usage-chart-legend {
  display:flex; gap:16px; flex-wrap:wrap;
  font-size:0.75rem; color:var(--muted);
  margin-top:8px;
}
.usage-chart-legend i {
  display:inline-block; width:12px; height:12px; border-radius:2px;
  margin-right:6px; vertical-align:middle;
}

/* Reviews ----------------------------------------------------- */
.reviews-toolbar {
  display:flex; gap:8px; margin-bottom:10px;
}
.review-row {
  border:1px solid rgba(255,255,255,0.08);
  border-radius:8px;
  padding:10px 12px;
  margin-bottom:10px;
  background:rgba(255,255,255,0.02);
}
.review-row-head {
  display:flex; flex-wrap:wrap; align-items:center; gap:10px;
  font-size:0.82rem; margin-bottom:8px;
}
.review-row-head strong { font-weight:600; }
.review-row-head .btn { margin-left:auto; }
.review-body { font-size:0.88rem; line-height:1.45; color:var(--text); white-space:pre-wrap; word-break:break-word; }
.review-next { margin-top:10px; font-size:0.82rem; color:var(--text); opacity:0.9; }
.review-blocker { font-size:0.72rem; text-transform:uppercase; letter-spacing:0.04em; }

.review-composer {
  position:fixed; inset:0; background:rgba(0,0,0,0.55);
  z-index:1000; display:flex; align-items:flex-start; justify-content:center;
  padding:60px 20px 20px; overflow-y:auto;
}
.review-composer-inner {
  width:100%; max-width:580px;
  background:var(--bg-elev, #1a2439);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:12px;
  padding:18px 20px;
}
.review-composer-head {
  display:flex; justify-content:space-between; align-items:center;
  margin-bottom:10px;
}
.review-composer-head .close-btn {
  background:transparent; border:none; color:var(--muted);
  font-size:1.3rem; cursor:pointer; padding:0 4px;
}
.review-composer-row {
  display:grid; grid-template-columns:150px 1fr; gap:12px; margin-bottom:12px;
}
.review-composer-row label,
.review-composer .block-label {
  display:flex; flex-direction:column; gap:4px;
  font-size:0.78rem; color:var(--muted);
}
.review-composer select,
.review-composer input,
.review-composer textarea {
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.1);
  border-radius:6px;
  padding:8px 10px;
  color:var(--text);
  font-family:inherit; font-size:0.88rem;
  width:100%;
}
.review-composer textarea { resize:vertical; }
.review-composer .block-label { margin-bottom:12px; }
.review-composer-foot {
  display:flex; justify-content:space-between; align-items:center;
  margin-top:8px;
}

/* Phase D.2 — mountScopeFilter hides non-matching rows when scope = Mine. */
.scope-hidden { display: none !important; }
