
/* =================================
   1. CONFIGURACIÓN GENERAL
================================= */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f0f7fc;
  color: #173f65;
}

/* =================================
   2. ENCABEZADO
================================= */

header {
  background: #0878c9;
  color: white;
  padding: 20px;
  text-align: center;
}

header h1 {
  margin: 0;
  font-size: 26px;
}

header p {
  margin: 7px 0 0;
  font-size: 14px;
}

/* =================================
   3. CONTENEDOR PRINCIPAL
================================= */

main {
  max-width: 600px;
  margin: auto;
  padding: 20px 16px 35px;
}

/* =================================
   4. PANTALLAS Y NAVEGACIÓN
================================= */

.pantalla {
  display: none;
}

.pantalla.activa {
  display: block;
}

.bienvenida {
  text-align: center;
  padding: 35px 10px;
}

/* =================================
   5. TEXTOS
================================= */

.gota {
  font-size: 70px;
}

h2 {
  font-size: 23px;
  margin-top: 8px;
}

.descripcion {
  color: #58738b;
  line-height: 1.5;
}

/* =================================
   6. BOTONES
================================= */

button {
  font-family: inherit;
  cursor: pointer;
}

.boton-principal {
  border: 0;
  border-radius: 25px;
  background: #0878c9;
  color: white;
  padding: 14px 22px;
  font-weight: bold;
  font-size: 15px;
}

.volver {
  border: 0;
  background: transparent;
  color: #0878c9;
  font-weight: bold;
  padding: 10px 0;
  margin-bottom: 10px;
}

/* =================================
   7. TARJETAS DE LAS PRESAS
================================= */

.tarjeta {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px;
  margin: 13px 0;
  background: white;
  border-radius: 15px;
  box-shadow: 0 3px 12px #173f6510;
}

.icono-presa {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 58px;
  height: 58px;
  border-radius: 12px;
  background: #dff2ff;
  font-size: 30px;
}

.datos {
  flex: 1;
  min-width: 0;
}

.datos h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.datos p {
  margin: 0 0 9px;
  color: #60788d;
  font-size: 13px;
}

.abrir {
  border: 0;
  background: transparent;
  color: #0878c9;
  font-size: 25px;
  padding: 5px;
}

/* =================================
   8. INDICADORES DE ESTADO
================================= */

.estado {
  font-size: 12px;
  font-weight: bold;
}

.estado-verde {
  color: #168347;
}

.estado-amarillo {
  color: #9a7000;
}

.estado-rojo {
  color: #c73535;
}

.estado-gris {
  color: #5f7284;
}

/* =================================
   9. DETALLE DE LA PRESA
================================= */

.resumen-nivel {
  background: white;
  border-radius: 18px;
  padding: 22px 16px;
  margin: 18px 0;
  box-shadow: 0 3px 12px #173f6510;
}

.nivel-flex {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.circulo-nivel {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(
    var(--color, #0878c9) var(--porcentaje),
    #dceefa 0
  );
}

.circulo-interior {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.circulo-interior strong {
  font-size: 30px;
  color: #0878c9;
}

.circulo-interior span {
  font-size: 12px;
  color: #58738b;
}

/* =================================
   10. COLORES DEL ESTADO
================================= */

.estado-grande {
  display: inline-block;
  padding: 9px 17px;
  border-radius: 22px;
  color: white;
  font-weight: bold;
  font-size: 14px;
}

.fondo-verde {
  background: #21894e;
}

.fondo-amarillo {
  background: #a77700;
}

.fondo-rojo {
  background: #c73535;
}

.fondo-gris {
  background: #5f7284;
}

/* =================================
   11. FECHAS Y AVISOS
================================= */

.actualizacion {
  font-size: 12px;
  line-height: 1.6;
  color: #58738b;
  margin-top: 12px;
}

.aviso {
  background: #fff4d6;
  color: #725315;
  border-radius: 10px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.5;
}

.aviso-datos {
  font-size: 12px;
  line-height: 1.5;
  color: #725315;
  background: #fff4d6;
  padding: 12px;
  border-radius: 10px;
}

/* =================================
   12. DATOS EXTRA, GRÁFICAS Y TABLA
================================= */

.datos-extra {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 6px;
}

.datos-extra div {
  background: #f0f7fc;
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
}

.datos-extra span {
  display: block;
  font-size: 11px;
  color: #58738b;
  margin-bottom: 4px;
}

.datos-extra strong {
  font-size: 13px;
}

.grafica {
  width: 100%;
  margin-top: 10px;
}

.grafica svg {
  display: block;
  width: 100%;
}

.tabla-historial {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 8px;
}

.tabla-historial th {
  text-align: left;
  font-size: 12px;
  color: #58738b;
  padding: 6px 4px;
  border-bottom: 2px solid #dceefa;
}

.tabla-historial td {
  padding: 8px 4px;
  border-bottom: 1px solid #e8f2f9;
}

.tabla-historial th:not(:first-child),
.tabla-historial td:not(:first-child) {
  text-align: right;
}

/* =================================
   13. PIE DE PÁGINA
================================= */

footer {
  text-align: center;
  font-size: 12px;
  color: #58738b;
  padding: 10px 16px 30px;
}

footer p {
  margin: 4px 0;
}

/* =================================
   14. FRASES SENCILLAS Y TENDENCIA
================================= */

.frases {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.frases li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid #e8f2f9;
  font-size: 14px;
  line-height: 1.5;
}

.frases li:last-child {
  border-bottom: 0;
}

.frase-icono {
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1.3;
}

.tendencia {
  margin-top: 6px;
  font-size: 12px;
  color: #58738b;
}
