/* ==========================================================================
   DASHBOARD 3 — "Analytics"
   Finance and population insights: joined KPI strip, revenue vs target,
   payer mix, demographics, claims, doctor leaderboard.
   Loaded together with dashboard2.css (shares the .d2-row grid helpers).
   ========================================================================== */

/* ---- Joined KPI strip (one card, four columns) ---- */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
  overflow: hidden;
}
.kpi-strip__item { padding: var(--space-5) var(--space-6); border-right: 1px solid var(--color-border); }
.kpi-strip__item:last-child { border-right: none; }
.kpi-strip__label { font-size: var(--fs-small); color: var(--color-text-secondary); margin-bottom: 6px; }
.kpi-strip__value { font-size: 1.75rem; font-weight: var(--fw-bold); letter-spacing: -0.02em; line-height: 1.1; margin-bottom: 8px; }
.kpi-strip__meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--color-text-muted); }
@media (max-width: 1200px) {
  .kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .kpi-strip__item:nth-child(2) { border-right: none; }
  .kpi-strip__item:nth-child(n+3) { border-top: 1px solid var(--color-border); }
}
@media (max-width: 576px) {
  .kpi-strip { grid-template-columns: 1fr; }
  .kpi-strip__item { border-right: none; }
  .kpi-strip__item:nth-child(n+2) { border-top: 1px solid var(--color-border); }
}

.d2-row--three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1200px) { .d2-row--three { grid-template-columns: 1fr 1fr; } }
@media (max-width: 767px) { .d2-row--three { grid-template-columns: 1fr; } }

/* ---- Payer mix legend ---- */
.payer-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--color-border); }
.payer-row:last-child { border-bottom: none; padding-bottom: 0; }
.payer-row__name { display: flex; align-items: center; gap: 8px; color: var(--color-text-secondary); }
.payer-row strong { font-weight: var(--fw-semibold); }

/* ---- Diagnoses + claims bars ---- */
.bar-row { margin-bottom: var(--space-4); }
.bar-row:last-child { margin-bottom: 0; }
.bar-row__top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.stackbar { display: flex; height: 10px; border-radius: var(--radius-pill); overflow: hidden; gap: 2px; margin-bottom: var(--space-4); }
.stackbar span { display: block; height: 100%; }

/* ---- Leaderboard ---- */
.rank {
  width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-card-alt); color: var(--color-text-secondary);
  font-size: 12px; font-weight: var(--fw-semibold);
}
.rank--1 { background: var(--color-warning-soft); color: var(--color-warning); }
.stars-inline { color: var(--color-warning); font-size: 0.75rem; letter-spacing: 1px; }

/* ---- Insights ---- */
.insight { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--color-border); font-size: var(--fs-small); }
.insight:last-child { border-bottom: none; padding-bottom: 0; }
.insight:first-child { padding-top: 0; }
.insight__icon { width: 34px; height: 34px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.insight p { margin: 0; color: var(--color-text-secondary); }
.insight strong { display: block; color: var(--color-text-primary); margin-bottom: 2px; }
