/* ============ LookoutParrot · OmniNet ============ */

:root, :root[data-tema="oscuro"] {
  --fondo: #0F1B2E;
  --fondo-barra: #0B1524;
  --tarjeta: #172740;
  --tarjeta-2: #1E3150;
  --borde: #283D5F;
  --borde-fuerte: #3A5583;
  --texto: #EDF2F8;
  --gris: #A0B1C8;
  --gris-2: #71859F;

  --menta: #00D8A0;
  --menta-osc: #00A27A;
  --menta-claro: #5CF0C6;
  --oro: #FFC24B;
  --oro-osc: #D99A1E;
  --coral: #FF6F61;
  --naranja: #FF9F43;

  --ok-fondo: #0E3B33; --ok-texto: #7DF2CF; --ok-borde: #17664F;
  --mal-fondo: #3B1C23; --mal-texto: #FFC0B8; --mal-borde: #6E2C35; --coral-texto: #FF9A8F;
  --oro-fondo: #3A3016; --naranja-fondo: #3D2A16; --naranja-texto: #FFB86E;
  --azul-fondo: #123A4A; --azul-texto: #84D6F2;
  --info-fondo: #142F4A; --info-borde: #22507A; --info-texto: #A9DAF6;
  --ico-fondo: #12305A; --campo: #0E192B; --placeholder: #5E7393;
  --port-fondo: #1A2C47; --port-borde: #2A4062; --port-texto: #6F86A6;
  --radar-anillo: #2A4166; --radar-ext: #36517C; --radar-cruz: #22365A; --radar-txt: #61779A;
  --dona-fondo: #1F3352; --deshab: #2C4166; --deshab-sombra: #1C2C47; --esqueleto: #27406A;
  --fila-par: rgba(255, 255, 255, .025); --brillo: rgba(255, 255, 255, .05); --velo: rgba(5, 10, 20, .7);
  --sombra-c: #091222;
  --loro-linea: #EDF2F8; --loro-ojo: #0F1B2E;

  --mint: var(--menta);
  --orange: var(--naranja);
  --red: var(--coral);

  --radio: 12px;
  --sombra: 0 4px 0 var(--sombra-c);
  color-scheme: dark;
}

/* tema claro: azul clarito */
:root[data-tema="claro"] {
  --fondo: #EAF3FD;
  --fondo-barra: #DCEBFB;
  --tarjeta: #FFFFFF;
  --tarjeta-2: #EEF5FD;
  --borde: #C4D8EF;
  --borde-fuerte: #8FB3DD;
  --texto: #12233D;
  --gris: #4A607E;
  --gris-2: #6A82A3;

  --menta: #00A57B;
  --menta-osc: #007A5B;
  --menta-claro: #00C792;
  --oro: #F2A900;
  --oro-osc: #B97F00;
  --coral: #E5503F;
  --naranja: #E8801C;

  --ok-fondo: #D6F5EA; --ok-texto: #00684D; --ok-borde: #8FDCC3;
  --mal-fondo: #FDE3DF; --mal-texto: #A8301F; --mal-borde: #F2AFA5; --coral-texto: #C23A29;
  --oro-fondo: #FFF0C7; --naranja-fondo: #FFE6CC; --naranja-texto: #A85600;
  --azul-fondo: #DCEEFB; --azul-texto: #1D6FA8;
  --info-fondo: #DDEEFC; --info-borde: #A8CDEF; --info-texto: #1C5C93;
  --ico-fondo: #DCEBFB; --campo: #F7FAFE; --placeholder: #8EA2BD;
  --port-fondo: #EEF4FB; --port-borde: #C4D8EF; --port-texto: #7D93B0;
  --radar-anillo: #B9D0EA; --radar-ext: #94B6DD; --radar-cruz: #CFE0F2; --radar-txt: #6A82A3;
  --dona-fondo: #E3EDF8; --deshab: #D3E1F1; --deshab-sombra: #B9CDE5; --esqueleto: #DCE8F6;
  --fila-par: rgba(31, 92, 160, .04); --brillo: rgba(255, 255, 255, .6); --velo: rgba(18, 35, 61, .45);
  --sombra-c: #C3D6EC;
  --loro-linea: #12233D; --loro-ojo: #FFFFFF;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font-family: 'Nunito', 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: 'Poppins', 'Segoe UI', sans-serif;
  margin: 0;
  line-height: 1.2;
}
h1 { font-size: 30px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 600; }

a { color: var(--menta); }
a:hover { color: var(--menta-claro); }

.mono { font-family: 'IBM Plex Mono', monospace; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

.menta, .mint { color: var(--menta); }
.oro { color: var(--oro); }
.coral, .red { color: var(--coral); }
.warn { color: var(--naranja); }

.texto-suave, .note { color: var(--gris); margin: 0; }
.chico { font-size: 13px; }
.pista { color: var(--gris-2); font-size: 13px; margin: 18px 0 0; text-align: center; }

.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--menta); display: inline-block; flex: none; }
.dot.off { background: var(--coral); }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border: 0; border-radius: 10px;
  background: var(--menta); color: #04261D;
  font: 600 15px 'Poppins', sans-serif;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 4px 0 var(--menta-osc);
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--menta-osc); color: #04261D; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--menta-osc); }
.btn:disabled { background: var(--deshab); color: var(--gris); box-shadow: 0 4px 0 var(--deshab-sombra); cursor: not-allowed; transform: none; }
.btn.chico, .btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.ancho { width: 100%; }

.btn-borde {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  background: transparent; color: var(--texto);
  border: 2px solid var(--borde); border-radius: 10px;
  font: 600 14px 'Poppins', sans-serif; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.btn-borde:hover { border-color: var(--gris); background: var(--tarjeta-2); }
.btn-borde.chico { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn-borde:disabled { opacity: .55; cursor: not-allowed; }

.link {
  background: none; border: 0; padding: 0;
  color: var(--menta); font: 600 14px 'Nunito', sans-serif;
  cursor: pointer; text-decoration: none;
}
.link:hover { text-decoration: underline; }

.btn:focus-visible, .btn-borde:focus-visible, .link:focus-visible, .tab:focus-visible, .chip:focus-visible {
  outline: 3px solid var(--oro); outline-offset: 3px;
}

/* ---------- formularios ---------- */
.form { display: flex; flex-direction: column; gap: 16px; margin-top: 20px; }
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo > span { font-weight: 700; font-size: 14px; }

input, select {
  width: 100%; min-height: 46px; padding: 0 14px;
  background: var(--campo); color: var(--texto);
  border: 2px solid var(--borde); border-radius: 10px;
  font: 15px 'Nunito', sans-serif; outline: none;
  transition: border-color .15s;
}
input::placeholder { color: var(--placeholder); }
input:focus, select:focus { border-color: var(--menta); }
input:disabled { opacity: .6; }
input.mayus { text-transform: uppercase; }
input.otp { font: 500 30px 'IBM Plex Mono', monospace; letter-spacing: .45em; text-align: center; padding-left: .45em; min-height: 62px; }

/* ---------- avisos ---------- */
.avisos { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.aviso { padding: 12px 14px; border-radius: 10px; font-size: 14px; border: 2px solid; }
.aviso.error { background: var(--mal-fondo); border-color: var(--mal-borde); color: var(--mal-texto); }
.aviso.ok { background: var(--ok-fondo); border-color: var(--ok-borde); color: var(--ok-texto); }
.aviso.info { background: var(--info-fondo); border-color: var(--info-borde); color: var(--info-texto); }
.aviso.chico { margin-top: 18px; font-size: 13px; }

.paso {
  display: inline-block; align-self: flex-start;
  background: var(--oro); color: #2A1C00;
  font: 700 12px 'Poppins', sans-serif;
  padding: 3px 10px; border-radius: 6px;
  transform: rotate(-2deg); margin-bottom: 8px;
}

/* ---------- marca ---------- */
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--texto); }
.marca span { font: 600 19px 'Poppins', sans-serif; }
.marca b { color: var(--menta); font-weight: 700; }
.marca:hover { color: var(--texto); }

/* el loro: el ojo gira y parpadea */
.loro { display: block; overflow: visible; }
.loro.vivo .barrido { transform-box: view-box; transform-origin: 56px 54px; animation: girar 4.5s linear infinite; }
.loro.vivo .ojo { transform-box: view-box; transform-origin: 56px 54px; animation: parpadeo 6s ease-in-out infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
@keyframes parpadeo { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes flotar { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-6px) rotate(1deg); } }

/* ============ pantallas de entrar ============ */
.pagina-auth { min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: flex; }

.auth-lado {
  flex: 0 0 40%; max-width: 560px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  padding: 40px 52px;
  background: var(--fondo-barra);
  border-right: 2px solid var(--borde);
  overflow: hidden;
}
.auth-hero { display: flex; flex-direction: column; gap: 34px; }
.loro-grande { position: relative; width: 300px; max-width: 100%; animation: flotar 4s ease-in-out infinite; }
.loro-grande .loro { width: 100%; height: auto; }
.ping { position: absolute; width: 11px; height: 11px; border-radius: 50%; background: var(--menta); opacity: 0; animation: ping 2.6s ease-out infinite; }
.ping.p1 { left: 66%; top: 34%; animation-delay: .4s; }
.ping.p2 { left: 30%; top: 68%; animation-delay: 1.3s; background: var(--oro); }
.ping.p3 { left: 58%; top: 76%; animation-delay: 2.1s; }
@keyframes ping {
  0% { opacity: 0; transform: scale(.4); box-shadow: 0 0 0 0 rgba(0, 216, 160, .6); }
  15% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; box-shadow: 0 0 0 18px rgba(0, 216, 160, 0); }
}

.eslogan { margin: 0; font-size: 46px; line-height: 1.08; letter-spacing: -.5px; }
.eslogan .oro { position: relative; display: inline-block; white-space: nowrap; }
.garabato { position: absolute; left: -4%; bottom: -14px; width: 108%; height: 16px; }
.auth-pie { color: var(--gris-2); font-size: 13px; }

.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-caja {
  position: relative; width: 100%; max-width: 440px;
  background: var(--tarjeta); border: 2px solid var(--borde);
  border-radius: 18px; padding: 36px 32px 30px;
  box-shadow: var(--sombra);
  animation: subir .5s ease-out both;
}
.auth-caja::before, .auth-caja::after {
  content: ""; position: absolute; width: 24px; height: 24px;
  border: 3px solid var(--oro); pointer-events: none;
}
.auth-caja::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 18px; }
.auth-caja::after { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 18px; }
.auth-caja h2 { font-size: 26px; margin-bottom: 8px; }
.auth-caja .pista { text-align: left; }
.auth-marca-movil { display: none; margin-bottom: 26px; }
.auth-marca-movil p { margin: 12px 0 0; color: var(--gris); }
.auth-marca-movil p b { color: var(--oro); }

.enlaces { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.enlaces form { margin: 0; }

@media (max-width: 860px) {
  .auth-lado { display: none; }
  .auth-marca-movil { display: block; }
  .auth-caja { padding: 28px 22px; }
}

/* ============ barra de arriba ============ */
.barra {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 28px;
  padding: 10px 28px;
  background: var(--fondo-barra);
  border-bottom: 2px solid var(--borde);
}
.menu { display: flex; gap: 4px; }
.tab {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 10px;
  color: var(--gris); text-decoration: none;
  font: 500 14px 'Poppins', sans-serif;
  transition: color .15s, background .15s;
}
.tab:hover { color: var(--texto); background: var(--tarjeta); }
.tab[aria-current="page"] { color: var(--texto); background: var(--tarjeta); box-shadow: inset 0 -3px 0 var(--menta); }
.tab[aria-current="page"] svg { color: var(--menta); }

.usuario { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.usuario form { margin: 0; }
.usuario-chip { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--texto); font-weight: 700; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--oro); color: #2A1C00;
  font: 700 14px 'Poppins', sans-serif;
  transition: transform .2s;
}
.usuario-chip:hover .avatar { transform: rotate(-8deg) scale(1.05); }

/* ============ contenido ============ */
.pagina { max-width: 1160px; margin: 0 auto; padding: 30px 24px 70px; display: flex; flex-direction: column; gap: 22px; }
.pagina > .avisos { margin: 0; }
.vista { display: flex; flex-direction: column; gap: 22px; }

.saludo { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.saludo-sub { margin: 4px 0 0; color: var(--gris); font-size: 16px; }
.saludo-sub b { color: var(--texto); }
.saludo-der { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.selector select { min-height: 40px; width: auto; max-width: 260px; font-size: 14px; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  background: var(--ok-fondo); color: var(--ok-texto);
  font-weight: 700; font-size: 13px; white-space: nowrap;
}
.pill .dot { animation: latido 1.8s ease-in-out infinite; }
.pill.off { background: var(--mal-fondo); color: var(--mal-texto); }
.pill.off .dot { animation: none; }
.pill.neutral { background: var(--tarjeta-2); color: var(--gris); }
@keyframes latido { 0%, 100% { box-shadow: 0 0 0 0 rgba(0, 216, 160, .55); } 60% { box-shadow: 0 0 0 7px rgba(0, 216, 160, 0); } }

.card {
  position: relative; min-width: 0;
  background: var(--tarjeta);
  border: 2px solid var(--borde);
  border-radius: var(--radio);
  padding: 20px;
  box-shadow: var(--sombra);
}
.card-titulo { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.etq { font-size: 12px; color: var(--gris-2); font-weight: 700; }

.seccion { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.seccion h2 { font-size: 22px; position: relative; padding-bottom: 6px; }
.seccion h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 34px; height: 4px; border-radius: 4px; background: var(--oro); }

/* entrada suave de las tarjetas */
.aparece { animation: subir .45s ease-out both; animation-delay: calc(var(--i, 0) * 80ms); }
@keyframes subir { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- el loro habla ---------- */
.loro-habla { display: flex; align-items: flex-start; gap: 16px; }
.loro-mini { flex: none; margin-top: 8px; animation: flotar 3.4s ease-in-out infinite; }
.globo {
  position: relative; flex: 1; min-width: 0;
  background: var(--tarjeta); border: 2px solid var(--borde);
  border-radius: 18px; padding: 18px 22px;
  box-shadow: var(--sombra);
}
.globo::before {
  content: ""; position: absolute; left: -11px; top: 30px;
  width: 18px; height: 18px; background: var(--tarjeta);
  border-left: 2px solid var(--borde); border-bottom: 2px solid var(--borde);
  transform: rotate(45deg);
}
.frase { margin: 0; font: 600 21px/1.35 'Poppins', sans-serif; }
.frase em { font-style: normal; color: var(--menta); }
.frase strong { color: var(--naranja); }
.frase.cambia { animation: frase .4s ease-out; }
@keyframes frase { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }

.numeros { display: flex; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 2px dashed var(--borde); }
.numeros div { display: flex; flex-direction: column; padding: 2px 24px; border-left: 2px solid var(--borde); }
.numeros div:first-child { padding-left: 0; border-left: 0; }
.numeros b { font: 600 28px 'Poppins', sans-serif; line-height: 1.1; }
.numeros b.hora { font: 500 20px/1.6 'IBM Plex Mono', monospace; }
.numeros span { color: var(--gris); font-size: 13px; }

/* ---------- radar y barras ---------- */
.dos-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 20px; }
.dos-col > .card { display: flex; flex-direction: column; }

.radar-caja { width: 100%; max-width: 360px; aspect-ratio: 1; margin: 0 auto; }
.radar { width: 100%; height: 100%; display: block; overflow: visible; }
.radar .anillo { fill: none; stroke: var(--radar-anillo); stroke-width: 1.2; }
.radar .anillo.ext { stroke: var(--radar-ext); stroke-width: 1.8; }
.radar .cruz { stroke: var(--radar-cruz); stroke-width: 1; stroke-dasharray: 3 5; }
.radar .rot { font: 9px 'IBM Plex Mono', monospace; fill: var(--radar-txt); paint-order: stroke; stroke: var(--tarjeta); stroke-width: 3px; }
.radar .sweep { transform-origin: 0 0; animation: girar 6s linear infinite; }
.radar .nodo { fill: var(--menta); }
.radar .nodo-halo { fill: none; stroke: var(--menta); stroke-width: 1.5; transform-origin: 0 0; animation: halo 2.4s ease-out infinite; }
@keyframes halo { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(2.3); opacity: 0; } }
.radar .eq circle { stroke: var(--fondo); stroke-width: 2.5; }
.radar .eq.ok circle { fill: var(--menta); }
.radar .eq.mal circle { fill: var(--naranja); }
.radar .eq.det circle { fill: var(--fondo); stroke: var(--gris); stroke-width: 1.8; stroke-dasharray: 3 2.5; }
.radar .eq.nuevo circle { stroke: var(--oro); stroke-width: 3; stroke-dasharray: none; }
.radar .eq text { font: 700 10px 'Nunito', sans-serif; fill: var(--texto); text-anchor: middle; paint-order: stroke; stroke: var(--tarjeta); stroke-width: 4px; stroke-linejoin: round; }
.radar .eq text.ip { font: 9px 'IBM Plex Mono', monospace; fill: var(--gris); }
.radar .alerta { fill: var(--coral); animation: titilar 1.8s ease-in-out infinite; }
@keyframes titilar { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.leyenda-radar { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 10px; font-size: 13px; color: var(--gris); }
.leyenda-radar .b { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.b.ok { background: var(--menta); }
.b.mal { background: var(--naranja); }
.b.alerta { background: var(--coral); }
.b.det { border: 2px dashed var(--gris); }

.barras { flex: 1; height: auto; min-height: 190px; display: flex; align-items: flex-end; gap: 5px; border-bottom: 2px solid var(--borde); }
.barras div {
  flex: 1 1 0; min-height: 4px;
  background: var(--menta); border-radius: 5px 5px 0 0;
  transform-origin: bottom; animation: crecer .6s ease-out both;
  transition: height .4s;
}
.barras div:hover { background: var(--menta-claro); }
.barras div.hi { background: var(--naranja); }
@keyframes crecer { from { transform: scaleY(0); } }
.eje { display: flex; justify-content: space-between; font-size: 11px; color: var(--gris-2); margin: 6px 0 12px; }

/* ---------- equipos ---------- */
.equipos { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.eq { display: flex; flex-direction: column; gap: 12px; transition: transform .2s, border-color .2s; }
.eq:hover { transform: translateY(-3px); border-color: var(--borde-fuerte); }
.eq-top { display: flex; align-items: center; gap: 12px; }
.eq-ico { width: 42px; height: 42px; flex: none; border-radius: 12px; background: var(--ico-fondo); display: flex; align-items: center; justify-content: center; }
.eq-ico svg { stroke: var(--menta); }
.eq-name { flex: 1; min-width: 0; }
.eq-name b { display: block; font: 600 16px 'Poppins', sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eq-name small { font: 12px 'IBM Plex Mono', monospace; color: var(--gris); }
.eq-del {
  width: 36px; height: 36px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 2px solid transparent; border-radius: 9px;
  color: var(--gris-2); cursor: pointer;
}
.eq-del:hover { border-color: var(--borde); color: var(--texto); }
.eq-del[data-borrar]:hover { border-color: var(--mal-borde); color: var(--mal-texto); }

.eq-estado { display: flex; flex-direction: column; gap: 6px; }
.chip-est { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--ok-fondo); color: var(--ok-texto); }
.chip-est.off { background: var(--mal-fondo); color: var(--mal-texto); }
.chip-est.neutral { background: var(--tarjeta-2); color: var(--gris); }
.eq-desc { font-size: 11px; color: var(--gris-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.eq-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.eq-stats div { background: var(--tarjeta-2); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; }
.eq-stats b { font: 600 20px 'Poppins', sans-serif; }
.eq-stats span { font-size: 12px; color: var(--gris); line-height: 1.25; }
.eq-foot { font-size: 12px; color: var(--gris-2); }

.ports { display: grid; gap: 4px; }
.port {
  aspect-ratio: 1; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font: 9px 'IBM Plex Mono', monospace;
  background: var(--port-fondo); border: 1px solid var(--port-borde); color: var(--port-texto);
}
.port.up { background: var(--menta); border-color: transparent; color: #04261D; }
.port.down { background: var(--naranja); border-color: transparent; color: #2A1200; animation: titilar 2s ease-in-out infinite; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--gris); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; }
.iflist { display: flex; flex-direction: column; gap: 6px; }
.iflist div { display: flex; justify-content: space-between; padding: 8px 12px; border-radius: 8px; background: var(--tarjeta-2); font-size: 13px; }

.eq.es-nuevo { border-color: var(--oro-osc); }
.sello {
  position: absolute; top: -13px; right: 16px;
  background: var(--oro); color: #2A1C00;
  font: 700 12px 'Poppins', sans-serif;
  padding: 3px 12px; border-radius: 6px;
  transform: rotate(4deg);
  box-shadow: 0 3px 0 var(--oro-osc);
}
.eq.apagado .eq-ico { background: var(--mal-fondo); }
.eq.apagado .eq-ico svg { stroke: var(--coral-texto); }
.eq.detected, .eq.empty-eq { border-style: dashed; background: transparent; box-shadow: none; }
.eq.empty-eq { align-items: flex-start; }

.form-equipo { border-color: var(--borde-fuerte); }
.rejilla-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 12px; }
.form-acciones { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.form-error { color: var(--mal-texto); font-size: 14px; }

/* ---------- tabla ---------- */
.filtros { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  min-height: 36px; padding: 0 16px; border-radius: 999px;
  background: transparent; color: var(--gris);
  border: 2px solid var(--borde);
  font: 600 13px 'Poppins', sans-serif; cursor: pointer;
  transition: all .15s;
}
.chip:hover { color: var(--texto); border-color: var(--gris-2); }
.chip[aria-pressed="true"] { background: var(--menta); border-color: var(--menta); color: #04261D; }

.tabla-card { padding: 8px 8px 16px; display: flex; flex-direction: column; gap: 12px; }
.tabla-card > .texto-suave { padding: 0 12px; }
.tabla-scroll { overflow-x: auto; }
table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 12px; color: var(--gris); font: 600 13px 'Poppins', sans-serif; border-bottom: 2px solid var(--borde); }
td { padding: 11px 12px; vertical-align: top; }
tbody tr:nth-child(even) { background: var(--fila-par); }
tbody tr:hover { background: var(--tarjeta-2); }
td.m { font: 12px 'IBM Plex Mono', monospace; color: var(--gris); white-space: nowrap; }
.sev { display: inline-block; padding: 2px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; text-transform: capitalize; }
.sev.alta { background: var(--mal-fondo); color: var(--coral-texto); }
.sev.media { background: var(--naranja-fondo); color: var(--naranja-texto); }
.sev.info { background: var(--azul-fondo); color: var(--azul-texto); }
.vacio, .empty { color: var(--gris); text-align: center; padding: 26px 10px; }
.btn-borde.mas { align-self: center; }

/* ---------- módulo físico ---------- */
.sensores { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.sensor { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.sensor h2 { margin-top: 8px; }
.sensor-valor { margin: 0; font: 600 26px 'Poppins', sans-serif; }
.sensor .btn-borde { margin-top: 10px; }
.sensor-ico {
  position: relative; width: 54px; height: 54px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
}
.sensor-ico.naranja { background: var(--naranja-fondo); color: var(--naranja); }
.sensor-ico.oro { background: var(--oro-fondo); color: var(--oro); }
.sensor-ico.menta { background: var(--ok-fondo); color: var(--menta); }
.onda { position: absolute; inset: 0; border-radius: 16px; border: 2px solid var(--naranja); opacity: 0; }
.sensor.activo .onda { animation: onda 1.8s ease-out infinite; }
.sensor.activo .onda.dos { animation-delay: .9s; }
.sensor.activo .sensor-valor { color: var(--naranja); }
@keyframes onda { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.7); opacity: 0; } }
.sensor.girando .sensor-ico svg { animation: girar 1.4s linear infinite; }

.oled-marco { width: fit-content; max-width: 100%; margin: 6px auto 0; padding: 14px; background: #1B1F27; border: 2px solid #2E3440; border-radius: 12px; }
.oled { width: 256px; max-width: 100%; height: 128px; background: #000; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font: 13px 'IBM Plex Mono', monospace; color: #9FE8FF; }
.oled hr { border: 0; height: 1px; background: #9FE8FF; margin: 0; }
.logrow { display: flex; align-items: baseline; gap: 12px; padding: 10px 2px; border-bottom: 1px dashed var(--borde); }
.logrow:last-child { border-bottom: 0; }
.logrow .m { font: 12px 'IBM Plex Mono', monospace; color: var(--gris-2); white-space: nowrap; }

/* ---------- mis kits ---------- */
.bienvenida { background: var(--ok-fondo); border: 2px solid var(--ok-borde); border-radius: var(--radio); padding: 22px; }
.bienvenida h2 { font-size: 21px; }
.bienvenida p { margin: 8px 0 0; color: var(--ok-texto); }

.kits { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; align-items: start; }
.kit { display: flex; flex-direction: column; gap: 16px; }
.kit-arriba { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.kit-datos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.kit-datos li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--borde); font-size: 14px; }
.kit-datos li span { color: var(--gris); }
.kit-acciones { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.renombrar summary { list-style: none; cursor: pointer; }
.renombrar summary::-webkit-details-marker { display: none; }
.form-linea { display: flex; gap: 8px; margin-top: 10px; }
.form-linea input { min-height: 38px; font-size: 14px; }
.registrar .form { margin-top: 6px; }
.registrar h2 { margin-bottom: 4px; }

.etiqueta-kit {
  max-width: 300px; margin: 16px 0 18px; padding: 12px 14px 10px;
  background: #ECF0F4; color: #0F1B2E; border-radius: 8px;
  transform: rotate(-2deg); box-shadow: 0 5px 0 var(--sombra-c);
  display: flex; flex-direction: column; gap: 6px;
  transition: transform .25s;
}
.etiqueta-kit:hover { transform: rotate(0deg) scale(1.02); }
.etiqueta-arriba { display: flex; justify-content: space-between; font: 600 10px 'IBM Plex Mono', monospace; letter-spacing: .1em; color: #3A4D66; border-bottom: 1px dashed #9AAABB; padding-bottom: 6px; }
.etiqueta-fila { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: #3A4D66; }
.etiqueta-fila b { font-size: 15px; color: #0F1B2E; }
.codigo-barras { height: 22px; background: repeating-linear-gradient(90deg, #0F1B2E 0 2px, transparent 2px 4px, #0F1B2E 4px 5px, transparent 5px 8px, #0F1B2E 8px 11px, transparent 11px 12px); }

/* ============ celular ============ */
@media (max-width: 760px) {
  .barra { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .menu { order: 3; width: 100%; overflow-x: auto; }
  .tab { white-space: nowrap; }
  .usuario-nombre, .usuario .btn-borde span { display: none; }
  .pagina { padding: 22px 16px 60px; }
  h1 { font-size: 26px; }
  .loro-habla { flex-direction: column; gap: 8px; }
  .loro-mini { margin: 0 0 0 10px; }
  .globo::before { left: 34px; top: -11px; border-left: 2px solid var(--borde); border-bottom: 0; border-top: 2px solid var(--borde); }
  .frase { font-size: 18px; }
  .numeros { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .numeros div, .numeros div:first-child { padding: 0; border-left: 0; }
  .eq-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .equipos, .kits { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============ panel estilo centro de monitoreo ============ */
.app { display: flex; min-height: 100vh; }
.principal { flex: 1; min-width: 0; }
.con-lateral .pagina { max-width: 1280px; padding: 26px 32px 70px; }

/* menú lateral */
.lateral {
  position: sticky; top: 0; height: 100vh; width: 248px; flex: none;
  display: flex; flex-direction: column; gap: 18px;
  padding: 22px 14px 16px;
  background: var(--fondo-barra);
  border-right: 2px solid var(--borde);
}
.lateral-arriba { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.lateral-arriba .marca span { font-size: 17px; }
.btn-menu { display: none; }
.lateral-nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-grupo { margin: 16px 12px 6px; font: 600 11px 'Poppins', sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--gris-2); }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--gris); text-decoration: none; font-weight: 700; font-size: 14px;
  transition: background .15s, color .15s, padding-left .2s;
}
.nav-item:hover { background: var(--tarjeta); color: var(--texto); padding-left: 16px; }
.nav-item[aria-current="page"] { background: var(--tarjeta); color: var(--texto); }
.nav-item[aria-current="page"]::before {
  content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px;
  border-radius: 0 4px 4px 0; background: var(--menta);
  animation: entraBarra .3s ease-out;
}
.nav-item[aria-current="page"] svg { color: var(--menta); }
@keyframes entraBarra { from { transform: scaleY(0); } }
.nav-num {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
  background: var(--coral); color: #2B0A06; font: 700 11px/22px 'Poppins', sans-serif; text-align: center;
  animation: latidoCoral 2s ease-in-out infinite;
}
@keyframes latidoCoral { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 111, 97, .55); } 60% { box-shadow: 0 0 0 7px rgba(255, 111, 97, 0); } }

.lateral-usuario { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border: 2px solid var(--borde); border-radius: 12px; }
.lateral-usuario form { margin: 0 0 0 auto; }
.lateral-usuario-txt { display: flex; flex-direction: column; min-width: 0; }
.lateral-usuario-txt b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lateral-usuario-txt small { font-size: 11px; color: var(--gris-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-icono {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  background: none; border: 2px solid transparent; border-radius: 9px; color: var(--gris); cursor: pointer; font-size: 15px;
}
.btn-icono:hover { border-color: var(--borde); color: var(--texto); }

/* encabezado y pestañas */
.encabezado { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ruta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--gris-2); font-size: 13px; font-weight: 700; }
.ruta b { color: var(--texto); }
.ruta .sep { color: var(--borde); }
.ruta .selector select { min-height: 32px; padding: 0 8px; font-size: 13px; }

.titulo-panel { display: flex; flex-direction: column; gap: 12px; border-bottom: 2px solid var(--borde); }
.titulo-panel h1 { font-size: 26px; letter-spacing: .02em; }
.titulo-panel .hola { font: 600 16px 'Nunito', sans-serif; color: var(--gris); }
.pestanas { position: relative; display: flex; gap: 6px; overflow-x: auto; }
.pestana {
  padding: 8px 14px 12px; color: var(--gris); text-decoration: none;
  font: 500 14px 'Poppins', sans-serif; white-space: nowrap; transition: color .15s;
}
.pestana:hover { color: var(--texto); }
.pestana[aria-current="page"] { color: var(--texto); }
.pestana-linea {
  position: absolute; left: 0; bottom: -2px; height: 3px; width: 0;
  background: var(--menta); border-radius: 3px;
  transition: transform .35s cubic-bezier(.3, 1.4, .5, 1), width .35s;
}

.vista:not([hidden]) { animation: vistaEntra .35s ease-out; }
@keyframes vistaEntra { from { opacity: 0; transform: translateY(8px); } }

/* el loro, más compacto */
.loro-habla { align-items: center; }
.loro-mini { margin-top: 0; }
.globo { padding: 12px 20px; }
.globo::before { top: 50%; margin-top: -9px; }
.globo-quien { font: 600 11px 'Poppins', sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--menta); }
.frase { font-size: 18px; }

/* tarjetas de números */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.kpi {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 4px;
  background: var(--tarjeta); border: 2px solid var(--borde); border-radius: var(--radio);
  padding: 16px 18px 14px; box-shadow: var(--sombra);
  transition: transform .2s, border-color .2s;
}
.kpi:hover { transform: translateY(-3px); border-color: var(--borde-fuerte); }
.kpi::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, var(--brillo), transparent);
  animation: brillo 6s ease-in-out infinite; animation-delay: calc(var(--i, 0) * .7s);
}
@keyframes brillo { 0%, 70% { left: -60%; } 100% { left: 130%; } }
.kpi-titulo { font: 600 13px 'Poppins', sans-serif; color: var(--gris); }
.kpi-fila { display: flex; align-items: baseline; gap: 10px; }
.kpi-num { font: 600 34px 'Poppins', sans-serif; line-height: 1.15; }
.kpi-de { color: var(--gris); font-size: 14px; font-weight: 700; }
.kpi-pie { font-size: 12px; color: var(--gris-2); }
.tendencia { font: 700 13px 'Poppins', sans-serif; padding: 1px 8px; border-radius: 6px; }
.tendencia.sube { color: var(--coral); background: rgba(255, 111, 97, .12); }
.tendencia.baja { color: var(--menta); background: rgba(0, 216, 160, .12); }

.spark { width: 100%; height: 36px; margin-top: 2px; overflow: visible; color: var(--menta); }
.spark.coral { color: var(--coral); }
.spark.oro { color: var(--oro); }
.spark-linea { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; vector-effect: non-scaling-stroke; animation: dibujarLinea 1.4s ease-out both; }
.spark-area { fill: currentColor; opacity: .1; animation: aparecer 1.4s ease-out both; }
@keyframes dibujarLinea { from { stroke-dashoffset: 1; } }
@keyframes aparecer { from { opacity: 0; } }

/* top 5 */
.top5 tbody tr { animation: filaEntra .4s ease-out both; animation-delay: calc(var(--i, 0) * 70ms + .3s); }
@keyframes filaEntra { from { opacity: 0; transform: translateX(-10px); } }
.fila-click { cursor: pointer; }
.alerta-link { background: none; border: 0; padding: 0; color: var(--menta); font: 700 14px 'Nunito', sans-serif; text-align: left; cursor: pointer; }
.alerta-link:hover { text-decoration: underline; color: var(--menta-claro); }

.nivel { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; }
.nivel-ico { position: relative; width: 18px; height: 18px; border-radius: 50%; flex: none; }
.nivel-ico::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--tarjeta); }
.nivel.alta { color: var(--coral-texto); }
.nivel.alta .nivel-ico { background: var(--coral); animation: latidoCoral 1.8s ease-in-out infinite; }
.nivel.media { color: var(--naranja-texto); }
.nivel.media .nivel-ico { background: var(--naranja); }
.nivel.info { color: var(--azul-texto); }
.nivel.info .nivel-ico { background: #4EA8DE; }

/* donas */
.donas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.donas .card { display: flex; flex-direction: column; }
.dona { width: 100%; height: auto; overflow: visible; }
.dona-fondo { fill: none; stroke: var(--dona-fondo); stroke-width: 22; }
.dona-seg {
  fill: none; stroke-width: 22; cursor: pointer;
  animation: dibujarDona 1s cubic-bezier(.3, .8, .4, 1) both; animation-delay: var(--d);
  transition: stroke-width .2s;
}
.dona-seg:hover { stroke-width: 30; }
@keyframes dibujarDona { from { stroke-dasharray: 0 var(--c); } }
.dona-etq { animation: aparecer .5s ease-out both; animation-delay: var(--d); }
.dona-etq path { fill: none; stroke-width: 1.4; }
.dona-etq text { font: 600 11px 'Nunito', sans-serif; fill: var(--texto); }
.dona-etq .v { fill: var(--gris); font-weight: 400; }
.dona-total { font: 600 34px 'Poppins', sans-serif; fill: var(--texto); text-anchor: middle; }
.dona-sub { font: 600 12px 'Nunito', sans-serif; fill: var(--gris); text-anchor: middle; }

.en-vivo { display: inline-flex; align-items: center; gap: 6px; color: var(--menta); }
.en-vivo .dot { width: 7px; height: 7px; animation: latido 1.6s ease-in-out infinite; }

/* ventana de detalle */
.modal-fondo {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: var(--velo);
  opacity: 0; transition: opacity .2s;
}
.modal-fondo.visible { opacity: 1; }
.modal {
  width: 100%; max-width: 520px;
  background: var(--tarjeta); border: 2px solid var(--borde-fuerte); border-radius: 16px;
  box-shadow: 0 6px 0 var(--sombra-c); padding: 22px;
  transform: scale(.92) translateY(10px); transition: transform .25s cubic-bezier(.3, 1.4, .5, 1);
}
.modal-fondo.visible .modal { transform: none; }
.modal-arriba { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-abajo { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.detalle { margin: 0 0 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.detalle div { background: var(--tarjeta-2); border-radius: 10px; padding: 10px 12px; }
.detalle div:nth-child(2) { grid-column: 1 / -1; }
.detalle dt { font-size: 12px; color: var(--gris); }
.detalle dd { margin: 2px 0 0; font-weight: 700; word-break: break-word; }

/* avisos emergentes */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; gap: 10px; width: min(340px, calc(100vw - 40px)); }
.toast {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--tarjeta); border: 2px solid var(--borde); border-left-width: 6px; border-left-color: var(--menta);
  border-radius: 12px; padding: 12px 14px; box-shadow: 0 5px 0 var(--sombra-c);
  animation: toastEntra .4s cubic-bezier(.3, 1.4, .5, 1);
}
.toast b { font: 600 14px 'Poppins', sans-serif; }
.toast span { font-size: 13px; color: var(--gris); }
.toast.coral { border-left-color: var(--coral); }
.toast.oro { border-left-color: var(--oro); }
.toast.sale { animation: toastSale .4s ease-in forwards; }
@keyframes toastEntra { from { opacity: 0; transform: translateX(40px); } }
@keyframes toastSale { to { opacity: 0; transform: translateX(40px); } }

/* mientras carga */
body:not(.listo) .kpi-num, body:not(.listo) .kpi-de {
  color: transparent; border-radius: 6px;
  background: linear-gradient(90deg, var(--tarjeta-2) 25%, var(--esqueleto) 50%, var(--tarjeta-2) 75%);
  background-size: 200% 100%; animation: cargando 1.2s linear infinite;
}
@keyframes cargando { to { background-position: -200% 0; } }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .donas { grid-template-columns: 1fr; }
  .donas .dona { max-width: 420px; margin: 0 auto; }
}
@media (max-width: 860px) {
  .app { flex-direction: column; }
  .lateral { position: sticky; top: 0; z-index: 20; width: 100%; height: auto; padding: 12px 16px; gap: 0; border-right: 0; border-bottom: 2px solid var(--borde); }
  .btn-menu { display: flex; flex-direction: column; gap: 4px; padding: 10px; background: none; border: 2px solid var(--borde); border-radius: 10px; cursor: pointer; }
  .btn-menu span { width: 18px; height: 2px; background: var(--texto); border-radius: 2px; transition: transform .25s, opacity .25s; }
  .lateral.abierto .btn-menu span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .lateral.abierto .btn-menu span:nth-child(2) { opacity: 0; }
  .lateral.abierto .btn-menu span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .lateral-nav, .lateral-usuario { display: none; }
  .lateral.abierto .lateral-nav, .lateral.abierto .lateral-usuario { display: flex; animation: vistaEntra .25s ease-out; }
  .lateral.abierto .lateral-nav { margin-top: 10px; }
  .lateral.abierto .lateral-usuario { margin-top: 12px; }
  .nav-item[aria-current="page"]::before { left: -6px; }
  .con-lateral .pagina { padding: 20px 16px 60px; }
  .kpi-num { font-size: 28px; }
  .detalle { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi { padding: 12px 14px; }
}

@media (min-width: 861px) {
  body.con-lateral { background: linear-gradient(90deg, var(--fondo-barra) 248px, var(--borde) 248px 250px, var(--fondo) 250px); }
  .lateral { border-right: 0; margin-right: 2px; }
}
@media (max-width: 760px) {
  .loro-habla { align-items: flex-start; }
  .globo::before { top: -11px; margin-top: 0; left: 34px; }
}

/* ============ RemoteOps ============ */
.remote { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.remote-accion { display: flex; flex-direction: column; gap: 18px; }
.remote-arriba { display: flex; gap: 16px; align-items: flex-start; }
.remote-arriba h2 { font-size: 20px; margin-bottom: 4px; }

.pasos { position: relative; list-style: none; margin: 6px 0 0; padding: 0; display: flex; justify-content: space-between; }
.pasos li { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 33%; text-align: center; font-size: 13px; color: var(--gris); font-weight: 700; }
.paso-bola {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--tarjeta-2); border: 3px solid var(--borde); color: var(--gris);
  font: 700 14px 'Poppins', sans-serif;
  transition: background .4s, border-color .4s, color .4s, transform .4s;
}
.pasos-linea { position: absolute; top: 18px; left: 16.5%; right: 16.5%; height: 4px; background: var(--borde); border-radius: 4px; overflow: hidden; }
.pasos-linea span { display: block; height: 100%; width: 0; background: var(--oro); border-radius: 4px; transition: width .7s cubic-bezier(.3, .8, .4, 1); }
.pasos[data-paso="2"] .pasos-linea span { width: 50%; }
.pasos[data-paso="3"] .pasos-linea span { width: 100%; background: var(--menta); }
.pasos[data-paso="1"] li:nth-child(1) .paso-bola,
.pasos[data-paso="2"] li:nth-child(-n+2) .paso-bola { background: var(--oro); border-color: var(--oro); color: #2A1C00; }
.pasos[data-paso="3"] li .paso-bola { background: var(--menta); border-color: var(--menta); color: #04261D; }
.pasos[data-paso="1"] li:nth-child(1), .pasos[data-paso="2"] li:nth-child(-n+2), .pasos[data-paso="3"] li { color: var(--texto); }
.pasos.corriendo[data-paso="1"] li:nth-child(2) .paso-bola,
.pasos.corriendo[data-paso="2"] li:nth-child(3) .paso-bola { border-color: var(--oro); animation: esperaBola 1.2s ease-in-out infinite; }
.pasos.corriendo .pasos-linea span { background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(0, 0, 0, .18) 6px 12px); background-size: 34px 100%; animation: avanzar .8s linear infinite; }
.pasos.mal .paso-bola { background: var(--tarjeta-2) !important; border-color: var(--coral) !important; color: var(--coral) !important; }
.pasos.mal .pasos-linea span { background: var(--coral); }
@keyframes esperaBola { 50% { transform: scale(1.12); box-shadow: 0 0 0 6px rgba(255, 194, 75, .15); } }
@keyframes avanzar { to { background-position: 34px 0; } }

.remote-estado { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--tarjeta-2); font-weight: 700; animation: frase .4s ease-out; }
.remote-estado.ok { background: var(--ok-fondo); color: var(--ok-texto); }
.remote-estado.mal { background: var(--mal-fondo); color: var(--mal-texto); }

.btn-grande { min-height: 56px; font-size: 17px; background: var(--oro); color: #2A1C00; box-shadow: 0 5px 0 var(--oro-osc); }
.btn-grande:hover { color: #2A1C00; box-shadow: 0 7px 0 var(--oro-osc); }
.btn-grande:active { box-shadow: 0 1px 0 var(--oro-osc); }
.btn-ico { display: flex; }
.btn-ico svg { width: 22px; height: 22px; }
.girando .btn-ico svg { animation: girarAtras 1.2s linear infinite; }
@keyframes girarAtras { to { transform: rotate(-360deg); } }
.btn-reiniciar:disabled { opacity: .7; }

.tabla-hist { min-width: 460px; }
.tabla-hist tbody tr { animation: filaEntra .35s ease-out both; animation-delay: calc(var(--i, 0) * 60ms); }
.estado-cmd { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.estado-cmd.ok { background: var(--ok-fondo); color: var(--ok-texto); }
.estado-cmd.mal { background: var(--mal-fondo); color: var(--mal-texto); }
.estado-cmd.mal .dot { background: var(--coral); }
.estado-cmd.espera { background: var(--oro-fondo); color: var(--oro); }
.estado-cmd.espera .dot { background: var(--oro); animation: latidoOro 1.4s ease-in-out infinite; }
@keyframes latidoOro { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 194, 75, .6); } 60% { box-shadow: 0 0 0 6px rgba(255, 194, 75, 0); } }

.nav-num.oro-num { background: var(--oro); color: #2A1C00; animation: latidoOro 1.6s ease-in-out infinite; }

.modal-chico { max-width: 420px; text-align: center; }
.modal-chico .modal-abajo { justify-content: center; }
.modal-chico h2 { margin: 12px 0 8px; font-size: 21px; }
.confirmar-ico { width: 64px; height: 64px; margin: 4px auto 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--oro-fondo); color: var(--oro); animation: girarAtras 3s linear infinite; }
.confirmar-ico svg { width: 30px; height: 30px; }

@media (max-width: 980px) { .remote { grid-template-columns: 1fr; } }
.tabla-hist { min-width: 0; }
.tabla-hist td { padding: 10px 8px; }
.estado-cmd { white-space: normal; }


/* el loro cambia de color con el tema */
.loro .l { stroke: var(--loro-linea); }
.loro .f { fill: var(--loro-ojo); }

/* botón de tema */
.tema-btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 38px; padding: 0 12px;
  background: var(--tarjeta); color: var(--texto);
  border: 2px solid var(--borde); border-radius: 999px;
  font: 600 13px 'Poppins', sans-serif; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.tema-btn:hover { border-color: var(--borde-fuerte); }
.tema-btn svg { width: 17px; height: 17px; transition: transform .5s cubic-bezier(.3, 1.4, .5, 1); }
.tema-btn:active svg { transform: rotate(180deg) scale(.8); }
.tema-btn .sol { display: none; color: var(--oro); }
.tema-btn .luna { color: var(--menta); }
:root[data-tema="claro"] .tema-btn .sol { display: block; }
:root[data-tema="claro"] .tema-btn .luna { display: none; }
.lateral .tema-btn { width: 100%; justify-content: center; }
.tema-auth { position: fixed; top: 18px; right: 18px; z-index: 30; }

/* transición suave al cambiar de tema */
.cambiando-tema, .cambiando-tema * { transition: background-color .35s, border-color .35s, color .35s, fill .35s, stroke .35s !important; }

/* detalles del tema claro */
:root[data-tema="claro"] body.con-lateral { background: linear-gradient(90deg, var(--fondo-barra) 248px, var(--borde) 248px 250px, var(--fondo) 250px); }
:root[data-tema="claro"] .oled-marco { background: #1B1F27; }
:root[data-tema="claro"] .barras div:hover { background: var(--menta-claro); }
:root[data-tema="claro"] .eq-ico svg { stroke: var(--menta); }
:root[data-tema="claro"] .radar .eq text { stroke: var(--tarjeta); }
@media (max-width: 860px) { :root[data-tema="claro"] body.con-lateral { background: var(--fondo); } }
@media (max-width: 860px) {
  .lateral > .tema-btn { display: none; }
  .lateral.abierto > .tema-btn { display: inline-flex; margin-top: 12px; }
}

/* ============ v3.1 · código de verificación animado ============ */
.sobre-anim { display: flex; justify-content: center; margin: -8px 0 6px; }
.sobre-svg { width: 132px; height: 99px; overflow: visible; }
.sobre-svg path, .sobre-svg rect { stroke-linejoin: round; stroke-linecap: round; }
.sobre-cuerpo { fill: var(--tarjeta-2, var(--campo)); stroke: var(--menta); stroke-width: 3.5; }
.sobre-lados { fill: none; stroke: var(--menta); stroke-width: 3; opacity: .55; }
/* la tapa de enfrente se dobla y la de atrás se levanta: así la carta puede salir por arriba */
.sobre-tapa { fill: var(--campo); stroke: var(--menta); stroke-width: 3.5;
  transform-box: view-box; transform-origin: 80px 56px; animation: tapaCierra .25s .45s ease-in both; }
.sobre-tapa-atras { fill: var(--campo); stroke: var(--menta); stroke-width: 3.5;
  transform-box: view-box; transform-origin: 80px 56px; animation: tapaAbre .3s .7s cubic-bezier(.3, 1.6, .5, 1) both; }
.sobre-carta { animation: cartaSube .7s .85s cubic-bezier(.3, 1.3, .5, 1) both, cartaFlota 3.2s 1.6s ease-in-out infinite; }
.sobre-carta rect { fill: var(--tarjeta); stroke: var(--borde-fuerte); stroke-width: 2.5; }
.sobre-carta path { stroke: var(--borde-fuerte); stroke-width: 3; }
.sobre-puntos circle { fill: var(--oro); transform-box: fill-box; transform-origin: center; animation: puntoSale .35s cubic-bezier(.3, 1.6, .5, 1) both; }
.sobre-puntos circle:nth-child(1) { animation-delay: 1.25s; } .sobre-puntos circle:nth-child(2) { animation-delay: 1.33s; }
.sobre-puntos circle:nth-child(3) { animation-delay: 1.41s; } .sobre-puntos circle:nth-child(4) { animation-delay: 1.49s; }
.sobre-puntos circle:nth-child(5) { animation-delay: 1.57s; } .sobre-puntos circle:nth-child(6) { animation-delay: 1.65s; }
.sobre-ondas circle { fill: none; stroke: var(--menta); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center;
  animation: ondaSobre 2.4s 1.7s ease-out infinite; }
.sobre-ondas circle:nth-child(2) { animation-delay: 2.5s; }
.sobre-svg { animation: sobreCae .5s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes sobreCae { from { opacity: 0; transform: translateY(-26px) rotate(-8deg); } }
@keyframes tapaCierra { to { transform: scaleY(0); } }
@keyframes tapaAbre { from { transform: scaleY(0); } }
@keyframes cartaSube { from { transform: translateY(22px); } }
@keyframes cartaFlota { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes puntoSale { from { transform: scale(0); } }
@keyframes ondaSobre { 0% { opacity: .7; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.9); } }

/* las 6 casillas: el campo real queda encima, invisible, para que pegar y el autollenado funcionen */
.otp-grupo { position: relative; display: block; }
.otp-cajas { display: none; }
.otp-grupo.con-cajas .otp-cajas { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp-grupo.con-cajas input.otp {
  position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%;
  opacity: 0; font-size: 16px; color: transparent; caret-color: transparent; cursor: text;
}
.otp-caja {
  position: relative; display: grid; place-items: center; height: 62px;
  background: var(--campo); border: 2px solid var(--borde); border-radius: 12px;
  font: 600 28px 'IBM Plex Mono', monospace; color: var(--texto);
  transition: border-color .15s, background .15s, transform .15s, box-shadow .15s;
}
.otp-caja b { font-weight: 600; }
.otp-caja::after {                          /* rayita de abajo */
  content: ""; position: absolute; left: 22%; right: 22%; bottom: 9px; height: 3px; border-radius: 3px;
  background: var(--borde); transition: background .2s, transform .2s;
}
.otp-caja.llena { border-color: var(--menta); background: var(--ok-fondo); box-shadow: 0 3px 0 var(--menta-osc); transform: translateY(-2px); }
.otp-caja.llena::after { background: var(--menta); transform: scaleX(.4); opacity: 0; }
.otp-caja.activa { border-color: var(--oro); box-shadow: 0 0 0 4px rgba(255, 194, 75, .18); }
.otp-caja.activa::before {                  /* cursor que parpadea */
  content: ""; width: 2px; height: 28px; background: var(--oro); border-radius: 2px; animation: titilar 1s steps(1) infinite;
}
.otp-caja.activa::after { background: var(--oro); }
.otp-caja.pop b { display: inline-block; animation: digitoPop .32s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes digitoPop { 0% { transform: translateY(10px) scale(.4); opacity: 0; } 100% { transform: none; opacity: 1; } }

.otp-grupo.completo .otp-caja { animation: ola .5s calc(var(--i) * 70ms) ease-in-out both; }
.otp-grupo.completo .otp-cajas { position: relative; }
.otp-grupo.completo .otp-cajas::after {    /* barrido de radar sobre las casillas */
  content: ""; position: absolute; top: -4px; bottom: -4px; width: 36%; left: -40%; border-radius: 12px;
  background: linear-gradient(90deg, transparent, rgba(0, 216, 160, .35), transparent);
  animation: barridoOtp .8s .1s ease-in-out infinite;
}
@keyframes ola { 40% { transform: translateY(-9px); } 100% { transform: translateY(-2px); } }
@keyframes barridoOtp { to { left: 104%; } }

.otp-grupo.error .otp-cajas { animation: sacudir .5s cubic-bezier(.36, .07, .19, .97); }
.otp-grupo.error .otp-caja { border-color: var(--coral); background: var(--mal-fondo); box-shadow: none; transform: none; }
@keyframes sacudir { 15%, 85% { transform: translateX(-3px); } 30%, 70% { transform: translateX(7px); } 45%, 55% { transform: translateX(-9px); } 50% { transform: translateX(9px); } }

.otp-grupo.vencido .otp-caja { opacity: .45; border-style: dashed; transform: none; box-shadow: none; background: var(--campo); }

/* cuenta regresiva */
.otp-tiempo { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: -4px;
  font: 500 13px 'IBM Plex Mono', monospace; color: var(--gris); }
.otp-tiempo svg { width: 22px; height: 22px; transform: rotate(-90deg); }
.otp-tiempo .anillo-fondo { fill: none; stroke: var(--borde); stroke-width: 4; }
.otp-tiempo .anillo { fill: none; stroke: var(--menta); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke .3s; }
.otp-tiempo.poco { color: var(--coral-texto); }
.otp-tiempo.poco .anillo { stroke: var(--coral); }
.otp-tiempo.poco svg { animation: latidoReloj 1s ease-in-out infinite; }
.otp-tiempo.fin { color: var(--coral-texto); font-weight: 600; }
@keyframes latidoReloj { 50% { transform: rotate(-90deg) scale(1.15); } }

/* botón con ruedita */
.btn-entrar .btn-giro { display: none; width: 16px; height: 16px; border-radius: 50%;
  border: 2.5px solid rgba(4, 38, 29, .3); border-top-color: #04261D; animation: girar .7s linear infinite; }
.btn-entrar.cargando .btn-giro { display: inline-block; }
.link:disabled { color: var(--gris-2, var(--gris)); cursor: default; text-decoration: none; }
.link.llamar { animation: llamar 1.2s ease-in-out infinite; }
@keyframes llamar { 50% { transform: scale(1.07); color: var(--oro); } }
.link.enviando { opacity: .7; }

/* ============ v3.1 · consola remota de switches ============ */
.eq-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.eq-acciones { display: inline-flex; gap: 8px; }
.eq-acciones svg, .fila-switch .btn svg, .remote-ssh .btn-borde svg { flex: none; }

.remote-switches, .remote-ssh { display: flex; flex-direction: column; gap: 16px; }
/* el historial va a la derecha; lo nuevo se acomoda debajo del botón de reinicio */
.remote { grid-auto-flow: row dense; }
.remote > :nth-child(1), .remote > .remote-switches, .remote > .remote-ssh { grid-column: 1; }
.remote > :nth-child(2) { grid-column: 2; grid-row: 1 / span 3; }
.remote #historial { max-height: 640px; overflow: auto; }
.remote-ssh .btn-borde { align-self: flex-start; }
.lista-switches { display: flex; flex-direction: column; gap: 10px; }
.fila-switch { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 2px solid var(--borde); border-radius: 12px;
  background: var(--tarjeta-2); animation: filaEntra .35s calc(var(--i) * 60ms) ease-out both; }
.fila-switch .eq-name { flex: 1; min-width: 0; }
.fila-switch .eq-name b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.modal-consola { max-width: 760px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 32px); }
.modal-consola .modal-arriba { margin-bottom: 0; align-items: flex-start; }
.consola-rapidas { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-orden { border: 2px solid var(--borde); background: var(--tarjeta-2); color: var(--texto); border-radius: 999px;
  padding: 6px 12px; font: 600 13px 'Poppins', sans-serif; cursor: pointer; transition: border-color .15s, transform .12s, background .15s; }
.chip-orden:hover:not(:disabled) { border-color: var(--menta); transform: translateY(-2px); }
.chip-orden:active:not(:disabled) { transform: translateY(1px); }
.chip-orden:disabled { opacity: .5; cursor: wait; }
.chip-orden:focus-visible { outline: 3px solid var(--oro); outline-offset: 2px; }

/* la terminal siempre es oscura, como una pantalla de verdad */
.terminal { position: relative; height: min(46vh, 380px); overflow: auto; padding: 14px 16px;
  background: #08111F; border: 2px solid #22365A; border-radius: 12px;
  font: 13px/1.5 'IBM Plex Mono', monospace; color: #CFE0F2; white-space: pre; tab-size: 8; }
.terminal::before { content: ""; position: sticky; top: -14px; display: block; height: 0; }
.modal-consola.trabajando .terminal { border-color: #00D8A0; box-shadow: 0 0 0 4px rgba(0, 216, 160, .12); }
.t-linea { min-height: 1.5em; }
.t-sistema { color: #61779A; white-space: pre-wrap; }
.t-orden { margin-top: 10px; color: #FFFFFF; }
.t-prompt { color: #00D8A0; font-weight: 500; }
.t-tecleo::after { content: "▌"; color: #00D8A0; animation: titilar .8s steps(1) infinite; }
.t-orden:not(:last-child) .t-tecleo::after { content: none; }
.t-salida { color: #CFE0F2; }
.aparece-l { animation: lineaSale .25s ease-out both; }
@keyframes lineaSale { from { opacity: 0; transform: translateY(4px); } }
.t-espera { color: #FFC24B; white-space: pre-wrap; }
.t-espera::after { content: ""; display: inline-block; width: 1.4em; text-align: left; animation: puntitos 1.2s steps(4) infinite; }
@keyframes puntitos { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.t-ok { color: #5CF0C6; margin-top: 4px; animation: lineaSale .3s ease-out both; }
.t-mal { color: #FF9A8F; margin-top: 4px; white-space: pre-wrap; animation: sacudir .45s; }

.consola-linea { display: flex; align-items: center; gap: 8px; background: var(--campo); border: 2px solid var(--borde);
  border-radius: 12px; padding: 4px 4px 4px 12px; transition: border-color .15s; }
.consola-linea:focus-within { border-color: var(--menta); }
.consola-prompt { flex: none; font-size: 13px; color: var(--menta); white-space: nowrap; }
.consola-linea input { flex: 1; min-width: 0; min-height: 38px; border: 0; padding: 0 4px; background: transparent; font-size: 14px; }
.consola-puerto summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--gris); }
.consola-puerto summary:hover { color: var(--texto); }
.consola-puerto-fila { display: flex; gap: 8px; margin: 10px 0 6px; flex-wrap: wrap; }
.consola-puerto-fila select { flex: 1; min-width: 160px; min-height: 40px; width: auto; }
#conPuertoBtn.seguro { border-color: var(--coral); color: var(--coral-texto); animation: latidoCoral 1s ease-in-out infinite; }
.consola-nota { margin: 0; }

/* ventana de SSH: el teléfono y el nodo unidos por un túnel cifrado */
.ssh-anim { display: flex; align-items: center; justify-content: center; gap: 0; margin: 4px 0 14px; }
.ssh-nodo { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 14px; background: var(--ico-fondo);
  color: var(--menta); border: 2px solid var(--borde-fuerte); position: relative; z-index: 1; }
.ssh-tubo { position: relative; width: 120px; height: 14px; margin: 0 -2px; border-radius: 8px; background: var(--tarjeta-2);
  border: 2px solid var(--borde); overflow: visible; }
.ssh-tubo i { position: absolute; top: 2px; left: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--menta);
  animation: paquete 1.8s linear infinite; }
.ssh-tubo i:nth-child(2) { animation-delay: .6s; } .ssh-tubo i:nth-child(3) { animation-delay: 1.2s; }
.ssh-tubo b { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%; background: var(--oro-fondo); color: var(--oro); border: 2px solid var(--oro);
  animation: latidoOro 2s ease-in-out infinite; }
.ssh-tubo b svg { width: 16px; height: 16px; }
@keyframes paquete { 0% { left: 0; opacity: 0; } 10%, 90% { opacity: 1; } 100% { left: calc(100% - 6px); opacity: 0; } }
.ssh-pasos { text-align: left; margin: 12px 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.ssh-pasos code, .ssh-cmd { font-family: 'IBM Plex Mono', monospace; }
.ssh-pasos code { background: var(--tarjeta-2); padding: 1px 6px; border-radius: 6px; }
.ssh-cmd { display: block; padding: 12px; border-radius: 10px; background: #08111F; color: #5CF0C6; font-size: 14px;
  border: 2px solid #22365A; word-break: break-all; user-select: all; }
#sshModal .modal-abajo { justify-content: center; flex-wrap: wrap; }
#sshCerrar { margin-top: 6px; }
#sshModal .modal-abajo + p { margin-top: 14px; }

@media (max-width: 980px) {
  .remote > :nth-child(n) { grid-column: 1; grid-row: auto; }
}
@media (max-width: 860px) {
  .terminal { height: 42vh; font-size: 12px; }
  .consola-prompt span { display: none; }
}

/* ============ v3.2 · nodo en vivo + red ============ */
.pill.lento { background: var(--oro-fondo); color: var(--oro-osc); }
:root[data-tema="oscuro"] .pill.lento, :root:not([data-tema]) .pill.lento { color: var(--oro); }
.dot.lento { background: var(--oro); animation: titilar 1.2s ease-in-out infinite; }

.nodo-red { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }
.nodo-red-arriba { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.nodo-red-titulo { display: flex; align-items: center; gap: 12px; }
.nodo-red-titulo h2 { font-size: 18px; margin: 0; }
.nodo-latido { position: relative; width: 14px; height: 14px; border-radius: 50%; background: var(--gris-2); flex: none; }
.nodo-latido.vivo { background: var(--menta); }
.nodo-latido.vivo::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--menta); animation: halo 1.8s ease-out infinite; }
.nodo-latido.lento { background: var(--oro); }
.nodo-latido.caido { background: var(--coral); }
#nrBuscar svg { flex: none; }
#nrBuscar.girando svg { animation: titilar 1s ease-in-out infinite; }

.nr-interfaces { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.nr-if { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--borde);
  background: var(--tarjeta-2); animation: filaEntra .35s calc(var(--i) * 70ms) ease-out both; }
.nr-if.salida { border-color: var(--menta); box-shadow: 0 3px 0 var(--menta-osc); }
.nr-if.mal { opacity: .8; }
.nr-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--ico-fondo); color: var(--menta); flex: none; }
.nr-if.mal .nr-ico { color: var(--gris-2); }
.nr-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.nr-txt b { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nr-detalle { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.nr-if.mal .nr-detalle { color: var(--coral-texto); }
.sello-salida { font: 600 11px 'Poppins', sans-serif; background: var(--ok-fondo); color: var(--ok-texto); border-radius: 6px; padding: 2px 7px; }
.nr-guardadas { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nr-guardadas:empty { display: none; }
.chip-red { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--tarjeta-2); border: 1px solid var(--borde); }

.barras-senal { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.barras-senal i { width: 4px; border-radius: 1px; background: var(--borde-fuerte); }
.barras-senal i:nth-child(1) { height: 25%; } .barras-senal i:nth-child(2) { height: 50%; }
.barras-senal i:nth-child(3) { height: 75%; } .barras-senal i:nth-child(4) { height: 100%; }
.barras-senal.n1 i:nth-child(-n+1), .barras-senal.n2 i:nth-child(-n+2) { background: var(--oro); }
.barras-senal.n3 i:nth-child(-n+3), .barras-senal.n4 i:nth-child(-n+4) { background: var(--menta); }
.barras-senal i { animation: crecer .4s ease-out both; transform-origin: bottom; }
.barras-senal i:nth-child(2) { animation-delay: .06s; } .barras-senal i:nth-child(3) { animation-delay: .12s; } .barras-senal i:nth-child(4) { animation-delay: .18s; }

.nr-escaneo { border-top: 2px dashed var(--borde); padding-top: 12px; }
.nr-escaneo-arriba { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.nr-buscando { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--gris); }
.radar-mini { position: relative; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--menta); overflow: hidden; }
.radar-mini::after { content: ""; position: absolute; left: 50%; top: 50%; width: 50%; height: 50%; transform-origin: 0 0;
  background: linear-gradient(90deg, rgba(0, 216, 160, .7), transparent); animation: girar 1.2s linear infinite; }
.nr-lista { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow: auto; }
.nr-red { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 10px; background: var(--tarjeta-2); animation: filaEntra .3s calc(var(--i) * 40ms) ease-out both; }
.nr-red b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nr-red svg { color: var(--gris); }
.confirmar-ico.menta { color: var(--menta); }
.confirmar-ico.menta { background: var(--ok-fondo); animation: none; }

/* ============ v3.2.2 · guardián del local (reemplaza la pantallita OLED) ============ */
.guardia { --g-color: var(--menta); --g-suave: rgba(0, 216, 160, .24); display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.guardia[data-modo="alerta"] { --g-color: var(--naranja); --g-suave: rgba(255, 159, 67, .3); border-color: var(--naranja); }
.guardia[data-modo="oro"] { --g-color: var(--oro); --g-suave: rgba(255, 194, 75, .28); }
.guardia[data-modo="dormido"] { --g-color: var(--gris-2); --g-suave: transparent; }
.guardia .card-titulo { margin-bottom: 0; }

.guardia-etq { display: inline-flex; align-items: center; gap: 6px; color: var(--g-color); transition: color .3s; }
.guardia-etq .dot { width: 7px; height: 7px; background: var(--g-color); animation: latido 1.6s ease-in-out infinite; }
.guardia[data-modo="dormido"] .guardia-etq .dot { animation: none; }

.guardia-escena {
  position: relative; height: 214px; margin: 0 -20px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 52%, var(--tarjeta-2) 0, transparent 68%);
}
.guardia-radar { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.guardia-radar::before, .guardia-radar::after { content: ""; position: absolute; border-radius: 50%; border: 2px dashed var(--borde); }
.guardia-radar::before { width: 196px; height: 196px; }
.guardia-radar::after { width: 150px; height: 150px; border-style: solid; border-width: 1px; }
.guardia-radar span {
  position: absolute; width: 118px; height: 118px; border-radius: 50%;
  border: 2px solid var(--g-color); opacity: 0; animation: gOnda 3.6s ease-out infinite;
}
.guardia-radar span:nth-child(2) { animation-delay: 1.2s; }
.guardia-radar span:nth-child(3) { animation-delay: 2.4s; }
.guardia[data-modo="alerta"] .guardia-radar span { animation-duration: 1.5s; }
.guardia[data-modo="alerta"] .guardia-radar span:nth-child(2) { animation-delay: .5s; }
.guardia[data-modo="alerta"] .guardia-radar span:nth-child(3) { animation-delay: 1s; }
.guardia[data-modo="dormido"] .guardia-radar span { animation: none; }
@keyframes gOnda { 0% { transform: scale(.8); opacity: .75; } 100% { transform: scale(1.75); opacity: 0; } }

.guardia-barrido {
  position: absolute; width: 196px; height: 196px; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--g-suave) 0deg, transparent 75deg, transparent 360deg);
  -webkit-mask: radial-gradient(circle, transparent 0 58px, #000 59px);
  mask: radial-gradient(circle, transparent 0 58px, #000 59px);
  animation: girar 5s linear infinite;
}
.guardia[data-modo="alerta"] .guardia-barrido { animation-duration: 2s; }

.guardia-loro { position: relative; z-index: 1; line-height: 0; animation: flotar 3.6s ease-in-out infinite; filter: drop-shadow(0 6px 0 var(--sombra-c)); transition: opacity .4s, filter .4s; }
.guardia-loro .loro .barrido { transform-box: view-box; transform-origin: 56px 54px; animation: girar 4.5s linear infinite; }
.guardia-loro .loro .ojo { transform-box: view-box; transform-origin: 56px 54px; animation: parpadeo 6s ease-in-out infinite; }
.guardia[data-modo="alerta"] .guardia-loro { animation: gAlerta .9s ease-in-out infinite; }
.guardia[data-modo="alerta"] .guardia-loro .loro .barrido { animation-duration: 1.2s; }
.guardia[data-modo="oro"] .guardia-loro .loro .barrido { animation-duration: 2s; }
.guardia[data-modo="dormido"] .guardia-loro { animation: gDormir 4.5s ease-in-out infinite; opacity: .6; filter: grayscale(.7) drop-shadow(0 6px 0 var(--sombra-c)); }
.guardia[data-modo="dormido"] .guardia-loro .loro .barrido { animation-play-state: paused; opacity: .35; }
.guardia[data-modo="dormido"] .guardia-loro .loro .ojo { animation: none; transform: scaleY(.12); }
@keyframes gAlerta { 0%, 100% { transform: translateY(0) rotate(0); } 20% { transform: translateY(-10px) rotate(-6deg); } 40% { transform: translateY(0) rotate(5deg); } 60% { transform: translateY(-5px) rotate(-3deg); } }
@keyframes gDormir { 0%, 100% { transform: rotate(-9deg) translateY(2px); } 50% { transform: rotate(-6deg) translateY(5px); } }

.guardia-zz { position: absolute; z-index: 2; left: calc(50% + 40px); top: 34px; display: none; }
.guardia-zz i { position: absolute; font: 700 17px 'Poppins', sans-serif; font-style: normal; color: var(--gris); opacity: 0; animation: gZ 3s ease-out infinite; }
.guardia-zz i:nth-child(2) { animation-delay: 1s; font-size: 14px; }
.guardia-zz i:nth-child(3) { animation-delay: 2s; font-size: 11px; }
.guardia[data-modo="dormido"] .guardia-zz { display: block; }
@keyframes gZ { 0% { opacity: 0; transform: translate(0, 8px) scale(.6); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(18px, -26px) scale(1.15); } }

.guardia-alerta {
  position: absolute; z-index: 2; left: calc(50% + 44px); top: 30px; display: none;
  width: 30px; height: 30px; border-radius: 50%; place-items: center;
  background: var(--naranja); color: #2A1200; font: 800 18px 'Poppins', sans-serif;
  box-shadow: 0 3px 0 var(--sombra-c); animation: gPop .9s cubic-bezier(.3, 1.6, .5, 1) infinite alternate;
}
.guardia[data-modo="alerta"] .guardia-alerta { display: grid; }
@keyframes gPop { from { transform: scale(.85) rotate(-8deg); } to { transform: scale(1.08) rotate(6deg); } }

.guardia-globo {
  position: relative; text-align: center;
  background: var(--tarjeta-2); border: 2px solid var(--borde); border-radius: 16px;
  padding: 12px 18px 14px; transition: border-color .3s;
}
.guardia-globo::before {
  content: ""; position: absolute; top: -10px; left: 50%; margin-left: -9px;
  width: 16px; height: 16px; background: var(--tarjeta-2);
  border-left: 2px solid var(--borde); border-top: 2px solid var(--borde); transform: rotate(45deg);
  transition: border-color .3s;
}
.guardia[data-modo="alerta"] .guardia-globo, .guardia[data-modo="alerta"] .guardia-globo::before { border-color: var(--naranja); }
.guardia[data-modo="oro"] .guardia-globo, .guardia[data-modo="oro"] .guardia-globo::before { border-color: var(--oro-osc); }
.guardia-globo .globo-quien { display: block; margin-bottom: 2px; color: var(--g-color); }
.guardia[data-modo="dormido"] .guardia-globo .globo-quien { color: var(--gris); }
.guardia-frase { font-size: 17px; }

.guardia-datos { display: flex; flex-direction: column; gap: 6px; }
.guardia-dato {
  display: flex; align-items: center; gap: 12px; min-width: 0; padding: 8px 12px 8px 8px;
  background: var(--tarjeta-2); border: 2px solid transparent; border-radius: 12px;
  transition: border-color .3s, background .3s;
}
.gd-ico { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--ico-fondo); color: var(--gris-2); transition: background .3s, color .3s; }
.gd-ico svg { width: 17px; height: 17px; }
.gd-txt { flex: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; }
.gd-txt small { font: 700 13px 'Nunito', sans-serif; color: var(--gris); white-space: nowrap; }
.gd-txt b { font: 600 14px 'Poppins', sans-serif; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guardia-dato[data-est="ok"] .gd-ico { background: var(--ok-fondo); color: var(--menta); }
.guardia-dato[data-est="alerta"] { border-color: var(--naranja); background: var(--naranja-fondo); }
.guardia-dato[data-est="alerta"] .gd-ico { background: var(--naranja); color: #2A1200; animation: latidoOro 1.4s ease-in-out infinite; }
.guardia-dato[data-est="alerta"] b { color: var(--naranja-texto); }
.guardia-dato[data-est="oro"] { border-color: var(--oro-osc); }
.guardia-dato[data-est="oro"] .gd-ico { background: var(--oro-fondo); color: var(--oro); }
.guardia-dato[data-est="oro"] .gd-ico svg { animation: girarAtras 1.2s linear infinite; }
.guardia-dato[data-est="lento"] .gd-ico { background: var(--oro-fondo); color: var(--oro-osc); }
.guardia-dato[data-est="off"] b { color: var(--gris); }
