:root {
  --navy: #00346A; --yellow: #FFC800; --red: #ED1C24; --sky: #0089DF; --green: #1E9E5A;
  --cream: #FFF8E7; --stone: #E9E4DA; --ink: #1A1A1A; --muted: #4A5B73; --white: #fff;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: Inter, system-ui, sans-serif; color: var(--ink); background: var(--cream); font-size: 15px; }
.oculto { display: none !important; }
h1, h2, h3 { font-family: 'Bebas Neue', sans-serif; color: var(--navy); font-weight: 400; letter-spacing: .5px; margin: 0; }
h1 { font-size: 40px; } h2 { font-size: 30px; } h3 { font-size: 22px; }
.sub { color: var(--muted); margin: 4px 0 20px; }
.error { color: var(--red); font-weight: 600; min-height: 1em; }

.login { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login-caja { width: 380px; max-width: 100%; display: grid; gap: 14px; text-align: center; }
.login-logo { width: 200px; margin: 0 auto; }

.panel { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.lateral { background: var(--navy); color: #fff; padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.lateral-logo { width: 170px; margin: 0 auto 6px; }
#menu { display: grid; gap: 4px; }
#menu a { color: #C9D6E8; text-decoration: none; padding: 10px 12px; border-radius: 12px; font-weight: 600; display: block; }
#menu a:hover { background: rgba(255,255,255,.08); color: #fff; }
#menu a.activo { background: var(--yellow); color: var(--navy); }
.yo { margin-top: auto; font-size: 13px; color: #C9D6E8; }
#yo-nombre { color: #fff; font-weight: 700; }
.yo-rol { text-transform: capitalize; margin-bottom: 6px; }
.btn-link { background: none; border: 0; color: var(--yellow); font-weight: 700; cursor: pointer; padding: 0; font-size: 13px; }

.contenido { padding: 28px 32px 60px; max-width: 1240px; }
.cabecera { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.cabecera .sub { margin-bottom: 0; }
.fila { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 1000px) { .g4 { grid-template-columns: 1fr 1fr; } .g2 { grid-template-columns: 1fr; } .panel { grid-template-columns: 1fr; } .lateral { position: static; height: auto; } }

.tarjeta { background: #fff; border: 2px solid var(--stone); border-radius: 20px; padding: 18px; }
.kpi .et { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .6px; text-transform: uppercase; }
.kpi .num { font-family: 'Bebas Neue'; font-size: 44px; color: var(--navy); line-height: 1.05; margin-top: 6px; }
.kpi .det { font-size: 13px; color: var(--muted); }
.banda { background: #FFF1BF; border: 1px solid var(--yellow); border-radius: 14px; padding: 12px 14px; margin-bottom: 16px; font-size: 14px; }
.banda.roja { background: #FDE3E4; border-color: var(--red); }

label { display: grid; gap: 6px; font-weight: 700; color: var(--navy); font-size: 14px; text-align: left; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--ink); border: 2px solid var(--navy); border-radius: 12px; padding: 10px 12px; background: #fff; min-height: 46px; }
textarea { min-height: 90px; resize: vertical; }
select { font-size: 16px; min-height: 50px; }
.btn { background: var(--navy); color: #fff; border: 2px solid var(--navy); border-radius: 999px; padding: 10px 20px; font-weight: 700; font-size: 15px; cursor: pointer; min-height: 46px; }
.btn:hover { filter: brightness(1.1); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.amarillo { background: var(--yellow); color: var(--navy); border-color: var(--yellow); }
.btn.borde { background: #fff; color: var(--navy); }
.btn.rojo { background: var(--red); border-color: var(--red); }
.btn.peq { padding: 6px 14px; min-height: 36px; font-size: 13px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; padding: 8px; border-bottom: 2px solid var(--stone); }
td { padding: 9px 8px; border-bottom: 1px solid var(--stone); vertical-align: middle; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tr.apagado td { color: #9aa5b4; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; }
.pill.ok { background: #DDF3E6; color: #11643A; } .pill.mal { background: #FDE3E4; color: #A3121A; }
.pill.gris { background: var(--stone); color: var(--muted); } .pill.azul { background: #DCEEFB; color: #00508A; }

/* Barras: una serie, marca delgada con punta redondeada anclada a la base */
.barras { display: flex; align-items: flex-end; gap: 2px; height: 180px; padding-top: 10px; border-bottom: 1px solid var(--stone); position: relative; }
.barra { flex: 1; background: var(--navy); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; cursor: default; }
.barra:hover { background: var(--sky); }
.barra:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 8px; white-space: nowrap; z-index: 5; }
.ejes { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }
.vacio { color: var(--muted); padding: 30px 0; text-align: center; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: grid; place-items: center; padding: 20px; z-index: 1000; }
.modal-caja { background: #fff; border-radius: 22px; padding: 24px; width: 520px; max-width: 100%; max-height: 90vh; overflow: auto; display: grid; gap: 14px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; z-index: 1100; }
.credencial { border: 3px dashed var(--navy); border-radius: 18px; padding: 18px; text-align: center; }
.credencial .grande { font-family: 'Bebas Neue'; font-size: 40px; color: var(--navy); letter-spacing: 2px; }

.telefono { background: #f1f1f4; border-radius: 18px; padding: 12px; }
.notif { background: rgba(255,255,255,.95); border-radius: 14px; padding: 10px 12px; box-shadow: 0 2px 8px rgba(0,0,0,.08); font-size: 13px; }
.notif b { display: block; }
.notif .app { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 2px; }

#mapa-admin { height: 560px; border-radius: 18px; border: 2px solid var(--stone); }
.pin { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--navy); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.dia-h { margin: 22px 0 8px; }
.interruptor { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--navy); }
.interruptor input { width: 22px; height: 22px; min-height: 0; }
@media print { .lateral, .no-print { display: none !important; } .panel { display: block; } }
