/* ===== CHART CONTAINERS ===== */
.chart-wrap {
  position: relative;
  width: 100%;
}

.chart-radar-lg {
  height: 420px;
  max-height: 50vw;
}
.chart-radar-md {
  height: 300px;
}
.chart-radar-sm {
  height: 220px;
}
.chart-bar-lg {
  height: 320px;
}
.chart-bar-md {
  height: 240px;
}
.chart-line-md {
  height: 220px;
}
.chart-doughnut-md {
  height: 240px;
}
.chart-doughnut-sm {
  height: 160px;
}

/* Responsive chart heights */
@media (max-width: 768px) {
  .chart-radar-lg { height: 300px; }
  .chart-radar-md { height: 250px; }
  .chart-bar-lg   { height: 240px; }
}
@media (max-width: 480px) {
  .chart-radar-lg { height: 250px; }
  .chart-radar-md { height: 200px; }
  .chart-bar-lg   { height: 200px; }
}

/* Chart card */
.chart-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}
.chart-card-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.chart-card-title {
  font-size: var(--text-base);
  font-weight: var(--font-semi);
  color: var(--text-primary);
  display: flex; align-items: center; gap: var(--space-2);
}
.chart-card-body {
  padding: var(--space-6);
}
.chart-card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface2);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Chart legend */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-4);
  justify-content: center;
}
.legend-item {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  cursor: pointer;
  transition: opacity var(--transition-fast);
}
.legend-item.hidden { opacity: 0.4; }
.legend-dot {
  width: 10px; height: 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.legend-line {
  width: 20px; height: 3px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.legend-dash {
  width: 20px; height: 2px;
  border-top: 2px dashed currentColor;
  flex-shrink: 0;
}

/* Chart filter pills */
.chart-filters {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.chart-filter-btn {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  transition: all var(--transition-fast);
}
.chart-filter-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }
.chart-filter-btn.active {
  background: var(--color-primary-500);
  border-color: var(--color-primary-500);
  color: #fff;
}

/* Score gauge (SVG) */
.gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}
.gauge-value {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  line-height: 1;
}
.gauge-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Trend indicator */
.trend-up   { color: var(--color-success-500); }
.trend-down { color: var(--color-danger-500); }
.trend-flat { color: var(--text-muted); }

/* ===== UNIVERSITY OVERVIEW LEGEND ===== */
.dept-legend {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.dept-legend-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: var(--text-xs);
}
.dept-legend-item:hover { border-color: var(--border-strong); background: var(--bg-surface2); }
.dept-legend-item.hidden { opacity: 0.5; }
.dept-legend-color {
  width: 12px; height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ===== GAP ANALYSIS ===== */
.gap-bar-row {
  display: flex; align-items: center; gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.gap-bar-label {
  min-width: 140px;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  text-align: right;
}
.gap-bar-track {
  flex: 1;
  height: 20px;
  background: var(--progress-track);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}
.gap-bar-fill {
  height: 100%;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  color: #fff;
  transition: width 0.8s ease;
}
.gap-bar-fill.critical { background: var(--color-danger-500); }
.gap-bar-fill.moderate { background: var(--color-warning-500); }
.gap-bar-fill.good     { background: var(--color-success-500); }

/* ===== PRIORITY MATRIX ===== */
.priority-matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: var(--space-3);
  height: 280px;
}
.matrix-quadrant {
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  position: relative;
  overflow: hidden;
}
.matrix-q1 { background: rgba(239,68,68,0.08);  border: 1px solid rgba(239,68,68,0.2); }
.matrix-q2 { background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.2); }
.matrix-q3 { background: rgba(14,165,233,0.08); border: 1px solid rgba(14,165,233,0.2); }
.matrix-q4 { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.2); }
.matrix-label {
  font-size: var(--text-xs);
  font-weight: var(--font-semi);
  margin-bottom: var(--space-2);
}
.matrix-q1 .matrix-label { color: var(--color-danger-600); }
.matrix-q2 .matrix-label { color: var(--color-warning-600); }
.matrix-q3 .matrix-label { color: var(--color-info-600); }
.matrix-q4 .matrix-label { color: var(--color-success-600); }

/* ===== SPARKLINE ===== */
.sparkline-wrap {
  display: flex; align-items: center; gap: var(--space-3);
}
.sparkline-canvas {
  width: 80px; height: 30px;
}

/* ===== LOADING SKELETON ===== */
.chart-skeleton {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  flex-direction: column;
  gap: var(--space-3);
  animation: pulse 1.5s ease-in-out infinite;
}
.chart-skeleton i { font-size: 2rem; opacity: 0.3; }
