/* ═══════════════════════════════════════════════════════
   Spendlyst — Chart Styles
   Wrappers and containers for dashboard chart areas.
   ═══════════════════════════════════════════════════════ */

.chart-container {
  position: relative;
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.chart-title {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
}

.chart-period {
  display: flex;
  gap: var(--space-1);
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  padding: var(--space-1);
}

.chart-period-btn {
  padding: var(--space-1) var(--space-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  transition: all var(--duration-fast);
}

.chart-period-btn.active,
.chart-period-btn:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}

.chart-canvas {
  width: 100%;
  min-height: 240px;
}

/* ── Donut legend ────── */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

.chart-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Mini sparkline ──── */
.sparkline-container {
  width: 80px;
  height: 28px;
}

@media (max-width: 768px) {
  .chart-canvas { min-height: 200px; }
}
