/* Estilo unificado BALU (ESTILO_BALU_UNIFICADO.md, 12-nov-2026): Manrope/Sora autoalojadas, tokens BALU */
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap; src: url('fuentes/manrope.woff2') format('woff2'); }
@font-face { font-family: 'Sora'; font-style: normal; font-weight: 100 800; font-display: swap; src: url('fuentes/sora.woff2') format('woff2'); }
:root {
  --balu-negro: #141414; --balu-negro-2: #1F1F1F; --balu-rojo: #C01830; --balu-rojo-osc: #9E1328; --balu-rojo-claro: #FBE9EC;
  --fondo: #F1F5F9; --texto: #1E293B; --texto-2: #64748B; --borde: #CBD5E1; --borde-2: #E2E8F0; --ok: #15803D; --aviso: #B45309; --error: #B91C1C;
  --negro: var(--balu-negro); --rojo: var(--balu-rojo);
  --pend: #D32F2F; --inst: #1F5FD1; --ret: #2E7D32; --aver: #EF6C00; --desc: #424242;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --titulo: 'Sora', 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--sans); background: var(--fondo); color: var(--texto); font-size: 14px;
  font-feature-settings: 'tnum' 1, 'cv11' 1, 'ss01' 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
h1, h2, .kpi b, .modulo b { font-family: var(--titulo); letter-spacing: -0.01em; }
.oculto { display: none !important; }
button, input, select { font: inherit; }
:focus-visible { outline: 2px solid var(--balu-rojo); outline-offset: 2px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; color: #334155; }
input, select { border: 1px solid var(--borde); border-radius: 8px; padding: 9px 11px; background: #fff; font-weight: 400; color: var(--texto); }
input:focus, select:focus { outline: none; border-color: transparent; box-shadow: 0 0 0 2px var(--balu-rojo); }
.btn, .btn-prim { background: var(--balu-rojo); color: #fff; border: 0; border-radius: 8px; padding: 11px 14px; font-weight: 600; cursor: pointer; min-height: 44px; }
.btn:hover, .btn-prim:hover { background: var(--balu-rojo-osc); }
.btn-sec { background: #fff; color: var(--texto); border: 1px solid var(--borde); border-radius: 8px; padding: 10px 14px; font-weight: 600; cursor: pointer; min-height: 40px; }
.btn-sec:hover { background: #F8FAFC; }
.btn:disabled, .btn-sec:disabled, .btn-prim:disabled { opacity: .6; cursor: default; }
.error { color: var(--error); font-weight: 600; font-size: 13.5px; }
.login .error:not(:empty) { background: #FEF2F2; border: 1px solid #FECACA; border-radius: 8px; padding: 10px 12px 10px 36px; position: relative; }
.login .error:not(:empty)::before { content: '!'; position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; border-radius: 50%;
  background: var(--error); color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.centro { text-align: center; margin: 0; }

/* ingreso, cambio de contraseña y portal: fondo negro BALU con trama fina, tarjeta blanca */
.login { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px;
  background: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px) 0 0 / 32px 32px,
              linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px) 0 0 / 32px 32px,
              linear-gradient(135deg, var(--balu-negro) 0%, var(--balu-negro-2) 55%, #2A0E14 100%); }
.login-col { width: 100%; max-width: 28rem; display: flex; flex-direction: column; gap: 16px; }
.login-caja { background: #fff; border-radius: 16px; box-shadow: 0 25px 50px -12px rgba(0,0,0,.45); overflow: hidden; }
.tarjeta-cab { padding: 28px 32px 18px; display: flex; flex-direction: column; align-items: center; gap: 12px; border-bottom: 1px solid #F1F5F9; }
.logo-login { width: 100%; max-width: 248px; height: auto; display: block; }
.sub { text-align: center; color: var(--texto-2); font-size: 14px; font-weight: 600; }
.tarjeta-cuerpo { padding: 28px 32px 32px; display: flex; flex-direction: column; gap: 16px; }
.tarjeta-cuerpo h2 { margin: 0; font-size: 18px; font-weight: 600; color: var(--texto); }
.login input { height: 44px; }
.clave-caja { position: relative; display: flex; } .clave-caja input { flex: 1; padding-right: 46px; min-width: 0; }
.ojo { position: absolute; right: 2px; top: 2px; bottom: 2px; width: 42px; border: 0; background: none; border-radius: 6px; cursor: pointer; color: var(--texto-2);
  display: flex; align-items: center; justify-content: center; }
.ojo svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ojo.visible { color: var(--balu-rojo); }
.btn-prim { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; font-size: 14px; }
.spin { display: none; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: giro .8s linear infinite; }
.btn-prim.cargando .spin { display: inline-block; }
@keyframes giro { to { transform: rotate(360deg); } }
.login .btn-sec { width: 100%; min-height: 44px; }
.ayuda.centro { color: var(--texto-2); }
.pie-marca { text-align: center; font-size: 12px; letter-spacing: .06em; color: rgba(255,255,255,.6); }
.portal-col { max-width: 30rem; }
.login .modulo { display: flex; flex-direction: row; align-items: center; gap: 16px; text-align: left; background: #fff; color: var(--texto); border: 1px solid var(--borde-2);
  border-radius: 12px; padding: 18px 16px; cursor: pointer; font: inherit; box-shadow: 0 1px 3px rgba(0,0,0,.08); min-height: 88px; transition: border-color .15s, box-shadow .15s; }
.login .modulo:hover { border-color: var(--balu-rojo); box-shadow: 0 6px 16px -6px rgba(192,24,48,.35); }
.modulo > div { display: flex; flex-direction: column; gap: 4px; } .modulo b { font-size: 17px; font-weight: 600; } .modulo span { color: var(--texto-2); font-size: 13px; }
.modulo-ic { flex: 0 0 44px; width: 44px; height: 44px; padding: 8px; border-radius: 10px; background: var(--balu-rojo-claro); fill: none; stroke: var(--balu-negro);
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.modulo-ic circle[fill] { fill: var(--balu-rojo-claro); }
.portal-pie { display: flex; justify-content: space-between; padding-top: 4px; }
.portal-pie a { color: var(--balu-rojo); font-weight: 600; cursor: pointer; text-decoration: none; } .portal-pie a:hover { text-decoration: underline; }
body.oficina .solo-admin { display: none !important; }

/* interior: cabecera negra con el logo y línea roja de 2 px */
.cab { background: var(--balu-negro); color: #fff; padding: 10px 20px; min-height: 60px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  border-bottom: 2px solid var(--balu-rojo); }
.cab-logo { height: 36px; display: block; flex: 0 0 auto; }
.cab-t { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cab-t b { font-family: var(--titulo); font-weight: 600; font-size: 16px; } .cab-t span { font-size: 12px; color: #CBD5E1; }
.cab-usr { color: #94A3B8; font-size: 13px; }
nav { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; } nav a { color: #CBD5E1; cursor: pointer; font-weight: 500; } nav a:hover { color: #fff; }
nav a.on { color: #fff; font-weight: 700; box-shadow: inset 0 -2px 0 var(--balu-rojo); padding-bottom: 2px; }
.cont { max-width: 1320px; margin: 0 auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; }
section { display: flex; flex-direction: column; gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid var(--borde-2); border-radius: 12px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(0,0,0,.08); display: flex; flex-direction: column; gap: 5px; }
.kpi span { font-size: 12.5px; color: var(--texto-2); font-weight: 500; } .kpi b { font-size: 28px; font-weight: 700; color: var(--texto); } .kpi.alerta { border-color: #E8A3A3; } .kpi.alerta b { color: #B71C1C; }
.fila2 { display: flex; gap: 16px; flex-wrap: wrap; }
.caja { background: #fff; border: 1px solid var(--borde-2); border-radius: 12px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.08); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.caja-mapa { padding: 0; overflow: hidden; } .caja-mapa .caja-cab { padding: 12px 14px 0; }
.caja-cab { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .caja-cab b { flex: 1; }
.caja > b, .caja-cab > b { font-family: var(--titulo); font-weight: 600; font-size: 15px; }
#mapa { height: 460px; margin-top: 10px; }
.seg { display: flex; border: 1px solid var(--borde); border-radius: 8px; overflow: hidden; } .seg button { border: 0; background: #fff; padding: 6px 10px; cursor: pointer; } .seg .on { background: var(--negro); color: #fff; }
/* barras de avance: mismo diseño que la APK BALU Mediciones (pendiente rosado, instalado azul, retirado verde) */
.avances { display: flex; flex-direction: column; gap: 12px; }
.av { display: flex; flex-direction: column; gap: 5px; font-size: 14px; } .av-fila { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.av-fila b { font-family: var(--titulo); font-weight: 600; }
.av-barra { height: 10px; border-radius: 6px; background: #F3C9C9; overflow: hidden; display: flex; } .av-barra div { height: 100%; }
.leyenda { display: flex; gap: 14px; font-size: 12px; color: var(--texto-2); flex-wrap: wrap; }
.leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }
.b-rojo { background: var(--pend); } .b-azul { background: var(--inst); } .b-verde { background: var(--ret); }
.tabla-caja { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 760px; }
th { background: #F8FAFC; color: #475569; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; text-align: left; padding: 10px;
  position: sticky; top: 0; border-bottom: 1px solid var(--borde-2); }
td { padding: 10px; border-top: 1px solid #F1F5F9; vertical-align: top; }
tr.clic { cursor: pointer; } tr.clic:hover { background: #F8FAFC; }
.e-pendiente { color: var(--pend); font-weight: 700; } .e-instalado { color: var(--inst); font-weight: 700; } .e-retirado { color: var(--ret); font-weight: 700; }
.al { color: #B71C1C; font-weight: 700; }
table.angosta { min-width: 0; } .num { text-align: right; font-variant-numeric: tabular-nums; }
.barra { display: inline-block; height: 9px; background: var(--inst); border-radius: 3px; vertical-align: middle; margin-right: 6px; }
.sin-datos { background: #F6F6F6; border: 1px dashed #BDBDBD; border-radius: 10px; padding: 14px; color: #444; }
.ayuda a { color: var(--inst); }
#f2-cuerpo { display: flex; flex-direction: column; gap: 16px; }
.ayuda { color: var(--texto-2); font-size: 13px; margin: 0; }
.form-fila { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; } .form-fila label { min-width: 180px; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.modal-caja { background: #fff; border-radius: 16px; box-shadow: 0 25px 50px -12px rgba(0,0,0,.45); padding: 20px; width: 100%; max-width: 860px; max-height: 90vh; overflow: auto; position: relative; }
.modal-x { position: absolute; right: 12px; top: 8px; border: 0; background: none; font-size: 28px; cursor: pointer; }
.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; } .fotos figure { margin: 0; } .fotos img { width: 100%; border-radius: 8px; } .fotos figcaption { font-size: 12px; color: #555; }
.pin-grande { font-size: 44px; font-weight: 700; letter-spacing: .25em; text-align: center; margin: 14px 0; }
.acciones { display: flex; gap: 6px; flex-wrap: wrap; } .acciones button { padding: 6px 10px; font-size: 12.5px; }
.inactivo td { color: #9E9E9E; }
.det { display: grid; grid-template-columns: 180px 1fr; gap: 6px 12px; font-size: 13.5px; } .det dt { font-weight: 700; color: #444; } .det dd { margin: 0; }
@media (max-width: 600px) { .cont { padding: 12px; } .det { grid-template-columns: 1fr; } }


@media (max-width: 480px) {
  .tarjeta-cab { padding: 24px 20px 16px; } .tarjeta-cuerpo { padding: 22px 20px 24px; }
  .cab { padding: 8px 12px; gap: 8px 12px; } .cab-logo { height: 30px; } .cab-t span, .cab-usr { display: none; }
  nav { gap: 4px 16px; width: 100%; } nav a { padding: 8px 0; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; } .kpi { padding: 12px; } .kpi b { font-size: 22px; }
}
.reemp { display: inline-block; margin-top: 2px; font-size: 11.5px; font-weight: 600; color: #8A5A00; background: #FFF1D6; border-radius: 6px; padding: 1px 6px; }
.b-averiado { background: var(--aver); } .b-descartado { background: var(--desc); }
.e-averiado { color: var(--aver); font-weight: 700; } .e-descartado { color: var(--desc); font-weight: 700; }
.cond { display: inline-block; margin-top: 2px; font-size: 11.5px; font-weight: 700; color: #fff; border-radius: 6px; padding: 1px 6px; }
.cond-averiado { background: var(--aver); } .cond-descartado { background: var(--desc); }

/* 18-nov: detalle por flujo y avance por día */
.av-det { font-size: 13px; color: var(--sub, #555); margin-top: 2px; }
.por-dia { margin-top: 10px; } .por-dia summary { cursor: pointer; margin-bottom: 6px; }
#t-dias th, #t-dias td { text-align: center; } #t-dias td:first-child { text-align: left; }
.det-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding: 10px; border: 1px solid #ddd; border-radius: 8px; }
.det-form label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; } .det-form label.chk { flex-direction: row; align-items: center; gap: 6px; }
