/* Statistics group (design review 2026-08, /stats/*). Everything reuses the
   dashboard system — KPI tiles, chart-card, k-card--table, window selector,
   key filters; this file only adds what the stats charts need: line series,
   sample points, the quota threshold rule and the two semantic bar fills.
   Tokenised throughout: both seams flow from --chart-N / --warn / --err. */

/* Line series (p50 / p95, cumulative spend). .seg-N sets fill for bars, so
   lines re-declare fill:none at higher specificity and take the stroke. */
.stats-chart .stats-line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.stats-chart .stats-line--dashed { stroke-dasharray: 5 4; }
.stats-chart .stats-line.seg-0 { stroke: var(--chart-1); fill: none; }
.stats-chart .stats-line.seg-1 { stroke: var(--chart-2); fill: none; }
.stats-chart .stats-line.seg-2 { stroke: var(--chart-3); fill: none; }
.stats-chart .stats-line.seg-3 { stroke: var(--chart-4); fill: none; }

/* Sample points carry the hover label; a surface-coloured ring lifts them
   off the line. */
.stats-chart .stats-point {
  stroke: var(--surface);
  stroke-width: 1.5;
  transition: opacity .12s ease;
}
.stats-chart:hover .stats-point { opacity: .6; }
.stats-chart .stats-point:hover { opacity: 1; }

/* Semantic bar fills (4xx / 5xx / upstream share) — same classes colour the
   legend swatches. */
.stats-chart .stats-fill--warn, .chart-legend .stats-fill--warn { fill: var(--warn); background: var(--warn); }
.stats-chart .stats-fill--err, .chart-legend .stats-fill--err { fill: var(--err); background: var(--err); }
.stats-chart .stats-fill--muted, .chart-legend .stats-fill--muted { fill: var(--line-18); background: var(--line-18); }

/* Line swatches in the legend: a short rule instead of a square. */
.chart-legend__swatch--line { height: 2px; width: 14px; border-radius: 1px; }
.chart-legend__swatch--dashed { opacity: .55; }

/* Quota threshold rule (spend forecast). */
.stats-chart .stats-threshold {
  stroke: var(--err);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}
.stats-chart .stats-threshold__label {
  fill: var(--err);
  font-size: 11px;
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
}

/* Risk chip sits inside a stat tile's value slot at tile scale. */
.kpi-row .stat-value .chip { font-size: 13px; padding: 4px 12px; vertical-align: middle; }
