/* =========================================================
   ESTILOS: DASHBOARDS (Visualización de Datos)
   ========================================================= */

.dash-hero { padding-bottom: var(--space-4); }

/* --- Contenedor del Dashboard --- */
.dashboard-wrapper {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: var(--space-5);
  box-shadow: var(--shadow);
}

.u-dark-theme .dashboard-wrapper {
  background: var(--c-ink);
  border-color: rgba(255,255,255,0.1);
}

/* Header del Dashboard */
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}

.dash-title {
  margin: 0;
  font-size: 1.25rem;
  color: var(--c-ink);
}
.u-dark-theme .dash-title { color: #fff; }

.dash-meta {
  font-size: 0.85rem;
  color: var(--c-text);
  margin: 4px 0 0;
}

.dash-controls {
  display: flex;
  gap: 8px;
}

/* --- Grid Layout --- */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* Tarjetas de Datos */
.dash-card {
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
}

.u-dark-theme .dash-card {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.05);
}

/* Tamaños de tarjetas */
.dash-card { grid-column: span 4; } /* Mobile default */

@media (min-width: 768px) {
  .dash-card { grid-column: span 2; } /* Tablet: 2 cols */
  .dash-card--wide { grid-column: span 4; } /* Filas completas */
}

@media (min-width: 1024px) {
  .dash-card { grid-column: span 1; } /* Desktop: 4 cols */
  .dash-card--wide { grid-column: span 2; } /* Mitad */
}

/* Elementos Internos */
.card-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--c-text);
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.kpi-value {
  font-family: var(--font-head);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--c-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.kpi-trend { font-size: 0.9rem; font-weight: 500; }
.trend-up { color: #DC2626; } /* Malo si es espera */
.trend-down { color: #16A34A; } /* Bueno si es espera */
.trend-stable { color: var(--c-text); }

/* --- Contenedores D3.js --- */
.chart-container {
  width: 100%;
  height: 200px;
  position: relative;
}

/* Tabla Estilizada */
.table-responsive { overflow-x: auto; }
.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.dash-table th {
  text-align: left;
  padding: 8px;
  border-bottom: 2px solid var(--border);
  color: var(--c-text);
}
.dash-table td {
  padding: 8px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.u-dark-theme .dash-table td { border-bottom-color: rgba(255,255,255,0.05); }

/* Status Dots en Tabla */
.status-ok { color: #16A34A; font-weight: 600; }
.status-warn { color: #F59E0B; font-weight: 600; }
.status-crit { color: #DC2626; font-weight: 600; }

/* Explicación Técnica */
.tech-list li { margin-bottom: 12px; }
.tech-list strong { color: var(--c-primary); }