/* ============================================================
   Aljibex - Control de Depósitos de Agua
   Desarrollado por Iñaki Serrano para Webcomunica.solutions
   Colores corporativos: #20a7c7, #034561, #000000
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&display=swap');

:root {
    --cyan: #20a7c7;
    --cyan-light: #e8f4f8;
    --cyan-hover: #1a8fa8;
    --navy: #034561;
    --navy-light: #045a80;
    --black: #000;
    --white: #fff;
    --bg: #edf2f7;
    --surface: #ffffff;
    --surface-alt: #f7f9fb;
    --border: #e3e8ef;
    --border-strong: #cdd4de;
    --text: #1a1e24;
    --text-secondary: #5a6370;
    --text-muted: #8c95a2;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --orange: #f97316;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
    --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: 'DM Sans', -apple-system, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--cyan-hover); }
::selection { background: var(--cyan); color: #fff; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.contenedor-app { display: flex; min-height: 100vh; }

.barra-lateral {
    width: 240px;
    background: var(--white);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.barra-lateral-logo {
    padding: 24px 22px 20px;
    border-bottom: 1px solid var(--border);
}

.barra-lateral-logo img {
    max-width: 140px;
    height: auto;
}

.barra-lateral-logo h2 {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.menu-navegacion {
    list-style: none;
    padding: 14px 12px;
    flex: 1;
}

.menu-navegacion li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    margin-bottom: 2px;
}

.menu-navegacion li a i,
.menu-navegacion li a svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.menu-navegacion li a:hover {
    background: var(--bg);
    color: var(--text);
}

.menu-navegacion li a:hover i,
.menu-navegacion li a:hover svg { color: var(--text); }

.menu-navegacion li a.activo {
    background: var(--cyan);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(32,167,199,0.3);
}

.menu-navegacion li a.activo i,
.menu-navegacion li a.activo svg { color: #fff; }

.menu-separador {
    border: none;
    border-top: 1px solid var(--border);
    margin: 10px 8px;
}

.sidebar-ayuda {
    margin: 8px 12px;
    padding: 16px;
    background: var(--cyan-light);
    border-radius: var(--radius-sm);
    text-align: center;
    border: 1px solid #c8e8f0;
}

.sidebar-ayuda p { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.sidebar-ayuda a { font-size: 12px; color: var(--cyan); font-weight: 600; }

.barra-lateral-pie {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.barra-lateral-pie a { color: var(--text-muted); font-size: 10px; letter-spacing: 0.5px; }
.barra-lateral-pie a:hover { color: var(--cyan); }

/* ============================================================
   CONTENIDO PRINCIPAL
   ============================================================ */
.contenido-principal {
    margin-left: 240px;
    flex: 1;
    padding: 16px 24px;
    min-height: 100vh;
    position: relative;
}

/* Onda decorativa */
.contenido-principal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(180deg, rgba(32,167,199,0.06) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

.contenido-principal > * { position: relative; z-index: 1; }

/* --- Cabecera de página --- */
.cabecera-pagina {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.cabecera-pagina h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: -0.5px;
}

.cabecera-pagina .info-usuario {
    font-size: 13px;
    color: var(--text-muted);
    background: var(--surface);
    padding: 8px 16px;
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

/* ============================================================
   TARJETAS
   ============================================================ */
.tarjeta {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.tarjeta-cabecera {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tarjeta-cabecera h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--navy);
}

.tarjeta-cuerpo { padding: 14px 16px; }

/* ============================================================
   GRID DEPÓSITOS (tarjetas)
   ============================================================ */
.grid-depositos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.tarjeta-deposito {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

.tarjeta-deposito:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--cyan);
}

.tarjeta-deposito .nombre-deposito { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.tarjeta-deposito .nombre-deposito a { color: var(--navy); }
.tarjeta-deposito .nombre-deposito a:hover { color: var(--cyan); }
.tarjeta-deposito .ubicacion-deposito { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }

/* --- Barra de nivel --- */
.barra-nivel-contenedor {
    background: var(--bg);
    height: 28px;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 14px;
}

.barra-nivel {
    height: 100%;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    min-width: 36px;
    transition: width 0.8s ease;
}

.barra-nivel.nivel-alto { background: linear-gradient(90deg, #1a8fa8, var(--cyan)); }
.barra-nivel.nivel-medio { background: linear-gradient(90deg, #d97706, var(--warning)); }
.barra-nivel.nivel-bajo { background: linear-gradient(90deg, #c2410c, var(--orange)); }
.barra-nivel.nivel-critico { background: linear-gradient(90deg, #b91c1c, var(--danger)); }

/* --- Datos depósito --- */
.datos-deposito { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 13px; }
.datos-deposito .dato-etiqueta { color: var(--text-muted); }
.datos-deposito .dato-valor { font-weight: 600; text-align: right; }

/* ============================================================
   ESTADOS
   ============================================================ */
.estado-bomba, .estado-deposito {
    display: inline-block;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
}

.estado-bomba.abierta { background: #dcfce7; color: #15803d; }
.estado-bomba.cerrada { background: #fee2e2; color: #b91c1c; }
.estado-bomba.desconocido { background: var(--bg); color: var(--text-muted); }
.estado-deposito.activo { background: #dcfce7; color: #15803d; }
.estado-deposito.inactivo { background: var(--bg); color: var(--text-muted); }
.estado-deposito.mantenimiento { background: #fef3c7; color: #92400e; }

/* ============================================================
   BOTONES
   ============================================================ */
.boton {
    display: inline-block;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    font-family: 'DM Sans', sans-serif;
    transition: all var(--transition);
}

.boton-primario { background: var(--cyan); color: #fff; }
.boton-primario:hover { background: var(--cyan-hover); color: #fff; box-shadow: 0 4px 12px rgba(32,167,199,0.25); }
.boton-secundario { background: var(--navy); color: #fff; }
.boton-secundario:hover { background: var(--navy-light); color: #fff; }
.boton-exito { background: var(--success); color: #fff; }
.boton-exito:hover { background: #16a34a; color: #fff; }
.boton-peligro { background: var(--danger); color: #fff; }
.boton-peligro:hover { background: #dc2626; color: #fff; }
.boton-contorno { background: var(--surface); border: 1px solid var(--border); color: var(--text-secondary); }
.boton-contorno:hover { border-color: var(--cyan); color: var(--cyan); }
.boton-pequeno { padding: 6px 14px; font-size: 12px; }
.boton-bloque { display: block; width: 100%; text-align: center; }

/* ============================================================
   FORMULARIOS
   ============================================================ */
.formulario-grupo { margin-bottom: 16px; }

.formulario-grupo label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.formulario-grupo input[type="text"],
.formulario-grupo input[type="email"],
.formulario-grupo input[type="password"],
.formulario-grupo input[type="number"],
.formulario-grupo input[type="date"],
.formulario-grupo input[type="datetime-local"],
.formulario-grupo input[type="time"],
.formulario-grupo select,
.formulario-grupo textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    transition: all var(--transition);
}

.formulario-grupo input:focus, .formulario-grupo select:focus, .formulario-grupo textarea:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(32,167,199,0.1);
}

.formulario-grupo textarea { resize: vertical; min-height: 80px; }
.formulario-grupo .ayuda { font-size: 12px; color: var(--text-muted); margin-top: 5px; line-height: 1.4; }
.formulario-fila { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.formulario-fila-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ============================================================
   TABLAS
   ============================================================ */
.tabla-contenedor { overflow-x: auto; }

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

.tabla th {
    background: var(--surface-alt);
    color: var(--text-secondary);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 2px solid var(--border);
}

.tabla td { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.tabla tbody tr { transition: background var(--transition); }
.tabla tbody tr:hover { background: var(--cyan-light); }
.tabla .acciones { white-space: nowrap; }
.tabla .acciones a, .tabla .acciones button { margin-right: 6px; }

/* ============================================================
   MENSAJES
   ============================================================ */
.mensaje {
    padding: 14px 18px;
    font-size: 13px;
    margin-bottom: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid;
    font-weight: 500;
}

.mensaje-exito { background: #dcfce7; color: #15803d; border-color: #86efac; }
.mensaje-error { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
.mensaje-advertencia { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.mensaje-info { background: var(--cyan-light); color: var(--navy); border-color: #a5d8e8; }

/* ============================================================
   ALERTAS
   ============================================================ */
.lista-alertas { list-style: none; }

.lista-alertas li {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    transition: background var(--transition);
}

.lista-alertas li:last-child { border-bottom: none; }
.lista-alertas li:hover { background: var(--surface-alt); }
.lista-alertas li.no-leida { background: var(--cyan-light); }

.alerta-contenido { flex: 1; }

.alerta-contenido .alerta-tipo {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 4px;
}

.alerta-contenido .alerta-tipo.nivel_bajo { color: var(--warning); }
.alerta-contenido .alerta-tipo.nivel_critico { color: var(--danger); }
.alerta-contenido .alerta-tipo.deposito_vacio { color: var(--danger); }
.alerta-contenido .alerta-tipo.sin_comunicacion { color: var(--text-muted); }
.alerta-contenido .alerta-tipo.bomba_error { color: var(--danger); }
.alerta-contenido .alerta-mensaje { font-size: 13px; }
.alerta-fecha { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-contenedor {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--navy) 0%, #0a6a8a 100%);
}

.login-caja {
    width: 420px;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 44px 40px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.2);
}

.login-caja .login-logo { text-align: center; margin-bottom: 12px; }
.login-caja .login-logo img { max-width: 200px; height: auto; }
.login-caja h1 { font-size: 18px; font-weight: 700; text-align: center; color: var(--navy); }
.login-caja .subtitulo { font-size: 12px; color: var(--cyan); text-align: center; margin-bottom: 32px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; }

/* ============================================================
   PAGINACIÓN
   ============================================================ */
.paginacion { display: flex; gap: 4px; justify-content: center; margin-top: 18px; }
.paginacion a, .paginacion span { padding: 8px 14px; font-size: 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-secondary); transition: all var(--transition); }
.paginacion a:hover { background: var(--surface-alt); }
.paginacion .pagina-activa { background: var(--cyan); color: #fff; border-color: var(--cyan); }

/* ============================================================
   FICHA DEPÓSITO
   ============================================================ */
.ficha-deposito { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.ficha-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.ficha-campo { padding: 10px 0; border-bottom: 1px solid var(--border); }
.ficha-campo .campo-etiqueta { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted); margin-bottom: 3px; }
.ficha-campo .campo-valor { font-size: 15px; font-weight: 600; color: var(--navy); }

.token-api { font-family: monospace; font-size: 11px; background: var(--surface-alt); padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); word-break: break-all; color: var(--cyan); }
.grafica-contenedor { position: relative; height: 300px; margin: 14px 0; }

/* ============================================================
   ARCHIVOS
   ============================================================ */
.galeria-archivos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.archivo-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; text-align: center; font-size: 11px; position: relative; transition: border-color var(--transition); }
.archivo-item:hover { border-color: var(--cyan); }
.archivo-item img { width: 100%; height: 90px; object-fit: cover; border-radius: 8px; margin-bottom: 6px; }
.archivo-item .archivo-nombre { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-secondary); }
.archivo-item .archivo-eliminar { position: absolute; top: 4px; right: 4px; background: var(--danger); color: #fff; border: none; border-radius: 50%; width: 20px; height: 20px; font-size: 11px; cursor: pointer; line-height: 20px; }

.control-bomba { display: flex; gap: 10px; align-items: center; margin-top: 12px; }

.lista-checkboxes { max-height: 200px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px; }
.lista-checkboxes label { display: block; padding: 6px 10px; font-size: 13px; cursor: pointer; border-radius: 6px; transition: background var(--transition); }
.lista-checkboxes label:hover { background: var(--surface-alt); }

/* ============================================================
   CONTADORES (genérico)
   ============================================================ */
.grid-contadores { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.contador { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.contador .contador-valor { font-size: 28px; font-weight: 700; color: var(--navy); letter-spacing: -1px; }
.contador .contador-etiqueta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.vacio { text-align: center; padding: 40px 16px; color: var(--text-muted); }
.vacio p { font-size: 14px; margin-bottom: 14px; }

#mapa { border-radius: 0 0 var(--radius) var(--radius); }

/* ============================================================
   PANEL DASHBOARD (mockup exacto)
   ============================================================ */

/* Header */
.dash-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; flex-wrap:wrap; gap:12px; }
.dash-header-izq h1 { font-size:18px; font-weight:700; color:var(--navy); margin-bottom:1px; }
.dash-header-izq p { font-size:12px; color:var(--text-muted); }
.dash-header-dcha { display:flex; align-items:center; gap:14px; }
.dash-empresa-nombre { font-size:13px; color:var(--text-secondary); background:var(--surface); padding:7px 14px; border-radius:var(--radius-sm); border:1px solid var(--border); }

.dash-bell { position:relative; width:38px; height:38px; display:flex; align-items:center; justify-content:center; border-radius:50%; background:var(--surface); border:1px solid var(--border); transition:all var(--transition); }
.dash-bell:hover { border-color:var(--cyan); }
.dash-bell i,.dash-bell svg { width:18px; height:18px; color:var(--text-secondary); }
.dash-bell-badge { position:absolute; top:-4px; right:-4px; background:var(--danger); color:#fff; font-size:10px; font-weight:700; width:18px; height:18px; border-radius:50%; display:flex; align-items:center; justify-content:center; border:2px solid var(--bg); }

.dash-user { display:flex; align-items:center; gap:8px; font-size:13px; font-weight:500; color:var(--text); }
.dash-user-avatar { width:34px; height:34px; border-radius:50%; background:var(--navy); color:#fff; display:flex; align-items:center; justify-content:center; font-size:14px; font-weight:700; }

/* KPIs */
.dash-kpis { display:grid; grid-template-columns:1fr 1fr 1fr auto; gap:12px; margin-bottom:14px; }
.dash-kpi { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:14px 16px; box-shadow:var(--shadow-sm); display:flex; gap:12px; align-items:flex-start; }
.dash-kpi-icon { width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.dash-kpi-icon i,.dash-kpi-icon svg { width:20px; height:20px; }
.dash-kpi-label { font-size:11px; color:var(--text-muted); margin-bottom:2px; }
.dash-kpi-value { font-size:24px; font-weight:700; color:var(--navy); letter-spacing:-1px; line-height:1; }
.dash-kpi-detail { font-size:10px; color:var(--text-muted); margin-top:4px; }
.dash-kpi-link { text-decoration:none; color:inherit; cursor:pointer; transition:transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease; }
.dash-kpi-link:hover { transform:translateY(-4px); box-shadow:0 8px 24px rgba(32,167,199,0.22); border-color:var(--cyan); background:#f0fafd; }
.dash-kpi-link:hover .dash-kpi-value { color:var(--cyan); }
.dash-kpi-link:hover .dash-kpi-icon { opacity:0.85; transform:scale(1.08); transition:transform 0.18s ease; }

/* Círculo */
.dash-circle { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:14px 18px; box-shadow:var(--shadow-sm); display:flex; align-items:center; gap:12px; }
.dash-circle-ring { width:64px; height:64px; border-radius:50%; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.dash-circle-inner { width:50px; height:50px; border-radius:50%; background:var(--surface); display:flex; align-items:center; justify-content:center; font-size:18px; font-weight:700; color:var(--navy); }
.dash-circle-text { font-size:11px; color:var(--text-muted); line-height:1.4; }
.dash-circle-text strong { display:block; font-size:13px; color:var(--navy); margin-bottom:1px; }

/* Body 2 cols */
.dash-body { display:grid; grid-template-columns:1.4fr 1fr; gap:14px; }
.dash-col-izq,.dash-col-dcha { display:flex; flex-direction:column; gap:12px; }
.dash-graficas-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.dash-grafica-mini { position:relative; height:140px; }

/* Lista depósitos */
.dash-dep-lista { list-style:none; }
.dash-dep-lista li { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--border); flex-wrap:wrap; }
.dash-dep-lista li:last-child { border-bottom:none; }
.dash-dep-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; }
.dash-dep-name { flex:1; font-size:13px; font-weight:500; color:var(--text); text-decoration:none; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dash-dep-name:hover { color:var(--cyan); }
.dash-dep-bar { width:80px; height:8px; background:var(--bg); border-radius:4px; overflow:hidden; flex-shrink:0; }
.dash-dep-bar-fill { height:100%; border-radius:4px; }
.dash-dep-pct { font-size:14px; font-weight:700; width:45px; text-align:right; flex-shrink:0; }
.dash-dep-lit { font-size:11px; color:var(--text-muted); width:60px; text-align:right; flex-shrink:0; }
.dash-dep-cal-row { flex-basis:100%; display:flex; align-items:center; gap:6px; padding:2px 0 2px 20px; font-size:11px; font-weight:600; }
.dash-dep-cal-sep { color:#e2e8f0; font-weight:400; }

/* Estado sistema */
.dash-estado { list-style:none; }
.dash-estado li { display:flex; justify-content:space-between; align-items:center; padding:8px 0; border-bottom:1px solid var(--border); font-size:12px; }
.dash-estado li:last-child { border-bottom:none; }
.dash-estado-left { display:flex; align-items:center; gap:10px; color:var(--text-secondary); }
.dash-estado-left i,.dash-estado-left svg { flex-shrink:0; }
.dash-estado li strong { color:var(--navy); }

/* Selector empresa */
.panel-selector-empresa { padding:9px 14px; font-size:13px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface); color:var(--text); font-family:'DM Sans',sans-serif; }

/* Topbar para superadmin listado */
.panel-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.panel-topbar-izq h1 { font-size: 22px; font-weight: 700; color: var(--navy); letter-spacing: -0.5px; margin-bottom: 2px; }
.panel-topbar-izq p { font-size: 13px; color: var(--text-muted); }

.panel-topbar-dcha { display: flex; align-items: center; gap: 12px; }

.panel-selector-empresa {
    padding: 9px 14px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    box-shadow: var(--shadow-sm);
}

/* KPIs con iconos */
.panel-kpis {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 16px;
    margin-bottom: 24px;
}

.panel-kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.panel-kpi-icono {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.panel-kpi-icono svg, .panel-kpi-icono i { width: 22px; height: 22px; color: #fff; }

.panel-kpi-icono.depositos { background: var(--orange); }
.panel-kpi-icono.alertas { background: var(--danger); }
.panel-kpi-icono.valvulas { background: var(--success); }

.panel-kpi-contenido { flex: 1; }
.panel-kpi-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.panel-kpi-valor { font-size: 28px; font-weight: 700; color: var(--navy); letter-spacing: -1px; line-height: 1; }

.panel-kpi-detalle { font-size: 11px; color: var(--text-muted); margin-top: 6px; }
.panel-kpi-detalle span { margin-right: 8px; }
.panel-kpi-detalle .ok { color: var(--success); font-weight: 600; }
.panel-kpi-detalle .warn { color: var(--warning); font-weight: 600; }
.panel-kpi-detalle .bad { color: var(--danger); font-weight: 600; }

/* Indicador circular */
.panel-circulo {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
}

.circulo-progreso {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.circulo-progreso-interior {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--navy);
}

.circulo-info { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.circulo-info strong { display: block; font-size: 14px; color: var(--navy); margin-bottom: 2px; }

/* Layout 2 columnas */
.panel-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 20px;
}

/* Lista compacta depósitos */
.lista-depositos-compacta { list-style: none; }

.lista-depositos-compacta li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.lista-depositos-compacta li:last-child { border-bottom: none; }

.dep-estado-mini { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dep-estado-mini.ok { background: var(--success); }
.dep-estado-mini.warn { background: var(--warning); }
.dep-estado-mini.bad { background: var(--danger); }
.dep-estado-mini.off { background: var(--border-strong); }

.dep-nombre { flex: 1; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dep-nombre a { color: var(--text); }
.dep-nombre a:hover { color: var(--cyan); }

.dep-barra-mini { width: 70px; height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; flex-shrink: 0; }
.dep-barra-mini-fill { height: 100%; border-radius: 4px; }

.dep-pct { font-size: 14px; font-weight: 700; width: 45px; text-align: right; flex-shrink: 0; }
.dep-litros { font-size: 11px; color: var(--text-muted); width: 65px; text-align: right; flex-shrink: 0; }

/* Estado del sistema */
.estado-sistema { list-style: none; }
.estado-sistema li { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.estado-sistema li:last-child { border-bottom: none; }
.estado-sistema-label { color: var(--text-secondary); }
.estado-sistema-valor { font-weight: 600; color: var(--navy); }

/* Gráficas mini */
.panel-graficas-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grafica-mini-contenedor { position: relative; height: 180px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .panel-grid { grid-template-columns: 1fr; }
    .panel-kpis { grid-template-columns: 1fr 1fr; }
    .panel-graficas-row { grid-template-columns: 1fr; }
    .ficha-deposito { grid-template-columns: 1fr; }
    .formulario-fila-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .barra-lateral { width: 100%; height: auto; position: relative; }
    .contenido-principal { margin-left: 0; padding: 16px; }
    .cabecera-pagina { flex-direction: column; align-items: flex-start; gap: 8px; }
    .grid-depositos { grid-template-columns: 1fr; }
    .formulario-fila, .formulario-fila-3 { grid-template-columns: 1fr; }
    .ficha-info-grid { grid-template-columns: 1fr; }
    .panel-kpis { grid-template-columns: 1fr; }
    .panel-topbar { flex-direction: column; align-items: flex-start; }
    .menu-navegacion { display: flex; flex-wrap: wrap; padding: 8px; }
    .menu-navegacion li a { padding: 8px 14px; }
}

/* ============================================================
   UTILIDADES
   ============================================================ */
.texto-derecha { text-align: right; }
.texto-centro { text-align: center; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.oculto { display: none; }

/* ============================================================
   SINÓPTICO
   ============================================================ */
.sinoptico-contenedor {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 24px;
    align-items: start;
}
.sinoptico-svgcard {
    min-width: 240px;
    max-width: 280px;
}
.sinoptico-panel {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.sinoptico-datos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.sinoptico-dato {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sinoptico-etiqueta {
    font-size: 12px;
    color: #888;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.sinoptico-valor {
    font-size: 20px;
    font-weight: 700;
    color: #034561;
}
.sinoptico-refresh {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #888;
    margin-top: 8px;
}

@media (max-width: 900px) {
    .sinoptico-contenedor { grid-template-columns: 1fr; }
    .sinoptico-svgcard { max-width: 100%; display: flex; justify-content: center; }
    .sinoptico-datos { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   CALIDAD DEL AGUA
   ============================================================ */
.calidad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.calidad-parametro {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    position: relative;
}
.calidad-parametro-etiqueta {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.calidad-parametro-valor {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
}
.calidad-parametro-unidad {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: -4px;
}
.calidad-estado-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}
.calidad-barra-contenedor {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}
.calidad-barra-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease, background 0.4s ease;
}
.calidad-sin-dato {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
}
.calidad-ultima {
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
    margin-top: 4px;
}
@media (max-width: 700px) {
    .calidad-grid { grid-template-columns: 1fr 1fr; }
}
