/* Deitres Cloud: misma estética que la nube vieja (webapp-ui, CityMesh): DM Sans, barra lateral azul #425980,
   amarillo #ffcc00, textos #091e42, tablas y diálogos con bordes de 24 px. */
@font-face { font-family: 'DM Sans'; src: url('/fuentes/DMSans-Regular.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }

:root {
  --fondo: #f5f6f7; --panel: #ffffff; --texto: #091e42; --suave: #5d6b82; --celda: #243757; --borde: #dfe2e6; --fila: #f2f5f8;
  --lateral: #425980; --lateral-osc: #243757; --lateral-hover: #6b788e; --lateral-activo: #5d6b82; --lateral-borde: #42526d;
  --amarillo: #ffcc00; --amarillo-osc: #e6b800; --hover-fila: #fadf7c;
  --ok: #34c759; --mal: #ff3b30; --aviso: #ff9500; --azul: #42526d; --gris: #98a1b0;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --sombra: 0 4px 12px rgba(47, 56, 75, .12);
  --vidrio: rgba(36, 55, 87, .75);
  --ancho-menu: 75px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--fondo); color: var(--texto); font: 14px/1.45 'DM Sans', sans-serif; }
body.menu-abierto { --ancho-menu: 200px; }
button, input, select, textarea { font: inherit; color: inherit; }
.material-icons { font-size: 22px; line-height: 1; user-select: none; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #cfd4db; border-radius: 3px; }

/* ── Barra lateral ───────────────────────── */
.app { min-height: 100vh; }
.lateral { position: fixed; left: 0; top: 0; bottom: 0; width: 70px; background: var(--lateral); color: #fff; display: flex; flex-direction: column;
  z-index: 997; transition: width .5s; overflow: hidden; }
body.menu-abierto .lateral { width: 200px; }
.lateral .logo { height: 80px; flex-shrink: 0; border: 0; background: var(--lateral-osc); cursor: pointer; display: grid; place-items: center; padding: 0 14px; }
.lateral .logo .logo-grande { height: 18px; display: none; }
.lateral .logo .logo-chico { width: 20px; }
body.menu-abierto .lateral .logo .logo-grande { display: block; }
body.menu-abierto .lateral .logo .logo-chico { display: none; }
.lateral .item { height: 65px; flex-shrink: 0; border: 0; border-bottom: 1px solid var(--lateral-borde); background: none; color: #fff; cursor: pointer;
  display: flex; align-items: center; gap: 14px; padding: 0 23px; text-align: left; white-space: nowrap; }
.lateral .item:hover { background: var(--lateral-hover); }
.lateral .item.activo, .lateral .item.activo-flyout { background: var(--lateral-activo); }
.lateral .item img { width: 24px; height: 24px; flex-shrink: 0; }
.lateral .item .material-icons { flex-shrink: 0; }
.lateral .item .material-icons.chico { font-size: 20px; margin: 0 2px; }
.lateral .item .texto { font-size: 16px; opacity: 0; transform: translateX(-8px); transition: opacity .3s, transform .3s; overflow: hidden; text-overflow: ellipsis; }
.lateral .item .flecha { margin-left: auto; opacity: 0; font-size: 18px; }
body.menu-abierto .lateral .item .texto, body.menu-abierto .lateral .item .flecha { opacity: 1; transform: none; }
.lateral .abajo { margin-top: auto; border-top: 1px solid var(--lateral-borde); }
.lateral .abajo .item { height: 56px; border-bottom: 0; }
.flyout { position: fixed; z-index: 998; min-width: 270px; background: var(--vidrio); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: 12px; padding: 6px; color: #fff; box-shadow: 0 8px 24px rgba(9, 30, 66, .25); font-size: 16px; }
.flyout button { display: flex; width: 100%; align-items: center; gap: 12px; border: 0; background: none; color: #fff; padding: 12px 14px; border-radius: 8px; cursor: pointer; text-align: left; }
.flyout button:hover { background: var(--lateral-activo); }
.flyout button img { width: 22px; height: 22px; }
.flyout .linea-flyout { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: #dfe2e6; border-top: 1px solid rgba(255,255,255,.15); }
/* Selector de idioma dentro del menú del usuario (BS #126, i18n.js → selectorIdioma). */
.flyout .selector-idioma { border-top: 1px solid rgba(255,255,255,.15); border-bottom: 1px solid rgba(255,255,255,.15); margin: 4px 0; padding: 4px 0; }
.flyout .selector-idioma-titulo { display: flex; align-items: center; gap: 12px; padding: 8px 14px 4px; color: #dfe2e6; font-size: 13px; }
.flyout .selector-idioma button { padding: 7px 14px; font-size: 14px; gap: 8px; }
.flyout .selector-idioma button .material-icons { width: 22px; font-size: 18px; }
.flyout .selector-idioma button[aria-pressed="true"] { font-weight: 600; }

/* ── Contenido ───────────────────────────── */
.contenido { margin-left: var(--ancho-menu); padding: 20px 20px 40px; transition: margin-left .5s; min-width: 0; }
.encabezado { display: flex; justify-content: space-between; align-items: center; margin: 4px 4px 18px; gap: 12px; flex-wrap: wrap; }
.encabezado h1 { font-size: 24px; margin: 0; font-weight: 700; color: var(--texto); }
.vista { display: none; }
.vista.activa { display: block; }
body.en-mapa .contenido { padding: 0; }
body.en-mapa .encabezado { display: none; }

/* ── Barra de herramientas ───────────────── */
.herramientas { display: flex; align-items: flex-end; gap: 18px; margin-bottom: 16px; flex-wrap: wrap; }
.campo { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--suave); }
.campo input.linea { border: 0; border-bottom: 1px solid #b8c0cf; background: transparent; padding: 6px 2px; min-width: 260px; outline: none; font-size: 15px; }
.campo input.linea:focus { border-color: var(--texto); }
.herramientas .derecha { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.boton { border: 1px solid var(--borde); background: var(--panel); border-radius: 6px; padding: 9px 18px; cursor: pointer; font-weight: 500; color: var(--texto); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.boton:hover { border-color: #717d92; }
.boton.primario { background: var(--amarillo); border-color: var(--amarillo); color: var(--texto); }
.boton.primario:hover { background: var(--amarillo-osc); border-color: var(--amarillo-osc); }
.boton.peligro { background: var(--mal); border-color: var(--mal); color: #fff; }
.boton.peligro:hover { background: #b52a22; }
.boton.chico { padding: 4px 10px; font-size: 12px; }
.boton:disabled { opacity: .5; cursor: default; }
.acciones-btn { height: 48px; padding: 0 16px 0 22px; font-size: 16px; box-shadow: 0 2px 6px rgba(9, 30, 66, .12); }
.acciones-btn:hover { background: #f5c000 !important; }
.icono-btn { border: 0; background: none; cursor: pointer; padding: 4px; border-radius: 6px; color: var(--texto); display: inline-grid; place-items: center; }
.icono-btn:hover { background: rgba(9, 30, 66, .06); }
.icono-btn svg { width: 20px; height: 20px; }

/* ── Tabla principal ─────────────────────── */
.tarjeta { background: var(--panel); border-radius: 24px; box-shadow: var(--sombra); overflow: hidden; }
.tabla { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; color: var(--suave); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .02em;
  padding: 16px 12px; border-bottom: 1px solid var(--borde); white-space: nowrap; cursor: pointer; user-select: none; background: var(--panel); }
th .flecha { opacity: 0; margin-left: 4px; }
th:hover .flecha, th.ordenada .flecha { opacity: 1; }
th.sin-orden { cursor: default; }
td { padding: 14px 12px; border-bottom: 1px solid var(--borde); vertical-align: middle; white-space: nowrap; color: var(--celda); }
tr.equipo > td { height: 76px; }
tr.equipo:hover > td { background: var(--hover-fila); }
tr.eliminado td { color: var(--gris); }
td.mono, .mono { font-family: var(--mono); font-size: 13px; }
.expandir { transition: transform .225s; }
tr.abierto .expandir { transform: rotate(180deg); }
.fallos { color: var(--texto); font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }
.fallos svg { width: 16px; height: 16px; color: var(--mal); }
.burbuja { display: inline-grid; place-items: center; min-width: 34px; height: 34px; border-radius: 50%; background: var(--azul); color: #fff; font-weight: 500; font-size: 13px; padding: 0 6px; }
.vinculos { display: flex; gap: 10px; }
.vinculo { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; color: #42526d; min-width: 26px; }
.vinculo i { width: 20px; height: 20px; background: var(--gris); -webkit-mask: var(--icono) center / contain no-repeat; mask: var(--icono) center / contain no-repeat; }
.vinculo.ok i { background: #04b53b; } .vinculo.mal i { background: #eb181e; } .vinculo.sin i { background: var(--gris); }
tr.eliminado .vinculo { color: var(--gris); }
.acciones { display: flex; gap: 4px; align-items: center; }
.acciones .icono-btn { color: var(--texto); }
.estado { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--fila); color: var(--suave); }
.estado.ok { background: #dcfce7; color: #15803d; } .estado.mal { background: #fee2e2; color: #b91c1c; } .estado.aviso { background: #fef3c7; color: #b45309; }
/* .aviso también es el aviso flotante (más abajo): la pastilla de estado no hereda su caja. */
.estado.aviso { display: inline; width: auto; padding: 2px 8px; border-radius: 999px; box-shadow: none; animation: none; font-size: 11px; }

/* Particiones dentro del equipo */
tr.detalle > td { background: var(--fila); padding: 0 12px 14px 48px; }
.subtabla { background: var(--panel); border-radius: 16px; margin-top: 4px; box-shadow: 0 1px 4px rgba(9, 30, 66, .06); overflow: hidden; }
.subtabla th { cursor: default; font-size: 11px; padding: 12px; }
.subtabla td { padding: 10px 12px; }
.vacio { text-align: center; color: var(--suave); padding: 28px; }

/* ── Menú contextual ─────────────────────── */
.menu { position: fixed; background: var(--panel); border-radius: 12px; box-shadow: 0 8px 24px rgba(9, 30, 66, .15); padding: 6px; z-index: 50; min-width: 220px; }
.menu button { display: flex; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 8px; cursor: pointer; gap: 12px; align-items: center; color: var(--texto); }
.menu button:hover { background: #fff6d1; }
.menu button .material-icons { font-size: 20px; }
.menu button.peligro { color: var(--mal); }
.menu hr { border: 0; border-top: 1px solid var(--borde); margin: 4px 0; }

/* ── Modales ─────────────────────────────── */
.fondo-modal { position: fixed; inset: 0; background: rgba(9, 30, 66, .45); display: grid; place-items: center; z-index: 1000; padding: 20px; }
.modal { background: var(--panel); border-radius: 24px; width: min(880px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 4px 24px -12px rgba(47, 56, 75, .12); }
.modal.angosto { width: min(520px, 100%); }
.modal.ancho { width: min(1100px, 100%); }
.modal header { padding: 24px 28px 6px; display: flex; justify-content: space-between; align-items: flex-start; }
.modal header h2 { margin: 0; font-size: 20px; font-weight: 700; }
.modal header p { margin: 4px 0 0; color: var(--suave); font-size: 13px; }
.modal .cuerpo { padding: 12px 28px; overflow-y: auto; }
.modal footer { padding: 14px 28px 24px; display: flex; gap: 10px; align-items: center; }
.modal footer .boton { height: 48px; padding: 0 22px; font-size: 15px; }
.modal footer .separador { flex: 1; }
.seccion { margin: 14px 0 6px; font-weight: 700; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.seccion .info { color: var(--suave); font-weight: 400; font-size: 12px; }
.grilla { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 18px; }
.grilla.tres { grid-template-columns: repeat(3, 1fr); }
.grilla .todo { grid-column: 1 / -1; }
.form label { display: block; font-size: 12px; color: var(--suave); }
.form label > input, .form label > select, .form label > textarea, .form label > button { display: block; width: 100%; margin-top: 4px; }
.form label > .chip { margin-top: 4px; }
.form label .req { color: var(--mal); }
.form input, .form select, .form textarea { border: 1px solid var(--borde); border-radius: 6px; padding: 10px 12px; background: #fff; outline: none; color: var(--texto); }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--texto); }
.form textarea { min-height: 70px; resize: vertical; }
.form .error-campo { border-color: var(--mal) !important; }
.form label.casilla { display: flex; flex-direction: row; align-items: center; gap: 8px; color: var(--texto); font-size: 13px; }
.form label.casilla > input { width: auto; margin: 0; accent-color: var(--texto); }
.lista-usuarios { border: 1px solid var(--borde); border-radius: 12px; max-height: 220px; overflow-y: auto; }
.lista-usuarios table th { position: sticky; top: 0; background: var(--fila); cursor: default; }
.campana { cursor: pointer; color: #b9c0cc; border: 0; background: none; }
.campana.on { color: var(--texto); }
.pestanas { display: flex; gap: 4px; border-bottom: 1px solid var(--borde); margin: 4px 0 14px; }
.pestanas button { border: 0; background: none; padding: 10px 14px; cursor: pointer; color: var(--suave); border-bottom: 2px solid transparent; font-weight: 500; }
/* En el celular, las pestañas que no entran (textos más largos en portugués: BS #126) se corren de costado. */
@media (max-width: 600px) { .pestanas { overflow-x: auto; scrollbar-width: none; } .pestanas button { flex-shrink: 0; white-space: nowrap; } }
.pestanas button.activa { color: var(--texto); border-color: var(--amarillo); }
.acordeon { border: 1px solid var(--borde); border-radius: 12px; margin: 8px 0; }
.acordeon summary { padding: 12px 14px; cursor: pointer; font-weight: 600; }
.acordeon .adentro { padding: 0 14px 12px; }
.datos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 18px; margin: 8px 0 12px; }
.datos div span { display: block; font-size: 12px; color: var(--suave); }
.chip { display: inline-flex; gap: 6px; align-items: center; background: var(--fila); border-radius: 999px; padding: 4px 10px; font-size: 12px; }
.resumen { display: flex; gap: 10px; margin: 6px 0 4px; }
.opciones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opcion { border: 1px solid var(--borde); border-radius: 12px; padding: 12px; cursor: pointer; display: flex; gap: 10px; }
.opcion.elegida { border-color: var(--texto); background: #f3f5fa; }
.opcion small { color: var(--suave); display: block; }
.ia { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ia > label, .ia-caja { border: 1px solid var(--borde); border-radius: 12px; padding: 10px; }
.ia-caja .requisito { display: block; margin-top: 6px; font-size: 12px; line-height: 1.35; }
.requisito.cumple { color: #15803d; } .requisito.falta { color: #b42318; }
.requisito ul { margin: 2px 0 0; padding-left: 16px; }
.chip.verde { background: #dcfce7; color: #15803d; } .chip.rojo { background: #fee4e2; color: #b42318; } .chip.gris { color: var(--suave); }
.modal header .junto-titulo { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* ── Avisos (toasts de la nube vieja) ────── */
.avisos { position: fixed; right: 20px; top: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 1100; }
.aviso { background: var(--azul); color: #fff; padding: 14px 18px; border-radius: 15px; box-shadow: var(--sombra); width: min(500px, calc(100vw - 40px)); font-size: 13px; display: flex; gap: 10px; align-items: center; animation: entra .2s ease-out; }
.aviso.ok { background: var(--ok); } .aviso.mal { background: var(--mal); }
@keyframes entra { from { transform: translateY(-10px); opacity: 0; } }
.cargando { color: var(--suave); padding: 24px; text-align: center; }

/* ── Login ───────────────────────────────── */
.tarjeta-login { max-width: 380px; margin: 14vh auto; background: var(--panel); border-radius: 24px; padding: 30px; text-align: center; box-shadow: var(--sombra); }
.tarjeta-login h1 { margin: 0; font-size: 22px; }
.tarjeta-login h1 small { color: var(--suave); font-weight: 400; font-size: 14px; }
.nota { color: var(--suave); font-size: 13px; }
.error { color: var(--mal); }
.boton-google { display: inline-flex; gap: 10px; align-items: center; justify-content: center; padding: 10px 18px; border-radius: 6px;
  border: 1px solid var(--borde); background: #fff; color: var(--texto); text-decoration: none; font-weight: 500; margin-top: 14px; }

@media (max-width: 1300px) {
  .lateral { width: 60px; } body.menu-abierto .lateral { width: 153px; }
  body { --ancho-menu: 60px; } body.menu-abierto { --ancho-menu: 153px; }
  .lateral .logo { height: 60px; } .lateral .logo .logo-grande { height: 15px; }
  .lateral .item { height: 50px; padding: 0 16px; gap: 8px; } .lateral .item .material-icons { font-size: 20px; } .lateral .item img { width: 20px; height: 20px; } .lateral .item .texto { font-size: 12px; }
}
@media (max-width: 760px) {
  .contenido { padding: 14px; }
  .grilla, .grilla.tres, .datos, .opciones, .ia { grid-template-columns: 1fr; }
  .campo input.linea { min-width: 160px; }
}

/* ══ Red Mesh (mapa) ═════════════════════════════════════════════════════ */
.mapa-marco { position: relative; height: 100vh; min-height: 420px; overflow: hidden; background: #e5e3df; --corrida: 0px; }
.mapa-marco.con-ficha { --corrida: 400px; }
#mapa { position: absolute; inset: 0; }
.mapa-cargando { position: absolute; inset: 0; background: rgba(0, 0, 0, .15); display: grid; place-items: center; z-index: 5; }
.giro { width: 48px; height: 48px; border-radius: 50%; border: 5px solid rgba(255, 204, 0, .3); border-top-color: var(--amarillo); animation: gira 1s linear infinite; }
.giro-chico { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .2); border-top-color: #000; animation: gira 1s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.mapa-estado { position: absolute; left: 50%; top: 60px; transform: translateX(-50%); background: #fff; border-radius: 8px; padding: 10px 16px; font-size: 14px; color: var(--texto); box-shadow: var(--sombra); z-index: 4; max-width: 520px; text-align: center; }

/* a) Buscador arriba al centro */
.isla-buscar { position: absolute; left: 0; right: var(--corrida); margin: 15px auto 0; width: 300px; height: 34px; background: rgba(0, 0, 0, .5); border-radius: 50px; z-index: 3;
  display: flex; align-items: center; padding: 0 4px 0 16px; transition: right .3s; }
.isla-buscar input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: #fff; font-size: 15px; }
.isla-buscar input::placeholder { color: rgba(255, 255, 255, .85); font-size: 13px; }
.isla-buscar button { border: 0; background: none; color: #fff; cursor: pointer; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; }
.isla-buscar button:hover { background: rgba(255, 255, 255, .15); }
.sugerencias { position: absolute; top: 38px; left: 10px; width: 280px; background: rgba(0, 0, 0, .4); border-radius: 8px; overflow: hidden; backdrop-filter: blur(4px); }
.sugerencias button { display: block; width: 100%; height: 30px; padding: 0 12px; text-align: left; border: 0; border-radius: 0; background: rgba(0, 0, 0, .3); color: #fff; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sugerencias button:hover { background: rgba(0, 0, 0, .55); }

/* Equipos sin ubicación (arriba a la izquierda) y prueba de carga (pelotita arriba a la derecha) */
.isla-sin-ubicacion { position: absolute; left: 12px; top: 15px; z-index: 3; height: 34px; border: 0; border-radius: 50px; background: #fff; color: var(--texto); padding: 0 14px 0 10px;
  display: flex; align-items: center; gap: 6px; box-shadow: rgba(0, 0, 0, .3) 0 1px 4px -1px; cursor: pointer; font-size: 13px; }
.isla-sin-ubicacion .material-icons { font-size: 18px; color: var(--mal); }
.isla-prueba { position: absolute; right: calc(60px + var(--corrida)); top: 10px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff; color: #42526d;
  box-shadow: rgba(0, 0, 0, .3) 0 1px 4px -1px; cursor: pointer; display: grid; place-items: center; transition: right .3s; }
.isla-prueba:hover { background: #fff6d1; }
.isla-prueba.activa { background: var(--amarillo); color: var(--texto); }

/* Perfil del terreno: botón al lado de la prueba de carga (para todos) */
.isla-perfil-boton { position: absolute; right: calc(110px + var(--corrida)); top: 10px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff;
  color: #42526d; box-shadow: rgba(0, 0, 0, .3) 0 1px 4px -1px; cursor: pointer; display: grid; place-items: center; transition: right .3s; }
.isla-perfil-boton:hover { background: #fff6d1; }
.isla-perfil-boton.activa { background: var(--amarillo); color: var(--texto); }

/* Leyenda del costo de los enlaces (arriba a la izquierda, debajo de "sin ubicación") */
.isla-costos { position: absolute; left: 12px; top: 58px; z-index: 3; background: rgba(36, 55, 87, .92); color: #fff; border-radius: 10px; padding: 10px 12px;
  font-size: 12px; line-height: 20px; box-shadow: var(--sombra); max-width: 210px; }
.isla-costos .titulo { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.isla-costos div { display: flex; align-items: center; gap: 8px; }
.isla-costos i { width: 22px; height: 4px; border-radius: 2px; flex-shrink: 0; }
.isla-costos i.rayitas { background: repeating-linear-gradient(90deg, #64748b 0 4px, transparent 4px 8px); }
.isla-costos .nota { display: block; color: #dfe2e6; line-height: 15px; margin-top: 6px; font-size: 11px; }
.tip-enlace { position: fixed; z-index: 70; max-width: 320px; background: #121315; color: #fff; border: 1px solid #243757; border-radius: 8px; padding: 8px 10px;
  font: 12px/1.45 'DM Sans', sans-serif; pointer-events: none; box-shadow: 0 4px 12px rgba(0, 0, 0, .3); }
.tip-enlace .chico { color: #c3c9d3; font-size: 11px; margin-top: 3px; }
.punto-costo { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.punto-costo.sin { border: 1px dashed #98a1b0; }
.chico-ficha { font-size: 12px; color: #dfe2e6; }

/* Panel del perfil del terreno (abajo, a lo ancho) */
.mapa-perfil { position: absolute; left: 12px; right: calc(12px + var(--corrida)); bottom: 12px; height: 290px; z-index: 5; background: rgba(36, 55, 87, .95);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-radius: 12px; box-shadow: var(--sombra); color: #fff; padding: 10px 14px 12px;
  display: flex; flex-direction: column; transition: right .3s; }
.perfil-cabeza { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.perfil-cabeza > b { font-size: 15px; margin-right: 10px; }
.perfil-cabeza .punto-perfil { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--amarillo); color: var(--texto);
  font-weight: 700; font-size: 11px; }
.perfil-cabeza label { color: #dfe2e6; margin-left: 4px; }
.perfil-cabeza input { width: 58px; background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .4); border-radius: 6px; padding: 1px 6px; }
.perfil-cabeza .flecha { margin: 0 6px; color: #dfe2e6; }
.perfil-cabeza .separador { flex: 1; }
.perfil-cargando { padding: 30px 0; text-align: center; color: #dfe2e6; }
.perfil-cuerpo { flex: 1; display: flex; gap: 14px; min-height: 0; margin-top: 6px; }
.perfil-grafico { flex: 1; min-width: 0; position: relative; background: rgba(255, 255, 255, .96); border-radius: 8px; }
.perfil-grafico svg { display: block; font: 11px 'DM Sans', sans-serif; }
.perfil-grafico text { fill: #5d6b82; }
.perfil-grafico .unidad { fill: #98a1b0; font-size: 10px; }
.perfil-grafico .grilla { stroke: #e5e7eb; }
.perfil-grafico .terreno { fill: #b08968; stroke: #7f5539; stroke-width: 1.2; }
.perfil-grafico .fresnel { fill: rgba(59, 130, 246, .16); stroke: #3b82f6; stroke-width: 1; stroke-dasharray: 4 3; }
.perfil-grafico .invadida { fill: rgba(220, 38, 38, .55); }
.perfil-grafico .vista { stroke: #091e42; stroke-width: 2; fill: none; }
.perfil-grafico .mastil { stroke: #091e42; stroke-width: 2.5; }
.perfil-grafico .antena { fill: var(--amarillo); stroke: #091e42; stroke-width: 1.5; }
.perfil-grafico .letra { fill: #091e42; font-weight: 700; font-size: 12px; }
.perfil-grafico .critico { stroke: #dc2626; stroke-dasharray: 2 3; }
.perfil-grafico .cursor { stroke: #dc2626; stroke-width: 1; }
.perfil-lectura { position: absolute; top: 4px; width: 300px; background: #121315; color: #fff; border-radius: 6px; padding: 4px 8px; font-size: 11px; pointer-events: none; }
.perfil-datos { width: 300px; flex-shrink: 0; font-size: 12.5px; line-height: 1.35; overflow: auto; }
.perfil-datos > div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.perfil-datos span { color: #dfe2e6; }
.perfil-datos b { white-space: nowrap; }
.perfil-datos .veredicto { display: block; font-weight: 700; border-radius: 6px; padding: 5px 8px; margin-bottom: 4px; border: 0; color: var(--texto); }
.perfil-datos .veredicto.ok { background: #86efac; }
.perfil-datos .veredicto.aviso { background: #fcd34d; }
.perfil-datos .veredicto.mal { background: #fca5a5; }
.perfil-datos .fuente { display: block; border: 0; color: #c3c9d3; font-size: 11px; margin-top: 4px; }
@media (max-width: 900px) {
  .mapa-perfil { height: 430px; }
  .perfil-cuerpo { flex-direction: column; }
  .perfil-grafico { min-height: 190px; }
  .perfil-datos { width: auto; }
}

/* e) Cola de pedidos de vecinos */
.isla-cola { position: absolute; right: calc(10px + var(--corrida)); top: 60px; width: 130px; z-index: 3; display: flex; flex-direction: column; gap: 6px; transition: right .3s; }
.ficha-cola { background: #e0e0e0; border-radius: 16px; padding: 4px 6px 4px 12px; display: flex; align-items: center; justify-content: space-between; font-size: 15px; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }

/* b) Tipo de mapa, abajo a la derecha encima del zoom */
.isla-tipos { position: absolute; right: calc(8px + var(--corrida)); bottom: 200px; z-index: 3; display: grid; gap: 5px; transition: right .3s; }
.isla-tipos button { width: 40px; height: 55px; background: #fff; border: 2px solid transparent; border-radius: 2px; cursor: pointer; padding: 3px 0 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
  box-shadow: rgba(0, 0, 0, .07) 0 1px 2px, rgba(0, 0, 0, .07) 0 2px 4px, rgba(0, 0, 0, .07) 0 4px 8px, rgba(0, 0, 0, .07) 0 8px 16px; }
.isla-tipos button img { width: 30px; height: 30px; border-radius: 2px; }
.isla-tipos button span { font-size: 9px; color: darkgray; line-height: 1; }
.isla-tipos button.activo { border-color: #242b38; }
.isla-tipos button .icono-potenciales { font-size: 26px; color: #7c3aed; line-height: 30px; height: 30px; }
.isla-tipos button[hidden] { display: none; }

/* c) Estado de la red (Señal / Vecinos) abajo a la derecha */
.isla-red { position: absolute; right: calc(65px + var(--corrida)); bottom: 20px; z-index: 3; min-width: 220px; opacity: .92; user-select: none; color: #fff; transition: right .3s; }
.pestanas-red { display: flex; width: 100%; box-sizing: border-box; height: 32px; background: rgba(36, 55, 87, .92); border-radius: 8px 8px 0 0; overflow: hidden; }
.pestanas-red button { flex: 1; border: 0; background: none; color: #fff; font-size: 14px; font-weight: 500; cursor: pointer; }
.pestanas-red button.activa { background: #384f72; }
.isla-red .caja { background: #384f72; border-radius: 0 0 10px 10px; padding: 12px; box-shadow: 0 3px 6px #05040429; }
.isla-red .columnas { display: flex; justify-content: center; gap: 4px; position: relative; }
.isla-red .columna { display: flex; flex-direction: column; align-items: center; position: relative; }
.isla-red .barras { display: flex; flex-direction: column; }
.isla-red .columnas.senal .barras img { width: 32px; height: 20.24px; border-radius: 4px; margin: 2px; }
.isla-red .columnas.vecinos .barras img { width: 23px; height: 20.24px; border-radius: 4px; margin: 2px; }
.isla-red .columna b { font-size: 12px; font-weight: 500; margin-top: 2px; }
.isla-red .tip, .isla-red .tip-grande { display: none; position: absolute; bottom: calc(100% + 8px); background: #121315; border: 1px solid #243757; border-radius: 8px; padding: 8px 10px;
  font-size: 12px; font-weight: 500; white-space: nowrap; z-index: 5; }
.isla-red .columna:hover .tip { display: block; }
.isla-red .tip-grande { left: 50%; transform: translateX(-50%); white-space: normal; width: 260px; }
.isla-red .tip-grande div { display: flex; gap: 8px; align-items: center; margin: 3px 0; }
.isla-red .tip-grande i { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; }
.isla-red .columnas:hover .tip-grande { display: block; }
.isla-red .columnas:has(.columna:hover) .tip-grande { display: none; }
.isla-red .progreso { height: 16px; border-radius: 8px; background: #243757; margin: 10px 0 0; overflow: hidden; }
.isla-red .progreso div { height: 100%; width: 40%; background: #5d6b82; border-radius: 8px; animation: avanza 1.2s ease-in-out infinite; }
@keyframes avanza { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
.isla-red .total { margin-top: 10px; width: 100%; height: 40px; border: 0; border-radius: 6px; background: #243757; color: #fff; font-size: 14px; font-weight: 500; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px; }
.isla-red .total img { width: 12px; }
.isla-red .leyenda { max-height: 0; overflow: hidden; transition: max-height .5s; }
.isla-red.abierta .leyenda { max-height: 200px; border-top: 1px solid #98a1b0; margin-top: 10px; }
.isla-red .leyenda .titulo { font-size: 12px; font-weight: 500; color: #98a1b0; margin: 8px 0 6px; }
.isla-red .filtros { display: flex; gap: 6px; }
.isla-red .filtros button { border: 0; border-radius: 6px; background: transparent; color: #fff; cursor: pointer; display: flex; align-items: center; gap: 4px; padding: 4px 6px; font-size: 12px; }
.isla-red .filtros button:hover { background: #738096d7; }
.isla-red .filtros button.elegido { background: #243757; }
.isla-red .filtros.enlaces button img { width: 10px; height: 10px; }
.isla-red .filtros.instalaciones button { width: 32%; justify-content: center; }
.isla-red .filtros.instalaciones button img { width: 16px; height: 16px; }
/* Vista Tensión de AMIAR (BS #79): barras pintadas con el color de cada clase y filtro mono/trifásico. */
.isla-red .columnas.tension .barras i { display: block; width: 32px; height: 20.24px; border-radius: 4px; margin: 2px; background: #5d6b82; }
.isla-red .filtros.fases { margin-top: 10px; justify-content: center; }
.isla-red .filtros.fases button { background: #243757; }
.isla-red .filtros.fases button.elegido { background: #5d6b82; }
.isla-red .nota-tension { font-size: 11px; line-height: 15px; color: #c3cad6; margin-top: 6px; max-width: 220px; }

/* g) Ventanita del equipo (InfoWindow) */
.ventana-equipo { font: 13px 'DM Sans', sans-serif; color: #000; padding: 4px 18px 2px 2px; position: relative; min-width: 150px; }
.ventana-equipo .cerrar-ventana { position: absolute; right: -4px; top: -4px; border: 0; background: none; color: gray; font-size: 14px; font-weight: bold; cursor: pointer; }
.ventana-equipo .cuenta { color: #F4B319; cursor: pointer; font-weight: 500; }
.ventana-equipo .cuenta:hover { color: #000; }
.ventana-equipo b { font-weight: 500; }
.ventana-equipo .varios { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; max-height: 150px; overflow: auto; margin-top: 6px; }
.ventana-equipo .varios button { border: 0; background: none; text-align: left; font-size: 12px; cursor: pointer; padding: 1px 0; }
.ventana-equipo .varios button:hover { color: #F4B319; }

/* Ficha del equipo: isla a la derecha con el estilo del panel de la nube vieja */
.mapa-ficha { position: absolute; right: 12px; top: 12px; bottom: 12px; width: 390px; max-width: calc(100% - 24px); background: rgba(36, 55, 87, .9);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-radius: 12px; box-shadow: var(--sombra); overflow: auto; padding: 16px 22px 20px 26px;
  z-index: 4; color: #fff; line-height: 25px; }
.mapa-ficha .cargando-ficha { color: #dfe2e6; padding: 24px 0; }
.ficha-arriba { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
/* Tamper abierto (BS #63): cartel rojo, en la ficha del mapa y en el detalle del medidor. */
.ficha-tamper { display: flex; gap: 6px 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 8px; padding: 8px 12px; border-radius: 10px;
  background: #fee2e2; color: #b91c1c; font-size: 13px; line-height: 1.35; }
.ficha-tamper .material-icons { font-size: 20px; }
.ficha-tamper span:last-child { color: #7f1d1d; }
.texto-tamper { color: #f87171; }
.tamper-ventana { display: flex; align-items: center; gap: 4px; margin-top: 4px; color: #b91c1c; font-weight: 700; }
.tamper-ventana .material-icons { font-size: 16px; }
.corte-ventana { display: flex; align-items: center; gap: 4px; margin-top: 4px; color: #1f2937; font-weight: 700; }
.corte-ventana .material-icons { font-size: 16px; color: #ca8a04; }
.ficha-corte { display: flex; flex-direction: column; gap: 2px; margin: 6px 0 8px; padding: 8px 12px; border-radius: 10px; background: #fef9c3; color: #1f2937; }
.ficha-corte .material-icons { font-size: 20px; color: #ca8a04; }
.ficha-corte .suave-corte { color: #57534e; font-size: 12px; }
.punto-tamper { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #dc2626; box-shadow: 0 0 0 2px #fff, 0 0 0 3px #dc2626;
  vertical-align: middle; margin-left: 4px; }
.ficha-arriba .leds { display: flex; gap: 10px; align-items: center; }
.ficha-arriba .leds span { display: grid; place-items: center; }
.icono-ficha { border: 0; background: none; color: #fff; cursor: pointer; padding: 3px; border-radius: 6px; display: inline-grid; place-items: center; vertical-align: middle; }
.icono-ficha:hover { background: rgba(255, 255, 255, .15); }
.icono-ficha .material-icons { font-size: 20px; }
.icono-ficha img { width: 20px; height: 20px; }
.mapa-ficha h3 { margin: 4px 0 10px; font-size: 20px; font-weight: 700; line-height: 1.3; }
.seccion-ficha { margin-top: 6px; }
.seccion-ficha .cabeza { width: 100%; display: flex; justify-content: space-between; align-items: center; border: 0; background: none; color: #fff; font-size: 16px; font-weight: 700; padding: 4px 0; cursor: pointer; }
.seccion-ficha hr { border: 0; border-top: 1px solid #fff; margin: 2px 0 6px; }
.cuerpo-seccion { padding-bottom: 6px; }
.mapa-ficha .dato { font-size: 14px; }
.mapa-ficha .dato b { font-weight: 700; }
.mapa-ficha .dato.fila { display: flex; align-items: center; gap: 2px; }
.mapa-ficha .dato.chico { font-size: 12px; line-height: 17px; margin: 8px 0; color: #dfe2e6; }
.mapa-ficha select { background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .4); border-radius: 6px; padding: 2px 6px; }
.mapa-ficha select option { color: var(--texto); }
.mapa-ficha .mac-link { color: #ffdf6e; cursor: pointer; text-decoration: underline; }
.tabla-macs { display: grid; grid-template-columns: 1fr 1fr; width: 297px; border: .5px solid #fff; border-radius: 5px; overflow: hidden; margin: 4px 0; }
.tabla-macs button { border: 0; border-bottom: .5px solid rgba(255, 255, 255, .5); background: none; color: #fff; font: 13px var(--mono); padding: 4px 8px; cursor: pointer; text-align: left; }
.tabla-macs button:hover { background: rgba(255, 255, 255, .12); }
.boton-blanco { border: 0; background: #fff; color: var(--texto); border-radius: 6px; padding: 6px 14px; font-weight: 500; cursor: pointer; margin-top: 6px; }
.boton-blanco:hover { background: #fff6d1; }
.boton-blanco[disabled] { opacity: .55; cursor: default; }
.boton-blanco[disabled]:hover { background: #fff; }
.boton-blanco.secundario { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .6); }
.boton-blanco.secundario:hover { background: rgba(255, 255, 255, .12); }
/* Edición en el lugar de la ficha del mapa (BS #133). */
.edicion-ficha { display: flex; flex-direction: column; gap: 6px; }
.campo-ficha { display: flex; flex-direction: column; font-size: 12px; font-weight: 700; color: #dfe2e6; line-height: 18px; }
.campo-ficha input, .campo-ficha textarea { background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .4); border-radius: 6px;
  padding: 4px 8px; font: 400 14px 'DM Sans', sans-serif; margin-top: 2px; }
.campo-ficha textarea { resize: vertical; min-height: 54px; }
.campo-ficha input:focus, .campo-ficha textarea:focus { outline: 2px solid #ffdf6e; outline-offset: 0; }
.campo-ficha input[disabled] { background: rgba(255, 255, 255, .05); color: #c3cad6; border-style: dashed; cursor: not-allowed; }
.campo-ficha .error-campo { border-color: #f87171; background: rgba(253, 1, 0, .15); }
.campo-ficha .error-edicion { color: #fca5a5; font-weight: 500; font-size: 12px; }
.coordenadas-ficha { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.edicion-ficha .error-guardado { display: flex; gap: 6px; align-items: flex-start; padding: 6px 8px; border-radius: 8px; background: rgba(253, 1, 0, .2); font-size: 13px; line-height: 1.35; }
.botones-edicion { display: flex; gap: 8px; }
.botones-edicion .giro-chico { border-color: rgba(0, 0, 0, .2); border-top-color: #000; vertical-align: -3px; }
/* Notas de la ficha: recuadro con alto tope y scroll propio; el botón de ampliar (sólo si no entran) las abre enteras. */
.mapa-ficha .notas-ficha { position: relative; margin: 2px 0 6px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 8px;
  background: rgba(255, 255, 255, .08); }
.mapa-ficha .notas-ficha .texto-notas { max-height: 92px; overflow-y: auto; padding: 6px 10px; font-size: 13px; line-height: 18px;
  white-space: pre-wrap; overflow-wrap: anywhere; color: #eef0f3; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .4) transparent; }
.mapa-ficha .notas-ficha.desborda .texto-notas { padding-right: 32px; }
.mapa-ficha .notas-ficha .ampliar-notas { position: absolute; top: 3px; right: 3px; background: rgba(0, 0, 0, .25); }
.mapa-ficha .notas-ficha .ampliar-notas .material-icons { font-size: 16px; }
.notas-completas { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; max-height: 65vh; overflow-y: auto; }
.usuarios-particion { justify-content: space-between; gap: 8px !important; }
.chico-boton { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; margin-top: 0; font-size: 13px; white-space: nowrap; }
.chico-boton .material-icons { font-size: 17px; }
.senales { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; font-size: 14px; padding-left: 8px; }
.reinicio { position: relative; height: 26px; border-radius: 6px; background: rgba(255, 255, 255, .15); overflow: hidden; margin-top: 8px; }
.reinicio .rayas { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(45deg, #e7b812 0 10px, #ffdf6e 10px 20px); transition: width 2s linear; }
.reinicio span { position: relative; padding-left: 10px; font-size: 13px; color: var(--texto); font-weight: 500; }

/* f) Menú contextual y aviso de "ubicar" */
.menu-mapa { position: fixed; z-index: 60; background: #fff; border-radius: 5%; box-shadow: var(--sombra); overflow: hidden; }
.menu-mapa button { display: block; width: 100%; border: 0; background: #fff; padding: 10px 14px; font-size: 14px; text-align: left; cursor: pointer; color: var(--texto); }
.menu-mapa button:hover { background: #fadf7c; }
.mapa-aviso { position: absolute; left: 50%; top: 60px; transform: translateX(-50%); background: var(--lateral-osc); color: #fff; border-radius: 8px; padding: 8px 14px; font-size: 13px; z-index: 6; display: flex; gap: 10px; align-items: center; }
.mapa-aviso button { background: none; border: 1px solid #fff6; color: #fff; border-radius: 6px; padding: 2px 8px; cursor: pointer; }
.mapa-aviso { flex-wrap: wrap; justify-content: center; max-width: calc(100% - 32px); }
.mapa-aviso input { background: #fff; color: #111; border: 0; border-radius: 6px; padding: 4px 8px; font: inherit; font-family: 'DM Mono', monospace; }

/* ── Cámaras (camaras.js) ───────────────────────────────────────────────── */
.modal.camaras { width: min(1500px, 100%); height: calc(100vh - 40px); }
.modal.camaras .cuerpo { flex: 1; overflow: hidden; padding: 8px 20px 20px; }
.cam-centro { display: grid; grid-template-columns: 220px 1fr 300px; gap: 16px; height: 100%; min-height: 0; }
.cam-lista, .cam-lado { overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.cam-lista > .boton { margin-top: 6px; justify-content: center; }
.cam-item { display: flex; gap: 10px; align-items: center; text-align: left; border: 1px solid var(--borde); background: var(--panel); border-radius: 10px; padding: 8px 10px; cursor: pointer; }
/* Cámara como sensor de la alarma (modal de datos de la cámara). */
.cam-sensor { border: 1px solid var(--borde); border-radius: 10px; padding: 8px 12px 12px; margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.cam-sensor legend { font-weight: 600; padding: 0 6px; }
.cam-sensor [data-sensor-campos] { display: flex; flex-direction: column; gap: 6px; }
.cam-sensor [data-sensor-campos][hidden] { display: none; }
.cam-sensor .ayuda { color: var(--suave); font-size: .85em; margin: 0; }
.cam-sensor .lista-simple { margin: 4px 0 0; padding-left: 18px; max-height: 160px; overflow-y: auto; font-size: .9em; }
.cam-item:hover { border-color: #717d92; }
.cam-item.activa { border-color: var(--amarillo); background: #fffbea; }
.cam-item.inactiva { opacity: .55; }
.cam-item small { display: block; color: var(--suave); font-size: 11px; }
.punto { width: 10px; height: 10px; border-radius: 50%; background: var(--gris); flex-shrink: 0; }
.punto.ok { background: var(--ok); } .punto.mal { background: var(--mal); }
.cam-principal { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; }
.cam-barra { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cam-barra .separador, .cam-tiempo-barra .separador { flex: 1; }
.cam-estado { font-size: 12px; color: var(--suave); } .cam-estado.ok { color: var(--ok); } .cam-estado.mal { color: var(--mal); }
.cam-modo { display: inline-flex; border: 1px solid var(--borde); border-radius: 8px; overflow: hidden; }
.cam-modo button { border: 0; background: var(--panel); padding: 5px 12px; cursor: pointer; font-size: 13px; }
.cam-modo button.activo { background: var(--amarillo); font-weight: 600; }
[data-grabar].grabando .material-icons { color: var(--mal); animation: latido 1s infinite; }
@keyframes latido { 50% { opacity: .3; } }
.cam-video { position: relative; background: #0b1220; border-radius: 12px; aspect-ratio: 16 / 9; width: 100%; max-height: 58vh; overflow: hidden; flex-shrink: 0; min-height: 180px; }
.cam-video > div:first-child { width: 100%; height: 100%; }
.cam-video-el { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.cam-mensaje { position: absolute; inset: 0; display: grid; place-items: center; color: #dfe6f1; padding: 20px; text-align: center; }
.cam-tiempo { background: var(--fila); border-radius: 12px; padding: 8px 12px 10px; }
.cam-tiempo-barra { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cam-tiempo-barra input[type=date] { border: 1px solid var(--borde); border-radius: 6px; padding: 4px 6px; background: #fff; }
.cam-posicion { min-width: 80px; text-align: center; font-weight: 600; }
.linea-tiempo { position: relative; height: 56px; margin-top: 8px; background: #fff; border: 1px solid var(--borde); border-radius: 8px; cursor: pointer; touch-action: none; user-select: none; overflow: hidden; }
.lt-escala span { position: absolute; top: 2px; transform: translateX(-50%); font-size: 10px; color: var(--suave); }
.lt-escala span::after { content: ''; position: absolute; left: 50%; top: 14px; height: 6px; border-left: 1px solid var(--borde); }
.lt-segmentos i { position: absolute; top: 24px; height: 22px; border-radius: 3px; }
.lt-segmentos i.alarma, .lt-muestra.alarma { background: #ff9500; }
.lt-segmentos i.continua, .lt-muestra.continua { background: #5b8def; }
.lt-segmentos i.nube, .lt-muestra.nube { background: #34c759; }
.lt-segmentos b.evento { position: absolute; top: 18px; bottom: 4px; width: 3px; margin-left: -1px; background: var(--mal); }
.lt-muestra.evento { background: var(--mal); }
.lt-cursor { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--texto); pointer-events: none; }
.lt-cursor::before { content: ''; position: absolute; top: 0; left: -5px; border: 6px solid transparent; border-top-color: var(--texto); }
.cam-leyenda { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; margin-top: 6px; font-size: 11px; color: var(--suave); }
.lt-muestra { display: inline-block; width: 12px; height: 8px; border-radius: 2px; margin-right: -8px; }
.cam-lado .pestanas { margin: 0 0 6px; } .cam-lado .pestanas button { padding: 8px 8px; font-size: 13px; }
.cam-lado h4 { margin: 12px 0 6px; font-size: 13px; color: var(--suave); text-transform: uppercase; letter-spacing: .04em; }
.ptz { display: grid; grid-template-columns: repeat(3, 56px); gap: 6px; justify-content: center; margin: 10px 0; }
.ptz button { height: 56px; border: 1px solid var(--borde); background: var(--panel); border-radius: 12px; cursor: pointer; display: grid; place-items: center; }
.ptz button:active { background: var(--amarillo); }
.ptz-fila { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: center; margin-bottom: 6px; }
.ptz-fila select { border: 1px solid var(--borde); border-radius: 6px; padding: 3px; }
.domo-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 1px solid var(--borde); border-radius: 10px; padding: 8px 10px; }
.domo-item small { display: block; color: var(--suave); font-size: 11px; }
.domo-acciones { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.domo-estado { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 10px; background: var(--borde); color: var(--suave); }
.domo-estado.on { background: #1f9d55; color: #fff; }
.domo-estado.off { background: #6b7280; color: #fff; }
.domo-acciones .confirmar { background: var(--mal); border-color: var(--mal); color: #fff; }
.ajuste { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--fila); }
.ajuste small { display: block; color: var(--suave); font-size: 11px; }
/* En gris: el modelo no lo tiene o EZVIZ no deja cambiarlo (el motivo va abajo del nombre). */
.ajuste.deshabilitado { opacity: .45; }
.ajuste select { border: 1px solid var(--borde); border-radius: 6px; padding: 4px; max-width: 130px; }
.ajuste .rango { display: flex; align-items: center; gap: 6px; } .ajuste .rango input { width: 100px; }
.ajuste .texto-aj { display: flex; gap: 4px; } .ajuste .texto-aj input { width: 120px; border: 1px solid var(--borde); border-radius: 6px; padding: 4px 6px; }
.interruptor { position: relative; width: 38px; height: 22px; flex-shrink: 0; }
.interruptor input { opacity: 0; width: 0; height: 0; }
.interruptor span { position: absolute; inset: 0; background: #cfd4db; border-radius: 999px; cursor: pointer; transition: .2s; }
.interruptor span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.interruptor input:checked + span { background: var(--ok); }
.interruptor input:checked + span::before { transform: translateX(16px); }
.interruptor input:disabled + span { opacity: .5; cursor: default; }
.clip { display: flex; align-items: center; gap: 6px; width: 100%; border: 1px solid var(--borde); background: var(--panel); border-radius: 8px; padding: 6px 8px; margin-bottom: 4px; cursor: pointer; text-align: left; flex-wrap: wrap; }
.clip:hover { border-color: var(--amarillo); }
.clip small { width: 100%; padding-left: 28px; color: var(--suave); font-size: 11px; }
.capturas { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } .capturas img { width: 100%; border-radius: 6px; }
@media (max-width: 1100px) { .cam-centro { grid-template-columns: 1fr; overflow-y: auto; } .modal.camaras .cuerpo { overflow-y: auto; } .cam-lista { flex-direction: row; overflow-x: auto; } }
.ayuda { color: var(--suave); font-size: 12px; margin: 8px 0; }
.chequeo { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.posiciones { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.posicion { display: flex; align-items: center; gap: 2px; } .posicion > .boton { flex: 1; justify-content: flex-start; }
/* Favorita (estrella) y posición en la que quedó el domo (azul hasta que se lo mueve). */
.posicion.favorita > .boton .material-icons, .posicion [data-favorita] .material-icons { color: #e0a800; }
.posicion:not(.favorita) [data-favorita] .material-icons { color: var(--gris); }
.posicion.actual > .boton, .posicion.yendo > .boton { background: var(--azul); color: #fff; }
.posicion.yendo > .boton { opacity: .7; }
.vuelta-favorita { display: flex; flex-direction: column; gap: 4px; font-size: 13px; margin: 6px 0; }
.ptz-fila input[data-nombre-preset] { flex: 1; min-width: 0; border: 1px solid var(--borde); border-radius: 6px; padding: 4px 6px; }
/* ── Historial de eventos ─────────────────────────────────────────────── */
.filtros-eventos select, .filtros-eventos input[type=datetime-local] { border: 1px solid var(--borde); border-radius: 8px; padding: 7px 10px; background: #fff; font: inherit; font-size: 13px; color: var(--texto); }
.filtros-eventos .check span { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--texto); padding: 8px 0; }
.ev-alarma { color: var(--mal); font-weight: 600; }
.ev-restauracion { color: #15803d; }
.ev-codigo { font-size: 11px; color: var(--suave); }
.paginado { display: flex; gap: 10px; justify-content: flex-end; align-items: center; padding: 10px 14px; font-size: 13px; color: var(--suave); }
.paginado:empty { display: none; }

.capturas.mosaicos { grid-template-columns: 1fr; }

/* ── Diagnóstico (herramientas de Domo, business spec #10) ───────────────── */
.diag-pestanas button { display: inline-flex; align-items: center; gap: 6px; }
.diag-pestanas .material-icons { font-size: 18px; }
.diag-fila { cursor: pointer; }
.diag-fila.elegido td { background: #fff6d1; }
.diag-test td { color: var(--suave); }
.diag-detalle td { background: var(--fila); font-size: 12px; line-height: 1.7; white-space: normal; }
.diag-detalle .mono { word-break: break-all; }
.diag-traza td .mono { font-size: 12px; }
.diag-chip { padding: 1px 7px; font-size: 10px; vertical-align: 1px; }
.diag-punto { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.diag-mini { display: block; }
.diag-grafico { padding: 16px 18px; margin-bottom: 16px; overflow: visible; }
.diag-graf-titulo { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px; }
.diag-leyenda { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--suave); }
.diag-leyenda i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -2px; }
.diag-leyenda i.rayada { height: 0; border-top: 2px dashed; border-radius: 0; width: 16px; vertical-align: 3px; }
.diag-scroll { overflow-x: auto; }
.diag-svg { width: 100%; min-width: 560px; height: auto; display: block; overflow: visible; }
.diag-svg .grilla { stroke: #e9ecef; stroke-width: 1; }
.diag-svg .umbral { stroke: #b8c0cf; stroke-width: 1; stroke-dasharray: 4 3; }
.diag-svg .eje { font-size: 11px; fill: var(--suave); }
.diag-svg .golpe { fill: transparent; }
.diag-svg .golpe:hover { fill: rgba(9, 30, 66, .05); }
.diag-svg .cruz { stroke: #98a1b0; stroke-width: 1; }
.diag-tip { position: fixed; z-index: 2000; background: #fff; color: var(--texto); border: 1px solid var(--borde); border-radius: 8px;
  box-shadow: var(--sombra); padding: 8px 10px; font-size: 12px; line-height: 1.5; pointer-events: none; max-width: 280px; }
.diag-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.diag-tile { background: var(--panel); border-radius: 16px; box-shadow: var(--sombra); padding: 12px 16px; border-top: 4px solid var(--borde); }
.diag-tile .valor { font-size: 26px; font-weight: 600; line-height: 1.3; }
.diag-tile.t-ok { border-top-color: var(--ok); } .diag-tile.t-aviso { border-top-color: var(--aviso); } .diag-tile.t-mal { border-top-color: var(--mal); }
.diag-h3 { font-size: 15px; margin: 22px 0 10px; }
.diag-propia { margin-bottom: 6px; }
.diag-propia .icono-btn { width: 26px; height: 26px; vertical-align: middle; }
@media print {
  .lateral, .flyout, .diag-pestanas, .herramientas, .avisos { display: none !important; }
  .contenido { margin: 0 !important; padding: 0 !important; }
  .tarjeta { box-shadow: none; border-radius: 0; }
  .diag-detalle { display: none; }
}
.diag-vin { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; margin-right: 8px; white-space: nowrap; }
.diag-vin i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

/* Permisos del usuario en la partición (business specs #14 y #73/#7) */
.permisos { display: flex; flex-wrap: wrap; gap: 4px; max-width: 260px; white-space: normal; }
.permiso { font-size: 11px; padding: 1px 7px; border-radius: 999px; }
.permiso.si { background: #dcfce7; color: #15803d; } .permiso.no { background: #fee2e2; color: #b91c1c; }
label.check { display: flex; gap: 8px; align-items: center; margin: 6px 0; font-size: 14px; color: var(--texto); }

/* ── Selector discreto CityMesh ⇄ AMIAR (producto.js) ───────────────────── */
.lateral .abajo { position: relative; }
.cambio-producto { position: absolute; right: 5px; bottom: 19px; width: 18px; height: 18px; padding: 0; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .75);
  font: 700 10px/16px 'DM Sans', sans-serif; text-align: center; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.cambio-producto:hover, .cambio-producto:focus-visible { background: rgba(255, 255, 255, .25); color: #fff; border-color: #fff; outline: none; }
.cambio-producto:disabled { opacity: .5; cursor: progress; }
body.menu-abierto .cambio-producto { right: 12px; }
/* La "P" de Producción va arriba del circulito de producto (plan/produccion.md §3). */
.cambio-producto.produccion { bottom: 41px; }
.bloque-producto { border: 1px solid var(--borde); border-radius: 10px; padding: 10px 14px; margin: 0; min-width: 0; }
.bloque-producto legend { padding: 0 6px; }
.bloque-producto[disabled] { opacity: .6; }
/* Con el circulito a la vista, el nombre del usuario se corta antes para no taparlo. */
.lateral .abajo:has(.cambio-producto:not([hidden])) [data-flyout="usuario"] { padding-right: 36px; }
.lateral .abajo [data-flyout="usuario"] { width: 100%; min-width: 0; overflow: hidden; }
.lateral .abajo [data-flyout="usuario"] .texto { min-width: 0; }
/* La empresa (y cualquier otro de abajo) también se corta con puntitos en vez de pegarse a la flecha; el nombre completo va en el globito. */
.lateral .abajo .item { width: 100%; min-width: 0; overflow: hidden; }
.lateral .abajo .item .texto { min-width: 0; flex: 0 1 auto; white-space: nowrap; }
.lateral .abajo .item .flecha { flex-shrink: 0; }
.cambio-producto { z-index: 1; }
.pestanas-historial { display: flex; gap: 6px; margin: 8px 0; }
.pestanas-historial .activo { background: var(--primario, #ffcc00); border-color: var(--primario, #ffcc00); }
.capturas.mosaicos figure { margin: 0; } .capturas.mosaicos figcaption { font-size: 12px; color: var(--suave); margin-top: 2px; }

/* Alta de cámaras nuevas (business spec #112) */
.cam-alta-estado { margin: 6px 0 4px; padding: 10px 12px; border-radius: 8px; background: var(--fila); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.cam-alta-estado p { flex-basis: 100%; margin: 0; color: var(--suave); }
.cam-alta-estado.bien { background: #dcfce7; } .cam-alta-estado.bien strong { color: #15803d; }
.cam-alta-estado.mal { background: #fee2e2; } .cam-alta-estado.mal strong { color: #b91c1c; }
.punto-estado { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.punto-estado.verde { background: #1f9d55; } .punto-estado.gris { background: #9ca3af; }
.ajuste.guardando { opacity: .55; pointer-events: none; }
.ajustes-aviso { margin: 6px 0; padding: 8px 10px; border-radius: 6px; background: #fef3c7; color: #b45309; font-size: 12px; }

/* ── Firmware OTA (firmware.js) ─────────── */
.fw-banda { display: flex; gap: 8px; align-items: center; margin: 0 0 10px; padding: 10px 14px; border-radius: 10px; background: #fef3c7; color: #92400e; font-size: 13px; }
.fw-banda .material-icons { font-size: 20px; }
.fw-select { border: 1px solid var(--borde); border-radius: 8px; padding: 7px 10px; background: var(--panel); color: var(--texto); }
.chip.fw-curso { background: #dbeafe; color: #1d4ed8; } .chip.fw-viejo { background: #ffedd5; color: #c2410c; }
.fw-barra { position: relative; height: 18px; min-width: 160px; border-radius: 9px; background: var(--fila); overflow: hidden; }
.fw-barra i { position: absolute; inset: 0 auto 0 0; background: var(--amarillo); transition: width .4s; }
.fw-barra span { position: relative; display: block; text-align: center; font-size: 11px; line-height: 18px; color: var(--texto); }
.fw-detalle { max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.fw-paginas { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 10px; }
.fw-cuentas { display: flex; gap: 6px; flex-wrap: wrap; }
.fw-lista { margin: 0; padding-left: 18px; line-height: 1.7; }
.fw-subir { padding: 18px 22px; margin-bottom: 16px; } .fw-subir h3 { margin: 0 0 10px; font-size: 15px; }
.fw-advertencia { color: #c2410c; max-width: 280px; white-space: normal; }
tr.fw-bloqueado td { color: var(--suave); }

/* "Cambiar empresa" (filtro de la sesión): chip junto al título con la empresa y la receptora elegidas. */
.encabezado .chip.filtro-empresa { margin-right: auto; background: var(--acento-suave, #fff4cc); }
.chip.filtro-empresa [data-texto] { cursor: pointer; font-weight: 600; }
.chip.filtro-empresa .icono-btn { padding: 0; width: 20px; height: 20px; }
