/* Security Report by Eixer Solutions — colores corporativos Eixer
   azul #006186 · teal #009CB2 · gris #4B4B4D
   Tema oscuro (oficina) y tema claro (terreno, alto contraste al sol). */

/* Fuentes incluidas en la plataforma (no dependen de internet) */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/vendor/fuentes/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/vendor/fuentes/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/vendor/fuentes/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/vendor/fuentes/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/vendor/fuentes/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/vendor/fuentes/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

:root, :root[data-theme="dark"] {
  --bg: #08161D; --panel: #0E212A; --panel2: #132C37; --borde: #1F3D4A; --borde2: #2B5263;
  --texto: #E6EEF2; --suave: #9DB2BC; --tenue: #7F96A1;
  --acento: #19B5CB; --acento-txt: #03222A; --acento-suave: #0F3A47; --enlace: #5FD3E4;
  --ok: #2FBF85; --warn: #F2B035; --down: #FF7070;
  --pin-borde: #08161D; --pin-icono: #06161C;
  --mapa-fondo: #0B1C24; --sombra: 0 8px 28px rgba(0,0,0,.45);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #EEF3F5; --panel: #FFFFFF; --panel2: #F3F7F9; --borde: #C9D6DC; --borde2: #9FB4BE;
  --texto: #10232B; --suave: #45545B; --tenue: #5C6B72;
  --acento: #006186; --acento-txt: #FFFFFF; --acento-suave: #D7EBF2; --enlace: #005577;
  --ok: #10804F; --warn: #9A6200; --down: #C32727;
  --pin-borde: #FFFFFF; --pin-icono: #06161C;
  --mapa-fondo: #E3ECEF; --sombra: 0 8px 24px rgba(16,35,43,.18);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--texto); }
body { font-family: 'IBM Plex Sans', system-ui, sans-serif; font-size: 14px; line-height: 1.45; }
:root[data-theme="light"] body { font-size: 15px; }
a { color: var(--enlace); }
.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }
.suave { color: var(--suave); }
.oculto { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--acento); outline-offset: 2px; }

.btn { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--borde2);
  background: transparent; color: var(--texto); display: inline-flex; align-items: center;
  justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--panel2); }
.btn.prim { background: var(--acento); border-color: var(--acento); color: var(--acento-txt); font-weight: 600; }
.btn.prim:hover { filter: brightness(1.08); }
.btn.peligro { border-color: var(--down); color: var(--down); }
.btn.chico { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.prim:disabled { background: transparent; color: var(--suave); border-color: var(--borde2); opacity: .7; }
.btn-icono { width: 44px; padding: 0; }

.campo { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--suave); min-width: 0; }
.campo input, .campo select, .campo textarea, .ctrl {
  background: var(--bg); color: var(--texto); border: 1px solid var(--borde); border-radius: 8px;
  padding: 10px 12px; font-size: 14px; min-height: 44px; width: 100%; }
.campo textarea { min-height: 90px; resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; color: var(--texto); }
.check input { width: 20px; height: 20px; accent-color: var(--acento); }

/* ---------- Login ---------- */
.login { min-height: calc(100vh - 72px); display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-caja { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--borde);
  border-radius: 16px; padding: 32px 28px; display: flex; flex-direction: column; gap: 18px; box-shadow: var(--sombra); }
.login-caja form { display: flex; flex-direction: column; gap: 14px; }
.login-ancha { max-width: 480px; }
.codigo-2fa { font: 500 22px "IBM Plex Mono", monospace !important; letter-spacing: 6px; min-height: 52px; }
.pasos-2fa { margin: 0 0 14px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; line-height: 1.5; }
.qr-fila { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.qr-caja { background: #fff; border-radius: 10px; padding: 8px; line-height: 0; flex: 0 0 auto; }
.qr-caja svg { width: 168px; height: 168px; }
.qr-clave { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1 1 160px; font-size: 12px; }
.qr-clave code { font: 500 13px "IBM Plex Mono", monospace; background: var(--bg); border: 1px solid var(--borde); border-radius: 8px; padding: 8px 10px; word-break: break-all; }
.estado-2fa { color: var(--ok); font-weight: 600; }
.error { color: var(--down); font-size: 13px; min-height: 18px; margin: 0; }

/* ---------- Marca ---------- */
.marca { display: flex; align-items: center; gap: 12px; }
.marca svg { flex: 0 0 auto; }
.marca-grande .marca-txt b { font-size: 22px; }
.marca-grande .marca-txt span { font-size: 12px; }
.mapa-ctl.arriba-izq button:disabled { opacity: .45; cursor: default; }
.marca-txt { display: flex; flex-direction: column; line-height: 1.15; }
.marca-txt b { font-size: 17px; letter-spacing: .2px; }
.marca-txt span { font-size: 11px; color: var(--suave); letter-spacing: 1.2px; text-transform: uppercase; }

/* ---------- Encabezado ---------- */
.cab { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; padding: 12px 20px;
  border-bottom: 1px solid var(--borde); background: var(--panel); position: sticky; top: 0; z-index: 1000; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; }
.nav a { padding: 10px 14px; border-radius: 8px; color: var(--suave); text-decoration: none; min-height: 44px;
  display: inline-flex; align-items: center; }
.nav a[aria-current="page"] { background: var(--acento-suave); color: var(--texto); font-weight: 600; }
.nav a:hover { color: var(--texto); }
.cab-sel { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: auto; }
.cab-sel label { display: flex; align-items: center; gap: 8px; color: var(--suave); font-size: 13px; }
.cab-sel select { background: var(--bg); border: 1px solid var(--borde); border-radius: 8px; padding: 9px 10px; min-height: 44px; max-width: 230px; }
.admin-tag { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--enlace);
  border: 1px solid var(--borde2); border-radius: 6px; padding: 2px 6px; }
.usuario-btn { display: flex; align-items: center; gap: 10px; background: transparent; border: 1px solid transparent;
  border-radius: 10px; padding: 4px 8px; min-height: 44px; }
.usuario-btn:hover { border-color: var(--borde); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--acento-suave); display: flex;
  align-items: center; justify-content: center; font-weight: 600; font-size: 13px; }
.usuario-txt { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.usuario-txt small { color: var(--suave); font-size: 12px; }
.menu { position: absolute; right: 16px; top: 64px; background: var(--panel); border: 1px solid var(--borde);
  border-radius: 12px; box-shadow: var(--sombra); padding: 6px; display: flex; flex-direction: column; min-width: 220px; z-index: 1100; }
.menu button { text-align: left; background: transparent; border: 0; padding: 12px; border-radius: 8px; min-height: 44px; }
.menu button:hover { background: var(--panel2); }

/* ---------- Contenido ---------- */
.cuerpo { padding: 16px 20px 28px; display: flex; flex-direction: column; gap: 16px; max-width: 1680px; margin: 0 auto; }
.tit-fila { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.tit-fila h1 { margin: 0; font-size: 24px; }
.panel { background: var(--panel); border: 1px solid var(--borde); border-radius: 12px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { padding: 12px 16px; font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; transition: border-color .15s, background .15s; }
.kpi:hover { border-color: var(--borde2); }
.kpi[aria-pressed="true"] { border-color: var(--acento); background: var(--acento-suave); box-shadow: inset 0 0 0 1px var(--acento); }
.kpi:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
.kpi small { color: var(--suave); font-size: 12px; }
.kpi b { display: block; font-size: 26px; margin-top: 2px; }
.kpi .ok { color: var(--ok); } .kpi .warn { color: var(--warn); } .kpi .down { color: var(--down); }

.mapa-fila { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.lista { flex: 1 1 260px; max-width: 330px; min-width: 0; display: flex; flex-direction: column; overflow: hidden; max-height: 680px; }
.lista-cab { padding: 12px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--borde); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--borde2);
  background: transparent; color: var(--suave); font-size: 12px; }
.chip[aria-pressed="true"] { border-color: var(--acento); background: var(--acento-suave); color: var(--texto); }
.lista ul { list-style: none; margin: 0; padding: 6px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.fila-cam { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 10px;
  border-radius: 8px; border: 1px solid transparent; background: transparent; text-align: left; }
.fila-cam:hover { background: var(--panel2); }
.fila-cam[aria-current="true"] { background: var(--acento-suave); border-color: var(--borde2); }
.fila-cam .txt { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.fila-cam .txt b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.fila-cam .txt small { color: var(--suave); font-size: 12px; }
.vacio { padding: 20px; color: var(--suave); text-align: center; }

.mapa-caja { flex: 999 1 520px; min-width: 0; position: relative; height: 680px; border-radius: 12px;
  overflow: hidden; border: 1px solid var(--borde); background: var(--mapa-fondo); }
#mapa { position: absolute; inset: 0; }
#mapa.leaflet-container { background: var(--mapa-fondo); font-family: inherit; }
.leaflet-bar a { width: 40px !important; height: 40px !important; line-height: 40px !important; }
.dl dd .btn { white-space: normal; text-align: left; height: auto; padding: 6px 10px; }
.mapa-ctl { position: absolute; z-index: 500; display: flex; gap: 6px; }
.mapa-ctl.arriba-izq { top: 12px; left: 12px; background: var(--panel); border: 1px solid var(--borde);
  border-radius: 10px; padding: 4px; box-shadow: var(--sombra); }
.mapa-ctl.arriba-izq button { min-height: 40px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--suave); }
.mapa-ctl.arriba-izq button[aria-pressed="true"] { background: var(--acento-suave); color: var(--texto); font-weight: 600; }
.mapa-ctl.abajo-izq { bottom: 12px; left: 12px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--borde);
  border-radius: 10px; padding: 8px 12px; font-size: 12px; color: var(--suave); gap: 12px; max-width: calc(100% - 24px); box-shadow: var(--sombra); }
.leyenda { padding: 0 !important; display: block !important; }
.leyenda summary { cursor: pointer; padding: 10px 14px; min-height: 40px; color: var(--texto); font-weight: 600; list-style-position: inside; }
.leyenda[open] summary { padding-bottom: 4px; }
.leyenda-items { display: flex; flex-wrap: wrap; gap: 8px 12px; padding: 4px 14px 10px; }
.leyenda-item { display: flex; align-items: center; gap: 6px; }
.punto { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.punto.operativa { background: var(--ok); } .punto.observacion { background: var(--warn); } .punto.fuera { background: var(--down); }
.aviso-mapa { position: absolute; z-index: 600; top: 64px; left: 50%; transform: translateX(-50%);
  background: var(--acento); color: var(--acento-txt); padding: 10px 16px; border-radius: 10px; font-weight: 600;
  box-shadow: var(--sombra); display: flex; gap: 12px; align-items: center; max-width: calc(100% - 24px); }
.aviso-mapa button { background: transparent; border: 1px solid currentColor; color: inherit; border-radius: 8px; min-height: 36px; padding: 0 10px; }
.etiqueta-mapa { position: absolute; z-index: 500; bottom: 12px; right: 12px; font-size: 11px; color: var(--suave);
  background: var(--panel); border-radius: 6px; padding: 3px 8px; border: 1px solid var(--borde); }

/* Pines de cámara: color = estado, dibujo = forma (bullet, domo, PTZ) */
.pin { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 3px solid var(--pin-borde); box-shadow: 0 3px 10px rgba(0,0,0,.45); cursor: pointer; position: relative; }
.pin svg { width: 28px; height: 28px; stroke: var(--pin-icono); }
.pin.operativa { background: #2FBF85; } .pin.observacion { background: #F2B035; } .pin.fuera { background: #FF7070; }
.pin.sel { box-shadow: 0 0 0 4px var(--pin-borde), 0 0 0 8px var(--acento), 0 4px 14px rgba(0,0,0,.5); z-index: 5; }
.pin.arrastrable { animation: latido 1.2s infinite; }
@keyframes latido { 50% { transform: scale(1.12); } }
.pin.cuadrado { border-radius: 12px; }
.punto.cuadro { border-radius: 3px; background: var(--ok); width: 12px; height: 12px; }
.linea-enlace { width: 18px; height: 0; border-top: 3px dotted #5FD3E4; display: inline-block; }
.pin-ant { position: absolute; top: -8px; right: -10px; width: 24px; height: 24px; border-radius: 50%;
  background: #E6EEF2; border: 2px solid #06161C; display: flex; align-items: center; justify-content: center; }
.pin-ant svg { width: 14px; height: 14px; stroke: #06161C; stroke-width: 2.4; }
.pin-cod { position: absolute; top: 48px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  font: 600 11px 'IBM Plex Mono', monospace; background: var(--panel); color: var(--texto);
  padding: 1px 6px; border-radius: 4px; border: 1px solid var(--borde); pointer-events: none; }
.leaflet-div-icon.pin-wrap { background: transparent; border: 0; }
.icono-forma { width: 18px; height: 18px; stroke: currentColor; }

/* Ficha lateral */
.ficha { flex: 1 1 320px; max-width: 400px; min-width: 0; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.ficha h2 { margin: 0; font-size: 20px; line-height: 1.25; }
.badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid currentColor; }
.badge.operativa { color: var(--ok); } .badge.observacion { color: var(--warn); } .badge.fuera { color: var(--down); }
.dl { margin: 0; display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 9px 12px; font-size: 13px; }
.dl dt { color: var(--suave); } .dl dd { margin: 0; overflow-wrap: anywhere; }
.cred { background: var(--bg); border: 1px solid var(--borde); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.cred-fila { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acciones { display: flex; flex-wrap: wrap; gap: 8px; }
.acciones .btn { flex: 1 1 140px; }

/* Tablas */
.tabla-caja { overflow-x: auto; }
table.tabla { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 760px; }
.tabla th { text-align: left; color: var(--suave); font-weight: 500; padding: 12px 10px; border-bottom: 1px solid var(--borde); white-space: nowrap; }
.tabla td { padding: 11px 10px; border-bottom: 1px solid var(--borde); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla tbody tr:hover { background: var(--panel2); }
.tabla .fin { text-align: right; white-space: nowrap; }

/* Administración */
.dos-col { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.dos-col > * { flex: 1 1 420px; min-width: 0; }
.seccion { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.seccion h2 { margin: 0; font-size: 16px; }
.item-sel { width: 100%; text-align: left; background: transparent; border: 1px solid var(--borde); border-radius: 10px;
  padding: 12px 14px; display: flex; justify-content: space-between; gap: 12px; align-items: center; min-height: 52px; }
.item-sel[aria-current="true"] { border-color: var(--acento); background: var(--acento-suave); }

/* Modal */
.velo { position: fixed; inset: 0; background: rgba(3,12,16,.62); z-index: 2000; display: flex; align-items: flex-start;
  justify-content: center; padding: 24px 12px; overflow-y: auto; }
.modal { width: 100%; max-width: 760px; background: var(--panel); border: 1px solid var(--borde); border-radius: 16px;
  box-shadow: var(--sombra); display: flex; flex-direction: column; }
.modal-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--borde); }
.modal-cab h2 { margin: 0; font-size: 18px; }
.modal-cuerpo { padding: 18px 20px; display: flex; flex-direction: column; gap: 18px; }
.modal-pie { padding: 14px 20px; border-top: 1px solid var(--borde); display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
fieldset.grupo { border: 1px solid var(--borde); border-radius: 12px; padding: 14px; margin: 0; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
fieldset.grupo legend { padding: 0 6px; font-weight: 600; font-size: 13px; }
.ancho { grid-column: 1 / -1; }
.formas { display: flex; flex-wrap: wrap; gap: 8px; }
.forma-op { flex: 1 1 110px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px;
  border: 1px solid var(--borde2); border-radius: 10px; background: transparent; min-height: 84px; }
.forma-op svg { width: 34px; height: 34px; stroke: var(--texto); }
.forma-op[aria-pressed="true"] { border-color: var(--acento); background: var(--acento-suave); font-weight: 600; }

/* Avisos */
.avisos { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 3000; display: flex;
  flex-direction: column; gap: 8px; width: min(92vw, 460px); pointer-events: none; }
.aviso { background: var(--panel); color: var(--texto); border: 1px solid var(--borde2); border-left-width: 1px;
  padding: 12px 16px; border-radius: 10px; box-shadow: var(--sombra); font-size: 14px; }
.aviso.err { border-color: var(--down); color: var(--down); }

@media (max-width: 760px) {
  .cab { padding: 10px 12px; position: static; }
  .cuerpo { padding: 12px; }
  .cab-sel { margin-left: 0; width: 100%; }
  .cab-sel label, .cab-sel select { flex: 1 1 140px; max-width: none; }
  .mapa-caja { height: 62vh; min-height: 380px; order: -1; }
  .lista { max-width: none; max-height: 420px; }
  .ficha { max-width: none; }
  .usuario-txt { display: none; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 8px 10px; }
  .kpi small { font-size: 11px; }
  .kpi b { font-size: 20px; }
}

/* ---------- Etapa 2: reportes ---------- */
.rep-equipo { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--borde); border-radius: 12px; background: var(--panel2); }
.rep-equipo svg { width: 26px; height: 26px; stroke: var(--texto); }
.segmentos { display: flex; flex-wrap: wrap; gap: 6px; }
.seg { min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--borde2); background: transparent; color: var(--suave); }
.seg[aria-pressed="true"] { border-color: var(--acento); background: var(--acento-suave); color: var(--texto); font-weight: 600; }
.estados-op { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.estado-op { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--borde2); background: transparent; color: var(--suave); text-align: left; }
.estado-op .punto { width: 14px; height: 14px; }
.estado-op[aria-pressed="true"] { background: var(--acento-suave); color: var(--texto); font-weight: 600; }
.estado-op[aria-pressed="true"][data-estado="operativa"] { border-color: var(--ok); }
.estado-op[aria-pressed="true"][data-estado="observacion"] { border-color: var(--warn); }
.estado-op[aria-pressed="true"][data-estado="fuera"] { border-color: var(--down); }
.fotos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.foto-item { position: relative; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.foto-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--borde); background: var(--bg); }
.foto-item figcaption { font-size: 12px; color: var(--suave); }
.foto-desc { background: var(--bg); color: var(--texto); border: 1px solid var(--borde); border-radius: 6px; padding: 6px 8px; font-size: 12px; min-height: 36px; width: 100%; }
.foto-x { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(6,22,28,.8); color: #fff; }
.pad-firma { width: 100%; height: 160px; border-radius: 10px; border: 1px dashed var(--borde2); background: #FFFFFF; touch-action: none; display: block; }
.firma-vista img { max-width: 100%; max-height: 140px; background: #FFFFFF; border-radius: 8px; border: 1px solid var(--borde); padding: 6px; }
.chip-tipo { display: inline-flex; padding: 3px 10px; border-radius: 6px; background: var(--acento-suave); font-size: 12px; }
.lista-reportes { display: flex; flex-direction: column; gap: 12px; }
.reporte { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.reporte-cab { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.reporte-txt { margin: 0; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.reporte-equipo { display: inline-flex; align-items: center; gap: 8px; color: var(--texto); text-decoration: none; }
.reporte-equipo svg { width: 18px; height: 18px; stroke: currentColor; }
.reporte-pie { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 13px; }
.miniaturas { display: flex; flex-wrap: wrap; gap: 8px; }
.mini { padding: 0; border: 1px solid var(--borde); border-radius: 8px; overflow: hidden; background: var(--bg); width: 132px; height: 92px; }
.mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.firma-mini { display: inline-flex; align-items: center; gap: 8px; }
.firma-mini img { height: 40px; background: #FFFFFF; border-radius: 6px; border: 1px solid var(--borde); padding: 2px 6px; }
.franja { display: grid; grid-template-columns: repeat(auto-fit, minmax(54px, 1fr)); gap: 6px; }
.franja-item { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.franja-item small { font-size: 11px; color: var(--suave); white-space: nowrap; }
.franja-barra { width: 100%; height: 26px; border-radius: 6px; display: block; }
.franja-barra.operativa { background: var(--ok); } .franja-barra.observacion { background: var(--warn); } .franja-barra.fuera { background: var(--down); }
.filtros { padding: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.filtros input[type="date"] { color-scheme: inherit; }
.fila-rep { cursor: pointer; }
.fila-rep:focus-visible { outline: 3px solid var(--acento); outline-offset: -3px; }
.visor { align-items: center; background: rgba(2,8,11,.88); }
.visor-caja { position: relative; max-width: min(1200px, 96vw); width: 100%; display: flex; flex-direction: column; gap: 10px; }
.visor-caja img { max-width: 100%; max-height: 80vh; object-fit: contain; border-radius: 10px; margin: 0 auto; background: #000; }
.visor-pie { display: flex; justify-content: space-between; gap: 12px; color: #E6EEF2; font-size: 14px; }
.visor-nav, .visor-cerrar { position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(6,22,28,.75); color: #fff; font-size: 26px; }
.visor-nav { top: calc(40vh - 24px); }
.visor-nav.ant { left: 8px; } .visor-nav.sig { right: 8px; }
.visor-cerrar { top: 8px; right: 8px; font-size: 18px; }

/* Foto de referencia del equipo */
.foto-ref { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--borde); border-radius: 10px; overflow: hidden; background: var(--bg); cursor: zoom-in; }
.foto-ref img { display: block; width: 100%; height: 190px; object-fit: cover; }
.foto-ref span { position: absolute; left: 8px; bottom: 8px; font-size: 12px; background: rgba(6,22,28,.78); color: #E6EEF2; padding: 3px 8px; border-radius: 6px; }
.foto-ref.foto-ref-vacia, .foto-ref-vacia { display: flex; align-items: center; justify-content: center; min-height: 64px; border: 1px dashed var(--borde2); color: var(--suave); cursor: pointer; font-size: 13px; border-radius: 10px; }
.foto-ref-edit { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.foto-ref-edit #foto-ref-prev { flex: 0 0 180px; }
.foto-ref-img { width: 180px; height: 120px; object-fit: cover; border-radius: 8px; border: 1px solid var(--borde); display: block; }
#foto-ref-prev .foto-ref-vacia { width: 180px; height: 120px; }

/* ---------- Etapa 3: exportación ---------- */
.barra-sel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; min-height: 56px; }
.barra-sel.activa { border-color: var(--acento); background: var(--acento-suave); }
.caja-sel { width: 20px; height: 20px; accent-color: var(--acento); cursor: pointer; }
.celda-sel { width: 44px; cursor: default; }
.fila-rep.marcada { background: var(--acento-suave); }

/* Pie con datos de contacto */
.pie { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 18px; padding: 18px 16px 24px;
  font-size: 12.5px; color: var(--suave); border-top: 1px solid var(--borde); }
.pie a { color: var(--enlace); text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.pie a:hover { text-decoration: underline; }
.login + .pie, body:has(.login) .pie { border-top: 0; }

/* Informe de estado del sistema */
.modal.modal-ancho { max-width: 980px; }
.estado-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; }
.estado-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.seg-doble { display: flex; gap: 8px; }
.seg-doble .btn { flex: 1; }
.seg-doble .btn[aria-pressed="true"] { border-color: var(--acento); background: var(--acento-suave); font-weight: 600; }
.estado-lista { display: flex; flex-direction: column; gap: 2px; max-height: 420px; overflow: auto; border: 1px solid var(--borde); border-radius: 12px; padding: 6px; }
.estado-sitio { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 6px 2px; color: var(--suave);
  font-size: 12px; letter-spacing: .4px; text-transform: uppercase; }
.estado-sitio .check { text-transform: none; letter-spacing: 0; font-size: 13px; min-height: 36px; color: var(--suave); }
.estado-eq { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; min-height: 40px; cursor: pointer; }
.estado-eq.sel { background: var(--panel2); }
.estado-eq input { width: 18px; height: 18px; accent-color: var(--acento); flex: 0 0 auto; }
.estado-eq .mono { width: 64px; flex: 0 0 auto; font-size: 13px; }
.estado-nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.punto.cuadro.operativa { background: var(--ok); } .punto.cuadro.observacion { background: var(--warn); } .punto.cuadro.fuera { background: var(--down); }
@media (max-width: 760px) {
  .estado-grid { grid-template-columns: 1fr; }
  .estado-lista { max-height: 300px; }
  .estado-eq small { display: none; }
}

/* Módulo de informes no contratado (usuarios de cliente) */
.nota-plan { display: none; margin: 0; padding: 10px 14px; border: 1px dashed var(--borde2); border-radius: 10px; color: var(--suave); font-size: 13px; }
body.sin-exportar .solo-exportar { display: none !important; }
body.sin-exportar .nota-plan { display: block; }

/* Mantenciones programadas */
.kpi .info { color: var(--enlace); }
.badge.info { color: var(--enlace); }
.txt-down { color: var(--down); font-weight: 600; }
.chk-lista { display: flex; flex-direction: column; gap: 8px; }
.chk-fila { display: grid; grid-template-columns: minmax(0, 1fr) 190px auto auto auto; gap: 6px; align-items: center; }
.chk-fila input, .chk-fila select { min-height: 40px; border-radius: 8px; border: 1px solid var(--borde); background: var(--bg); color: var(--texto); padding: 0 10px; font: inherit; min-width: 0; }
.v-avance { padding: 12px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.v-avance .barra { flex: 1 1 100%; height: 10px; border-radius: 999px; background: var(--borde); overflow: hidden; }
.v-avance .barra span { display: block; height: 100%; background: var(--acento); }
.v-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.v-lista ul { list-style: none; margin: 0; padding: 6px; display: flex; flex-direction: column; gap: 2px; max-height: 640px; overflow: auto; }
.v-ico { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: 0 0 auto; }
.v-ico.ok { background: var(--ok); color: #fff; } .v-ico.falla { background: var(--warn); color: #10232B; } .v-ico.pend { border: 2px solid var(--borde2); color: var(--suave); }
.v-form { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.v-foto { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; }
.chk-cab { display: flex; justify-content: space-between; align-items: center; }
.chk-items { display: flex; flex-direction: column; border: 1px solid var(--borde); border-radius: 12px; padding: 2px 12px; }
.chk-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--borde); }
.chk-item:last-child { border-bottom: 0; }
.chk-item > span { flex: 1; min-width: 0; }
.chk-ops { display: flex; gap: 4px; flex: 0 0 auto; }
.chk-op { min-width: 48px; min-height: 40px; border-radius: 8px; border: 1px solid var(--borde2); background: transparent; color: var(--suave); font: inherit; cursor: pointer; }
.chk-op.ok[aria-checked="true"] { border-color: var(--ok); color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); font-weight: 700; }
.chk-op.falla[aria-checked="true"] { border-color: var(--down); color: var(--down); background: color-mix(in srgb, var(--down) 14%, transparent); font-weight: 700; }
.chk-op.na[aria-checked="true"] { border-color: var(--suave); color: var(--texto); font-weight: 700; }
.chk-resumen { margin: 0; font-size: 13px; }
.aviso-suave { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--warn); color: var(--texto); font-size: 13px; }
@media (max-width: 760px) {
  .v-grid { grid-template-columns: 1fr; }
  .v-lista ul { max-height: 260px; }
  .chk-fila { grid-template-columns: minmax(0, 1fr) auto auto auto; }
  .chk-fila select { grid-column: 1 / -1; grid-row: 2; }
  .chk-item { flex-wrap: wrap; }
}
.plan-sitios { display: flex; flex-direction: column; gap: 0; max-height: 240px; overflow: auto; border: 1px solid var(--borde); border-radius: 10px; padding: 4px 12px; }
.v-sitio { padding: 10px 8px 4px; color: var(--suave); font-size: 12px; letter-spacing: .4px; text-transform: uppercase; }
