/**
 * =============================================================================
 * 03-components.css
 * =============================================================================
 * Components UI: cards, badges, pills, tabs, botons, alerts i elements visuals.
 *
 * @package    temperatura.viladrau.online
 * @author     Andreu Pujol <hola@andreupujol.dev>
 * @version    1.0.0
 * @created    2025-11-27
 * =============================================================================
 */

/* =============================================================================
   1. Card base
   ============================================================================= */
.card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 16px 60px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(226, 232, 240, 0.8);
  animation: floatIn 0.6s ease forwards;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 70px rgba(15, 23, 42, 0.25);
}

/* =============================================================================
   2. Metric cards (targetes de mètriques)
   ============================================================================= */
.metric-card {
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 20% 20%,
    rgba(14, 165, 233, 0.08),
    transparent 32%
  );
  pointer-events: none;
}

.metric-card.cool {
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--temp-cool) 12%, transparent),
    var(--bg-card)
  );
}

.metric-card.warm {
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--temp-warm) 12%, transparent),
    var(--bg-card)
  );
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.metric-icon {
  font-size: 1.2rem;
}

.metric-value {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 6px 0;
}

/* =============================================================================
   3. Temperature display (targeta actual en vertical)
   ============================================================================= */
.temp {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--color-primary);
  margin: 12px 0;
  animation: pulseTemp 2.2s ease-in-out infinite;
  text-align: center;
}

.current-card-vertical {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.current-card-vertical .metric-top {
  width: 100%;
}

.current-meta-vertical {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: 100%;
}

.current-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-bottom: 8px;
}

.current-date-line,
.current-time-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.current-date-line span:last-child,
.current-time-line span:last-child {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
}

.current-separator {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.2) 50%, transparent);
  margin: 8px 0;
}

.current-predictions-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
}

.current-predictions-title {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ai-primary);
  margin-bottom: 6px;
}

.current-predictions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.current-pred-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px;
  background: rgba(168, 85, 247, 0.05);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.current-pred-item:hover {
  background: rgba(168, 85, 247, 0.1);
  transform: translateY(-1px);
}

.current-pred-item .pred-value {
  font-weight: 700;
  color: var(--ai-primary);
  font-size: 1.05rem;
}

.current-card-vertical.shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(14, 165, 233, 0.12) 40%,
    rgba(22, 163, 74, 0.16) 60%,
    transparent 100%
  );
  transform: translateX(-120%);
  animation: sweep 1.1s ease;
  pointer-events: none;
}

.halo {
  box-shadow: 0 0 0 rgba(14, 165, 233, 0.0);
  animation: halo 1.8s ease-out forwards;
}

/* =============================================================================
   4. Badges
   ============================================================================= */
.badge {
  background: var(--bg-card);
  color: var(--color-secondary);
  border-radius: 9999px;
  padding: 4px 10px;
  font-size: 0.8rem;
}

/* =============================================================================
   5. Pills (status indicators)
   ============================================================================= */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(14, 165, 233, 0.1);
  color: var(--color-primary);
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 600;
  font-size: 0.9rem;
}

.status-pill {
  background: rgba(16, 185, 129, 0.12);
  color: var(--color-secondary);
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-size: 0.75rem;
}

/* =============================================================================
   6. Trend indicators
   ============================================================================= */
.trend {
  font-weight: 700;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trend.hot {
  color: var(--color-danger);
}

.trend.cool {
  color: var(--color-primary);
}

.trend.muted {
  color: var(--text-muted);
}

/* =============================================================================
   7. Tabs (botons de control)
   ============================================================================= */
.tab {
  padding: 10px 18px;
  border-radius: 12px;
  border: 2px solid var(--border-color);
  background: var(--color-slate-50);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.9rem;
  position: relative;
  overflow: hidden;
  min-width: 56px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08);
}

.tab::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(168, 85, 247, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tab:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
  border-color: var(--color-primary);
}

.tab:hover::before {
  opacity: 1;
}

.tab.active {
  background: linear-gradient(135deg, var(--color-primary), #0284c7);
  color: white;
  border-color: var(--color-primary);
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.5);
  transform: translateY(-2px) scale(1.05);
  font-weight: 800;
}

.tab:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

/* =============================================================================
   8. Legend chips (llegenda gràfiques)
   ============================================================================= */
.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--color-slate-50);
  transition: all 0.16s ease;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.legend-chip .dot {
  width: 10px;
  height: 10px;
  border-radius: 9999px;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}

.legend-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.1);
  border-color: var(--color-slate-300);
}

.legend-chip.is-muted {
  opacity: 0.45;
  border-style: dashed;
  background: transparent;
}

/* =============================================================================
   9. Alerts (avisos)
   ============================================================================= */
.alert {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

/* =============================================================================
   10. Toast alerts (notificacions flotants)
   ============================================================================= */
.toast-alert {
  position: fixed;
  top: 80px;
  right: 20px;
  background: var(--bg-card);
  border-left: 4px solid var(--color-accent);
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.3);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  gap: 12px;
  max-width: 360px;
  transform: translateX(420px);
  transition: transform 0.3s ease;
  z-index: 1000;
}

.toast-alert.show {
  transform: translateX(0);
}

.toast-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.toast-alert strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.toast-alert p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* =============================================================================
   11. Targetes verticals (min/max apilats verticalment)
   ============================================================================= */
.metric-card-vertical {
  background: linear-gradient(135deg, var(--color-slate-50) 0%, var(--bg-card) 100%);
}

.metric-vertical-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 10px 0;
}

.metric-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.metric-item.cool {
  background: rgba(14, 165, 233, 0.05);
}

.metric-item.warm {
  background: rgba(245, 158, 11, 0.05);
}

.metric-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.metric-label-tiny {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.metric-value-md {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
}

.metric-item.cool .metric-value-md {
  color: var(--color-primary);
}

.metric-item.warm .metric-value-md {
  color: var(--color-accent);
}

.metric-variation {
  text-align: center;
  padding: 6px 12px;
  background: rgba(100, 116, 139, 0.05);
  border-radius: 6px;
  margin-top: 4px;
}

.metric-footer {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(100, 116, 139, 0.1);
  text-align: center;
}

.metric-footer > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-footer span {
  font-weight: 600;
  color: var(--text-secondary);
}

/* Targeta unificada (Avui + Rècords) - Layout vertical amb separació clara */
.metric-card-unified {
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, var(--color-slate-50) 0%, var(--bg-card) 100%);
  position: relative;
  overflow: hidden;
}

.temps-layout-vertical {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.temps-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(100, 116, 139, 0.02);
  border: 1px solid rgba(100, 116, 139, 0.08);
  transition: all 0.3s ease;
}

.temps-column:hover {
  background: rgba(100, 116, 139, 0.04);
  border-color: rgba(100, 116, 139, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.temps-header {
  display: flex;
  flex-direction: row;
  align-items: center; justify-content: space-between;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(100, 116, 139, 0.12);
}

.temps-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.temps-title::before {
  content: "📅";
  font-size: 1rem;
}

.temps-date {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.4;
  text-align: left;
  width: 100%;
}

.temps-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.temps-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border-radius: 10px;
  background: rgba(100, 116, 139, 0.04);
  border: 1px solid rgba(100, 116, 139, 0.1);
  transition: all 0.2s ease;
}

.temps-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

.temps-item.warm {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.05));
  border-color: rgba(245, 158, 11, 0.2);
}

.temps-item.warm:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(245, 158, 11, 0.08));
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.temps-item.cool {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(14, 165, 233, 0.05));
  border-color: rgba(14, 165, 233, 0.2);
}

.temps-item.cool:hover {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.18), rgba(14, 165, 233, 0.08));
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

.temps-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.temps-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  text-align: center;
  line-height: 1;
}

.temps-item.warm .temps-value {
  color: var(--color-accent);
}

.temps-item.cool .temps-value {
  color: var(--color-primary);
}

/* =============================================================================
   12. Targeta de predicció destacada
   ============================================================================= */
.metric-card-prediction {
  background: linear-gradient(
    135deg,
    rgba(168, 85, 247, 0.08) 0%,
    rgba(168, 85, 247, 0.02) 50%,
    var(--bg-card) 100%
  );
  border: 2px solid rgba(168, 85, 247, 0.2);
  position: relative;
  overflow: hidden;
}

.metric-card-prediction::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  background: radial-gradient(
    circle,
    rgba(168, 85, 247, 0.15),
    transparent 70%
  );
  pointer-events: none;
  animation: pulse 4s ease-in-out infinite;
}

.prediction-badge {
  background: linear-gradient(135deg, var(--ai-primary), var(--ai-secondary));
  color: white;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1px;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.4);
}

.prediction-badge-link {
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.prediction-badge-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(168, 85, 247, 0.6);
}

.prediction-main {
  margin: 12px 0;
}

.prediction-temp {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--ai-primary);
  line-height: 1;
  margin-bottom: 8px;
}

.prediction-confidence {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

.confidence-bar {
  flex: 1;
  height: 8px;
  background: rgba(168, 85, 247, 0.1);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.confidence-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ai-primary), var(--ai-secondary));
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.confidence-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  animation: shine 2s ease-in-out infinite;
}

.confidence-value {
  font-weight: 700;
  color: var(--ai-primary);
  min-width: 40px;
  text-align: right;
}

.prediction-stats-enhanced {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(168, 85, 247, 0.1);
}

.prediction-stat-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: rgba(168, 85, 247, 0.04);
  border: 1px solid rgba(168, 85, 247, 0.15);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.prediction-stat-box:hover {
  background: rgba(168, 85, 247, 0.08);
  border-color: rgba(168, 85, 247, 0.25);
}

.stat-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-icon {
  font-size: 0.9rem;
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ai-primary);
  text-align: center;
}

.stat-desc {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
}

/* Prediccions esteses (dia/setmana/mes) */
.prediction-extended {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(168, 85, 247, 0.1);
}

.prediction-extended-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  background: rgba(168, 85, 247, 0.05);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.prediction-extended-item:hover {
  background: rgba(168, 85, 247, 0.1);
  transform: translateY(-2px);
}

.prediction-extended-value {
  font-weight: 700;
  color: var(--ai-primary);
  font-size: 1rem;
}

/* Timeline controls */
.prediction-timeline {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(168, 85, 247, 0.15);
}

.timeline-label {
  text-align: center;
  margin-bottom: 8px;
}

.timeline-controls {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.timeline-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid rgba(168, 85, 247, 0.3);
  background: rgba(168, 85, 247, 0.05);
  color: var(--ai-primary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.timeline-btn:hover {
  background: rgba(168, 85, 247, 0.15);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.2);
}

.timeline-btn:active {
  transform: translateY(0);
}

.timeline-btn-primary {
  background: linear-gradient(135deg, var(--ai-primary) 0%, var(--ai-secondary) 100%);
  color: white;
  border-color: var(--ai-primary);
}

.timeline-btn-primary:hover {
  background: linear-gradient(135deg, var(--ai-secondary) 0%, var(--ai-primary) 100%);
  box-shadow: 0 2px 12px rgba(168, 85, 247, 0.4);
}

.timeline-btn span {
  font-size: 0.9rem;
}

/* =============================================================================
   13. Mini gràfica de predicció
   ============================================================================= */
.metric-card-mini-chart {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card) 100%);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.metric-card-mini-chart canvas {
  margin: 8px 0;
  max-height: 80px;
}

.prediction-summary {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  padding-top: 6px;
  border-top: 1px solid var(--border-color);
}

/* =============================================================================
   14. Badges de qualitat del model
   ============================================================================= */
.quality-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-left: 6px;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
}

.quality-badge:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.5);
}

.quality-badge.excellent {
  background: linear-gradient(135deg, var(--color-secondary), var(--color-secondary));
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.quality-badge.good {
  background: linear-gradient(135deg, var(--temp-cold), var(--temp-cold));
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.quality-badge.fair {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent));
  color: white;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.quality-badge.improving {
  background: linear-gradient(135deg, var(--ai-primary), var(--ai-primary));
  color: white;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.quality-badge.training {
  background: linear-gradient(135deg, var(--text-secondary), var(--text-secondary));
  color: white;
  box-shadow: 0 2px 8px rgba(100, 116, 139, 0.3);
}

.quality-badge.poor {
  background: linear-gradient(135deg, var(--temp-hot), var(--color-danger));
  color: white;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* =============================================================================
   15. Estats de confiança per targeta de predicció
   ============================================================================= */
.metric-card-prediction.high-confidence {
  border-color: rgba(16, 185, 129, 0.4);
}

.metric-card-prediction.high-confidence::before {
  background: radial-gradient(
    circle,
    rgba(16, 185, 129, 0.15),
    transparent 70%
  );
}

.metric-card-prediction.medium-confidence {
  border-color: rgba(59, 130, 246, 0.4);
}

.metric-card-prediction.low-confidence {
  border-color: rgba(245, 158, 11, 0.4);
}

.metric-card-prediction.low-confidence::before {
  background: radial-gradient(
    circle,
    rgba(245, 158, 11, 0.15),
    transparent 70%
  );
}

/* =============================================================================
   16. Utilitats de text
   ============================================================================= */
.tiny {
  font-size: 0.7rem;
}

/* =============================================================================
   17. Barra d'informació de predicció automàtica
   ============================================================================= */
.prediction-info-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(168, 85, 247, 0.03));
  border-radius: 10px;
  border: 1px solid rgba(168, 85, 247, 0.2);
  margin-top: 8px;
  text-align: center;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 180px;
}

.control-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.control-value {
  background: rgba(168, 85, 247, 0.1);
  color: var(--ai-primary);
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.8rem;
}

/* Sliders personalitzats */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.2), rgba(168, 85, 247, 0.5));
  outline: none;
  transition: opacity 0.2s;
}

.slider:hover {
  opacity: 0.8;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ai-primary), var(--ai-secondary));
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 6px 16px rgba(168, 85, 247, 0.6);
}

.slider::-webkit-slider-thumb:active {
  transform: scale(0.95);
}

.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ai-primary), var(--ai-secondary));
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.slider::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 6px 16px rgba(168, 85, 247, 0.6);
}

/* Botó de refresc */
.btn-refresh {
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--ai-primary), var(--ai-secondary));
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
  white-space: nowrap;
}

.btn-refresh:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(168, 85, 247, 0.5);
}

.btn-refresh:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.3);
}

.btn-refresh:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* =============================================================================
   18. Widget de comparativa predicció vs realitat
   ============================================================================= */
.comparison-widget {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card) 100%);
  border: 2px solid rgba(59, 130, 246, 0.2);
}

.comparison-content {
  margin-top: 8px;
}

.comparison-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(59, 130, 246, 0.05);
  border-radius: 10px;
}

.comparison-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-value.highlight {
  color: var(--temp-cold);
  text-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.btn-toggle {
  padding: 6px 12px;
  background: rgba(59, 130, 246, 0.1);
  color: var(--temp-cold);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-toggle:hover {
  background: rgba(59, 130, 246, 0.2);
  transform: translateY(-1px);
}

/* =============================================================================
   19. Targeta predicció 7 dies (optimitzada per compacte)
   ============================================================================= */
.metric-card-forecast-5d {
  background: linear-gradient(135deg, #f0fdf4 0%, #fff 100%);
  border: 2px solid rgba(34, 197, 94, 0.2);
  display: flex;
  flex-direction: column;
  gap: 0 !important;
  min-height: 0;
  position: relative;
  overflow: visible; /* Changed from hidden to visible */
  padding: 16px 16px 16px 16px !important;
  border-radius: 14px;
}

.metric-card-forecast-5d::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(
    circle,
    rgba(34, 197, 94, 0.08),
    transparent 70%
  );
  pointer-events: none;
}

.metric-card-forecast-5d > * {
  margin: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.metric-card-forecast-5d .metric-top {
  margin: 0 !important;
  padding: 0 !important;
  margin-bottom: 4px !important;
}

.metric-card-forecast-5d .title {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.2;
}

.forecast-5d-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 0 !important;
  padding: 0 !important;
  min-height: auto;
  align-items: stretch;
  /* Assegurar que tots els 7 dies es vegin */
  overflow: visible;
  width: 100%;
}

.forecast-day {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 12px 10px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(34,197,94,0.1), rgba(14,165,233,0.08));
  border: 1px solid rgba(34, 197, 94, 0.25);
  transition: all 0.2s ease;
  cursor: pointer;
}

.forecast-day:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(34,197,94,0.16), rgba(14,165,233,0.14));
  border-color: rgba(14, 165, 233, 0.5);
  box-shadow: 0 6px 14px rgba(14, 165, 233, 0.28);
}

.forecast-day-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.2px;
  line-height: 1.25;
  margin-bottom: 4px;
}

.forecast-day-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.forecast-icon {
  font-size: 1.9rem;
  line-height: 1;
  flex-shrink: 0;
}

.forecast-temps {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: baseline;
}

.forecast-temp-max {
  font-size: 1rem;
  font-weight: 800;
  color: #ef4444;
  line-height: 1.1;
}

.forecast-temp-max::before {
  content: "Max: ";
  font-weight: 700;
  opacity: 0.85;
  font-size: 0.75rem;
}

.forecast-temp-min {
  font-size: 1rem;
  font-weight: 800;
  color: #0ea5e9;
  line-height: 1.1;
}

.forecast-temp-min::before {
  content: "Min: ";
  font-weight: 700;
  opacity: 0.85;
  font-size: 0.75rem;
}

/* Skeleton per forecast */
.forecast-day-skeleton {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 10px;
  background: rgba(203, 213, 225, 0.2);
}

.skeleton-text {
  width: 30px;
  height: 10px;
  background: linear-gradient(90deg, var(--border-color) 25%, var(--color-slate-100) 50%, var(--border-color) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}

.skeleton-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(90deg, var(--border-color) 25%, var(--color-slate-100) 50%, var(--border-color) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 50%;
}

.skeleton-temp {
  width: 40px;
  height: 20px;
  background: linear-gradient(90deg, var(--border-color) 25%, var(--color-slate-100) 50%, var(--border-color) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}

/* =============================================================================
   20. Mini gràfica de tendència predicció 7 dies (més prominent)
   ============================================================================= */
.forecast-mini-chart-container {
  width: 100%;
  height: 140px;
  margin-top: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  border: 1px solid rgba(34, 197, 94, 0.15);
}

/* =============================================================================
   21. Bloc fusionat de predicció (vista compacta + gràfica + mètriques)
   ============================================================================= */
.prediction-unified-card {
  position: relative;
  overflow: visible;
}

.prediction-unified-card #predictionChart {
  min-height: 300px;
}

.prediction-compact-view {
  margin-bottom: 20px;
  padding: 16px;
  background: linear-gradient(135deg, #f0fdf4 0%, #fff 100%);
  border-radius: 12px;
  border: 2px solid rgba(34, 197, 94, 0.2);
}

.prediction-validation-card {
  margin: 12px 0 20px;
  padding: 14px 16px;
  background: rgba(15, 23, 42, 0.03);
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.validation-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.daily-validation-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.daily-validation-item {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

.daily-validation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-weight: 800;
  color: var(--text-primary);
}

.daily-validation-error {
  display: flex;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 700;
}

.daily-validation-error span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip-ok {
  color: #15803d;
}

.chip-warn {
  color: #b45309;
}

.chip-bad {
  color: #dc2626;
}

.prediction-model-metrics {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(168,85,247,0.08), rgba(14,165,233,0.08));
  border-radius: 8px;
  flex-wrap: wrap;
  border: 1px solid rgba(168,85,247,0.15);
}

.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #0ea5e9;
  background: rgba(14, 165, 233, 0.1);
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid rgba(14, 165, 233, 0.18);
}

.pill-link:hover {
  background: rgba(14, 165, 233, 0.16);
}

/* =============================================================================
   22. Tooltips per informació del model
   ============================================================================= */
.info-tooltip {
  position: relative;
  cursor: help;
}

.info-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  line-height: 14px;
  text-align: center;
  background: rgba(168, 85, 247, 0.15);
  border-radius: 50%;
  font-size: 0.65rem;
  margin-left: 4px;
  cursor: help;
  transition: all 0.2s ease;
}

.info-icon:hover {
  background: rgba(168, 85, 247, 0.3);
  transform: scale(1.1);
}

.info-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 10px;
  padding: 12px 16px;
  background: var(--text-primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
  border-radius: 8px;
  white-space: normal;
  width: 280px;
  max-width: 90vw;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 1000;
  text-align: left;
}

.info-tooltip::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 2px;
  border: 8px solid transparent;
  border-top-color: var(--text-primary);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1001;
}

.info-tooltip:hover::after,
.info-tooltip:hover::before {
  opacity: 1;
  visibility: visible;
}

/* =============================================================================
   22. Recuadre d'informació del model
   ============================================================================= */
.prediction-model-info {
  margin-top: 16px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.04), rgba(168, 85, 247, 0.02));
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 10px;
}

.model-info-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ai-primary);
  margin-bottom: 10px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.model-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.model-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  text-align: center;
}

.model-info-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.model-info-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.model-info-link {
  display: block;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ai-primary);
  text-decoration: none;
  padding: 8px;
  background: rgba(168, 85, 247, 0.08);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.model-info-link:hover {
  background: rgba(168, 85, 247, 0.15);
  transform: translateX(2px);
}
/* =============================================================================
   20. Mini gràfica de tendència predicció 7 dies (COMPACTA)
   ============================================================================= */
.forecast-mini-chart-container {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 2px solid rgba(34, 197, 94, 0.2);
  display: flex;
  flex-direction: column;
  height: 280px; /* Augmentat de 200px a 280px per més visibilitat */
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.03), rgba(34, 197, 94, 0.01));
  border-radius: 8px;
  padding: 12px;
  box-shadow: inset 0 2px 8px rgba(34, 197, 94, 0.1);
}

.forecast-mini-chart-container canvas {
  width: 100% !important;
  height: 100% !important;
  max-height: 280px !important; /* Augmentat també aquí */
}

.temps-record-date {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* Prediccions millorades amb icones i info */
.current-predictions-grid-enhanced {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.current-pred-item-enhanced {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(168, 85, 247, 0.03));
  border: 1px solid rgba(168, 85, 247, 0.15);
  border-radius: 10px;
  transition: all 0.25s ease;
}

.current-pred-item-enhanced:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(168, 85, 247, 0.06));
  border-color: rgba(168, 85, 247, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
}

.pred-icon {
  font-size: 1.15rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(168, 85, 247, 0.3));
}

.pred-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.pred-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pred-value-enhanced {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ai-primary);
  line-height: 1;
}

/* Prediccions en grid 2x2 */
.current-predictions-inline {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

/* Graella per a agregats (4 targetes) */
.aggregates-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.aggregates-grid .chart-card {
  min-height: 320px;
}

.current-pred-compact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(168, 85, 247, 0.03));
  border: 1px solid rgba(168, 85, 247, 0.15);
  border-radius: 8px;
  flex: 1;
  transition: all 0.2s ease;
  min-width: 0;
}

.current-pred-compact:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(168, 85, 247, 0.06));
  border-color: rgba(168, 85, 247, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.2);
}

.pred-label-compact {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.pred-value-compact {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ai-primary);
  line-height: 1;
  white-space: nowrap;
}

/* Grid compacte amb 4 columnes en 1 línia */
.model-info-grid-compact {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

/* Responsive: en mòbil mantenir 3 columnes però més petites */
@media (max-width: 768px) {
  .model-info-grid-compact {
    gap: 6px;
  }
  
  .model-info-grid-compact .model-info-item {
    padding: 6px;
  }
  
  .model-info-grid-compact .model-info-label {
    font-size: 0.65rem;
  }
  
  .model-info-grid-compact .model-info-value {
    font-size: 0.8rem;
  }
}

.temps-column:first-child .temps-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}
/* Rang de diferència AVUI - Compacte en 1 línia */
.temps-range-badge {
  margin-top: 8px;
  padding: 4px 10px;
  background: linear-gradient(90deg, 
    rgba(245, 158, 11, 0.12) 0%, 
    rgba(14, 165, 233, 0.12) 100%);
  border-radius: 8px;
  border: 1.5px solid rgba(245, 158, 11, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 0.75rem;
}

.range-icon {
  font-size: 0.85rem;
}

.range-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-accent);
}

.range-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Valor amb data inline per estalviar alçada */
.temps-value-with-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.temps-record-date-inline {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

/* =============================================================================
   23. Rendiment Real del Model (OPCIÓ 2)
   ============================================================================= */
.model-performance-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #fff 100%);
  border: 2px solid rgba(34, 197, 94, 0.2);
}

.performance-period-selector {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.8);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.period-btn {
  padding: 6px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.period-btn:hover {
  background: rgba(34, 197, 94, 0.1);
  color: var(--text-primary);
}

.period-btn.active {
  background: #22c55e;
  color: white;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.performance-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 20px 0;
}

.performance-stat-box {
  text-align: center;
  padding: 20px 16px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  border: 1px solid rgba(34, 197, 94, 0.15);
  transition: all 0.3s ease;
}

.performance-stat-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.3);
}

.stat-icon-large {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.stat-value-large {
  font-size: 2.2rem;
  font-weight: 800;
  color: #22c55e;
  line-height: 1.2;
  margin-bottom: 4px;
}

.stat-label-large {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.stat-desc-small {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Distribució d'errors */
.error-distribution-section {
  margin-top: 24px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  border: 1px solid rgba(34, 197, 94, 0.15);
}

.section-subtitle {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.error-distribution-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.error-bar-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.error-bar-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
}

.error-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.error-badge.excellent {
  background: #10b981;
  color: white;
}

.error-badge.good {
  background: #3b82f6;
  color: white;
}

.error-badge.acceptable {
  background: #f59e0b;
  color: white;
}

.error-badge.poor {
  background: #f97316; /* taronja-roig, punt mig */
  color: white;
}

.error-badge.bad {
  background: #e60000; /* vermell sòlid per >3.0°C */
  color: white;
}

.error-range {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.error-bar-track {
  flex: 1;
  height: 32px;
  background: rgba(148, 163, 184, 0.1);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.error-bar-fill {
  height: 100%;
  transition: width 0.8s ease;
  position: relative;
}

.error-bar-fill.excellent {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.error-bar-fill.good {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.error-bar-fill.acceptable {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.error-bar-fill.poor {
  background: #f6593a; /* to intermedi del gradient anterior, ara color sòlid */
}

.error-bar-fill.bad {
  background: #e60000; /* vermell sòlid per als casos BAD */
}

.error-bar-value {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Placeholder quan no hi ha validacions */
.performance-placeholder {
  text-align: center;
  padding: 60px 40px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  border: 2px dashed rgba(34, 197, 94, 0.3);
  margin: 20px 0;
}

.placeholder-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.placeholder-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.placeholder-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto 16px;
}

.placeholder-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 12px 20px;
  background: rgba(34, 197, 94, 0.1);
  border-radius: 8px;
  display: inline-block;
}

.placeholder-info strong {
  color: #22c55e;
  font-weight: 700;
}
