/* =========================================
   Charts Styling (FINAL – FIXED)
========================================= */

/* -----------------------------------------
   Chart Container (CRITICAL FIX)
----------------------------------------- */
.chart-container {
  width: 100%;
  height: 360px;              /* 🔥 REQUIRED */
  position: relative;
  overflow: hidden;
}

/* -----------------------------------------
   SVG Charts
----------------------------------------- */
.chart-svg {
  width: 100%;
  height: 100%;
  display: block;             /* 🔥 prevents inline SVG gaps */
  overflow: visible;
}

/* -----------------------------------------
   Axes
----------------------------------------- */
.axis path,
.axis line {
  stroke: rgba(229, 231, 235, 0.4);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.axis text {
  fill: #9ca3af;
  font-size: 12px;
}

/* -----------------------------------------
   Data Labels
----------------------------------------- */
.chart-label {
  font-size: 12px;
  fill: #e5e7eb;
}

/* -----------------------------------------
   Legends
----------------------------------------- */
.chart-legend {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #d1d5db;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* -----------------------------------------
   Bars (SAFE MULTI-COLOR)
----------------------------------------- */
.chart-bar {
  transition: opacity 0.2s ease;
}

.chart-bar:nth-child(5n + 1) { fill: #6366f1; }
.chart-bar:nth-child(5n + 2) { fill: #22c55e; }
.chart-bar:nth-child(5n + 3) { fill: #f59e0b; }
.chart-bar:nth-child(5n + 4) { fill: #ef4444; }
.chart-bar:nth-child(5n + 5) { fill: #06b6d4; }

.chart-bar:hover {
  opacity: 0.85;
}

/* -----------------------------------------
   Lines
----------------------------------------- */
.chart-line {
  fill: none;
  stroke: #6366f1;
  stroke-width: 2;
}

/* -----------------------------------------
   Points
----------------------------------------- */
.chart-point {
  fill: #6366f1;
}

/* -----------------------------------------
   Slices (Pie / Donut)
----------------------------------------- */
.chart-slice {
  stroke: #020617;
  stroke-width: 1;
}
