/* ============================================================
   NOC · Monitor de Ping — sistema de diseño
   Paleta funcional (señal semaforo) sobre fondo de sala de
   operaciones. Tipografia: Futura -- con Jost (Google Fonts)
   como respaldo libre para quien no tenga Futura instalada
   localmente, ya que es una fuente comercial sin licencia
   gratuita disponible -- para interfaz/texto general, +
   IBM Plex Mono (datos, IPs, timestamps, tablas) para mantener
   alineacion en columnas tabulares.
   ============================================================ */

:root {
  --bg-void:      #211a4d;
  --bg-grid:      #251d54;
  --panel:        #12161d;
  --panel-raised: #171c25;
  --line:         #1f2733;
  --line-soft:    #171d27;

  --text-primary: #d7dee7;
  --text-muted:   #6b7787;
  --text-dim:     #465065;

  --ok:        #34d399;
  --ok-dim:    #1a3f34;
  --warn:      #f0a93e;
  --warn-dim:  #4a3319;
  --down:      #f0454a;
  --down-dim:  #4a1a1c;
  --pulse:     #4fc3f7;
  --brand-glow: #ef9f27;
  --brand-gradient: linear-gradient(135deg, #ffc738, #ef9f27);

  --font-display: 'Futura', 'Jost', -apple-system, BlinkMacSystemFont, 'Century Gothic', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --radius: 3px;
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-display);
  min-height: 100vh;
}

body {
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: -1px -1px;
}

/* ---------------- topbar ---------------- */

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
}

.topbar__left {
  grid-column: 1;
  align-self: center;
  display: flex;
  align-items: center;
}

@font-face {
  font-family: 'Futura Heavy';
  src: url('/static/fonts/Futura-Heavy.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

.eyebrow {
  font-family: 'Futura Heavy', var(--font-display), sans-serif;
  font-size: 13px;
  letter-spacing: 0.12em;
  background: linear-gradient(90deg, #ffcd1e 0%, #eb6e0a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-transform: uppercase;
}

.topbar__id {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 4px;
}

.topbar__logo {
  height: 168px;
  width: auto;
  flex-shrink: 0;
}

.topbar__id h1 {
  margin: 0;
  font-family: 'Futura Heavy', var(--font-display), sans-serif;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.01em;
  background: linear-gradient(90deg, #ffcd1e 0%, #eb6e0a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.topbar__right {
  grid-column: 3;
  justify-self: end;
  align-self: center;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.live-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  border: 1px solid var(--line);
  background: var(--panel);
  width: 90px;
  height: 32px;
  box-sizing: border-box;
  padding: 2px 6px;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.live-indicator__fila {
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-gradient);
  box-shadow: 0 0 0 0 rgba(239, 159, 39, 0.6);
  animation: heartbeat 3s ease-out infinite;
}

@keyframes heartbeat {
  0%   { box-shadow: 0 0 0 0 rgba(239, 159, 39, 0.55); }
  15%  { box-shadow: 0 0 0 6px rgba(239, 159, 39, 0); }
  100% { box-shadow: 0 0 0 6px rgba(239, 159, 39, 0); }
}

.live-label { letter-spacing: 0.08em; color: var(--brand-glow); }
.live-clock { color: var(--text-primary); font-weight: 500; }

.summary-pills { display: flex; flex-direction: row; align-items: center; gap: 8px; }

.pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 32px;
  padding: 2px 6px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  box-sizing: border-box;
  flex-shrink: 0;
}

.pill__value { font-family: var(--font-mono); font-size: 13px; font-weight: 600; line-height: 1.1; }
.pill__label { font-size: 8px; letter-spacing: 0.06em; color: var(--text-muted); margin-top: 1px; text-align: center; }

.pill--ok .pill__value   { color: var(--ok); }
.pill--down .pill__value { color: var(--down); }
.pill--vpn .pill__value  { color: var(--warn); }

/* ---------------- layout general (sidebar + contenido) ---------------- */

html, body {
  height: 100%;
}

.app-shell {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto 1fr;
  grid-template-areas: "header" "nav" "body";
  min-height: 100vh;
}

.app-shell > .topbar { grid-area: header; }
.app-shell > .sidebar { grid-area: nav; }
.app-shell > .app-body { grid-area: body; }

.app-shell--vertical {
  grid-template-columns: 190px 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "header header"
    "nav    body";
}

.app-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.sidebar {
  width: 100%;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
  padding: 14px 24px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  max-height: 220px;
  overflow-y: auto;
  transition: max-height 0.2s ease, padding 0.2s ease, border-color 0.2s ease;
}

.app-shell--vertical .sidebar {
  grid-template-columns: 1fr;
  grid-auto-rows: min-content;
  max-height: none;
  height: 100%;
  border-bottom: none;
  border-right: 1px solid var(--line);
  padding: 16px 10px;
  align-content: start;
}

.sidebar-toggle {
  appearance: none;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  box-sizing: border-box;
  padding: 0;
  border-radius: var(--radius);
  flex-shrink: 0;
  font-size: 16px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sidebar-toggle:hover { background: rgba(255, 255, 255, 0.1); color: var(--text-primary); }

.app-shell--sidebar-oculto .sidebar { display: none; }
.app-shell--vertical.app-shell--sidebar-oculto { grid-template-columns: 0 1fr; }

/* Cuando el menu esta oculto, el boton hamburguesa se resalta en color
   marca para que quede claro que hay que tocarlo para volver a mostrarlo */
.app-shell--sidebar-oculto .sidebar-toggle {
  background: rgba(239, 159, 39, 0.16);
  border-color: var(--brand-glow, #ef9f27);
  color: var(--brand-glow, #ef9f27);
}

.nav-item[hidden] {
  display: none;
}

.nav-item {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #232b3a, var(--panel));
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: center;
  padding: 10px 4px 8px;
  line-height: 1.2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  width: 100%;
  position: relative;
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.6),
    0 4px 8px rgba(0, 0, 0, 0.5);
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.app-shell--vertical .nav-item {
  flex-direction: row;
  justify-content: flex-start;
  text-align: left;
  padding: 10px 10px;
  gap: 10px;
}

.app-shell--vertical .nav-item__label {
  font-size: 10px;
}

.nav-item:hover {
  color: var(--text-primary);
  border-color: var(--text-dim);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.65),
    0 8px 14px rgba(0, 0, 0, 0.55);
}

.app-shell--vertical .nav-item:hover {
  transform: translateX(2px);
}

.nav-item--active {
  color: var(--text-primary);
  background: linear-gradient(180deg, var(--panel), #232b3a);
  border-color: var(--pulse);
  transform: translateY(0);
  box-shadow:
    inset 0 2px 0 0 rgba(0, 0, 0, 0.7),
    inset 0 -1px 0 0 rgba(255, 255, 255, 0.1);
}

.nav-item--active:hover {
  transform: translateY(0);
  box-shadow:
    inset 0 2px 0 0 rgba(0, 0, 0, 0.7),
    inset 0 -1px 0 0 rgba(255, 255, 255, 0.1);
}

.app-shell--vertical .nav-item--active:hover {
  transform: translateX(0);
}

.nav-item__icon {
  font-size: 18px;
  color: inherit;
  line-height: 1;
}

.nav-item__label {
  color: #ffffff;
}

.nav-item--active .nav-item__label {
  color: #ffffff;
  font-weight: 700;
}

.nav-item__dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
  opacity: 0.35;
  flex-shrink: 0;
}

.nav-item--incident-critico { color: var(--down); border-color: var(--down-dim); }
.nav-item--incident-critico .nav-item__dot { background: var(--down); opacity: 1; }
.nav-item--incident-critico.nav-item--active { border-color: var(--down); }

.nav-item--incident-advertencia { color: var(--warn); border-color: var(--warn-dim); }
.nav-item--incident-advertencia .nav-item__dot { background: var(--warn); opacity: 1; }
.nav-item--incident-advertencia.nav-item--active { border-color: var(--warn); }

.main-content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
}

.tab-panel { display: none; }
.tab-panel--active { display: block; }

/* ---------------- administracion: usuarios y roles ---------------- */

.admin-btn {
  appearance: none;
  border: none;
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.admin-btn--nuevo {
  background: #352b7b;
  color: #ffffff;
  margin-bottom: 14px;
}
.admin-btn--nuevo:hover { filter: brightness(1.15); }

.admin-btn--guardar { background: #22c55e; color: #ffffff; }
.admin-btn--cancelar { background: rgba(255, 255, 255, 0.12); color: #ffffff; }
.admin-btn--peligro { background: #ef4444; color: #ffffff; }
.admin-btn--secundario { background: #f5f4fa; color: #352b7b; }

.admin-tabla-wrap {
  background: #ffffff;
  border-radius: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 340px;
}

.admin-tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-tabla th {
  text-align: left;
  background: #352b7b;
  color: #ffffff;
  padding: 10px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 1;
}

.admin-tabla td {
  padding: 10px 14px;
  border-bottom: 1px solid #eeecf6;
  color: #1e1b3a;
}

.admin-tabla tr:last-child td { border-bottom: none; }
.admin-tabla tr:nth-child(even) { background: #f8f7fc; }

.admin-tabla__acciones {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-tabla__accion-btn {
  appearance: none;
  border: 1px solid #e4e2ee;
  background: #ffffff;
  color: #352b7b;
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 5px;
  cursor: pointer;
}
.admin-tabla__accion-btn:hover { background: #f5f4fa; }
.admin-tabla__accion-btn--peligro { color: #dc2626; border-color: #fca5a5; }

/* ---------------- interruptor maestro de envio de correo ---------------- */

.envio-incidencias-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 14px;
}

.envio-incidencias-switch__titulo {
  font-family: var(--font-mono);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-primary);
}

.envio-incidencias-switch__detalle {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 3px;
}

.envio-incidencias-switch__btn {
  appearance: none;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.envio-incidencias-switch__btn--on {
  background: var(--ok);
  color: #0b2e22;
}

.envio-incidencias-switch__btn--off {
  background: var(--down);
  color: #ffffff;
}

.envio-correos-subseccion {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.envio-correos-subseccion:first-of-type {
  margin-top: 0;
}

.envio-correos-subseccion__titulo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.envio-correos-subseccion__titulo i {
  color: var(--pulse);
  font-size: 16px;
}

/* ---------------- Administracion: cajas colapsables (estilo tile) ---------------- */

.admin-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  align-items: start;
}

.admin-collapsible {
  background: transparent;
}

.admin-collapsible--abierto {
  grid-column: 1 / -1;
}

.admin-collapsible__header {
  appearance: none;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #232b3a, var(--panel));
  color: var(--text-muted);
  font-family: var(--font-mono);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 22px 12px 18px;
  cursor: pointer;
  position: relative;
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.6),
    0 4px 8px rgba(0, 0, 0, 0.5);
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.admin-collapsible__header:hover {
  color: var(--text-primary);
  border-color: var(--text-dim);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.65),
    0 8px 14px rgba(0, 0, 0, 0.55);
}

.admin-collapsible--abierto .admin-collapsible__header {
  color: var(--text-primary);
  background: linear-gradient(180deg, var(--panel), #232b3a);
  border-color: var(--pulse);
  transform: translateY(0);
  box-shadow:
    inset 0 2px 0 0 rgba(0, 0, 0, 0.7),
    inset 0 -1px 0 0 rgba(255, 255, 255, 0.1);
}

.admin-collapsible--abierto .admin-collapsible__header:hover {
  transform: translateY(0);
  box-shadow:
    inset 0 2px 0 0 rgba(0, 0, 0, 0.7),
    inset 0 -1px 0 0 rgba(255, 255, 255, 0.1);
}

.admin-collapsible__icon {
  font-size: 26px;
  color: inherit;
  line-height: 1;
}

.admin-collapsible--abierto .admin-collapsible__icon {
  color: var(--pulse);
}

.admin-collapsible__title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.25;
}

.admin-collapsible__count {
  font-size: 10px;
  color: var(--text-dim);
}

.admin-collapsible__body {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  margin-top: 10px;
}

@media (max-width: 780px) {
  .admin-cards-grid { grid-template-columns: repeat(3, 1fr); }
}

.admin-roles-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.admin-rol-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 16px 18px;
  min-width: 240px;
  flex: 1 1 260px;
  max-width: 320px;
}

.admin-rol-card__nombre {
  font-size: 15px;
  font-weight: 700;
  color: #1e1b3a;
  margin-bottom: 8px;
}

.admin-rol-card__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 12px;
}

.admin-rol-card__tab-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  background: #f5f4fa;
  color: #352b7b;
  padding: 3px 8px;
  border-radius: 4px;
}

.admin-acceso-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
}
.admin-acceso-badge--ok { background: #dcfce7; color: #16a34a; }
.admin-acceso-badge--fallido { background: #fee2e2; color: #dc2626; }

.admin-silencio-fila--vencido,
.admin-fila--inactiva {
  opacity: 0.5;
}

/* ---------------- modal generico de administracion ---------------- */

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-modal[hidden] { display: none; }

.admin-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 13, 18, 0.7);
}

.admin-modal__box {
  position: relative;
  width: min(480px, 92vw);
  max-height: 86vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.admin-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
}

.admin-modal__close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}

.admin-modal__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.admin-modal__label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  margin-top: 14px;
  display: block;
}
.admin-modal__label:first-child { margin-top: 0; }

.admin-modal__input, .admin-modal__select {
  background: var(--bg-grid);
  border: 1px solid var(--line);
  color: var(--text-primary);
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
  display: block;
}

.admin-modal__checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.admin-modal__check-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-primary);
}

.admin-modal__error {
  color: #f0454a;
  font-size: 12.5px;
  padding: 0 20px 12px;
}

.admin-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}

/* ---------------- banner de alarma critica sin reconocer ---------------- */

.alarma-critica-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 300;
  background: var(--down);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  animation: alarma-critica-parpadeo 1s ease-in-out infinite;
}

.alarma-critica-banner[hidden] { display: none; }

@keyframes alarma-critica-parpadeo {
  0%, 100% { background: var(--down); }
  50% { background: #8f1c20; }
}

.alarma-critica-banner__icono {
  font-size: 20px;
  flex-shrink: 0;
}

.alarma-critica-banner__texto {
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.alarma-critica-banner__btn {
  appearance: none;
  background: #ffffff;
  color: #8f1c20;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.alarma-critica-banner__btn:hover {
  background: #ffe4e4;
}

body.tiene-alarma-banner {
  padding-top: 46px;
}

.correo-pendiente-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 290;
  background: var(--warn);
  color: #1e1b3a;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.correo-pendiente-banner[hidden] { display: none; }

body.tiene-alarma-banner.tiene-correo-pendiente-banner {
  padding-top: 92px;
}

body.tiene-correo-pendiente-banner:not(.tiene-alarma-banner) {
  padding-top: 46px;
}

.correo-pendiente-banner__icono {
  font-size: 18px;
  flex-shrink: 0;
}

.correo-pendiente-banner__texto {
  font-family: var(--font-mono);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.correo-pendiente-banner__btn {
  appearance: none;
  background: #1e1b3a;
  color: var(--warn);
  border: none;
  border-radius: 8px;
  padding: 6px 16px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.correo-pendiente-banner__btn:hover {
  background: #2a2650;
}

.correo-pendiente-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(10, 8, 20, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

.correo-pendiente-modal[hidden] { display: none; }

.correo-pendiente-modal__caja {
  background: #1e1b3a;
  border: 1px solid var(--warn);
  border-radius: 16px;
  max-width: 640px;
  width: 100%;
  padding: 32px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.correo-pendiente-modal__icono {
  font-size: 48px;
  color: var(--warn);
}

.correo-pendiente-modal__titulo {
  font-family: var(--font-mono);
  font-size: 20px;
  color: #ffffff;
  margin: 14px 0 20px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.correo-pendiente-modal__lista {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.correo-pendiente-item {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 16px 18px;
}

.correo-pendiente-item__asunto {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--warn);
  font-weight: 700;
  margin-bottom: 8px;
}

.correo-pendiente-item__cuerpo {
  font-size: 13px;
  color: #d7dee7;
  white-space: pre-wrap;
  max-height: 160px;
  overflow-y: auto;
  margin-bottom: 12px;
  line-height: 1.5;
}

.correo-pendiente-item__tiempo {
  font-size: 11.5px;
  color: #8b86a0;
  margin-bottom: 10px;
}

.correo-pendiente-item__aprobar-btn {
  appearance: none;
  background: var(--warn);
  color: #1e1b3a;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}

.correo-pendiente-item__aprobar-btn:hover {
  filter: brightness(1.1);
}

.correo-pendiente-modal__nota {
  font-size: 12px;
  color: #8b86a0;
  margin-top: 18px;
}

/* ---------------- tooltip de protocolo de solucion ---------------- */

.auth-status {
  appearance: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  width: auto;
  min-width: 60px;
  height: 32px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.auth-status:hover { background: rgba(255, 255, 255, 0.14); }

.auth-status--logueado {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.4);
}

.mi-cuenta-btn {
  appearance: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  height: 54px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  margin-left: 8px;
}
.mi-cuenta-btn[hidden] { display: none; }
.mi-cuenta-btn:hover { background: rgba(255, 255, 255, 0.14); }

.login-page__tooltip-clave {
  background: var(--bg-grid);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}
.login-page__tooltip-clave ul { margin: 4px 0 0; padding-left: 18px; }
.login-page__tooltip-clave li.cumple { color: #34c37c; }
.login-page__tooltip-clave li.falta { color: var(--text-muted); }

.solicitudes-pendientes-pill {
  appearance: none;
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  cursor: pointer;
  flex-shrink: 0;
  font-size: 14px;
}

.solicitudes-pendientes-pill i { animation: solicitudes-pendientes-parpadeo 2s ease-in-out infinite; }

.solicitudes-pendientes-pill__contador {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 13px;
  height: 13px;
  padding: 0 3px;
  border-radius: 7px;
  background: var(--warn);
  color: #1a1a1a;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.solicitudes-pendientes-pill[hidden] { display: none; }

.solicitudes-pendientes-pill:hover { background: rgba(255, 255, 255, 0.1); color: var(--text-primary); }

@keyframes solicitudes-pendientes-parpadeo {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.sonido-toggle {
  appearance: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  color: var(--text-muted);
  width: 150px;
  height: 54px;
  box-sizing: border-box;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.sonido-toggle:hover { background: rgba(255, 255, 255, 0.14); color: var(--text-primary); }

.sonido-toggle--flotante {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 260;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  font-size: 38px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.sonido-toggle--silenciado {
  color: var(--down);
  border-color: var(--down-dim);
}

.login-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-modal[hidden] { display: none; }

.login-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 13, 18, 0.7);
}

.login-modal__box {
  position: relative;
  width: min(720px, 92vw);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.login-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 30px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 24px;
  color: var(--text-primary);
}

.login-modal__close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 30px;
  cursor: pointer;
}

.login-modal__body {
  padding: 30px;
  display: flex;
  flex-direction: column;
}

.login-modal__label {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.login-modal__input {
  background: var(--bg-grid);
  border: 1px solid var(--line);
  color: var(--text-primary);
  font-size: 20px;
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 22px;
}

.login-modal__info {
  color: #f0a93e;
  font-size: 17px;
  margin-bottom: 16px;
  line-height: 1.5;
}

.login-modal__error {
  color: #f0454a;
  font-size: 17px;
  margin-bottom: 16px;
}

.login-modal__btn {
  appearance: none;
  background: #352b7b;
  color: #ffffff;
  font-weight: 600;
  font-size: 18px;
  border: none;
  padding: 16px 22px;
  border-radius: var(--radius);
  cursor: pointer;
}

.login-modal__btn:hover { filter: brightness(1.15); }

.protocolo-tooltip__acciones {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.protocolo-tooltip__historial {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  max-height: 320px;
  overflow-y: auto;
}

.protocolo-tooltip__historial-item {
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.protocolo-tooltip__historial-meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #a09bd8;
  margin-top: 5px;
}

/* ---------------- tooltip de protocolo (contenido base) ---------------- */

.protocolo-tooltip {
  position: fixed;
  z-index: 200;
  width: 640px;
  background: #1e1b3a;
  color: #ffffff;
  border-radius: 14px;
  padding: 26px 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  font-family: inherit;
}

.protocolo-tooltip[hidden] {
  display: none;
}

.protocolo-tooltip__label {
  font-family: var(--font-mono);
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #a09bd8;
  margin-bottom: 4px;
}

.protocolo-tooltip__subtitulo {
  font-size: 12.5px;
  color: #8b86a0;
  margin-bottom: 12px;
}

.protocolo-tooltip__subtitulo--especifico {
  color: #4fd1c5;
}

.protocolo-tooltip__texto {
  font-size: 20px;
  line-height: 1.6;
  margin-bottom: 18px;
  white-space: pre-wrap;
}

.protocolo-tooltip__editar {
  appearance: none;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-size: 16px;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
}

.protocolo-tooltip__editar:hover {
  background: rgba(255, 255, 255, 0.2);
}

.protocolo-tooltip__editar--silenciar {
  background: rgba(240, 169, 62, 0.18);
  border-color: rgba(240, 169, 62, 0.5);
}

.protocolo-tooltip__editar--silenciar:hover {
  background: rgba(240, 169, 62, 0.3);
}

.protocolo-tooltip__silenciar-form {
  margin-top: 4px;
}

.protocolo-tooltip__silenciar-label {
  display: block;
  font-size: 13px;
  color: #a09bd8;
  margin-bottom: 6px;
  margin-top: 12px;
}

.protocolo-tooltip__silenciar-label:first-child {
  margin-top: 0;
}

.protocolo-tooltip__silenciar-form textarea,
.protocolo-tooltip__silenciar-form select {
  width: 100%;
  box-sizing: border-box;
  background: #ffffff;
  color: #1e1b3a;
  border: none;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
}

.protocolo-tooltip__silenciar-form .protocolo-tooltip__edit-botones {
  margin-top: 14px;
}

.protocolo-tooltip__edit textarea {
  width: 100%;
  box-sizing: border-box;
  background: #ffffff;
  color: #1e1b3a;
  border: none;
  border-radius: 8px;
  padding: 14px;
  font-size: 18px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 14px;
}

.protocolo-tooltip__edit-botones {
  display: flex;
  gap: 12px;
}

.protocolo-tooltip__btn {
  appearance: none;
  border: none;
  border-radius: 8px;
  padding: 12px 22px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.protocolo-tooltip__btn--guardar {
  background: #22c55e;
  color: #ffffff;
}

.protocolo-tooltip__btn--cancelar {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* ---------------- resumen general: tarjetas de incidentes ---------------- */

.resumen-superior {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: stretch;
  margin-bottom: 26px;
}

.resumen-superior .group {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

.resumen-superior__plataforma .plataforma-card,
.resumen-superior__red .scada-diagrama {
  max-width: none;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.resumen-superior__plataforma .plataforma-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px;
}

.resumen-superior__plataforma .plataforma-card__desglose {
  width: 100%;
}

@media (max-width: 780px) {
  .resumen-superior {
    grid-template-columns: 1fr;
  }
}

.plataforma-card {
  background: #1b1642;
  border-radius: 16px;
  padding: 28px;
  max-width: 780px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: center;
}

.plataforma-card__main {
  text-align: center;
}

.plataforma-card .bw-gauge__svg {
  max-width: 160px;
}

.plataforma-card__valor {
  font-size: 30px;
  font-weight: 700;
  color: #ffffff;
  margin-top: 4px;
}

.plataforma-card__estado {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  margin-top: 2px;
}

.plataforma-card__estado--ok { color: #34d399; }
.plataforma-card__estado--atencion { color: #f0a93e; }
.plataforma-card__estado--critico { color: #f0454a; }

.plataforma-card__desglose {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.plataforma-stat {
  background: #241d54;
  border-radius: 8px;
  padding: 10px 12px;
  border-left: 3px solid #34d399;
}

.plataforma-stat--atencion { border-left-color: #f0a93e; }
.plataforma-stat--critico { border-left-color: #f0454a; }

.plataforma-stat__label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #8b86a8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 2px;
}

.plataforma-stat__valor {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

/* ---------------- Diagrama SCADA de estado de la red ---------------- */

.scada-diagrama {
  background: #1b1642;
  border-radius: 16px;
  padding: 20px;
  max-width: 780px;
  margin: 0 auto;
}

.scada-flow {
  stroke: #5a5570;
  stroke-width: 1.2;
  stroke-dasharray: 4 4;
  animation: scada-flow 1.2s linear infinite;
}

.scada-nodo rect {
  fill: #201a45;
  stroke: #3a3460;
  stroke-width: 1;
  transition: stroke 0.2s ease, fill 0.2s ease;
}

.scada-nodo:not(.scada-nodo--fijo) {
  cursor: pointer;
}

.scada-nodo:not(.scada-nodo--fijo):hover rect {
  stroke: #6d67a8;
}

.scada-titulo {
  font-family: var(--font-mono);
  font-size: 14px;
  fill: #d7d3ea;
}

.scada-subtitulo {
  font-size: 12px;
  fill: #8b86a0;
}

.scada-dot {
  fill: #97c459;
  animation: scada-pulse 1.8s ease-in-out infinite;
}

.scada-nodo--ok rect { stroke: #3b6d11; }
.scada-nodo--ok .scada-titulo { fill: #c0dd97; }
.scada-nodo--ok .scada-dot { fill: #97c459; }

.scada-nodo--advertencia rect { stroke: #854F0B; }
.scada-nodo--advertencia .scada-titulo { fill: #fac775; }
.scada-nodo--advertencia .scada-dot { fill: #EF9F27; }

.scada-nodo--critico rect { stroke: #791f1f; }
.scada-nodo--critico .scada-titulo { fill: #f09595; }
.scada-nodo--critico .scada-dot { fill: #E24B4A; }

@keyframes scada-flow { to { stroke-dashoffset: -16; } }
@keyframes scada-pulse { 0%, 100% { opacity: 0.9; } 50% { opacity: 0.35; } }

@media (prefers-reduced-motion: reduce) {
  .scada-flow, .scada-dot { animation: none; }
}

.scada-lista {
  display: none;
  flex-direction: column;
  gap: 8px;
  max-width: 780px;
  margin: 0 auto;
}

.scada-lista__item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #201a45;
  border-left: 3px solid #3b6d11;
  border-radius: 0 8px 8px 0;
  padding: 10px 12px;
}

.scada-lista__item--advertencia { border-left-color: #854F0B; }
.scada-lista__item--critico { border-left-color: #791f1f; }

.scada-lista__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #97c459;
  flex-shrink: 0;
}

.scada-lista__item--advertencia .scada-lista__dot { background: #EF9F27; }
.scada-lista__item--critico .scada-lista__dot { background: #E24B4A; }

.scada-lista__texto {
  font-size: 13px;
  color: #d7d3ea;
}

.scada-lista__subtexto {
  font-size: 11px;
  color: #8b86a0;
}

@media (max-width: 780px) {
  .scada-diagrama { display: none; }
  .scada-lista { display: flex; }
}

.incidentes-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.incidente-card {
  flex: 1 1 340px;
  max-width: 400px;
}

.incidente-card {
  appearance: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #3a1420;
  border: none;
  border-left: 3px solid #f0454a;
  border-radius: 0 10px 10px 0;
  padding: 14px 16px;
  font-family: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.incidente-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(30, 27, 58, 0.28);
}

.incidente-card--advertencia {
  background: #3a2c14;
  border-left-color: #f0a93e;
}

.incidente-card__icono {
  font-size: 18px;
  color: #f09595;
  margin-top: 2px;
  flex-shrink: 0;
}

.incidente-card--advertencia .incidente-card__icono {
  color: #fac775;
}

.incidente-card__body {
  min-width: 0;
}

.incidente-card__tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  padding: 3px 8px;
  margin-bottom: 8px;
}

.incidente-card__text {
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  line-height: 1.4;
}

.incidente-card__count {
  color: #f09595;
  font-weight: 700;
}

.incidente-card--advertencia .incidente-card__count {
  color: #fac775;
}

.incidentes-empty {
  background: #ffffff;
  border-left: 4px solid #22c55e;
  border-radius: 10px;
  padding: 16px;
  font-size: 13px;
  color: #15803d;
  font-weight: 500;
}

@media (max-width: 780px) {
  .app-shell--vertical {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
    grid-template-areas: "header" "nav" "body";
  }
  .app-shell--vertical .sidebar {
    grid-template-columns: repeat(4, 1fr);
    height: auto;
    max-height: 320px;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
    overflow-y: auto;
  }
  .app-shell--vertical .nav-item {
    flex-direction: column;
    text-align: center;
    padding: 8px 4px 6px;
  }
  .sidebar {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: min-content;
    gap: 8px;
    padding: 10px 12px;
    max-height: 320px;
  }
  .nav-item {
    padding: 8px 4px 6px;
    font-size: 9px;
    gap: 4px;
  }
  .nav-item__icon { font-size: 16px; }
  .nav-item--active { border-color: var(--pulse); }
  .nav-item--incident-critico.nav-item--active { border-color: var(--down); }
  .nav-item--incident-advertencia.nav-item--active { border-color: var(--warn); }
}

/* ---------------- banner de error ---------------- */

.banner-error {
  margin: 14px 28px 0;
  padding: 10px 14px;
  border: 1px solid var(--down);
  background: var(--down-dim);
  color: #ffb3b5;
  font-family: var(--font-mono);
  font-size: 13px;
  border-radius: var(--radius);
}

/* ---------------- grupos y tarjetas ---------------- */

.board { padding: 20px 28px 8px; }

.group { margin-bottom: 26px; }

.group__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 26px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 16px;
  font-weight: 600;
}

.group__bar {
  width: 4px;
  height: 24px;
  background: var(--pulse);
  border-radius: 2px;
  display: inline-block;
}

.group__count {
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-weight: 400;
  text-transform: none;
}

.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

.card {
  flex: 1 1 300px;
  max-width: 380px;
}

.card {
  position: relative;
  --card-text: #ffffff;
  --card-text-muted: rgba(255, 255, 255, 0.78);
  --card-text-dim: rgba(255, 255, 255, 0.58);
  --card-border-soft: rgba(255, 255, 255, 0.14);
  background: #132a1c;
  color: var(--card-text);
  border: none;
  border-left: 3px solid #22c55e;
  border-radius: 0 12px 12px 0;
  padding: 16px 18px;
  overflow: hidden;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.card--down {
  background: #3a1420;
  border-left-color: #f0454a;
}

.card--warn {
  background: #3a2c14;
  border-left-color: #f0a93e;
}

.card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.card__icono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 14px;
  flex-shrink: 0;
  color: #4ade80;
}

.card--down .card__icono { color: #f09595; }
.card--warn .card__icono { color: #fac775; }

.status-dot {
  position: relative;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

.status-dot--down, .status-dot--warn { background: #f0454a; }

/* señal tipo sonar: solo se activa cuando el host esta caido */
.status-dot--down::before,
.status-dot--down::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(240, 69, 74, 0.85);
  animation: sonar 1.8s ease-out infinite;
}
.status-dot--down::after { animation-delay: 0.6s; }

@keyframes sonar {
  0%   { transform: scale(1);   opacity: 0.7; }
  100% { transform: scale(4.2); opacity: 0; }
}

.card__name {
  font-size: 17px;
  font-weight: 600;
  color: var(--card-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card__ip {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--card-text-muted);
  margin-bottom: 10px;
}

.card__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--card-text-dim);
}

.card__meta strong {
  color: var(--card-text);
  font-weight: 700;
}

.card__downtime {
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 700;
  color: var(--card-text);
  margin-top: 4px;
}

.card__downtime-acumulado {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--card-text-dim);
  margin-top: 8px;
}

.card__downtime-acumulado strong {
  color: var(--card-text);
  font-weight: 600;
}

.card__event {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--card-border-soft);
  font-size: 13px;
  color: var(--card-text-muted);
  line-height: 1.4;
  max-height: 3.2em;
  overflow: hidden;
}

.badge-vpn, .badge-criterio {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.6);
  padding: 2px 7px;
  border-radius: 2px;
  letter-spacing: 0.06em;
  margin-left: auto;
}

/* ---------------- APIs: certificado SSL y estado "lenta" ---------------- */

.status-dot--lenta {
  background: #f59e0b;
}

.card--cert-problema {
  background: #f59e0b;
}

.badge-criterio--cert {
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.8);
}

.badge-criterio--cert-aviso {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.7);
  color: #1e1b3a;
}

.apis-hover-hint {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--text-dim);
  text-transform: none;
  letter-spacing: normal;
  font-family: var(--font-display);
  font-style: italic;
}

@media (max-width: 780px) {
  .apis-hover-hint { display: none; }
}

/* ---------------- tooltip flotante de detalle de API ---------------- */

.api-detalle-tooltip {
  position: fixed;
  z-index: 200;
  width: 420px;
  background: #1e1b3a;
  color: #ffffff;
  border-radius: 14px;
  padding: 18px 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  font-family: inherit;
}

.api-detalle-tooltip[hidden] {
  display: none;
}

.api-detalle-tooltip__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.api-detalle-tooltip__nombre {
  font-family: var(--font-mono);
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #a09bd8;
}

.api-detalle-tooltip__sla {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
}

.api-detalle-tooltip__sla--ok { color: var(--ok); }
.api-detalle-tooltip__sla--violacion { color: var(--down); }

.api-detalle-tooltip__kpis {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #c7c2e0;
  margin-bottom: 14px;
}

.api-detalle-tooltip__kpis strong {
  font-family: var(--font-mono);
  color: #ffffff;
}

.api-detalle-tooltip__kpis strong.valor--violacion { color: var(--down); }

.api-detalle-tooltip__heatmap-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8b86a0;
  margin-bottom: 6px;
}

.api-detalle-tooltip__heatmap {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 2px;
}

.api-detalle-tooltip__heatmap-celda {
  height: 20px;
  border-radius: 2px;
}

.apis-sla-aviso {
  background: #fffbeb;
  color: #b45309;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  margin-bottom: 10px;
}

/* ---------------- feed de eventos ---------------- */

.feed {
  border-top: 1px solid var(--line);
  padding: 16px 28px 28px;
}

.feed__header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.feed__header h2 {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
  font-weight: 600;
}

.feed__hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
}

.feed__list {
  background: #ffffff;
  border: none;
  border-radius: 10px;
  height: 220px;
  overflow-y: auto;
  padding: 8px 0;
  font-family: var(--font-mono);
  font-size: 12px;
}

.feed__row {
  display: grid;
  grid-template-columns: 84px 90px 1fr;
  gap: 10px;
  padding: 3px 14px;
  color: #6b6680;
  white-space: nowrap;
}

.feed__row:hover { background: #f5f4fa; }

.feed__ts { color: #a09bb8; }

.feed__tag {
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.feed__tag--fallo      { color: #dc2626; }
.feed__tag--recuperado { color: #16a34a; }
.feed__tag--reinicio   { color: #6d28d9; }
.feed__tag--inicio     { color: #6b6680; }
.feed__tag--sistema    { color: #d97706; }

.feed__txt {
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1e1b3a;
}

.feed__empty {
  padding: 10px 14px;
  color: #a09bb8;
}

/* ---------------- reportes ---------------- */

.alertme-status {
  background: #ffffff;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12.5px;
  color: #1e1b3a;
  margin-bottom: 14px;
}

.alertme-status__header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.alertme-status__badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.alertme-status__badge--ok {
  background: #dcfce7;
  color: #16a34a;
}

.alertme-status__badge--degradado {
  background: #fee2e2;
  color: #dc2626;
}

.alertme-status__badge--sin-datos {
  background: #f1f0f7;
  color: #6b6680;
}

.alertme-status__counts {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #6b6680;
}

.alertme-status__ultimo {
  color: #4b4660;
}

.alertme-status__warn {
  color: #b45309;
  background: #fffbeb;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11.5px;
}

.alertme-status__lista {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
}

.alertme-status__empty {
  color: #a09bb8;
  padding: 6px 0;
}

.alertme-evento {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.alertme-evento--ok {
  background: #f0fdf4;
  color: #15803d;
}

.alertme-evento--fallo {
  background: #fef2f2;
  color: #b91c1c;
}

.alertme-evento__icono {
  font-weight: 700;
  width: 14px;
  text-align: center;
}

.alertme-evento__ts {
  color: #6b6680;
}

.alertme-evento__servicio {
  font-weight: 600;
  white-space: nowrap;
}

.alertme-evento__servicio--desconocido {
  font-weight: 400;
  font-style: italic;
  opacity: 0.7;
}

.alertme-evento__desc {
  color: #6b6680;
  margin-left: auto;
}

.alertme-evento--ok .alertme-evento__ts,
.alertme-evento--fallo .alertme-evento__ts {
  color: inherit;
  opacity: 0.7;
}

.reportes-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

.reporte-card {
  flex: 1 1 300px;
  max-width: 380px;
}

.reporte-card {
  background: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reporte-card__title {
  font-size: 14px;
  font-weight: 600;
  color: #1e1b3a;
}

.reporte-card__desc {
  font-size: 11.5px;
  color: #6b6680;
  line-height: 1.5;
}

.reporte-card__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reporte-card__label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: #8b86a0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.reporte-card select,
.reporte-card input[type="date"] {
  background: #f5f4fa;
  border: 1px solid #e4e2ee;
  color: #1e1b3a;
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 7px 8px;
  border-radius: var(--radius);
}

.reporte-card__row {
  display: flex;
  gap: 8px;
}

.reporte-card__row .reporte-card__field { flex: 1; }

.reporte-card__btn {
  appearance: none;
  background: #352b7b;
  color: #ffffff;
  font-weight: 600;
  border: none;
  padding: 9px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  margin-top: 4px;
}

.reporte-card__btn:hover { filter: brightness(1.15); }

.reportes-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ---------------- reinicios de tuneles VPN ---------------- */

.reinicio-card {
  background: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 14px;
  flex: 1 1 460px;
  max-width: 560px;
}

.reinicio-card--con-errores {
  background: #ef4444;
}

.reinicio-card__title {
  font-size: 13.5px;
  font-weight: 600;
  color: #1e1b3a;
  margin-bottom: 8px;
}

.reinicio-card--con-errores .reinicio-card__title { color: #ffffff; }

.reinicio-card__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.reinicio-card__ultimo {
  font-family: var(--font-mono);
  font-size: 14px;
  color: #6b6680;
  padding-top: 8px;
  border-top: 1px solid #eeecf6;
}

.reinicio-card--con-errores .reinicio-card__ultimo {
  color: rgba(255, 255, 255, 0.85);
  border-top-color: rgba(255, 255, 255, 0.3);
}

.reinicio-card__ultimo strong.ok { color: #16a34a; }
.reinicio-card__ultimo strong.error { color: #dc2626; }
.reinicio-card__ultimo strong.en_progreso { color: #d97706; }
.reinicio-card--con-errores .reinicio-card__ultimo strong.error { color: #ffffff; }

.feed__list--reinicios { font-family: var(--font-mono); }

.feed__entry { border-bottom: 1px solid #eeecf6; }
.feed__entry:last-child { border-bottom: none; }

.feed__row-btn {
  all: unset;
  cursor: pointer;
  display: grid;
  grid-template-columns: 150px 76px 1fr;
  gap: 10px;
  padding: 6px 14px;
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #6b6680;
}

.feed__row-btn:hover { background: #f5f4fa; }

.feed__tag--ok { color: #16a34a; }
.feed__tag--error { color: #dc2626; }
.feed__tag--en_progreso { color: #d97706; }

.feed__detail {
  margin: 0;
  padding: 8px 14px 12px 30px;
  background: #f5f4fa;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  color: #4a4560;
  white-space: pre-wrap;
  word-break: break-word;
  border-top: 1px dashed #e4e2ee;
}

/* ---------------- salud de servidores ---------------- */

.salud-lista {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

.salud-item {
  flex: 1 1 300px;
  max-width: 380px;
  appearance: none;
  text-align: left;
  cursor: pointer;
  background: #132a1c;
  border: none;
  border-left: 3px solid #22c55e;
  border-radius: 0 12px 12px 0;
  padding: 16px 18px;
  font-family: inherit;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.salud-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(30, 27, 58, 0.28);
}

.salud-item__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.salud-item__icono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 14px;
  flex-shrink: 0;
  color: #4ade80;
}

.salud-item--critico {
  background: #3a1420;
  border-left-color: #f0454a;
}

.salud-item--critico .salud-item__icono { color: #f09595; }

.salud-item--advertencia {
  background: #3a2c14;
  border-left-color: #f0a93e;
}

.salud-item--advertencia .salud-item__icono { color: #fac775; }

.salud-item--sin_datos {
  background: #232042;
  border-left-color: #4a4470;
}

.salud-item--sin_datos .salud-item__icono { color: #8b86a8; }
.salud-item--sin_datos { opacity: 0.7; }

.salud-item__name {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.salud-item__so {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 2px 7px;
  border-radius: 3px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.salud-item__ip {
  font-family: var(--font-mono);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 8px;
}

.salud-item__resumen {
  font-family: var(--font-mono);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
}

.salud-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
}

/* Modal de detalle IIS / Top procesos */

.salud-modal[hidden] {
  display: none;
}

.salud-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

.salud-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 10, 0.75);
}

.salud-modal__box {
  position: relative;
  width: min(760px, 92vw);
  max-height: 96vh;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.salud-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 18px;
}

.salud-modal__close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
}

.salud-modal__close:hover { color: var(--text-primary); }

.salud-modal__tabs {
  display: flex;
  gap: 4px;
  padding: 8px 16px 0;
  border-bottom: 1px solid var(--line);
}

.salud-modal__tab {
  appearance: none;
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 12px;
  border-radius: var(--radius) var(--radius) 0 0;
  cursor: pointer;
}

.salud-modal__tab--active {
  color: var(--pulse);
  background: var(--bg-grid);
  border-color: var(--line);
}

.salud-modal__body {
  margin: 0;
  padding: 16px 20px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.salud-modal__gauges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 16px;
  padding: 16px 16px;
}

.salud-modal__discos-lista {
  padding: 0 16px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.salud-item__so-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.salud-item__badge-seg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: var(--radius);
  font-size: 11px;
}

.salud-item__badge-seg--ok {
  background: var(--ok-dim);
  color: var(--ok);
}

.salud-item__badge-seg--advertencia {
  background: var(--warn-dim);
  color: var(--warn);
}

.salud-item__badge-seg--critico {
  background: var(--down-dim);
  color: var(--down);
}

.salud-modal__seguridad {
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.salud-modal__seg-fila {
  display: grid;
  grid-template-columns: 140px 90px 1fr;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
}

.salud-modal__seg-check {
  color: var(--text-primary);
}

.salud-modal__seg-estado {
  font-weight: 700;
}

.salud-modal__seg-estado--ok {
  color: var(--ok);
}

.salud-modal__seg-estado--advertencia {
  color: var(--warn);
}

.salud-modal__seg-estado--critico {
  color: var(--down);
}

.salud-modal__seg-detalle {
  color: var(--text-muted);
}

.salud-modal__discos-titulo {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 11px;
  margin-bottom: 8px;
}

.salud-modal__disco-fila {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.salud-modal__disco-punto {
  color: var(--text-primary);
}

.salud-modal__disco-pct {
  color: var(--text-muted);
  font-weight: 700;
}

.salud-modal__gauge {
  text-align: center;
}

.salud-modal__gauge .bw-gauge__svg {
  max-width: 140px;
}

.salud-modal__gauge-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 6px;
}

.salud-modal__gauge-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* ---------------- SLA ---------------- */

.sla-mes {
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-weight: 400;
  text-transform: none;
  margin-left: 6px;
}

.sla-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.sla-panel {
  background: #ffffff;
  border: none;
  border-left: 4px solid #22c55e;
  border-radius: 10px;
  padding: 14px;
}

.sla-panel--incumple {
  border-left-color: #ef4444;
}

.sla-panel__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #1e1b3a;
  margin-bottom: 4px;
}

.sla-panel__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sla-panel__desc {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #8b86a0;
  margin-bottom: 8px;
}

.sla-headline {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.sla-headline__pct {
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 700;
  color: #16a34a;
}

.sla-panel--incumple .sla-headline__pct { color: #dc2626; }

.sla-headline__status {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 2px;
  border: 1px solid #16a34a;
  color: #16a34a;
}

.sla-panel--incumple .sla-headline__status { border-color: #dc2626; color: #dc2626; }

.sla-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.sla-stat {
  background: #f5f4fa;
  border: none;
  border-radius: var(--radius);
  padding: 8px 10px;
}

.sla-stat__label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: #8b86a0;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sla-stat__value {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: #1e1b3a;
  margin-top: 3px;
}

.sla-chart-wrap {
  position: relative;
  height: 120px;
}

.sla-footer {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: #a09bb8;
}

.sla-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ---------------- ancho de banda ---------------- */

.bw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.bw-panel {
  background: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 14px;
  color: #1e1b3a;
}

.bw-panel__title { color: #1e1b3a; }
.bw-panel__desc { color: #6b6680; }
.bw-legend { color: #6b6680; }
.bw-stat { background: #f5f4fa; border: none; }
.bw-stat__label { color: #8b86a0; }
.bw-stat__value { color: #1e1b3a; }
.bw-stat__sub { color: #8b86a0; }
.bw-chart-fallback { color: #8b86a0; border-color: #e4e2ee; }

.bw-panel__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.bw-panel__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bw-panel__desc {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.bw-gauge {
  text-align: center;
  margin-bottom: 8px;
}

.bw-gauge__svg {
  width: 100%;
  max-width: 75px;
}

[data-panel="sla"] .bw-gauge__svg {
  max-width: 105px;
}

#sla-puertos-cards .bw-gauge__svg {
  max-width: 140px;
}

#sla-puertos-cards.cards .sla-panel {
  flex: 1 1 340px;
  max-width: 400px;
}

[data-panel="reinicios"] .bw-gauge__svg {
  max-width: 210px;
}

.bw-gauge__value {
  font-size: 15px;
  font-weight: 500;
  color: #1e1b3a;
  margin-top: 2px;
}

.bw-gauge__sub {
  font-size: 9px;
  color: #8b86a0;
}

.bw-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.bw-stat {
  background: var(--bg-grid);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 8px 10px;
}

.bw-stat__label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bw-stat__value {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 3px 0;
  white-space: nowrap;
}

.bw-stat__sub {
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.4;
}

.bw-chart-wrap {
  position: relative;
  height: 150px;
}

.bw-legend {
  display: flex;
  gap: 14px;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.bw-legend span { display: flex; align-items: center; gap: 5px; }

.bw-legend i {
  display: inline-block;
  width: 10px;
  height: 2px;
  border-radius: 2px;
}

.bw-chart-fallback[hidden] {
  display: none;
}

.bw-chart-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.bw-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ---------------- responsive ---------------- */

@media (max-width: 640px) {
  .topbar { padding: 16px 16px 12px; grid-template-columns: 1fr; justify-items: center; }
  .topbar__id { grid-column: 1; }
  .topbar__status { grid-column: 1; justify-self: center; }
  .board { padding: 16px 16px 4px; }
  .feed { padding: 12px 16px 20px; }
  .feed__row { grid-template-columns: 68px 74px 1fr; font-size: 11px; }
  .topbar__id h1 { font-size: 42px; }
  .topbar__logo { height: 68px; }
  .bw-stats { grid-template-columns: 1fr; }
}

/* ---------------- Topologia de Red (pestana, todos los roles) ---------------- */

.topologia-panel {
  background: linear-gradient(180deg, #1a1440, var(--panel));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 28px 20px;
  max-width: 1600px;
  margin: 0 auto;
}

.topologia-grupo-etiqueta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  fill: #8b86a0;
}

.topologia-grupo-caja {
  fill: rgba(255, 255, 255, 0.015);
  stroke: #35406b;
  stroke-width: 1;
  stroke-dasharray: 3 4;
}
.topologia-grupo-caja--ext { stroke: #6b3a2a; }
.topologia-grupo-caja--host { fill: rgba(127, 119, 221, 0.07); stroke: #4a4488; }

.topologia-flujo {
  stroke: #5a5570;
  stroke-width: 1.4;
  stroke-dasharray: 4 4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: topologia-flujo-anim 1.1s linear infinite;
}
.topologia-flujo--caido {
  stroke: #A32D2D;
  stroke-dasharray: none;
  animation: none;
  opacity: 0.85;
}

.topologia-nodo rect {
  fill: #201a45;
  stroke: #3a3460;
  stroke-width: 1.1;
  transition: stroke 0.15s ease, filter 0.15s ease;
}
.topologia-nodo { cursor: pointer; }
.topologia-nodo:hover rect { stroke: #8f88c2; filter: brightness(1.15); }
.topologia-nodo__titulo { font-family: var(--font-mono); font-size: 13px; font-weight: 600; fill: #d7d3ea; }
.topologia-nodo__sub { font-size: 11px; fill: #8b86a0; }
.topologia-nodo__dot { animation: topologia-pulso 1.8s ease-in-out infinite; }

.topologia-nodo--ok rect { stroke: #3b6d11; }
.topologia-nodo--ok .topologia-nodo__titulo { fill: #c0dd97; }
.topologia-nodo--ok .topologia-nodo__dot { fill: #97c459; }
.topologia-nodo--advertencia rect { stroke: #854F0B; }
.topologia-nodo--advertencia .topologia-nodo__titulo { fill: #fac775; }
.topologia-nodo--advertencia .topologia-nodo__dot { fill: #EF9F27; }
.topologia-nodo--critico rect { stroke: #791f1f; }
.topologia-nodo--critico .topologia-nodo__titulo { fill: #f09595; }
.topologia-nodo--critico .topologia-nodo__dot { fill: #E24B4A; }
.topologia-nodo--externo rect { stroke: #993C1D; }
.topologia-nodo--externo.topologia-nodo--ok .topologia-nodo__titulo { fill: #f0997b; }
.topologia-nodo--externo.topologia-nodo--ok .topologia-nodo__dot { fill: #f0997b; }
.topologia-nodo--fijo rect { stroke: #534AB7; filter: drop-shadow(0 0 4px rgba(127, 119, 221, 0.35)); }
.topologia-nodo--fijo .topologia-nodo__titulo { fill: #cecbf6; }
.topologia-nodo--fijo .topologia-nodo__dot { fill: #7f77dd; }
.topologia-nodo--sindatos rect { stroke: #4a4f5c; }
.topologia-nodo--sindatos .topologia-nodo__titulo { fill: #9aa1ad; }
.topologia-nodo--sindatos .topologia-nodo__dot { fill: #6b7787; animation: none; }

@keyframes topologia-resaltado-anim {
  0%, 100% { box-shadow: 0 0 0 0 rgba(83, 74, 183, 0); }
  50% { box-shadow: 0 0 0 6px rgba(83, 74, 183, 0.55); }
}
.topologia-resaltado { animation: topologia-resaltado-anim 0.6s ease-in-out 3; border-color: #7f77dd !important; }

@keyframes topologia-flujo-anim { to { stroke-dashoffset: -16; } }
@keyframes topologia-pulso { 0%, 100% { opacity: 0.95; } 50% { opacity: 0.4; } }
@media (prefers-reduced-motion: reduce) {
  .topologia-flujo, .topologia-nodo__dot { animation: none; }
}

.topologia-leyenda {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--text-muted);
}
.topologia-leyenda__item { display: flex; align-items: center; gap: 6px; }
.topologia-leyenda__dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.topologia-leyenda__hint { margin-left: auto; font-style: normal; opacity: 0.8; }
