/* ispcore — "Consola de fibra"
   Azul marino de centro de operaciones + luz de fibra como acento. Un solo gesto memorable:
   el pulso de luz que recorre el borde del menú (como la señal en un hilo de fibra).
   Títulos y cifras: Chakra Petch · texto: IBM Plex Sans · datos técnicos (IP, MAC, serial, dBm): IBM Plex Mono. */

:root {
  color-scheme: dark;
  --fondo: #0b1322;
  --superficie: #111c2f;
  --superficie-2: #172440;
  --borde: #263655;
  --texto: #e7edf7;
  --suave: #9aa8c3;
  --acento: #59c3e8;          /* luz de fibra */
  --sobre-acento: #06121f;
  --ok: #3ddc97;
  --alerta: #f2b84b;
  --error: #ff6b7a;
  --serie-1: #3987e5;        /* gráficas (paleta validada, paso oscuro) */
  --sombra: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px rgba(2, 8, 20, .35);
  --radio: 10px;
  --lateral: 252px;
  --f-titulo: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --f-texto: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --f-dato: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}
:root[data-tema="claro"] {
  color-scheme: light;
  --fondo: #f3f6fb;
  --superficie: #ffffff;
  --superficie-2: #eaf0f8;
  --borde: #d3dcea;
  --texto: #0f1a2e;
  --suave: #4a5875;
  --acento: #0e7ba8;
  --sobre-acento: #ffffff;
  --ok: #0f8a5f;
  --alerta: #a86a00;
  --error: #c9334a;
  --serie-1: #2a78d6;
  --sombra: 0 1px 2px rgba(15, 26, 46, .06), 0 6px 18px rgba(15, 26, 46, .06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fondo); color: var(--texto);
  font: 15px/1.5 var(--f-texto); font-variant-numeric: tabular-nums;
}
a { color: var(--acento); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--f-titulo); font-weight: 600; letter-spacing: .01em; line-height: 1.2; }
h1 { font-size: 1.45rem; margin: 0; }
h2 { font-size: 1.08rem; margin: 0 0 .8rem; }
h2 a { color: var(--texto); }
h2 a:hover { color: var(--acento); text-decoration: none; }
small { color: var(--suave); }
code, pre { font-family: var(--f-dato); font-size: .86em; }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.velo { display: none; }

/* ---------- Estructura ---------- */
.app { display: grid; grid-template-columns: var(--lateral) minmax(0, 1fr); min-height: 100vh; }
/* En computadora el panel se veía grande al 100% (el usuario trabajaba con el navegador al 80%): se reduce todo.
   Los 100vh se compensan porque dentro de un zoom también se encogen. Ajustar aquí si se quiere más o menos. */
@media (min-width: 901px) {
  :root { --zoom: .85; }
  .app { zoom: var(--zoom); min-height: calc(100vh / var(--zoom)); }
  .app .lateral, .app .lateral::after { height: calc(100vh / var(--zoom)); }
  .app main { max-width: calc(1280px / var(--zoom)); }
}
.lateral {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--superficie); border-right: 1px solid var(--borde); padding: 1rem .75rem 1.5rem;
}
/* La firma: un pulso de luz que viaja por el borde, como la señal en la fibra */
.lateral::after {
  content: ""; position: fixed; top: 0; left: calc(var(--lateral) - 1px); width: 2px; height: 100vh;
  background: linear-gradient(to bottom, transparent 0, var(--acento) 50%, transparent 100%) no-repeat;
  background-size: 100% 22vh; animation: pulso 7s cubic-bezier(.45, 0, .55, 1) infinite; opacity: .85;
  pointer-events: none;
}
@keyframes pulso { from { background-position: 0 -25vh; } to { background-position: 0 125vh; } }
@media (prefers-reduced-motion: reduce) { .lateral::after { animation: none; background-position: 0 10vh; } }

.marca { display: flex; align-items: center; gap: .65rem; padding: .25rem .5rem 1.1rem; color: var(--texto); }
.marca:hover { text-decoration: none; }
.marca img { height: 32px; max-width: 64px; object-fit: contain; border-radius: 6px; }
.marca b { font: 600 1.1rem/1.15 var(--f-titulo); }
.marca small { display: block; font-size: .78rem; }

.nav-grupo { margin-top: .35rem; }
.nav-grupo > summary {
  display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding: 0 .6rem;
  border-radius: 8px; font-size: .8rem; font-weight: 600; letter-spacing: .02em; color: var(--suave);
  cursor: pointer; list-style: none; user-select: none;
}
.nav-grupo > summary::-webkit-details-marker { display: none; }
.nav-grupo > summary::after {  /* flecha: › cerrado, ⌄ abierto */
  content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform .18s ease; margin-right: .2rem;
}
.nav-grupo[open] > summary { color: var(--texto); }
.nav-grupo[open] > summary::after { transform: rotate(45deg); }
.nav-grupo > summary:hover { background: var(--superficie-2); color: var(--texto); }
.nav-grupo > summary:focus-visible { outline: 2px solid var(--acento); outline-offset: 1px; }
.nav-grupo .nav { padding-bottom: .3rem; }
@media (prefers-reduced-motion: reduce) { .nav-grupo > summary::after { transition: none; } }
.nav a {
  display: flex; align-items: center; gap: .7rem; padding: .48rem .6rem; border-radius: 8px;
  color: var(--suave); font-weight: 500; position: relative;
}
.nav a:hover { background: var(--superficie-2); color: var(--texto); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--superficie-2); color: var(--texto); }
.nav a[aria-current="page"]::before {
  content: ""; position: absolute; left: -.75rem; top: 20%; bottom: 20%; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--acento);
}
.nav a[aria-current="page"] .ico { color: var(--acento); }

.principal { min-width: 0; display: flex; flex-direction: column; }
.barra {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .75rem;
  padding: .7rem clamp(1rem, 3vw, 2rem); background: color-mix(in srgb, var(--fondo) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--borde);
}
.barra .buscar { flex: 1; max-width: 420px; position: relative; }
.barra .buscar .ico { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--suave); }
.barra .buscar input { width: 100%; padding-left: 2.3rem; }
.barra .acciones { margin-left: auto; display: flex; align-items: center; gap: .4rem; }
.icono-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 8px;
  border: 1px solid var(--borde); background: var(--superficie); color: var(--suave); cursor: pointer;
}
.icono-btn:hover { color: var(--texto); border-color: var(--suave); }
.usuario { display: flex; align-items: center; gap: .5rem; color: var(--suave); font-size: .9rem; }
.usuario b { color: var(--texto); font-weight: 500; }
.solo-movil { display: none; }

main { padding: 1.4rem clamp(1rem, 3vw, 2rem) 3rem; width: 100%; max-width: 1280px; }

/* ---------- Bloques ---------- */
.caja {
  background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 1.1rem 1.2rem; margin-bottom: 1rem; box-shadow: var(--sombra);
}
.fila { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.fila h1 { margin-right: auto; }
.scroll { overflow-x: auto; }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.kpi { margin: 0; padding: .9rem 1rem; color: var(--suave); font-size: .88rem; border-left: 3px solid var(--borde); }
.kpi b { display: block; margin-top: .2rem; font: 600 1.9rem/1.1 var(--f-titulo); color: var(--texto); }
.kpi:has(.est-activo, .est-online) { border-left-color: var(--ok); }
.kpi:has(.est-suspendido, .est-offline) { border-left-color: var(--error); }
.kpi a { color: inherit; }

/* ---------- Tablas ---------- */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-weight: 500; font-size: .82rem; color: var(--suave);
  padding: .55rem .7rem; border-bottom: 1px solid var(--borde); white-space: nowrap;
}
td { padding: .62rem .7rem; border-bottom: 1px solid color-mix(in srgb, var(--borde) 60%, transparent); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, tr:hover td { background: color-mix(in srgb, var(--superficie-2) 70%, transparent); }
td a { font-weight: 500; }
/* Barra de estado a la izquierda de la fila (lectura rápida) */
tr.r-activo td:first-child, tr.r-online td:first-child, tr.r-pagada td:first-child, tr.r-cerrado td:first-child { box-shadow: inset 3px 0 var(--ok); }
tr.r-suspendido td:first-child, tr.r-offline td:first-child, tr.r-urgente td:first-child { box-shadow: inset 3px 0 var(--error); }
tr.r-pendiente td:first-child, tr.r-en_proceso td:first-child, tr.r-alta td:first-child { box-shadow: inset 3px 0 var(--alerta); }
tr.r-retirado td:first-child, tr.r-anulada td:first-child { box-shadow: inset 3px 0 var(--suave); }

/* Datos técnicos y estados */
.dato { font-family: var(--f-dato); font-size: .87em; }
.pill {
  display: inline-flex; align-items: center; gap: .4rem; padding: .12rem .55rem .12rem .45rem; border-radius: 999px;
  font-size: .82rem; font-weight: 500; white-space: nowrap;
  background: color-mix(in srgb, currentColor 14%, transparent);
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.est-suspendido::before, .pill.est-offline::before, .pill.est-anulada::before { border-radius: 1px; } /* forma distinta, no solo color */
.est-activo, .est-online, .est-pagada, .est-cerrado { color: var(--ok); }
.est-suspendido, .est-offline, .est-urgente { color: var(--error); }
.est-pendiente, .est-en_proceso, .est-abierto, .est-alta { color: var(--alerta); }
.est-retirado, .est-anulada { color: var(--suave); }
.no { color: var(--error); }

/* ---------- Formularios y botones ---------- */
form.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .9rem; }
label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--suave); }
input, select, textarea {
  font: inherit; color: var(--texto); background: var(--fondo); border: 1px solid var(--borde);
  border-radius: 8px; padding: .55rem .7rem; min-height: 40px; width: 100%;
}
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--acento); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acento); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acento) 25%, transparent); }
textarea { font: 13px/1.45 var(--f-dato); min-height: 8rem; }
input[type=file] { padding: .4rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 40px;
  padding: .5rem 1rem; border-radius: 8px; border: 1px solid transparent; cursor: pointer;
  font: 600 .92rem var(--f-texto); background: var(--acento); color: var(--sobre-acento); text-decoration: none;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.gris { background: var(--superficie-2); color: var(--texto); border-color: var(--borde); }
.btn.rojo { background: color-mix(in srgb, var(--error) 16%, transparent); color: var(--error); border-color: color-mix(in srgb, var(--error) 45%, transparent); }
.btn.verde { background: var(--ok); color: #04150d; }
:root[data-tema="claro"] .btn.verde { color: #fff; }
details summary { cursor: pointer; color: var(--acento); font-weight: 500; }

.error, .ok {
  display: flex; gap: .6rem; align-items: flex-start; padding: .75rem .9rem; border-radius: 8px; margin-bottom: 1rem;
  border: 1px solid; white-space: pre-wrap;
}
.error { color: var(--error); background: color-mix(in srgb, var(--error) 10%, var(--superficie)); }
.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--superficie)); }
.error a { color: inherit; text-decoration: underline; }

/* Gráficas SVG */
.viz text { fill: var(--suave); font: 10px var(--f-texto); }
.viz .grid { stroke: var(--borde); stroke-width: 1; }
.viz .col { fill: var(--serie-1); }
.viz g:hover .col { fill: var(--acento); }

/* ---------- Entrada (login) ---------- */
.entrada { max-width: none; min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; position: relative; overflow: hidden; }
.entrada::before { /* un hilo de fibra cruzando la pantalla, con su pulso */
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px;
  background: linear-gradient(to right, transparent, var(--acento), transparent) no-repeat;
  background-size: 30% 100%; animation: pulso-h 6s cubic-bezier(.45, 0, .55, 1) infinite; opacity: .7;
}
@keyframes pulso-h { from { background-position: -40% 0; } to { background-position: 140% 0; } }
@media (prefers-reduced-motion: reduce) { .entrada::before { animation: none; background-position: 50% 0; } }
.entrada .caja { position: relative; width: min(400px, 100%); padding: 2rem; }
.entrada h1 { font-size: 1.6rem; margin-bottom: .2rem; }
.entrada form { display: grid; gap: .9rem; margin-top: 1.4rem; }

/* ---------- Celular ---------- */
.tabs { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .lateral {
    position: fixed; z-index: 40; left: 0; top: 0; width: min(300px, 85vw); transform: translateX(-102%);
    transition: transform .22s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .5);
  }
  .lateral::after { display: none; }
  .nav-grupo > summary { min-height: 48px; font-size: .9rem; }  /* dedo: zonas táctiles ≥ 44 px */
  .nav a { min-height: 46px; }
  #menu:checked ~ .app .lateral { transform: none; }
  #menu:checked ~ .app .velo { display: block; }
  .velo { position: fixed; inset: 0; z-index: 30; background: rgba(3, 8, 18, .55); }
  .solo-movil { display: inline-grid; }
  .solo-escritorio { display: none !important; }
  .barra { padding: .55rem .8rem; }
  main { padding: 1rem .8rem calc(84px + env(safe-area-inset-bottom)); }
  .tabs {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; z-index: 25; left: 0; right: 0; bottom: 0;
    background: var(--superficie); border-top: 1px solid var(--borde); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabs a, .tabs label {
    display: flex; flex-direction: column; align-items: center; gap: .15rem; min-height: 58px; justify-content: center;
    font-size: .72rem; color: var(--suave); cursor: pointer;
  }
  .tabs a[aria-current="page"] { color: var(--acento); }
  .tabs .ico { width: 22px; height: 22px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
  .kpi b { font-size: 1.5rem; }
  h1 { font-size: 1.25rem; }
  .caja { padding: .9rem; }
  .btn { min-height: 44px; }
  /* Tablas de listados como tarjetas */
  table.tarjetas thead { display: none; }
  table.tarjetas tr { display: block; padding: .6rem .2rem; border-bottom: 1px solid var(--borde); }
  table.tarjetas td { display: flex; justify-content: space-between; gap: 1rem; padding: .22rem .6rem; border: 0; text-align: right; }
  table.tarjetas td::before { content: attr(data-label); color: var(--suave); font-size: .82rem; text-align: left; }
  table.tarjetas td:first-child { box-shadow: none !important; }
  /* Tarjeta: título (primera columna) + estado arriba; sin "#" ni campos vacíos; toda la tarjeta abre el detalle */
  table.tarjetas tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; position: relative; padding: .7rem .3rem .6rem .5rem; }
  table.tarjetas td { grid-column: 1 / -1; }
  table.tarjetas td.c-id, table.tarjetas td:empty { display: none; }
  table.tarjetas td.c-titulo { grid-column: 1; grid-row: 1; font-weight: 600; font-size: 1rem; padding-bottom: .35rem; }
  table.tarjetas td.c-titulo::before, table.tarjetas td.c-estado::before { display: none; }
  table.tarjetas td.c-estado { grid-column: 2; grid-row: 1; padding-bottom: .35rem; }
  table.tarjetas .enlace-tarjeta { color: var(--texto); }
  table.tarjetas .enlace-tarjeta::after { content: ""; position: absolute; inset: 0; }
  table.tarjetas tr[class*="r-"] { box-shadow: inset 3px 0 var(--borde); }
  table.tarjetas tr.r-activo, table.tarjetas tr.r-online, table.tarjetas tr.r-pagada { box-shadow: inset 3px 0 var(--ok); }
  table.tarjetas tr.r-suspendido, table.tarjetas tr.r-offline { box-shadow: inset 3px 0 var(--error); }
  table.tarjetas tr.r-pendiente, table.tarjetas tr.r-abierto, table.tarjetas tr.r-en_proceso { box-shadow: inset 3px 0 var(--alerta); }
}
#menu { position: absolute; opacity: 0; pointer-events: none; }

/* ---------- Inicio: instrumentos ---------- */
.instrumentos { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.instrumento { margin: 0; display: flex; flex-direction: column; }
.instrumento h2 { font-size: .95rem; color: var(--suave); }
.cifra { margin: 0 0 .9rem; color: var(--suave); }
.cifra b { display: block; font: 600 2.6rem/1 var(--f-titulo); color: var(--texto); letter-spacing: -.01em; }
.cifra .de { font-size: .5em; color: var(--suave); margin-left: .1em; }
.medidor { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; margin-bottom: .9rem; background: var(--superficie-2); }
.medidor span { min-width: 3px; }
.m-ok { background: var(--ok); } .m-error { background: var(--error); } .m-pend { background: var(--alerta); }
dl { margin: auto 0 0; display: grid; gap: .1rem; }
dl div { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; border-top: 1px solid color-mix(in srgb, var(--borde) 60%, transparent); }
dt { color: var(--suave); } dd { margin: 0; font-weight: 600; font-family: var(--f-titulo); }

.dos-columnas { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; }
.dos-columnas .caja { margin-bottom: 1rem; }
.renglon {
  display: flex; align-items: flex-start; gap: .75rem; padding: .6rem .5rem; margin: 0 -.5rem; border-radius: 8px; color: var(--texto);
}
.renglon:hover { background: var(--superficie-2); text-decoration: none; }
.renglon .pill { flex: none; margin-top: .1rem; min-width: 5.5rem; justify-content: flex-start; }
.renglon-texto { min-width: 0; display: flex; flex-direction: column; }
.renglon-texto b { font-weight: 500; }
.renglon-texto small { overflow-wrap: anywhere; }
.vacio { color: var(--suave); margin: .2rem 0; }
@media (max-width: 900px) {
  .dos-columnas { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .cifra b { font-size: 2.1rem; }
}

/* Caja: una factura = una línea de cobro */
.cobro { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(120px, 1fr)) auto; gap: .8rem; align-items: end;
  padding: .8rem 0; border-top: 1px solid var(--borde); }
@media (max-width: 900px) { .cobro { grid-template-columns: 1fr 1fr; } .cobro > div:first-of-type, .cobro .btn { grid-column: 1 / -1; } }

/* Portal del cliente: misma identidad, sin menú lateral, columna cómoda de leer */
.portal-barra { justify-content: space-between; }
main.portal { margin: 0 auto; max-width: 920px; padding-bottom: 3rem; }
main.portal h1 { margin: .4rem 0 1rem; }
.entrada details form { margin-top: .6rem; }

/* ---------- ONU ilustrada: los LEDs muestran el estado real ---------- */
.onu-dibujo { max-width: 360px; margin: 0 auto; }
.onu-svg { width: 100%; height: auto; display: block; }
.onu-sombra { fill: #000; opacity: .35; }
:root[data-tema="claro"] .onu-sombra { opacity: .12; }
.onu-dibujo.est-online #led-power, .onu-dibujo.est-online #led-pon, .onu-dibujo.est-online #led-lan { fill: #22c55e; filter: drop-shadow(0 0 2px #22c55e); }
.onu-dibujo.est-los #led-power { fill: #22c55e; }
.onu-dibujo.est-los #led-los { fill: #ef4444; filter: drop-shadow(0 0 3px #ef4444); animation: parpadeo 1s steps(2) infinite; }
.onu-dibujo.est-offline #led-power { fill: #22c55e; }
.onu-dibujo.est-offline #led-pon { fill: #f59e0b; animation: parpadeo 1.4s steps(2) infinite; }
@keyframes parpadeo { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .onu-dibujo #led-los, .onu-dibujo #led-pon { animation: none; } }

/* ---------- Componentes ilustrativos ---------- */
.estado-onu { display: inline-flex; align-items: center; gap: .4rem; font-weight: 500; font-size: .88rem; white-space: nowrap; }
.estado-onu .ico { width: 20px; height: 20px; }
.e-ok { color: var(--ok); } .e-error { color: var(--error); } .e-energia { color: var(--alerta); } .e-gris { color: var(--suave); }

.senal { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; }
.senal svg { width: 20px; height: 16px; flex: none; }
.senal rect.off { fill: color-mix(in srgb, var(--suave) 30%, transparent); }
.senal.s-ok rect.on { fill: var(--ok); } .senal.s-adv rect.on { fill: var(--alerta); } .senal.s-crit rect.on { fill: var(--error); }
.senal-val { font: 500 .9rem var(--f-dato); }
.senal-val small { font: .68rem var(--f-texto); margin-left: .2rem; }
.senal.s-crit .senal-val { color: var(--error); } .senal.s-adv .senal-val { color: var(--alerta); }
.senal.s-nada { color: var(--suave); }

.medidor-rx { position: relative; display: inline-block; width: 64px; height: 6px; vertical-align: middle; }
.medidor-rx .zonas { display: flex; gap: 1px; height: 100%; border-radius: 3px; overflow: hidden; }
.medidor-rx i { display: block; height: 100%; }
.medidor-rx .z-crit { flex: 5; background: var(--error); } .medidor-rx .z-adv { flex: 2; background: var(--alerta); } .medidor-rx .z-ok { flex: 15; background: var(--ok); }
.medidor-rx b { position: absolute; top: -3px; width: 3px; height: 12px; border-radius: 2px; background: var(--texto); transform: translateX(-50%); box-shadow: 0 0 0 1.5px var(--superficie); }

.tag { display: inline-block; padding: .08rem .45rem; border-radius: 4px; font: 600 .74rem/1.5 var(--f-texto); white-space: nowrap; letter-spacing: .01em; }
.tag-azul { background: #1d4ed8; color: #fff; } .tag-verde { background: #15803d; color: #fff; } .tag-ambar { background: #b45309; color: #fff; }
.tag-violeta { background: #6d28d9; color: #fff; } .tag-neutro { background: var(--superficie-2); color: var(--texto); border: 1px solid var(--borde); }

.barra-prog { display: block; height: 6px; border-radius: 3px; background: var(--superficie-2); overflow: hidden; margin-top: .3rem; }
.barra-prog span { display: block; height: 100%; border-radius: 3px; }
.bp-azul span { background: var(--serie-1); } .bp-naranja span { background: #eb6834; }

/* ---------- Inicio estilo centro de operaciones ---------- */
.vivo { display: inline-flex; align-items: center; gap: .45rem; }
.vivo i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.bloques { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.bloque { display: flex; flex-direction: column; border-radius: var(--radio); overflow: hidden; border: 1px solid var(--borde);
  background: var(--superficie); color: var(--texto); box-shadow: var(--sombra); }
.bloque:hover { text-decoration: none; transform: translateY(-1px); }
.bloque-cab { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: center; column-gap: .8rem;
  padding: .9rem 1.1rem; color: #fff; min-height: 98px; }
.bloque-cab .ico { grid-row: 1 / 3; width: 44px; height: 44px; stroke-width: 1.6; opacity: .95; }
.bloque-cab b { font: 600 2.6rem/1 var(--f-titulo); text-align: right; }
.bloque-cab span { text-align: right; font-weight: 600; font-size: .92rem; }
.bloque-pie { display: flex; justify-content: space-between; gap: .6rem; padding: .55rem 1.1rem; font-size: .84rem; color: var(--suave); }
.b-azul .bloque-cab { background: linear-gradient(135deg, #1d5fd0, #2a78d6); }
.b-verde .bloque-cab { background: linear-gradient(135deg, #12804c, #1f9d5c); }
.b-gris .bloque-cab { background: linear-gradient(135deg, #2b3445, #3b465a); }
.b-ambar .bloque-cab { background: linear-gradient(135deg, #a85d00, #c27100); }
.t-adv { color: var(--alerta); } .t-crit { color: var(--error); }

.franja-datos { display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; padding: .75rem 1.1rem; margin-bottom: 1rem; border-radius: var(--radio);
  background: var(--superficie); border: 1px solid var(--borde); color: var(--suave); font-size: .9rem; }
.franja-datos a { color: var(--suave); } .franja-datos a:hover { color: var(--texto); text-decoration: none; }
.franja-datos b { font: 600 1.15rem var(--f-titulo); color: var(--texto); margin-right: .35rem; }
.franja-datos .rojo b { color: var(--error); }

.rejilla-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 1rem; margin-bottom: 1rem; }
.panel { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra); padding: 0 1.1rem 1rem; min-width: 0; }
.panel > header { display: flex; align-items: center; gap: .55rem; margin: 0 -1.1rem .8rem; padding: .7rem 1.1rem;
  background: var(--superficie-2); border-bottom: 1px solid var(--borde); border-radius: var(--radio) var(--radio) 0 0;
  font: 600 .98rem var(--f-titulo); }
.panel > header small { font-family: var(--f-texto); font-weight: 400; }
.panel > header .ver-todo { margin-left: auto; font: 500 .82rem var(--f-texto); }
.grafica-red { width: 100%; min-width: 520px; height: auto; }
.grafica-red polyline { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.l-ok { stroke: var(--ok); } .l-energia { stroke: var(--alerta); } .l-error { stroke: var(--error); }
.a-ok { fill: color-mix(in srgb, var(--ok) 12%, transparent); }
.franja { fill: transparent; } .franja:hover { fill: color-mix(in srgb, var(--texto) 6%, transparent); }
.leyenda { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin: .4rem 0 0; font-size: .84rem; color: var(--suave); }
.leyenda i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: .4rem; vertical-align: middle; }
.leyenda i.l-ok { background: var(--ok); } .leyenda i.l-energia { background: var(--alerta); } .leyenda i.l-error { background: var(--error); }
.punto { width: 10px; height: 10px; border-radius: 50%; flex: none; margin-top: .4rem; }
.p-ok { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.p-error { background: var(--error); } .p-gris { background: var(--suave); }
.icono-alarma { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; flex: none; }
.ia-error { color: var(--error); background: color-mix(in srgb, var(--error) 14%, transparent); }
.ia-adv { color: var(--alerta); background: color-mix(in srgb, var(--alerta) 14%, transparent); }
.ia-ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.renglon .hora { margin-left: auto; flex: none; }
.evento { display: flex; justify-content: space-between; gap: .8rem; padding: .45rem 0; border-top: 1px solid color-mix(in srgb, var(--borde) 60%, transparent); font-size: .88rem; }
.evento:first-of-type { border-top: 0; }
.evento small { flex: none; }
@media (max-width: 900px) {
  .rejilla-2-1 { grid-template-columns: minmax(0, 1fr); }
  .bloques { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .bloque-cab { min-height: 84px; padding: .7rem .8rem; }
  .bloque-cab .ico { width: 30px; height: 30px; }
  .bloque-cab b { font-size: 1.9rem; }
  .bloque-cab span { font-size: .78rem; }
  .bloque-pie { flex-direction: column; gap: .1rem; padding: .45rem .8rem; font-size: .76rem; }
}

/* Filtros rápidos (chips) y contadores */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.chips a { display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .75rem; border-radius: 999px; border: 1px solid var(--borde);
  background: var(--superficie); color: var(--suave); font-size: .86rem; font-weight: 500; }
.chips a:hover { color: var(--texto); text-decoration: none; border-color: var(--suave); }
.chips a[aria-current] { border-color: var(--acento); color: var(--texto); background: color-mix(in srgb, var(--acento) 12%, var(--superficie)); }
.chips b { font-family: var(--f-titulo); color: var(--texto); }
.chips .senal-val { display: none; }
.contadores { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.contadores > div { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: .8rem 1rem; color: var(--suave); display: flex; flex-direction: column; gap: .15rem; }
.contadores b { font: 600 1.8rem/1 var(--f-titulo); color: var(--texto); }
.contadores .rojo b { color: var(--error); } .contadores .ambar b { color: var(--alerta); }
.celda-senal { display: inline-flex; align-items: center; gap: .7rem; }
@media (max-width: 900px) { .celda-senal .medidor-rx { display: none; } }

/* Ficha de ONU */
.ficha-onu { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 1.2fr) minmax(0, 1.2fr); gap: 1rem; margin-bottom: 1rem; }
.ficha-equipo { display: flex; flex-direction: column; align-items: center; padding-top: 1rem; }
.ficha-equipo .modelo { margin: .3rem 0 .6rem; font: 600 1rem var(--f-titulo); }
.ficha-estado { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .9rem; }
dl.ficha { margin: 0; }
dl.ficha div { padding: .42rem 0; }
dl.ficha dd { font-family: var(--f-texto); font-weight: 500; text-align: right; }
.acciones-onu { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.btn.b-naranja { background: #d97706; color: #fff; }
.rejilla-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
details.editar > summary { padding: .2rem 0; }
details.editar[open] > summary { margin-bottom: .9rem; }
@media (max-width: 1100px) { .ficha-onu { grid-template-columns: minmax(0, 1fr); } }

/* Chip (VLANs de un uplink, VLANs a marcar al autorizar una ONU) */
.chip{display:inline-flex;align-items:center;gap:.3rem;border:1px solid var(--borde);border-radius:999px;padding:.2rem .6rem;margin:.15rem;font-size:.9rem;min-height:36px}
.chip form{margin:0}.chip button{background:none;border:0;color:var(--suave);cursor:pointer;padding:0 .1rem;font:inherit}

/* campo de clave con botón para verla (como SmartOLT) */
.con-ojo { display: flex; gap: .3rem; align-items: stretch; }
.con-ojo input { flex: 1; min-width: 0; }
.ojo { background: var(--superficie-2); border: 1px solid var(--borde); border-radius: 8px; color: var(--texto); min-width: 44px; cursor: pointer; }
