/* ────────────────────────────────────────────────────────────────────
 * Spartan CRM — V2.1 shared conventions (WIP-V2.1-PAGES-POLISH-01)
 *
 * Lifted from the polish audit: purple highlights, AI summary card
 * (Deal-Detail-aligned), gap-card state colours, critical pulses,
 * lead-time mini tags, empty-state panel, red-pulse for critical CTAs.
 *
 * Applied to .wtc-page, .fd-page, .cp-page, .is-v21-wrap. Classes are
 * generic (no namespace) so the polish doc's class names lift verbatim —
 * collisions avoided because the page roots set their own scoped tokens.
 * ──────────────────────────────────────────────────────────────────── */

/* ── Purple highlights ─────────────────────────────────────────────── */
.wtc-page .purple-hi,
.fd-page  .purple-hi,
.cp-page  .purple-hi,
.is-v21-wrap .purple-hi {
  color: #fff;
  font-weight: 700;
  background: rgba(124,58,237,.18);
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
}
.wtc-page .purple-hi-light,
.fd-page  .purple-hi-light,
.cp-page  .purple-hi-light,
.is-v21-wrap .purple-hi-light {
  color: #7C3AED;
  font-weight: 700;
  background: rgba(124,58,237,.10);
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
}

/* ── AI Summary card (light, Deal-Detail aligned) ──────────────────── */
.ai-summary-v21 {
  --ai-purple:#7C3AED;
  --ai-purple-bg:rgba(124,58,237,.06);
  background: linear-gradient(135deg, #fff 0%, var(--ai-purple-bg) 100%);
  border: 1px solid rgba(124,58,237,.2);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(10,10,10,.03), 0 1px 1px rgba(10,10,10,.02);
  display: flex;
  align-items: stretch;
}
.ai-summary-v21 .ai-spark-col {
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  border-right: 1px dashed rgba(124,58,237,.18);
  background: linear-gradient(180deg, rgba(124,58,237,.04) 0%, rgba(124,58,237,.08) 100%);
}
.ai-summary-v21 .ai-spark-icon {
  width: 40px; height: 40px; border-radius: 11px;
  background: linear-gradient(135deg, #7C3AED 0%, #A855F7 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px -2px rgba(124,58,237,.4);
  animation: v21-ai-glow 2.4s ease-in-out infinite;
}
.ai-summary-v21 .ai-spark-icon svg { width: 20px; height: 20px; }
.ai-summary-v21 .ai-spark-label {
  font-size: 9px; font-weight: 800; letter-spacing: 0.18em;
  text-transform: uppercase; color: #7C3AED;
  text-align: center; line-height: 1.2;
  font-family: 'Archivo Narrow', sans-serif;
}
.ai-summary-v21 .ai-body {
  flex: 1; min-width: 0;
  padding: 14px 18px;
  display: flex; flex-direction: column; gap: 7px;
}
.ai-summary-v21 .ai-h {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.ai-summary-v21 .ai-eyebrow {
  font-size: 10px; font-weight: 800; letter-spacing: 0.18em;
  text-transform: uppercase; color: #7C3AED;
  font-family: 'Archivo Narrow', sans-serif;
}
.ai-summary-v21 .ai-meta {
  font-size: 10.5px; color: #78716C; font-weight: 600;
  font-family: 'Archivo Narrow', sans-serif; letter-spacing: .02em;
}
.ai-summary-v21 .ai-meta b { color: #0A0A0A; font-weight: 700; }
.ai-summary-v21 .ai-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.ai-summary-v21 .ai-action-btn {
  padding: 5px 10px;
  font-size: 10.5px; font-weight: 700;
  color: #44403C; background: #fff;
  border: 1px solid #E7E5E4; border-radius: 6px;
  cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 4px;
  transition: all 180ms cubic-bezier(.4,0,.2,1);
}
.ai-summary-v21 .ai-action-btn:hover {
  background: #7C3AED; color: #fff; border-color: #7C3AED;
  transform: translateY(-1px);
}
.ai-summary-v21 .ai-action-btn svg { width: 11px; height: 11px; }
.ai-summary-v21 .ai-text {
  font-size: 13px; color: #0A0A0A; font-weight: 500;
  line-height: 1.55; letter-spacing: -0.005em; margin: 0;
}
/* `<b>` inside AI text gets the inline purple highlight automatically. */
.ai-summary-v21 .ai-text b,
.ai-summary-v21 .ai-text .purple-hi-light {
  font-weight: 700;
  color: #7C3AED;
  background: rgba(124,58,237,.08);
  padding: 0 3px;
  border-radius: 3px;
}
.ai-summary-v21 .ai-foot {
  display: flex; align-items: center; gap: 8px;
  padding-top: 6px; border-top: 1px dashed rgba(124,58,237,.15);
  flex-wrap: wrap;
  font-family: 'Archivo Narrow', sans-serif;
  font-size: 10px; color: #78716C; font-weight: 600;
}
.ai-summary-v21 .ai-foot b { color: #44403C; font-weight: 700; }

@keyframes v21-ai-glow {
  0%, 100% { box-shadow: 0 4px 12px -2px rgba(124,58,237,.4); }
  50%      { box-shadow: 0 4px 18px -2px rgba(124,58,237,.7); }
}

/* ── Pulse keyframes ────────────────────────────────────────────────── */
@keyframes pulse-gap-critical {
  0%,100% { box-shadow: 0 0 0 0 rgba(220,38,38,.5), inset 0 0 0 1px rgba(220,38,38,.5); }
  50%     { box-shadow: 0 0 0 8px rgba(220,38,38,0), inset 0 0 0 2px rgba(220,38,38,.8); }
}
@keyframes pulse-cell-critical {
  0%,100% { box-shadow: 0 0 0 0 rgba(220,38,38,.4); }
  50%     { box-shadow: 0 0 0 5px rgba(220,38,38,0); }
}
@keyframes pulse-btn-red {
  0%,100% { box-shadow: 0 0 0 0 rgba(196,18,48,.55), 0 4px 12px -2px rgba(196,18,48,.45); }
  50%     { box-shadow: 0 0 0 8px rgba(196,18,48,0),   0 6px 18px -2px rgba(196,18,48,.65); }
}

@media (prefers-reduced-motion: reduce) {
  .wtc-page .gap-card.critical,
  .wtc-page .pulse-gap-critical,
  .wtc-page .pulse-cell-critical,
  .wtc-page .btn-pulse-red,
  .fd-page  .btn-pulse-red,
  .cp-page  .btn-pulse-red,
  .is-v21-wrap .btn-pulse-red,
  .ai-summary-v21 .ai-spark-icon {
    animation: none !important;
  }
}

/* ── Red-pulse for critical CTAs ────────────────────────────────────── */
.btn-pulse-red {
  animation: pulse-btn-red 1.8s ease-in-out infinite;
}

/* ── Gap card state colours (Weekly Target Console) ─────────────────── */
.wtc-page .wtc-gap-card.critical {
  background: rgba(220,38,38,.12);
  border: 1.5px solid rgba(220,38,38,.5);
  animation: pulse-gap-critical 2.2s ease-in-out infinite;
}
.wtc-page .wtc-gap-card.critical .wtc-gap-card-label,
.wtc-page .wtc-gap-card.critical .wtc-gap-card-amount { color: #EF4444; }
.wtc-page .wtc-gap-card.warn {
  background: rgba(245,158,11,.12);
  border: 1px solid rgba(245,158,11,.3);
}
.wtc-page .wtc-gap-card.warn .wtc-gap-card-label,
.wtc-page .wtc-gap-card.warn .wtc-gap-card-amount { color: #F59E0B; }
.wtc-page .wtc-gap-card.over {
  background: rgba(14,165,233,.1);
  border: 1px solid rgba(14,165,233,.3);
}
.wtc-page .wtc-gap-card.over .wtc-gap-card-label,
.wtc-page .wtc-gap-card.over .wtc-gap-card-amount { color: #67E8F9; }
.wtc-page .wtc-gap-card.muted {
  background: rgba(255,255,255,.04);
  border: 1px solid #292524;
}
.wtc-page .wtc-gap-card.muted .wtc-gap-card-label,
.wtc-page .wtc-gap-card.muted .wtc-gap-card-amount { color: #78716C; }

/* ── Empty state panel ──────────────────────────────────────────────── */
.empty-state-v21 {
  padding: 32px 24px;
  text-align: center;
  background: #FAFAF9;
  border: 1px dashed #D6D3D1;
  border-radius: 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  margin: 18px 22px;
}
.empty-state-v21 .empty-state-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: #F5F5F4; color: #78716C;
  display: flex; align-items: center; justify-content: center;
}
.empty-state-v21 .empty-state-icon svg { width: 18px; height: 18px; }
.empty-state-v21 .empty-state-title { font-weight: 700; font-size: 13px; color: #44403C; }
.empty-state-v21 .empty-state-sub {
  font-size: 11.5px; color: #78716C;
  line-height: 1.4; max-width: 480px;
}

/* ── Lead-time mini tag (Schedule + WTC shortlist) ──────────────────── */
.lead-mini {
  font-family: 'Archivo Narrow', sans-serif;
  font-size: 9px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 1px 5px; border-radius: 3px; margin-top: 2px;
  display: inline-block; width: max-content; line-height: 1.3;
}
.lead-mini.standard { display: none; }
.lead-mini.medium    { background: rgba(245,158,11,.18); color: #92400E; border: .5px solid rgba(245,158,11,.45); }
.lead-mini.special   { background: rgba(220,38,38,.18); color: #991B1B; border: .5px solid rgba(220,38,38,.45); }
.lead-mini.emergency { background: #DC2626; color: #fff; }
.lead-mini.service   { background: rgba(34,197,94,.18); color: #166534; border: .5px solid rgba(34,197,94,.45); }

/* ── Bar empty hint (segmented bar with zero data) ─────────────────── */
.bar-empty-hint {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  font-family: 'Archivo Narrow', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: #78716C; white-space: nowrap; pointer-events: none;
}

/* ── Status text colours (inside hero status: "on pace" / "at risk") ── */
.status-risk { color: #EF4444; font-weight: 800; }
.status-ok   { color: #22C55E; font-weight: 800; }
.status-over { color: #67E8F9; font-weight: 800; }
.status-muted{ color: #A8A29E; font-weight: 700; }
