/* Tablero CP-024: tokens, fuentes y login comunes en balu.css (cargado antes). */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 14px; line-height: 1.45; }
header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 20px; min-height: 60px;
  background: var(--balu-negro); color: #fff; border-bottom: 2px solid var(--balu-rojo); }
body.en-login header { display: none; }
header .marca { display: flex; align-items: center; gap: 12px; } header .marca .logo { height: 34px; display: block; }
header .marca b, header .marca .sub { display: block; }
header .marca b { font-family: var(--f-titulo); font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
header .sub { color: #CBD5E1; } header button, header button.sec, header .btn-sec { color: #fff; border: 1px solid rgba(255,255,255,.45); background: transparent; }
header button:hover, header .btn-sec:hover { background: rgba(255,255,255,.1); }
.sub { color: var(--suave); font-size: 12px; }
.demo { background: #8a1c1c; color: #fff; text-align: center; font-size: 12px; font-weight: 700; padding: 3px; }
main { padding: 16px 20px 40px; max-width: 1440px; margin: 0 auto; }
label { display: block; margin: 10px 0; font-weight: 600; }
input, select { width: 100%; min-height: 38px; padding: 7px 10px; margin-top: 4px; border: 1px solid var(--borde); border-radius: 8px; background: var(--tarjeta); color: var(--texto); font-size: 14px; }
button { min-height: 36px; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--balu-rojo); background: var(--balu-rojo); color: #fff; cursor: pointer; font-size: 13px; font-weight: 600; }
button:hover { background: var(--balu-rojo-osc); border-color: var(--balu-rojo-osc); }
button.sec { background: #fff; color: var(--texto); border-color: var(--borde); }
button.sec:hover { background: #F8FAFC; border-color: #94A3B8; }
button.min { min-height: 0; padding: 3px 8px; font-size: 12px; font-weight: 600; background: #fff; color: var(--texto); border-color: var(--borde); margin: 1px; border-radius: 6px; }
button.min:hover { background: #F8FAFC; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 14px; }
.tabs button { background: #fff; color: #334155; border-color: var(--borde-2); box-shadow: var(--sombra); }
.tabs button:hover { background: #F8FAFC; }
.tabs button.activo { background: var(--balu-negro); color: #fff; border-color: var(--balu-negro); }
.sp { flex: 1; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--tarjeta); border: 1px solid var(--borde-2); border-radius: 12px; padding: 12px 14px; box-shadow: var(--sombra); }
.kpi b { display: block; font-family: var(--f-titulo); font-weight: 700; font-size: 26px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--texto-2); font-size: 12px; font-weight: 500; }
.kpi.alerta b { color: var(--mal); }
.dos { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 900px) { .dos { grid-template-columns: 1fr; } }
.mapa { height: 460px; border-radius: 12px; border: 1px solid var(--borde-2); box-shadow: var(--sombra); }
.tabla-cont { overflow-x: auto; background: var(--tarjeta); border: 1px solid var(--borde-2); border-radius: 12px; padding: 0; box-shadow: var(--sombra); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--borde-2); text-align: left; white-space: nowrap; }
th { background: var(--cab-tabla); color: #475569; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:hover td, table tr:hover td { background: #F8FAFC; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tr.total td { font-weight: 700; }
.chip { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #E2E8F0; color: #334155; margin-right: 3px; }
.chip.alerta { background: #FEF2F2; color: #B91C1C; }
.fila { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.filtros input { max-width: 420px; margin: 0 0 8px; }
.leyenda { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; font-size: 12px; color: var(--suave); }
.leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.tarjeta { background: var(--tarjeta); border: 1px solid var(--borde-2); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--sombra); }
.rojo { color: var(--mal); } .verde { color: var(--ok); }
h3 { margin: 20px 0 10px; font-size: 16px; }
td.det { white-space: normal; min-width: 260px; font-family: ui-monospace, Consolas, monospace; font-size: 11px; color: var(--suave); }

/* --- Planificación --- */
.plan { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 12px; }
@media (max-width: 900px) { .plan { grid-template-columns: 1fr; } }
.plan-panel { background: var(--tarjeta); border: 1px solid var(--borde-2); border-radius: 12px; padding: 12px 14px; max-height: 640px; overflow-y: auto; box-shadow: var(--sombra); }
.plan-panel label { margin: 8px 0; }
.plan-panel details { margin: 10px 0; border-top: 1px solid var(--borde); padding-top: 8px; }
.plan-panel summary { cursor: pointer; font-weight: 600; }
.mapa-plan { height: 640px; border-radius: 12px; border: 1px solid var(--borde-2); box-shadow: var(--sombra); }
label.chk { display: flex; align-items: center; gap: 6px; font-weight: 400; margin: 4px 0; }
label.chk input { width: auto; margin: 0; }
label.chk i, .leyenda i, i.punto { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.lista-chk { max-height: 150px; overflow-y: auto; margin: 6px 0; }
.aviso-p { min-height: 18px; color: var(--acento); font-size: 13px; margin: 6px 0; }
.cuad { margin: 4px 0; font-size: 13px; } .cuad-form { margin-top: 8px; } .cuad-form select { height: auto; }
table.cal td[data-d] { cursor: pointer; min-width: 52px; }
.cal-ok { background: #d6f2df; } .cal-bajo { background: #fdf0cf; } .cal-alto { background: #fbdcd9; }
:root:not([data-theme="light"]) .cal-ok, :root:not([data-theme="light"]) .cal-bajo, :root:not([data-theme="light"]) .cal-alto { color: #1d2733; }

/* --- Operación (Fase 5) --- */
.fila-o { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 8px 0; }
.mapa-o { height: 46vh; min-height: 320px; border: 1px solid var(--borde-2); border-radius: 12px; margin: 8px 0; box-shadow: var(--sombra); }
.barra-km { height: 8px; width: 140px; background: #e4e8ec; border-radius: 4px; overflow: hidden; }
.barra-km i { display: block; height: 100%; background: var(--ok); }
.chip.aviso-chip { background: #fdf0cf; color: #6b4500; }

/* --- Ingreso con el formato de la Plataforma BALU (copiado de BALU Mediciones) --- */
.login-marca { display: flex; gap: 12px; align-items: center; justify-content: center; margin-bottom: 6px; }
.login-marca img { width: 56px; height: 56px; object-fit: contain; }
.login-c { font-size: 14px; letter-spacing: .3em; font-weight: 700; }
.login-b { font-size: 36px; font-weight: 700; color: #C01830; line-height: 1; }
.login-sub { text-align: center; color: var(--suave); font-size: 13px; margin-bottom: 12px; }

.btn-sec { color: inherit; border: 1px solid var(--borde); border-radius: 6px; padding: 4px 10px; text-decoration: none; font-size: 13px; }

.aviso-clave { background: #fdf0cf; color: #6b4500; border: 1px solid #e8c766; border-radius: 6px; padding: 8px 12px; margin: 8px 12px; font-size: 14px; }
.aviso-clave a { color: #6b4500; font-weight: bold; }

/* login: la plataforma BALU es la entrada; el acceso local (emergencia / administración) queda plegado */
.btn-plataforma { font-size: 15px; min-height: 48px; display: flex; align-items: center; justify-content: center; margin: 4px 0 6px; }
.acceso-local { margin-top: 16px; border-top: 1px solid #F1F5F9; padding-top: 12px; }
.acceso-local summary { cursor: pointer; color: var(--texto-2); font-size: 12px; text-align: center; list-style: none; padding: 6px 0; }
.acceso-local summary:hover { color: var(--texto); text-decoration: underline; }
.acceso-local .btn-rojo { margin-top: 18px; }
.acceso-local summary::-webkit-details-marker { display: none; }
.acceso-local[open] summary { margin-bottom: 8px; }
.acceso-local.sin-sso { border-top: 0; padding-top: 0; margin-top: 0; }
.acceso-local.sin-sso summary { display: none; }
@media (max-width: 420px) {
  header { flex-wrap: wrap; gap: 6px; padding: 8px 14px; }
  header .marca b { font-size: 13px; }
  header .marca .logo { height: 28px; }
  main { padding: 12px 12px 32px; }
}
