/* ════════════════════════════════════════════════════════════════════
   KPI cards (Spartan summary style)
   ────────────────────────────────────────────────────────────────────
   The inline `?` help tooltip is the .hint primitive — see
   css/components/hint.css.
   ════════════════════════════════════════════════════════════════════ */

.kpi-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin-bottom: 24px;
}
.kpi {
  position: relative;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color .3s, transform .3s;
}
/* Lift hovered KPI above the chart canvases below. Chart canvases sit at
   z-index: 1 in the root stacking context; a tooltip rendered inside .kpi
   at z-index 60 still loses against them unless its container also escapes
   the default stacking layer. */
.kpi:hover { border-color: var(--border-strong); transform: translateY(-1px); z-index: 10; }
.kpi-label {
  color: var(--muted-foreground);
  font-size: 12px; font-weight: 500;
  margin-bottom: 4px;
}
.kpi-value {
  font-size: 24px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.kpi-value .kpi-yield {
  display: inline-block; margin-left: 8px;
  font-size: 13px; font-weight: 500;
  color: var(--profit);
}
/* Inline secondary stat next to a primary KPI value (e.g. "+$12K (45% APR)").
   Muted + smaller so the dollar figure remains the visual anchor. */
.kpi-value .kpi-aux {
  display: inline-block; margin-left: 8px;
  font-size: 13px; font-weight: 500;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}
/* Secondary stat that sits beneath the primary KPI value */
.kpi-sub {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  color: var(--foreground);
}
.kpi-sub-label {
  color: var(--muted-foreground);
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .08em;
  display: inline-flex; align-items: center; gap: 6px;
}

/* Responsive — collapse to single column on narrow viewports. */
@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(1, 1fr); }
}
