/* ═════════════════════════════════════════════════════════════════════════
   SALES DASHBOARD v3 POLISH — visual layer only (S-171 UI cleanup, page 1).
   Consumed by modules/08b-sales-dashboard.js `_renderDashboardOverview`.
   No behavioural rules here: classes style existing wired elements; every
   data-action / handler is untouched. Tokens come from spartan-tokens.css.
   ═════════════════════════════════════════════════════════════════════════ */

/* ── Live pulse — the brand red heartbeat (eyebrow dot, Activities Today) ── */
@keyframes sp-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(196, 18, 48, 0.45); }
  70%  { box-shadow: 0 0 0 8px rgba(196, 18, 48, 0); }
  100% { box-shadow: 0 0 0 0 rgba(196, 18, 48, 0); }
}
.sp-live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red);
  display: inline-block; flex-shrink: 0;
  animation: sp-pulse 2.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ── iOS-style segmented branch switcher ────────────────────────────────── */
.dash-seg {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--s100);
  border: 1px solid var(--s200);
  border-radius: 16px;
  max-width: 100%; overflow-x: auto;
}
.dash-seg-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 9px 18px; min-width: 128px;
  border: none; border-radius: 12px; background: transparent;
  cursor: pointer; font-family: inherit; text-align: left;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}
.dash-seg-btn:hover { background: rgba(255, 255, 255, 0.6); }
.dash-seg-btn.on {
  background: #fff;
  box-shadow: 0 1px 2px rgba(10, 10, 10, 0.06), 0 4px 12px -6px rgba(10, 10, 10, 0.12);
}
.dash-seg-label {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 700; color: var(--s500); line-height: 1.2;
}
.dash-seg-btn.on .dash-seg-label { color: var(--ink); }
.dash-seg-sub { font-size: 11px; color: var(--s400); white-space: nowrap; }
.dash-seg-btn.on .dash-seg-sub { color: var(--s500); }

/* ── KPI + panel cards — soft iOS card language ─────────────────────────── */
.dash-kpi, .dash-card {
  background: #fff;
  border: 1px solid #efedec;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(10, 10, 10, 0.03), 0 10px 28px -22px rgba(10, 10, 10, 0.22);
}
.dash-kpi {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.dash-kpi:hover {
  transform: translateY(-2px);
  border-color: var(--s200);
  box-shadow: 0 2px 4px rgba(10, 10, 10, 0.04), 0 16px 32px -20px rgba(10, 10, 10, 0.28);
}
.dash-kpi:active { transform: translateY(0); }

/* ── List rows (run-sheet + closest-to-winning) ─────────────────────────── */
.dash-row {
  border-radius: 10px;
  margin: 0 -8px; padding-left: 8px !important; padding-right: 8px !important;
  transition: background 0.15s ease;
}
.dash-row:hover { background: #fafaf9; }

.dash-time-pill {
  font-size: 11px; font-weight: 700; color: var(--s700);
  font-family: Syne, sans-serif;
  background: var(--s100); border-radius: 999px;
  padding: 4px 10px; flex-shrink: 0; line-height: 1;
}

/* Rounded progress bars (closest-to-winning) */
.dash-bar {
  flex: 1; height: 6px; border-radius: 999px;
  background: var(--s100); overflow: hidden;
}
.dash-bar > i {
  display: block; height: 100%; border-radius: 999px;
  /* fill colour stays semantic (branch / green-to-win) via inline style */
}

/* ── S-183 pages 3-4 — shared harmonize for Today + Deals ────────────────── */
/* Deals kanban (legacy .kanban-col / .deal-card, also used by the sales-v2
   wrapper + factory board): same hairline + radius + soft shadow family. */
.kanban-col { border-radius: 16px; border-color: #efedec; }
.deal-card {
  border-radius: 12px; border-color: #efedec;
  box-shadow: 0 1px 2px rgba(10, 10, 10, 0.03);
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.deal-card:hover {
  transform: translateY(-1px);
  border-color: var(--s200, #E7E5E4);
  box-shadow: 0 2px 4px rgba(10, 10, 10, 0.04), 0 12px 24px -16px rgba(10, 10, 10, 0.25);
}

/* ── S-183 global: every page-hero eyebrow carries the pulsing live-dot ──
   One rule covers all 24 pages using the mockup hero chassis (Sales, Jobs,
   Factory, …) so each page doesn't need its own markup. Leads/Won use their
   own eyebrow classes and define the same ::before in their page CSS. */
.page-hero .eyebrow, .eyebrow.sp-live { display: inline-flex; align-items: center; gap: 8px; }
.page-hero .eyebrow::before, .eyebrow.sp-live::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--red, #C41230); flex-shrink: 0;
  animation: sp-pulse 2.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@media (prefers-reduced-motion: reduce) { .page-hero .eyebrow::before, .eyebrow.sp-live::before { animation: none; } }
