/* ═══════════════════════════════════════════════════════════
   CHARTS — Canvas wrappers and SVG ring components
   ═══════════════════════════════════════════════════════════ */

.chart-wrap {
  position: relative;
  width: 100%;
}
.chart-wrap canvas { max-width: 100%; display: block; }

/* Height variants */
.ch-sm  { height: 160px; }
.ch-md  { height: 220px; }
.ch-lg  { height: 280px; }
.ch-xl  { height: 360px; }

/* ─── SVG Budget Ring ────────────────────────────────────── */
.ring-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s2);
  cursor: pointer;
  transition: transform 0.15s;
}
.ring-wrap:hover { transform: translateY(-2px); }

.ring-svg { overflow: visible; }

.ring-track {
  fill: none;
  stroke: var(--border-2);
  stroke-width: 5;
  stroke-linecap: round;
}
.ring-fill {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
  transform: rotate(-90deg);
}
.ring-fill.ok   { stroke: var(--green); }
.ring-fill.warn { stroke: var(--yellow); }
.ring-fill.over { stroke: var(--red); }
.ring-fill.blue { stroke: var(--blue); }
.ring-fill.accent { stroke: var(--accent); }

.ring-center-text {
  text-anchor: middle;
  dominant-baseline: middle;
  font-family: var(--mono);
  fill: var(--text-1);
  font-weight: 700;
}

.ring-label {
  font-size: 11px;
  color: var(--text-3);
  text-align: center;
  font-weight: 500;
  line-height: 1.3;
  max-width: 72px;
}
.ring-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  text-align: center;
  font-family: var(--mono);
}

/* ─── Budget ring grid ───────────────────────────────────── */
.rings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: var(--s4) var(--s3);
  padding: var(--s3) 0;
}

/* ─── Sparkline ──────────────────────────────────────────── */
.sparkline-wrap {
  position: relative;
  height: 40px;
}
.sparkline-wrap canvas { max-width: 100%; }

/* ─── Chart empty state ──────────────────────────────────── */
.chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 12px;
  background: var(--bg-1);
  border-radius: var(--r1);
}
