/* ═══════════════════════════════════════════════════
   CHARTS — Analytics visualizations layout
   ═══════════════════════════════════════════════════ */

/* ── Analytics Container ── */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px;
  overflow-y: auto;
  height: 100%;
}

/* ── Chart Card ── */
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-height: 200px;
  transition: border-color var(--transition-fast);
}
.chart-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
}
.chart-card.full-width {
  grid-column: 1 / -1;
}

/* ── Chart Header ── */
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.chart-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
}
.chart-subtitle {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ── Chart Body ── */
.chart-body {
  flex: 1;
  position: relative;
  min-height: 150px;
}
.chart-body canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ── Loading State ── */
.chart-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 11px;
  gap: 8px;
}
.chart-loading::before {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: chartSpin 0.8s linear infinite;
}
@keyframes chartSpin {
  to { transform: rotate(360deg); }
}

/* ── Error State ── */
.chart-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--accent-rose);
  font-size: 11px;
}

/* ── KPI Summary Row ── */
.analytics-kpis {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
}
.analytics-kpi {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  text-align: center;
}
.analytics-kpi .akv {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-mono);
}
.analytics-kpi .akl {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}
