/* ============================================================
   Panel de monitoreo — Hosting Montevideo
   Rediseño NOC oscuro (estética de observabilidad premium).
   Tipografía: Inter (auto-hospedada, CSP-safe).
   Layout: barra lateral fija + barra superior + contenido.
   ============================================================ */

/* --- Tipografía auto-hospedada (self-host): no usa CDN externo, respeta la CSP
       default-src 'self'. Los .woff2 viven en /assets/fonts/.
       Inter en dos cortes: regular (100–450) y semibold (451–900). El corte
       semibold cubre 500–900 para conservar el grosor marcado en títulos,
       etiquetas y botones sin necesidad de un archivo de peso extra. --- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 450; font-display: swap; src: url("/assets/fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 451 900; font-display: swap; src: url("/assets/fonts/inter-600.woff2") format("woff2"); }

:root {
    /* Marca / acento interactivo — azul frío profesional (estética NOC). */
    --navy:        #0f2350;
    --navy-2:      #0a1f4d;
    --navy-ink:    #12244d;
    --navy-soft:   #e9eefb;
    --accent:      #3b74f0;   /* azul de acción: botones, item activo, foco */
    --accent-2:    #2f5fd0;
    --accent-soft: rgba(59, 116, 240, .12);

    /* Superficies */
    --bg:      #eef2f8;
    --surface: #ffffff;
    --surface-2: #f5f8fc;
    --field:   #ffffff;   /* fondo de campos de formulario */
    --line:    #e4e9f2;
    --line-2:  #d3dcea;
    --ok-line: #c5e7d9;   /* borde de estados/flashes correctos */

    /* Texto */
    --text:    #17244a;
    --muted:   #5f6e88;
    --muted-2: #8b98b2;

    /* Estados (reservados; siempre con etiqueta) */
    --ok:        #17926a;   /* conectado: verde */
    --ok-bg:     #e6f5ef;
    --warn:      #b9810b;   /* advertencia: ámbar dorado */
    --warn-bg:   #fbf1dc;
    --crit:      #d64545;   /* crítico / desconectado: rojo */
    --crit-bg:   #fdeaea;
    --off:       #6d5cd6;   /* mantenimiento: violeta (estado secundario) */
    --off-bg:    #efecfb;

    --radius:    13px;
    --radius-sm: 9px;
    /* Altura UNIFORME de todas las tarjetas de servidor: dimensionada para mostrar
       hasta 3 particiones SIN scroll ni deformar la grilla. Las tarjetas con menos
       contenido conservan esta misma altura (el espacio sobrante queda vacío). */
    --card-h:    452px;
    --shadow:    0 1px 2px rgba(6, 36, 107, .04), 0 12px 28px -18px rgba(6, 36, 107, .22);
    /* Tipografía principal: Inter (auto-hospedada). Fallback a la fuente del
       sistema. CSP-safe (no CDN externo). */
    --font:      "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono:      ui-monospace, SFMono-Regular, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

    --sidebar-w: 258px;
    --topbar-h:  64px;
}

body {
    font-feature-settings: "cv05" 1, "ss01" 1;
    letter-spacing: -0.01em;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

/* ---------- Estructura ---------- */

.layout { min-height: 100vh; min-height: 100dvh; }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }

.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    z-index: 40;
}

.main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    min-height: 100dvh; /* robustez en TVs/navegadores con vh dinámico */
    display: flex;
    flex-direction: column;
}

/* ---------- Barra lateral ---------- */

.sidebar__brand {
    min-height: var(--topbar-h);
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}
/* Logo más grande: usa el ancho disponible del sidebar (el alto se ajusta solo,
   con un tope por seguridad). */
.sidebar__brand img { width: 100%; max-width: 200px; height: auto; max-height: 58px; object-fit: contain; }

.sidebar__scroll { flex: 1; overflow-y: auto; padding: 18px 14px; }

/* Grupos del menú: MONITOREO / EVENTOS / SISTEMA, con separación clara. */
.nav-group { margin-bottom: 4px; }
.nav-group + .nav-group { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.nav-group__title {
    font-size: 10px;
    letter-spacing: 1.7px;
    text-transform: uppercase;
    color: var(--muted-2);
    font-weight: 600;
    padding: 2px 12px 9px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 450;
    position: relative;
    transition: background .14s, color .14s, box-shadow .14s;
    margin-bottom: 3px;
}
.nav-item__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--muted-2); transition: color .14s; }
.nav-item:hover { background: var(--surface-2); color: var(--navy); }
.nav-item:hover svg { color: var(--navy); }

/* Ítem activo: fondo diferenciado + halo azul sutil + icono resaltado. */
.nav-item.is-active {
    background: var(--navy-soft);
    color: var(--navy);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(74, 128, 245, .30);
}
.nav-item.is-active svg { color: var(--accent); }

.nav-item__badge {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    background: var(--crit-bg);
    color: var(--crit);
    border-radius: 999px;
    padding: 1px 8px;
}

.sidebar__footer {
    border-top: 1px solid var(--line);
    padding: 12px;
    flex-shrink: 0;
}
.user {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
}
.user__avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--navy) 0%, #123a9e 100%);
    color: #fff;
    display: grid; place-items: center;
    font-weight: 700; font-size: 14px;
    flex-shrink: 0;
}
.user__meta { min-width: 0; }
.user__name { font-size: 13.5px; font-weight: 650; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user__role { font-size: 11.5px; color: var(--muted-2); }
.user__logout {
    margin-left: auto;
    display: grid; place-items: center;
    width: 34px; height: 34px;
    border-radius: 9px;
    color: var(--muted);
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    transition: all .14s;
    flex-shrink: 0;
}
.user__logout:hover { color: var(--crit); border-color: var(--crit-bg); background: var(--crit-bg); }

/* Bloque público (sin sesión): botón "Iniciar sesión" + acceso administrativo */
.login-block { display: flex; flex-direction: column; gap: 6px; padding: 4px; }
.login-block__btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: linear-gradient(180deg, var(--accent), var(--accent-2));   /* azul de acción */
    color: #fff;
    font-size: 13.5px; font-weight: 650;
    text-decoration: none;
    transition: filter .14s;
}
.login-block__btn:hover { filter: brightness(1.06); }
.login-block__btn svg { stroke: #fff; }
.login-block__hint { text-align: center; font-size: 11px; color: var(--muted-2); }
.public-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 10.5px; font-weight: 650;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--line);
    vertical-align: middle;
}
:root[data-theme="dark"] .login-block__btn { border-color: rgba(255,255,255,.14); }

/* ---------- Rotación del Dashboard (principales / clientes) ---------- */
.rotate-view { display: none; }
.rotate-view.is-active { display: block; animation: rotFade .25s ease; }
@keyframes rotFade { from { opacity: .35; } to { opacity: 1; } }

.rot-bar {
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px;
    padding: 10px 14px; margin-bottom: 16px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius);
}
.rot-bar__status { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.rot-bar__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); flex-shrink: 0; }
.rot-bar.is-paused .rot-bar__dot { background: var(--muted-2); box-shadow: none; }
.rot-bar__label { font-weight: 700; color: var(--navy); }
.rot-bar__sep { color: var(--muted-2); }
.rot-bar__count { color: var(--muted); font-variant-numeric: tabular-nums; }
.rot-bar__progress { flex: 1 1 120px; min-width: 90px; height: 4px; background: var(--line); border-radius: 999px; overflow: hidden; }
.rot-bar__fill { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .25s linear; }
.rot-bar__controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-left: auto; }

.rot-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.rot-seg__btn {
    padding: 6px 12px; border: 0; background: transparent; cursor: pointer;
    font-family: var(--font); font-size: 12.5px; font-weight: 600; color: var(--muted);
    transition: background .14s, color .14s;
}
.rot-seg__btn + .rot-seg__btn { border-left: 1px solid var(--line); }
.rot-seg__btn:hover { background: var(--surface-2); }
.rot-seg__btn.is-active { background: var(--navy); color: #fff; }

.rot-pause {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 11px; border: 1px solid var(--line); border-radius: 9px;
    background: var(--field); color: var(--muted); cursor: pointer;
    font-family: var(--font); font-size: 12.5px; font-weight: 600;
    transition: all .14s;
}
.rot-pause:hover { color: var(--navy); border-color: var(--line-2); }
.rot-ico--play { display: none; }
.rot-pause.is-paused .rot-ico--pause, .rot-bar.is-paused .rot-ico--pause { display: none; }
.rot-pause.is-paused .rot-ico--play, .rot-bar.is-paused .rot-ico--play { display: inline; }
:root[data-theme="dark"] .rot-seg__btn.is-active { background: #2554c6; }

/* Resumen (KPIs) + filtros reubicados DEBAJO de las tarjetas */
.kpi-row--bottom { margin-top: 22px; }
.section-head--bottom { margin-top: 14px; }

/* Barra de rotación en el TOPBAR: contador naranja + controles, SIN barra ancha.
   Se mantiene TODO en una sola fila (nada de apilar en columna en la TV). */
.topbar--rot { flex-wrap: nowrap; }
.topbar__center { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.topbar__center .rot-bar--top {
    margin: 0; padding: 0; width: auto; min-width: 0;
    background: transparent; border: 0; border-radius: 0;
    gap: 8px; flex-wrap: nowrap;
}
.topbar__center .rot-bar__controls { margin-left: 0; flex-wrap: nowrap; gap: 6px; }
.topbar__center .rot-bar--top .btn-soft,
.topbar__center .rot-bar--top .btn-test { padding: 7px 10px; white-space: nowrap; }
.rot-bar--top .rot-bar__count { color: var(--accent); font-weight: 700; white-space: nowrap; }
.rot-bar--top .rot-bar__dot { background: var(--accent); box-shadow: none; }
.rot-bar--top.is-paused .rot-bar__dot { background: var(--muted-2); }
/* El buscador cede espacio (hasta quedar solo el ícono) para que la fila entre. */
.topbar--rot .search { flex: 0 1 180px; min-width: 42px; }

/* ---------- Barra superior ---------- */

.topbar {
    height: var(--topbar-h);
    /* Fondo sólido: el desenfoque (backdrop-filter) repintaba toda la barra en
       cada scroll/actualización y era de lo más pesado para las TVs. */
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 30;
}
.topbar__title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.topbar__title h1 { font-size: 18.5px; font-weight: 700; margin: 0; color: var(--navy); letter-spacing: -.4px; }
.topbar__sub { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; font-weight: 400; }
.topbar__sub .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); display: inline-block; }

/* Contadores de estado integrados en la barra superior (reemplazan las 4
   tarjetas KPI). Los actualiza panel-filter.js vía [data-stat]. */
.topbar__stats {
    display: flex; align-items: center; flex-wrap: nowrap;
    gap: 4px 16px; margin-top: 1px;
    font-size: 11.5px; color: var(--muted); font-weight: 400; line-height: 1.2;
    white-space: nowrap;
}
.tstat { display: inline-flex; align-items: center; gap: 5px; }
.tstat b { color: var(--navy); font-weight: 600; font-variant-numeric: tabular-nums; }
.tstat__dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.tstat__dot--total { background: var(--accent); }
.tstat__dot--ok    { background: var(--ok); }
.tstat__dot--crit  { background: var(--crit); }
.tstat__dot--off   { background: var(--off); }
/* Visibilidad de los indicadores del topbar (Total/Operativos/Desconectados/Mant.):
   Una TV con escalado de Windows rinde a ~1280px CSS, por eso el umbral general es
   bajo para que SÍ se vean en la TV.
   - Clientes/Nodos y Dashboard PÚBLICO (TV, sin botones admin): hay lugar → se ven.
   - Dashboard ADMIN (topbar--auth): además lleva "Añadir servidor" + "Probar correo/
     alerta", así que se necesita más ancho → se ocultan por debajo de 1500px para
     no salirse ni superponerse (en la TV pública igual se ven).
   Siempre quedan en el DOM (el JS los mantiene actualizados). */
@media (max-width: 1000px) { .topbar__stats { display: none; } }
@media (max-width: 1500px) { .topbar--rot.topbar--auth .topbar__stats { display: none; } }

.topbar__spacer { flex: 1; }

.search {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface-2);
    border: 1px solid var(--line-2);
    border-radius: 8px;
    padding: 8px 12px;
    width: 260px;
    max-width: 40vw;
}
.search svg { width: 15px; height: 15px; color: var(--muted-2); flex-shrink: 0; }
.search input {
    border: 0; background: transparent; outline: none;
    font-size: 13.5px; color: var(--text); width: 100%;
    font-family: var(--font);
}
.search input::placeholder { color: var(--muted-2); }

.icon-btn {
    display: grid; place-items: center;
    width: 38px; height: 38px;
    border-radius: 7px;
    border: 1px solid var(--line-2);
    background: #fff;
    color: var(--muted);
    cursor: pointer;
    transition: all .14s;
    position: relative;
}
.icon-btn:hover { color: var(--navy); border-color: var(--line-2); background: var(--surface-2); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .ping { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; }

.btn-primary {
    display: inline-flex; align-items: center; gap: 8px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
    color: #fff; border: 0; border-radius: 7px;
    padding: 9px 15px; font-size: 13.5px; font-weight: 650;
    cursor: pointer; font-family: var(--font);
    box-shadow: 0 8px 18px -8px rgba(59, 116, 240, .5);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary svg { width: 16px; height: 16px; }

.hamburger { display: none; }

/* ---------- Contenido ---------- */

/* padding-bottom reserva el alto del footer FIJO para que nunca tape las tarjetas. */
.content { padding: 28px 30px 78px; flex: 1 1 auto; }
.content__section { margin-bottom: 28px; }

/* ---------- Footer del sitio (FIJO al fondo de la pantalla) ---------- */
/* position:fixed lo pega literalmente al borde inferior de la ventana, sin depender
   de la altura del contenido ni de cadenas de flex: así queda SIEMPRE abajo (no
   flota en el medio) en cualquier pantalla/TV. Ocupa el ancho del área principal
   (a la derecha del menú lateral). El contenido reserva espacio abajo (padding) para
   que no se superponga con las tarjetas. */
.site-footer {
    position: fixed;
    left: var(--sidebar-w);
    right: 0;
    bottom: 0;
    z-index: 25;
    display: flex; align-items: center; justify-content: center; gap: 14px;
    flex-wrap: wrap;
    padding: 13px 30px;
    border-top: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    font-size: 12px; font-weight: 400; letter-spacing: .02em;
    text-align: center;
}
.site-footer__text strong, .site-footer__text b { color: var(--navy); }
/* Comprobante de actualización (versión cargada + hora del último dato). */
.site-footer__sync { font-size: 11px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.site-footer__sync b { color: var(--muted); font-weight: 700; }
/* Control de tamaño de pantalla (zoom guardado por dispositivo, assets/js/core.js). */
.zoom-ctl {
    display: inline-flex; align-items: center; gap: 2px;
    padding: 2px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--line);
}
.zoom-ctl button {
    border: 0; background: transparent; color: var(--muted);
    font: inherit; font-size: 12px; font-weight: 700; line-height: 1;
    padding: 4px 9px; border-radius: 999px; cursor: pointer;
}
.zoom-ctl .zoom-ctl__btn { font-size: 15px; padding: 2px 10px; }
.zoom-ctl button:hover,
.zoom-ctl button:focus-visible { background: var(--line); color: var(--navy); outline: none; }
.site-footer__ver {
    color: var(--muted-2); font-size: 11px;
    padding: 2px 9px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--line);
}

.section-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin-bottom: 14px;
}
.section-head h2 { font-size: 15px; font-weight: 700; margin: 0; color: var(--navy); }
.section-head h2 span { color: var(--muted-2); font-weight: 600; }

/* Chips de filtro */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
    font-size: 12.5px; font-weight: 600;
    padding: 6px 12px; border-radius: 8px;
    border: 1px solid var(--line-2); background: #fff; color: var(--muted);
    cursor: pointer; transition: all .14s;
    display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { border-color: var(--navy); color: var(--navy); }
.chip.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip .n { opacity: .7; font-weight: 700; }

/* ---------- Tarjetas KPI resumen ---------- */

.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 26px;
}
.kpi {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 20px 18px;
    box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: 12px;
}
.kpi__top { display: flex; align-items: center; justify-content: space-between; }
.kpi__label { font-size: 11.5px; color: var(--muted); font-weight: 500; letter-spacing: .3px; }
.kpi__icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: grid; place-items: center; flex-shrink: 0;
    background: var(--accent-soft); color: var(--accent);
}
.kpi__icon svg { width: 17px; height: 17px; }
.kpi__icon.is-ok   { background: var(--ok-bg);   color: var(--ok); }
.kpi__icon.is-warn { background: var(--warn-bg); color: var(--warn); }
.kpi__icon.is-crit { background: var(--crit-bg); color: var(--crit); }
.kpi__icon.is-off  { background: var(--off-bg);  color: var(--off); }
/* Acento de estado: barra vertical de color a la izquierda (sobria, premium). */
.kpi { position: relative; overflow: hidden; }
.kpi::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: var(--line-2); opacity: .8;
}
.kpi--total::before { background: var(--accent); }
.kpi--ok::before    { background: var(--ok); }
.kpi--crit::before  { background: var(--crit); }
.kpi--off::before   { background: var(--off); }
.kpi__value { font-size: 30px; font-weight: 700; color: var(--navy); line-height: 1; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.kpi__foot { font-size: 11.5px; color: var(--muted-2); display: flex; align-items: center; gap: 6px; font-weight: 400; }
.trend { font-weight: 650; display: inline-flex; align-items: center; gap: 3px; }
.trend.up   { color: var(--ok); }
.trend.down { color: var(--crit); }

/* ---------- Grid de servidores ---------- */

.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
    gap: 14px;
    align-items: start; /* las filas no estiran: la altura la fija la propia tarjeta */
}
/* Pantallas grandes / TV / 4K: la tarjeta se mantiene COMPACTA (ancho mínimo
   contenido) para que entren varias por fila, en vez de pocas y anchas. La misma
   regla aplica a todas las secciones (Dashboard, Clientes, Nodos): el tamaño NO
   cambia al navegar. Usa el ancho real disponible (después del menú lateral). */
@media (min-width: 1500px) { .server-grid { grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); } }
@media (min-width: 2000px) { .server-grid { grid-template-columns: repeat(auto-fill, minmax(246px, 1fr)); gap: 16px; } }
@media (min-width: 2800px) { .server-grid { grid-template-columns: repeat(auto-fill, minmax(256px, 1fr)); gap: 16px; } }
.server-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 18px 15px;
    box-shadow: var(--shadow);
    transition: border-color .14s, transform .14s, box-shadow .14s;
    /* min-width:0 impide que un nombre/host largo (o unidades) ensanche la
       columna del grid y desborde el layout. overflow oculto contiene el
       contenido dentro de la tarjeta (el glow es box-shadow, no se recorta). */
    min-width: 0;
    overflow: hidden;
    /* Altura FIJA y uniforme + columna flex: el encabezado queda arriba, los
       medidores ocupan el centro (flexible) y el pie se alinea siempre abajo.
       La altura NO depende del contenido ni de la cantidad de particiones. */
    height: var(--card-h);
    display: flex;
    flex-direction: column;
}
/* Distribución interna dentro de la altura fija. */
.server-card__head   { flex: 0 0 auto; }
.server-card__meters { flex: 1 1 auto; min-height: 0; }        /* centro flexible: absorbe el sobrante */
.server-card__report,
.server-card__dc,
.server-card__sla    { flex: 0 0 auto; }
.server-card__foot   { flex: 0 0 auto; }                        /* pie siempre al fondo */
/* Bloque de particiones: área controlada. Hasta 3 entran sin scroll; si hay más,
   scroll interno discreto SOLO en este bloque (no agranda la tarjeta). */
.server-card__meters > .meter { flex: 0 0 auto; }              /* medidores fijos (carga/CPU/RAM/disco) */
/* Bloque de particiones SIN scroll interno: no captura la rueda del mouse (por eso
   antes el scroll de la página quedaba "trancado"). Con la altura de tarjeta actual
   hasta 3 particiones entran; si excepcionalmente hay más, el excedente se recorta
   y el detalle completo queda en la ficha del servidor. */
.server-card__meters > .parts { flex: 0 1 auto; min-height: 0; overflow: hidden; }
/* El detalle de cada partición en UNA sola línea (altura de partición determinista);
   el texto completo queda disponible en la ficha del servidor. */
.part__sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.server-card:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: 0 16px 34px -20px rgba(6, 36, 107, .3); }

/* Encabezado: área IZQUIERDA flexible (icono + nombre/host apilados) y área
   DERECHA de tamaño fijo para el badge de estado. El badge nunca se solapa: el
   nombre no invade su espacio porque el área izquierda tiene min-width:0 y todo
   el texto se trunca con ellipsis. align-items:flex-start deja el badge arriba. */
.server-card__head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    margin-bottom: 12px;
}
.server-card__name { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.server-card__ico {
    width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
    background: var(--surface-2); border: 1px solid var(--line);
    display: grid; place-items: center; color: var(--accent);
}
.server-card__ico svg { width: 17px; height: 17px; }
/* Título en columna: nombre arriba, hostname (y cliente) debajo; todos truncados. */
.server-card__title { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.server-card__title b,
.server-card__title small {
    display: block; max-width: 100%;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.server-card__title b { font-size: 14.5px; font-weight: 600; color: var(--navy); line-height: 1.25; letter-spacing: -.2px; }
.server-card__title small { font-size: 11.5px; color: var(--muted-2); font-family: var(--mono); line-height: 1.35; font-weight: 400; }
.server-card__title .server-card__client { font-family: var(--font); color: var(--muted); }

.server-card__meters { display: flex; flex-direction: column; gap: 10px; }

/* Medidores */
.meter__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.meter__label { font-size: 11.5px; color: var(--muted); font-weight: 500; letter-spacing: .1px; }
.meter__value { font-size: 12.5px; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }
.meter__track {
    height: 6px; border-radius: 999px;
    background: #eaeef6;
    overflow: hidden;
}
.meter__fill {
    height: 100%; border-radius: 999px;
    background: var(--ok);
    transition: width .3s ease;
}
.meter__fill.is-ok   { background: var(--ok); }
.meter__fill.is-warn { background: var(--warn); }
.meter__fill.is-crit { background: var(--crit); }
/* Barra de MEMORIA RAM: color propio (violeta) para diferenciarla de la carga y
   de los discos. Va después de las reglas is-* (misma especificidad) para ganar. */
.meter__fill.meter__fill--ram { background: #6f63f2; }
:root[data-theme="dark"] .meter__fill.meter__fill--ram { background: #8f86f5; }

.server-card__foot {
    margin-top: 12px; padding-top: 10px;
    border-top: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    font-size: 11px; color: var(--muted-2); font-weight: 400;
}
.server-card__foot .mono { font-family: var(--mono); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Bloque derecho del pie: badge de SO (sobrio) + acciones (admin). */
.server-card__foot-right { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
/* En la tarjeta el SO es información SECUNDARIA: neutro/gris, sin color llamativo. */
.server-card__foot .os-badge,
.server-card__foot .os-badge--linux,
.server-card__foot .os-badge--windows {
    color: var(--muted-2);
    background: var(--surface-2);
    border-color: var(--line);
    font-size: 10px; font-weight: 600; letter-spacing: .2px;
    padding: 2px 8px; margin-top: 0;
}
:root[data-theme="dark"] .server-card__foot .os-badge,
:root[data-theme="dark"] .server-card__foot .os-badge--linux,
:root[data-theme="dark"] .server-card__foot .os-badge--windows {
    color: var(--muted-2); background: var(--surface-2); border-color: var(--line);
}

/* Placeholder de disco reservado */
.meter__reserved {
    height: 7px; border-radius: 999px;
    background: repeating-linear-gradient(45deg, #eef1f7 0 6px, #e6eaf3 6px 12px);
}

/* Particiones de disco (una por punto de montaje) */
.parts { display: flex; flex-direction: column; gap: 7px; }
.parts__title { display: block; margin-bottom: 2px; flex-shrink: 0; }
/* Fila 1: punto de montaje a la izquierda, porcentaje a la derecha. */
.part__row {
    display: flex; flex-wrap: nowrap; align-items: baseline;
    justify-content: space-between; gap: 12px; margin-bottom: 3px;
}
.part__mount {
    font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--navy);
    min-width: 0; margin-right: auto;                 /* empuja el % al extremo derecho */
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.part__pct { flex-shrink: 0; margin-left: auto; white-space: nowrap; }  /* siempre a la derecha */
/* Fila 3: usado de total · libre · filesystem. */
/* (El truncado a una línea de .part__sub se define arriba, en el bloque de tarjeta.) */
.part { flex-shrink: 0; }

/* ---------- Etiquetas de estado (pill) ---------- */

.pill {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 550; letter-spacing: .1px;
    padding: 4px 11px 4px 9px; border-radius: 999px;
    border: 1px solid transparent; white-space: nowrap;
    flex-shrink: 0; align-self: flex-start;
}
.pill .pill__dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 3px rgba(255,255,255,.06); }
.pill--ok   { background: var(--ok-bg);   color: var(--ok);   border-color: #c5e7d9; }
.pill--ok   .pill__dot { background: var(--ok); }
/* En las TARJETAS, "Conectado" ya NO es una píldora con texto, sino solo un punto
   verde que titila con aura/reflejo verde (conexión de forma discreta). El resto
   de vistas (ficha, etc.) conservan la píldora con etiqueta. */
.server-card .pill--ok { background: transparent; border-color: transparent; padding: 0; gap: 0; }
.server-card .pill--ok [data-field="pill-text"] { display: none; }
.server-card .pill--ok .pill__dot {
    width: 8px; height: 8px; background: var(--ok);
    box-shadow: 0 0 6px 1px rgba(53, 201, 144, .5);
    /* El titilado anima solo la OPACIDAD (lo resuelve la GPU sin repintar). Antes
       animaba box-shadow en ~40 puntos a la vez: la página entera se repintaba
       60 veces por segundo y era la causa principal del "lag" en las TVs. */
    animation: connDot 2.2s ease-in-out infinite;
    will-change: opacity;
}
@keyframes connDot {
    0%, 100% { opacity: 1; }
    50%      { opacity: .45; }
}
.pill--warn { background: var(--warn-bg); color: var(--warn); border-color: #ecdcb4; }
.pill--warn .pill__dot { background: var(--warn); }
.pill--crit { background: var(--crit-bg); color: var(--crit); border-color: #f2c9c9; }
.pill--crit .pill__dot { background: var(--crit); }
.pill--off  { background: var(--off-bg);  color: var(--off);  border-color: #d8dfe9; }
.pill--off  .pill__dot { background: var(--off); }
/* Sin datos: el servidor nunca reportó (agente sin vincular). Gris neutro: no es una caída. */
.pill--idle { background: var(--surface-2); color: var(--muted); border-color: var(--line-2); }
.pill--idle .pill__dot { background: var(--muted-2); }

/* ---------- Tabla (conexiones) ---------- */

.toolbar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin-bottom: 16px;
}
.toolbar__spacer { flex: 1; }
.segmented {
    display: inline-flex; background: var(--surface-2);
    border: 1px solid var(--line-2); border-radius: 9px; padding: 3px;
}
.segmented button {
    border: 0; background: transparent; cursor: pointer;
    font-size: 12.5px; font-weight: 600; color: var(--muted);
    padding: 6px 12px; border-radius: 7px; font-family: var(--font);
}
.segmented button.is-active { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(6,36,107,.12); }

.table-wrap {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.table-scroll { overflow-x: auto; }

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    min-width: 720px;
}
table.data thead th {
    text-align: left;
    font-size: 11px; letter-spacing: .6px; text-transform: uppercase;
    color: var(--muted-2); font-weight: 700;
    padding: 13px 18px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
table.data tbody td {
    padding: 13px 18px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: var(--surface-2); }

.cell-ip { font-family: var(--mono); font-weight: 600; color: var(--navy); }
.cell-port { font-family: var(--mono); color: var(--muted); }
.cell-muted { color: var(--muted); }

.bar-cell { display: flex; align-items: center; gap: 10px; }
.bar-cell__num { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--navy); width: 46px; text-align: right; }
.bar-cell__track { flex: 1; max-width: 160px; height: 6px; border-radius: 999px; background: #eaeef6; overflow: hidden; }
.bar-cell__fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #1e4fc4, #123a9e); }

.table-foot {
    display: flex; align-items: center; justify-content: space-between;
    padding: 13px 18px; border-top: 1px solid var(--line);
    font-size: 12.5px; color: var(--muted); background: var(--surface-2);
    flex-wrap: wrap; gap: 10px;
}
.pager { display: flex; gap: 6px; }
.pager button {
    border: 1px solid var(--line-2); background: #fff; color: var(--muted);
    width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 13px;
}
.pager button.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- Utilidades ---------- */
/* Anchos discretos para medidores/barras: evitan estilos inline y respetan
   la política CSP estricta (style-src 'self', sin 'unsafe-inline'). */
.w-0{width:0}.w-5{width:5%}.w-10{width:10%}.w-15{width:15%}.w-20{width:20%}
.w-25{width:25%}.w-30{width:30%}.w-35{width:35%}.w-40{width:40%}.w-45{width:45%}
.w-50{width:50%}.w-55{width:55%}.w-60{width:60%}.w-65{width:65%}.w-70{width:70%}
.w-75{width:75%}.w-80{width:80%}.w-85{width:85%}.w-90{width:90%}.w-95{width:95%}
.w-100{width:100%}

.search--sm { width: 220px; max-width: 40vw; }
.logout-inline { display: contents; }

/* ---------- Mensajes flash ---------- */

.flash {
    display: flex; align-items: flex-start; gap: 9px;
    border-radius: var(--radius-sm);
    padding: 12px 14px; margin-bottom: 20px;
    font-size: 13.5px; line-height: 1.45;
    border: 1px solid transparent;
}
.flash svg { flex-shrink: 0; margin-top: 1px; }
.flash--ok    { background: var(--ok-bg);   color: #0b6b49; border-color: var(--ok-line); }
.flash--error { background: var(--crit-bg); color: #a12a2a; border-color: #f2c9c9; }

/* ---------- Estado vacío ---------- */

.empty-state {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 56px 28px;
    text-align: center;
    max-width: 520px;
    margin: 24px auto;
}
.empty-state__icon {
    width: 64px; height: 64px; border-radius: 12px;
    display: grid; place-items: center; margin: 0 auto 18px;
    background: var(--navy-soft); color: var(--navy);
}
.empty-state h2 { font-size: 18px; font-weight: 700; color: var(--navy); margin: 0 0 8px; }
.empty-state p { font-size: 13.5px; color: var(--muted); margin: 0 auto 22px; max-width: 380px; line-height: 1.6; }
.empty-state .btn-primary { display: inline-flex; }

/* ---------- Formularios ---------- */

.form-wrap { max-width: 620px; margin: 4px auto; }
.form-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px 26px 24px;
}
.form-card__head { margin-bottom: 20px; }
.form-card__head h2 { font-size: 18px; font-weight: 700; color: var(--navy); margin: 0 0 5px; }
.form-card__head p { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.5; }

.form-row { margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--navy); margin-bottom: 7px; }
.form-opt { color: var(--muted-2); font-weight: 500; }

.form-input {
    width: 100%;
    background: var(--field);
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    padding: 11px 12px;
    font-family: var(--font);
    transition: border-color .15s, box-shadow .15s, background .15s;
    appearance: none;
}
.form-input:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-input.is-error { border-color: var(--crit); background: #fff; }
select.form-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f6e88' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    background-size: 16px;
    padding-right: 34px;
}
.form-error { display: block; font-size: 12px; color: var(--crit); margin-top: 6px; }

.form-actions {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 10px; margin-top: 22px;
}

/* Botones auxiliares */
.btn-ghost {
    display: inline-flex; align-items: center; gap: 8px;
    background: #fff; border: 1px solid var(--line-2); color: var(--navy);
    border-radius: 7px; padding: 10px 16px; font-size: 13.5px; font-weight: 600;
    cursor: pointer; font-family: var(--font); text-decoration: none;
}
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--crit); border: 0; color: #fff;
    border-radius: 7px; padding: 10px 16px; font-size: 13.5px; font-weight: 650;
    cursor: pointer; font-family: var(--font);
    box-shadow: 0 8px 16px -8px rgba(214, 69, 69, .5);
}
.btn-danger:hover { filter: brightness(1.05); }

/* ---------- Confirmación de eliminación ---------- */

.confirm-card { text-align: center; padding: 32px 28px 26px; }
.confirm-card__icon {
    width: 60px; height: 60px; border-radius: 12px;
    display: grid; place-items: center; margin: 0 auto 16px;
    background: var(--crit-bg); color: var(--crit);
}
.confirm-card h2 { font-size: 18px; font-weight: 700; color: var(--navy); margin: 0 0 8px; }
.confirm-card p { font-size: 13.5px; color: var(--muted); margin: 0 auto 22px; max-width: 420px; line-height: 1.6; }
.confirm-card p .mono { color: var(--navy); }
.confirm-card__actions { display: flex; align-items: center; justify-content: center; gap: 10px; }

/* ---------- Token de servidor ---------- */

.token-box {
    background: #0b1a3a;
    border: 1px solid #16305f;
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin: 4px 0 14px;
    overflow-x: auto;
}
.token-box__value {
    font-family: var(--mono);
    font-size: 14px;
    line-height: 1.5;
    color: #cfe0ff;
    word-break: break-all;
    user-select: all;
    -webkit-user-select: all;
}
.token-note { font-size: 12.5px; color: var(--muted); line-height: 1.55; margin: 0 0 4px; }

.token-section {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}
.token-section h3 { font-size: 14px; font-weight: 700; color: var(--navy); margin: 0 0 6px; }
.token-section p { font-size: 12.5px; color: var(--muted); line-height: 1.55; margin: 0 0 14px; }
.token-section__row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; flex-wrap: wrap;
}
.token-status {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 12.5px; font-weight: 600; color: var(--navy);
    background: var(--ok-bg); border: 1px solid var(--ok-line);
    border-radius: 999px; padding: 6px 12px;
}
.token-status__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }

/* ---------- Acciones en tarjeta de servidor ---------- */

.server-card__actions { display: inline-flex; gap: 6px; }
.card-act {
    display: grid; place-items: center;
    width: 30px; height: 30px; border-radius: 8px;
    border: 1px solid var(--line); background: #fff; color: var(--muted);
    transition: all .14s; text-decoration: none;
}
.card-act:hover { color: var(--navy); border-color: var(--line-2); background: var(--surface-2); }
.card-act--danger:hover { color: var(--crit); border-color: #f2c9c9; background: var(--crit-bg); }

.meter__value--muted { color: var(--muted-2); font-weight: 600; }
.meter__sub { margin-top: 3px; font-size: 10.5px; color: var(--muted-2); line-height: 1.25; font-weight: 400; }

/* Acciones compactas en tablas (p. ej. gestión de usuarios) */
.tbl-actions { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tbl-actions form { display: contents; }
.btn-xs {
    display: inline-flex; align-items: center; gap: 5px;
    background: #fff; border: 1px solid var(--line-2); color: var(--navy);
    border-radius: 7px; padding: 5px 10px; font-size: 12px; font-weight: 600;
    cursor: pointer; font-family: var(--font); text-decoration: none; white-space: nowrap;
}
.btn-xs:hover { background: var(--surface-2); border-color: var(--navy); }
.btn-xs--danger { color: var(--crit); }
.btn-xs--danger:hover { background: var(--crit-bg); border-color: #f2c9c9; }
.tag-you {
    font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
    color: var(--accent); background: var(--accent-soft);
    border-radius: 999px; padding: 1px 7px; margin-left: 4px;
}

/* Valor de carga: en rojo cuando supera el umbral (> 12). */
.load-v.is-high { color: var(--crit); font-weight: 700; }

/* Herramientas de la cabecera (botón de prueba + chips de filtro) */
.section-head__tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Botón "Probar alerta" */
.btn-test {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12.5px; font-weight: 600;
    padding: 6px 12px; border-radius: 8px;
    border: 1px solid var(--line-2); background: var(--surface); color: var(--crit);
    cursor: pointer; font-family: var(--font); white-space: nowrap;
    transition: all .14s;
}
.btn-test:hover { background: var(--crit-bg); border-color: var(--crit); }
.btn-test svg { width: 14px; height: 14px; }

/* Botones neutros de la cabecera (Probar envío de correo, Activar sonido) */
.btn-soft {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12.5px; font-weight: 600;
    padding: 6px 12px; border-radius: 8px;
    border: 1px solid var(--line-2); background: var(--surface); color: var(--navy);
    cursor: pointer; font-family: var(--font); white-space: nowrap; transition: all .14s;
}
.btn-soft:hover { background: var(--surface-2); border-color: var(--navy); }
.btn-soft:disabled { opacity: .6; cursor: default; }
.btn-soft svg { width: 14px; height: 14px; }
.btn-soft--sound.is-on { color: var(--ok); border-color: var(--ok); background: var(--ok-bg); }

/* Aviso flotante (toast) */
.toast {
    position: fixed; right: 20px; bottom: 20px; z-index: 130;
    max-width: 360px; padding: 12px 16px; border-radius: 10px;
    font-size: 13px; font-weight: 600; line-height: 1.4;
    box-shadow: var(--shadow); border: 1px solid var(--line);
    background: var(--surface); color: var(--text);
    opacity: 0; transform: translateY(8px);
    transition: opacity .18s ease, transform .18s ease;
    pointer-events: none;
}
.toast.is-visible { opacity: 1; transform: none; }
.toast--ok    { border-color: var(--ok);   background: var(--ok-bg);   color: #0b6b49; }
.toast--error { border-color: var(--crit); background: var(--crit-bg); color: #a12a2a; }
.toast[hidden] { display: none; }
:root[data-theme="dark"] .btn-soft { background: var(--surface-2); }
:root[data-theme="dark"] .toast--ok    { color: var(--ok); }
:root[data-theme="dark"] .toast--error { color: var(--crit); }

/* Etiqueta discreta de cliente en la tarjeta (nombre o empresa) */
.server-card__client {
    display: block;
    font-family: var(--font);
    font-size: 11.5px;
    color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-top: 1px;
}

/* "Último reporte: hace X" — línea discreta bajo los medidores */
.os-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: .2px;
    line-height: 1;
    padding: 3px 8px 3px 6px;
    border-radius: 7px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--muted);
    vertical-align: middle;
    white-space: nowrap;
}
.os-badge .os-ico { width: 12px; height: 12px; flex-shrink: 0; }
.os-badge--linux   { color: #b45309; border-color: rgba(180,83,9,.35);  background: rgba(245,158,11,.12); }
.os-badge--windows { color: #1d5fd0; border-color: rgba(29,95,208,.35); background: rgba(37,99,235,.12); }
.cfg-card__title .os-badge { margin-left: 8px; }
:root[data-theme="dark"] .os-badge--linux   { color: #fbbf24; border-color: rgba(251,191,36,.4);  background: rgba(245,158,11,.16); }
:root[data-theme="dark"] .os-badge--windows { color: #7dabff; border-color: rgba(125,171,255,.4); background: rgba(37,99,235,.20); }

/* Etiqueta de centro de datos / proveedor: chip discreto (estilo badge de SO),
   en el espacio inferior de la tarjeta, sobre "Último reporte". Se ancha al
   contenido y se trunca si es muy largo. Editable desde la ficha del servidor. */
.server-card__dc {
    flex: 0 0 auto;
    align-self: flex-start; max-width: 100%;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 2px 9px; border-radius: 7px;
    background: var(--surface-2); border: 1px solid var(--line);
    color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: .2px;
}
.server-card__dc svg { width: 12px; height: 12px; flex-shrink: 0; color: var(--muted-2); }
.server-card__dc span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.server-card__report {
    margin-top: 6px;
    font-size: 11px;
    color: var(--muted-2);
    line-height: 1.3;
}
/* Fila: chip de proveedor (izquierda, queda donde estaba) + servicios (derecha,
   HORIZONTAL). Rellena el espacio inferior de la tarjeta, sobre «Último reporte».
   No cambia el alto de la tarjeta. */
.server-card__meta-row {
    flex: 0 0 auto; margin-top: 8px;
    display: flex; align-items: center; gap: 10px; min-width: 0;
}
.server-card__meta-row .server-card__dc { margin: 0; align-self: center; flex: 0 0 auto; }
/* Servicios (HTTPS / Mail / MySQL) en horizontal, empujados a la derecha. */
.server-card__svc {
    margin-left: auto; flex: 0 1 auto; min-width: 0;
    display: flex; align-items: center; justify-content: flex-end; gap: 13px; flex-wrap: nowrap;
}
.svc { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 650; color: var(--muted); white-space: nowrap; }
.svc__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); flex-shrink: 0; }
.svc--ok   .svc__dot { background: var(--ok); }
.svc--warn .svc__dot { background: var(--warn); }
.svc--crit .svc__dot { background: var(--crit); }
.svc--idle .svc__dot { background: var(--muted-2); }
/* El caído/parcial resalta también el texto (no solo el punto). */
.svc--crit { color: var(--crit); }
.svc--warn { color: var(--warn); }

/* Mensaje cuando el buscador/filtro no deja tarjetas visibles */
.grid-empty {
    grid-column: 1 / -1;
    margin: 8px 0;
    padding: 22px;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
    background: var(--surface);
    border: 1px dashed var(--line-2);
    border-radius: var(--radius);
}
.server-card[hidden], .grid-empty[hidden] { display: none; }

/* ---------- Principales en TIRAS (Configuración → Panel → Diseño) ----------
   Mismo marcado de tarjeta (el refresco cada 5 s no cambia): acá solo cambia la
   forma. 2 columnas de tiras horizontales, ordenadas de arriba hacia abajo.
   assets/js/strips-fit.js fija la cantidad de filas y el ALTO de cada tira para
   que todas entren en la pantalla, y la escala del texto (--sk) según el alto.
   Las medidas internas van en em sobre una base que escala con --sk. */
.server-grid.server-grid--strips {
    --strip-cols: 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
    align-items: stretch;
}
.server-grid--strips .server-card {
    height: auto; min-height: 0;
    display: grid;
    /* identificación | medidores (CPU/carga · RAM · discos · servicios) | IP y acciones.
       Las tres columnas tienen ancho FIJO en em (escala con --sk): el contenido
       nunca empuja a los vecinos. */
    grid-template-columns: minmax(0, 19em) minmax(0, 1fr) minmax(0, 16em);
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas: "head meters foot" "head meters report";
    column-gap: 1.6em; align-items: center;
    padding: .7em 1.3em;
    font-size: calc(10px * var(--sk, 1));
}
.server-grid--strips .server-card:hover { transform: none; }
.server-grid--strips .server-card__head {
    grid-area: head; margin: 0; min-width: 0;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .5em .8em;
}
/* Estado SOLO como punto de color, igual que el verde de conectado: rojo =
   desconectado, violeta = mantenimiento, gris = sin datos (el texto queda oculto;
   el detalle está en la ficha y en el popup de alertas). */
.server-grid--strips .server-card .pill { background: transparent; border-color: transparent; padding: 0; gap: 0; }
.server-grid--strips .server-card .pill [data-field="pill-text"] { display: none; }
.server-grid--strips .server-card .pill .pill__dot { width: calc(9px * var(--sk, 1)); height: calc(9px * var(--sk, 1)); }
.server-grid--strips .server-card .pill--crit .pill__dot { box-shadow: 0 0 6px 1px rgba(232, 72, 85, .6); }
.server-grid--strips .server-card .pill--off .pill__dot { box-shadow: 0 0 6px 1px rgba(139, 120, 240, .55); }
.server-grid--strips .server-card__ico { width: 3.3em; height: 3.3em; border-radius: 1em; }
.server-grid--strips .server-card__ico svg { width: 1.7em; height: 1.7em; }
.server-grid--strips .server-card__title b { font-size: 1.55em; }
.server-grid--strips .server-card__title small { font-size: 1.12em; }

/* Medidores en una sola fila: CPU/carga y RAM de ancho fijo, discos con el
   resto, servicios (puntos) al final. */
.server-grid--strips .server-card__meters {
    grid-area: meters; height: 100%; min-width: 0;
    flex-direction: row; align-items: center; gap: 1.6em;
}
.server-grid--strips .server-card__meters > .meter { flex: 0 0 13.5em; min-width: 0; }
.server-grid--strips .server-card__meters > .meter + .meter { flex-basis: 11.5em; }
/* Título arriba y valor debajo: así "Carga 13.78 · 3.44 · 8.73" no se parte. */
.server-grid--strips .meter__head { margin-bottom: .4em; flex-direction: column; align-items: flex-start; gap: .1em; }
.server-grid--strips .meter__label,
.server-grid--strips .meter__value { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.server-grid--strips .meter__label { font-size: 1.1em; }
.server-grid--strips .meter__value { font-size: 1.25em; }
.server-grid--strips .meter__sub { font-size: 1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.server-grid--strips .meter__track,
.server-grid--strips .meter__reserved { height: .6em; }
/* Discos: TODOS en una sola fila, mismo ancho cada uno (nunca se parten en
   líneas ni se recortan). El detalle de cada disco queda en la ficha. */
.server-grid--strips .server-card__meters > .parts {
    flex: 1 1 0; min-width: 0;
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    gap: 1.2em; align-items: center;
}
.server-grid--strips .parts__title,
.server-grid--strips .part__sub { display: none; }
.server-grid--strips .part { min-width: 0; }
/* Nombre y % del disco SIEMPRE en una sola línea (todos los discos quedan a la
   misma altura): si no entra, el nombre se recorta con "…" y el % queda entero. */
.server-grid--strips .part__row { margin-bottom: .35em; gap: .5em; min-width: 0; flex-wrap: nowrap; }
.server-grid--strips .part__pct { flex: 0 0 auto; }
.server-grid--strips .part__mount { font-size: 1.15em; min-width: 0; }
.server-grid--strips .part__pct { font-size: 1.2em; }
/* Servicios: solo los puntos de color (el nombre aparece al pasar el mouse).
   El proveedor se ve en la ficha. */
.server-grid--strips .server-card__meta-row { flex: 0 0 auto; margin: 0; }
.server-grid--strips .server-card__dc { display: none; }
.server-grid--strips .server-card__svc { margin: 0; gap: .6em; }
.server-grid--strips .svc { font-size: 0; gap: calc(3px * var(--sk, 1)); flex-direction: column; align-items: center; }
/* Letra debajo de cada punto: H = HTTPS, C = Correo, M = MySQL. Se elige por el
   servicio (title), no por la posición, así nunca se cruzan. */
.server-grid--strips .svc::after {
    font-size: calc(9.5px * var(--sk, 1)); font-weight: 700; line-height: 1; letter-spacing: 0;
}
.server-grid--strips .svc[title^="Web"]::after    { content: "H"; }
.server-grid--strips .svc[title^="Correo"]::after { content: "C"; }
.server-grid--strips .svc[title^="MySQL"]::after  { content: "M"; }
/* Tamaño en px escalados (no em): con font-size 0 un tamaño en em daba 0 y los
   puntos desaparecían. */
.server-grid--strips .svc__dot { width: calc(9px * var(--sk, 1)); height: calc(9px * var(--sk, 1)); }

/* IP · datacenter arriba, SO y acciones abajo; todo dentro de su columna. */
.server-grid--strips .server-card__foot {
    grid-area: foot; margin: 0; padding: 0; border: 0; min-width: 0;
    flex-direction: column; align-items: flex-end; justify-content: center; gap: .6em;
    font-size: 1.05em;
}
/* IP · datacenter: hasta 2 líneas alineadas a la derecha (no se corta la IP). */
.server-grid--strips .server-card__foot .mono {
    max-width: 100%; text-align: right; line-height: 1.35;
    white-space: normal; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
.server-grid--strips .server-card__foot-right { margin-left: 0; }
.server-grid--strips .server-card__foot .os-badge { font-size: .95em; padding: .2em .8em; }
/* Último reporte en versión corta ("Update hace 8s"): el texto largo queda oculto
   y se muestra data-short (lo mantiene dashboard-refresh.js). */
.server-grid--strips .server-card__report { grid-area: report; margin: 0; min-width: 0; text-align: right; font-size: 0; white-space: nowrap; overflow: hidden; }
.server-grid--strips .server-card__report::after { content: attr(data-short); font-size: calc(10.5px * var(--sk, 1)); }
.server-grid--strips .server-card__sla { display: none; }
/* Tira ANGOSTA (PC a 100 %; lo marca strips-fit.js): la última columna queda
   solo con las acciones (editar / eliminar). IP, SO y último reporte se ven en
   la ficha (clic en la tira). */
.server-grid--strips[data-compact] .server-card { grid-template-columns: minmax(0, 12.5em) minmax(0, 1fr) auto; column-gap: 1.2em; padding: .6em 1em .6em 1.2em; }
.server-grid--strips[data-compact] .server-card__ico,
.server-grid--strips[data-compact] .server-card__foot .mono,
.server-grid--strips[data-compact] .server-card__foot .os-badge,
.server-grid--strips[data-compact] .server-card__report { display: none; }
.server-grid--strips[data-compact] .server-card__title b { font-size: 1.45em; }
.server-grid--strips[data-compact] .server-card__meters { gap: 1.2em; }
.server-grid--strips[data-compact] .server-card__meters > .meter { flex-basis: 12em; }
.server-grid--strips[data-compact] .server-card__meters > .meter + .meter { flex-basis: 9em; }
.server-grid--strips[data-compact] .parts { gap: .8em; }
.server-grid--strips[data-compact] .part__mount { font-size: 1.05em; }
.server-grid--strips[data-compact] .part__pct { font-size: 1.1em; }
/* Tira BAJA (muchos servidores, p. ej. ~40 clientes en la TV; lo marca
   strips-fit.js): sin la línea secundaria de CPU/RAM, para que entren todas. */
.server-grid--strips[data-tight] .meter__sub { display: none; }
.server-grid--strips[data-tight] .server-card { padding-top: .45em; padding-bottom: .45em; }
/* Baja y angosta (3 columnas): la RAM es solo un %, se achica para dar lugar a
   los discos (con 4 discos, el % baja debajo del nombre del disco). */
.server-grid--strips[data-tight][data-compact] .server-card__meters { gap: 1em; }
.server-grid--strips[data-tight][data-compact] .server-card__meters > .meter + .meter { flex-basis: 6.5em; }
.server-grid--strips[data-tight][data-compact] .parts { gap: .6em; }
/* Editar / eliminar uno arriba del otro: ocupan la mitad de ancho. */
.server-grid--strips[data-compact] .server-card__actions { flex-direction: column; gap: 4px; }

/* Pantallas angostas: una sola columna y la tira se acomoda en dos líneas. */
@media (max-width: 1100px) {
    .server-grid.server-grid--strips { --strip-cols: 1; grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
    .server-grid--strips .server-card {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "head foot" "meters meters" "report report";
        grid-template-rows: auto auto auto; row-gap: .8em;
    }
    .server-grid--strips .server-card__meters { flex-wrap: wrap; }
    .server-grid--strips .server-card__meters > .meter { flex: 1 1 40%; }
}

/* Interruptor de mantenimiento + ayuda en el formulario */
.form-check {
    display: inline-flex; align-items: center; gap: 9px;
    font-size: 13.5px; color: var(--text); cursor: pointer;
    padding: 10px 0 2px;
}
.form-check input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.form-hint { display: block; font-size: 11.5px; color: var(--muted-2); margin-top: 4px; line-height: 1.4; }

/* Sección de datos de cliente en el formulario */
.form-section {
    margin-top: 8px; padding-top: 18px;
    border-top: 1px solid var(--line);
}
.form-section__title { font-size: 14px; font-weight: 700; color: var(--navy); margin: 0 0 14px; }
textarea.form-input { resize: vertical; min-height: 76px; line-height: 1.5; }

/* ---------- Backdrop móvil ---------- */

.backdrop { display: none; }

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
    .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(6,36,107,.25); }
    .main { margin-left: 0; }
    .site-footer { left: 0; } /* el menú lateral pasa a off-canvas: el footer ocupa todo el ancho */
    .nav-toggle:checked ~ .sidebar { transform: translateX(0); }
    .nav-toggle:checked ~ .backdrop {
        display: block; position: fixed; inset: 0; z-index: 35;
        background: rgba(10, 20, 45, .45);
    }
    .hamburger {
        display: grid; place-items: center;
        width: 38px; height: 38px; border-radius: 9px;
        border: 1px solid var(--line-2); background: #fff; color: var(--navy);
        cursor: pointer; flex-shrink: 0;
    }
    .hamburger svg { width: 18px; height: 18px; }
}

/* TVs del NOC (core.js marca <html data-device="tv">): el menú lateral SIEMPRE
   escondido (igual que en pantallas angostas), para que el muro use todo el
   ancho. Se puede abrir con el botón ☰ si hiciera falta. Independiente del zoom. */
html[data-device="tv"] .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(6,36,107,.25); }
html[data-device="tv"] .main { margin-left: 0; }
html[data-device="tv"] .site-footer { left: 0; }
html[data-device="tv"] .nav-toggle:checked ~ .sidebar { transform: translateX(0); }
html[data-device="tv"] .nav-toggle:checked ~ .backdrop {
    display: block; position: fixed; inset: 0; z-index: 35;
    background: rgba(10, 20, 45, .45);
}
html[data-device="tv"] .hamburger {
    display: grid; place-items: center;
    width: 38px; height: 38px; border-radius: 9px;
    border: 1px solid var(--line-2); background: #fff; color: var(--navy);
    cursor: pointer; flex-shrink: 0;
}
html[data-device="tv"] .hamburger svg { width: 18px; height: 18px; }

@media (max-width: 640px) {
    .content { padding: 16px; }
    .topbar { padding: 0 16px; gap: 10px; }
    .search { display: none; }
    .topbar__sub { display: none; }
    .topbar .btn-primary { display: none; }
    .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
    .kpi__value { font-size: 24px; }
    .server-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 460px) {
    .kpi-row { grid-template-columns: 1fr; }
}

/* ============================================================
   Botón de tema (sol/luna) en la barra superior
   ============================================================ */
.theme-ico { width: 17px; height: 17px; }
.ico-sun  { display: none; }
.ico-moon { display: block; }
:root[data-theme="dark"] .ico-sun  { display: block; }
:root[data-theme="dark"] .ico-moon { display: none; }

/* ============================================================
   MODO OSCURO — solo redefine variables y algunos fondos fijos.
   Todo el panel usa var(--…), así que el cambio se propaga a
   menú, encabezados, tarjetas, formularios, tablas, filtros,
   modales, alertas y la sección de clientes.
   ============================================================ */
:root[data-theme="dark"] {
    /* Paleta de azules profundos / tonos fríos (sin negro puro), estética NOC. */
    --navy:        #f2f6ff;   /* “tinta” principal -> blanco frío sobre azul oscuro */
    --navy-2:      #dfe7f5;
    --navy-ink:    #f2f6ff;
    --navy-soft:   #16294d;   /* fondo de ítem de menú activo */

    --bg:      #0a1322;   /* fondo principal: navy casi negro con matiz azul */
    --surface: #101c31;   /* tarjetas: azul grisáceo profundo */
    --surface-2: #16243c; /* hover / superficies secundarias */
    --field:   #0e1b30;   /* campos y filtros */
    --line:    #223350;   /* bordes: azul grisáceo medio */
    --line-2:  #2e4267;
    --ok-line: #1f4a3a;

    --text:    #eaf0fc;   /* texto principal: blanco frío */
    --muted:   #a7b6d3;   /* texto secundario: gris azulado claro */
    --muted-2: #7284a6;

    --ok:      #36cf90; --ok-bg:   #0f3325;   /* conectado: verde */
    --warn:    #eab24a; --warn-bg: #33290c;   /* advertencia: ámbar */
    --crit:    #f56a6a; --crit-bg: #3a1b1b;   /* crítico / desconectado: rojo */
    --off:     #9b8cf2; --off-bg:  #221d43;   /* mantenimiento: violeta */

    --accent:      #4a80f5;   /* azul de acción (un punto más claro para contraste) */
    --accent-2:    #3467e0;
    --accent-soft: rgba(74, 128, 245, .18);
    --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 18px 40px -20px rgba(0, 0, 0, .8);
}

/* Fondo premium: navy profundo con un halo azul frío muy sutil arriba. */
:root[data-theme="dark"] body {
    background:
        radial-gradient(1100px 520px at 50% -260px, rgba(74, 128, 245, .10), transparent 70%),
        radial-gradient(900px 500px at 100% 0%, rgba(107, 92, 242, .06), transparent 60%),
        var(--bg);
    /* Sin background-attachment: fixed (obligaba a repintar TODA la página en cada
       scroll; en las TVs era una de las causas del "lag"). */
    background-repeat: no-repeat;
}

/* Fondos que estaban fijos en claro y necesitan un valor propio en oscuro. */
:root[data-theme="dark"] .sidebar {
    background: linear-gradient(180deg, #0a1526 0%, #070f1e 100%);
    border-right-color: #1b2a44;
    box-shadow: 8px 0 40px -26px rgba(0, 0, 0, .95);
}
:root[data-theme="dark"] .topbar {
    background: #09121f; /* sólido (sin backdrop-filter: muy costoso en TVs) */
    border-bottom-color: #1a2942;
}
/* Tarjetas y KPIs con profundidad: borde superior tenue + sombra. */
:root[data-theme="dark"] .server-card,
:root[data-theme="dark"] .kpi,
:root[data-theme="dark"] .cfg-card,
:root[data-theme="dark"] .form-card,
:root[data-theme="dark"] .table-wrap {
    background: linear-gradient(180deg, rgba(255,255,255,.022), rgba(255,255,255,0) 60%), var(--surface);
    box-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 18px 40px -24px rgba(0,0,0,.85);
}
/* Acento de color por estado en los KPIs (borde tenue del color). */
:root[data-theme="dark"] .kpi--total { border-color: rgba(74,128,245,.30); }
:root[data-theme="dark"] .kpi--ok    { border-color: rgba(54,207,144,.28); }
:root[data-theme="dark"] .kpi--crit  { border-color: rgba(245,106,106,.30); }
:root[data-theme="dark"] .kpi--off   { border-color: rgba(155,140,242,.30); }
:root[data-theme="dark"] .icon-btn,
:root[data-theme="dark"] .btn-ghost,
:root[data-theme="dark"] .chip,
:root[data-theme="dark"] .pager button,
:root[data-theme="dark"] .card-act,
:root[data-theme="dark"] .user__logout,
:root[data-theme="dark"] .segmented button.is-active,
:root[data-theme="dark"] .btn-test,
:root[data-theme="dark"] .btn-xs { background: var(--surface-2); }
/* Botones/estados activos: azul intenso. */
:root[data-theme="dark"] .chip.is-active,
:root[data-theme="dark"] .pager button.is-active {
    background: #2f5bd0; border-color: #2f5bd0; color: #fff;
}
:root[data-theme="dark"] .meter__track,
:root[data-theme="dark"] .bar-cell__track { background: #24314c; }
:root[data-theme="dark"] .meter__reserved {
    background: repeating-linear-gradient(45deg, #172845 0 6px, #1f2f4d 6px 12px);
}
:root[data-theme="dark"] .form-input:focus,
:root[data-theme="dark"] .form-input.is-error { background: var(--field); }
:root[data-theme="dark"] .user__avatar { background: linear-gradient(135deg, #2f5bd0, #123a9e); }
:root[data-theme="dark"] .flash--ok    { color: var(--ok); }
:root[data-theme="dark"] .flash--error { color: var(--crit); }
:root[data-theme="dark"] .pill--ok   { border-color: #1f5540; }
:root[data-theme="dark"] .pill--warn { border-color: #4d3d14; }
:root[data-theme="dark"] .pill--crit { border-color: #542626; }
:root[data-theme="dark"] .pill--off  { border-color: #3a2f66; }
:root[data-theme="dark"] .bar-cell__fill { background: linear-gradient(90deg, #3a6ad6, #244a9e); }

/* ============================================================
   ALERTAS CRÍTICAS — glow rojo en la tarjeta + modal
   ============================================================ */
.server-card--alert {
    position: relative;
    border-color: var(--crit);
    box-shadow: 0 0 0 1px var(--crit), 0 0 22px 4px rgba(214, 69, 69, .45);
}
/* Pulso de la alerta: una capa interna que solo cambia de OPACIDAD (barato para
   la GPU). Antes se animaba el box-shadow con desenfoque grande, que obligaba a
   repintar la zona en cada cuadro. No afecta el tamaño de la tarjeta. */
.server-card--alert::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 0 0 2px var(--crit), inset 0 0 24px rgba(214, 69, 69, .35);
    animation: cardAlert 1.4s ease-in-out infinite;
    will-change: opacity;
}
@keyframes cardAlert {
    0%, 100% { opacity: .25; }
    50%      { opacity: 1; }
}
:root[data-theme="dark"] .server-card--alert {
    box-shadow: 0 0 0 1px var(--crit), 0 0 26px 6px rgba(243, 106, 106, .5);
}

/* Resaltado por carga/CPU: NO se rellena el fondo de la tarjeta. El estado se
   expresa como una estela/halo exterior (misma lógica que la alerta crítica roja),
   manteniendo el fondo normal y la legibilidad.
   · ADVERTENCIA (no crítico) → halo CELESTE / azul marino, sutil y elegante.
   · crítico (por carga alta)  → halo rojo, más marcado.
   El :not(.server-card--alert) deja SIEMPRE ganar a la alerta crítica pulsante
   (desconexión), que sigue con su glow rojo animado sin cambios. */
.server-card--load-warn:not(.server-card--alert) {
    border-color: #bfe3f2;
    box-shadow: 0 0 0 1px rgba(38, 166, 214, .38), 0 0 18px 2px rgba(38, 166, 214, .26);
}
.server-card--load-crit:not(.server-card--alert) {
    border-color: #f0c4c4;
    box-shadow: 0 0 0 1px rgba(214, 69, 69, .42), 0 0 18px 2px rgba(214, 69, 69, .3);
}
:root[data-theme="dark"] .server-card--load-warn:not(.server-card--alert) {
    border-color: #235a70;
    box-shadow: 0 0 0 1px rgba(74, 190, 235, .40), 0 0 20px 3px rgba(74, 190, 235, .28);
}
:root[data-theme="dark"] .server-card--load-crit:not(.server-card--alert) {
    border-color: #5a2e32;
    box-shadow: 0 0 0 1px rgba(243, 106, 106, .45), 0 0 20px 3px rgba(243, 106, 106, .32);
}
/* Mantenimiento (status off): halo violeta suave (fondo normal). */
.server-card[data-status="off"]:not(.server-card--alert) {
    border-color: #cdc4f2;
    box-shadow: 0 0 0 1px rgba(109, 92, 214, .30), 0 0 16px 1px rgba(109, 92, 214, .16);
}
:root[data-theme="dark"] .server-card[data-status="off"]:not(.server-card--alert) {
    border-color: #3a2f66;
    box-shadow: 0 0 0 1px rgba(155, 140, 242, .38), 0 0 20px 2px rgba(155, 140, 242, .22);
}
/* Desconectado (status crit): contenido atenuado; el estado se lee en la píldora
   y el borde. No pinta el fondo. */
.server-card[data-status="crit"] .server-card__meters { opacity: .58; }
.server-card[data-status="idle"] .server-card__meters { opacity: .5; }
/* En hover el glow de carga cede al realce estándar de la tarjeta (no se acumulan). */

/* Popup de alertas. NO usa unidades vh (en las TVs Hisense/VIDAA se calculan mal
   y la lista crecía fuera de la pantalla, dejando los botones inalcanzables). La
   lista se limita a 5 ítems desde JS y, por si acaso, el contenedor hace scroll. */
.alert-modal {
    position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 120;
    display: flex; align-items: flex-start; justify-content: center;
    padding: 40px 20px;
    overflow-y: auto;
}
.alert-modal[hidden] { display: none; }
.alert-modal__backdrop {
    position: fixed; top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(40, 4, 4, .62); /* sin blur: muy costoso en TVs */
}
.alert-modal__card {
    position: relative;
    margin: auto 0;
    width: 760px; max-width: 100%;
    background: var(--surface);
    border: 2px solid var(--crit);
    border-radius: 14px;
    box-shadow: 0 30px 80px -18px rgba(214, 69, 69, .75);
    padding: 34px 38px 30px;
    animation: modalPop .18s ease-out;
}
@keyframes modalPop {
    from { transform: translateY(8px) scale(.98); opacity: 0; }
    to   { transform: none; opacity: 1; }
}
.alert-modal__head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.alert-modal__icon {
    width: 60px; height: 60px; border-radius: 14px; flex-shrink: 0;
    display: grid; place-items: center;
    background: var(--crit-bg); color: var(--crit);
}
.alert-modal__icon svg { width: 32px; height: 32px; }
.alert-modal__head h2 { margin: 0; flex: 1 1 auto; font-size: 30px; font-weight: 800; color: var(--crit); letter-spacing: -.01em; }
.alert-modal__count { font-size: 22px; font-weight: 700; opacity: .8; }
/* X de cierre: siempre arriba a la derecha, grande para el control remoto. */
.alert-modal__close {
    flex-shrink: 0; width: 52px; height: 52px; border-radius: 12px;
    display: grid; place-items: center; cursor: pointer;
    background: var(--surface-2); color: var(--text);
    border: 1px solid var(--line-2);
}
.alert-modal__close:hover,
.alert-modal__close:focus-visible { border-color: var(--crit); color: var(--crit); outline: none; }
.alert-modal__list {
    list-style: none; margin: 0 0 22px; padding: 0;
    display: flex; flex-direction: column; gap: 12px;
    max-height: 520px; overflow-y: auto;
}
.alert-item--more {
    border-left-color: var(--line-2);
    font-size: 16px; font-weight: 700; color: var(--muted); text-align: center;
}
.alert-modal__actions .btn-danger:focus-visible,
.alert-modal__actions .btn-ghost:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.alert-item {
    border: 1px solid var(--line); border-left: 5px solid var(--crit);
    border-radius: 11px; padding: 16px 20px; background: var(--surface-2);
}
.alert-item__srv { font-size: 22px; font-weight: 800; color: var(--navy); line-height: 1.25; }
.alert-item__reason {
    display: flex; align-items: center; gap: 9px;
    font-size: 17px; font-weight: 600; color: var(--crit); margin-top: 6px;
}
.alert-item__reason svg { width: 20px; height: 20px; flex-shrink: 0; }
.alert-modal__actions { display: flex; justify-content: flex-end; gap: 12px; }
.alert-modal__actions .btn-ghost,
.alert-modal__actions .btn-danger {
    font-size: 16.5px; padding: 13px 26px; border-radius: 9px;
}

/* Barra de tiempo del popup: comienza llena y se vacía en 10 s (izq -> der).
   Al llegar a vacía, el popup se cierra solo. Se reinicia en cada alerta nueva. */
.alert-modal__progress {
    margin-top: 20px; height: 7px; border-radius: 999px; overflow: hidden;
    background: rgba(214, 69, 69, .16);
}
.alert-modal__bar {
    display: block; height: 100%; width: 100%; border-radius: inherit;
    background: var(--crit); transform: scaleX(1); transform-origin: left center;
}
.alert-modal__bar.is-counting { transform: scaleX(0); transition: transform 10s linear; }
:root[data-theme="dark"] .alert-modal__progress { background: rgba(255, 255, 255, .12); }
/* En pantallas chicas se mantiene grande, pero sin desbordar. */
@media (max-width: 560px) {
    .alert-modal__card { padding: 22px 20px 18px; }
    .alert-modal__head h2 { font-size: 23px; }
    .alert-modal__icon { width: 50px; height: 50px; }
    .alert-item__srv { font-size: 19px; }
    .alert-item__reason { font-size: 15px; }
}

/* Versión actual del panel: discreta, fija abajo a la derecha, sin tapar contenido. */
.app-version {
    position: fixed; right: 12px; bottom: 10px; z-index: 20;
    padding: 3px 9px; border-radius: 999px;
    font-size: 11px; font-weight: 600; letter-spacing: .02em;
    color: var(--muted); background: var(--surface-2);
    border: 1px solid var(--line); opacity: .75;
    pointer-events: none; user-select: none;
}

/* ---------- Página Changelog ---------- */
.changelog { display: flex; flex-direction: column; gap: 14px; max-width: 760px; margin: 0 auto; }
.changelog__entry {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 16px 18px;
    display: grid; grid-template-columns: 76px 1fr; gap: 16px; align-items: start;
}
.changelog__ver {
    font-size: 14px; font-weight: 800; color: var(--navy);
    background: var(--navy-soft); border: 1px solid var(--line-2);
    border-radius: 8px; padding: 5px 0; text-align: center;
}
.changelog__list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.changelog__list li { font-size: 13px; color: var(--muted); line-height: 1.45; }
@media (max-width: 560px) {
    .changelog__entry { grid-template-columns: 1fr; gap: 10px; }
    .changelog__ver { justify-self: start; padding: 4px 12px; }
}

/* ---------- Página Registro de alertas ---------- */
.alert-log { max-width: 620px; margin: 0 auto; }
.alert-log__list {
    display: flex; flex-direction: column; gap: 10px;
    max-height: 70vh; overflow-y: auto; padding-right: 4px;
}
.log-card {
    border: 1px solid var(--line); border-left: 4px solid var(--line-2);
    border-radius: 12px; padding: 12px 14px; background: var(--surface);
}
.log-card__time { font-size: 11.5px; font-weight: 600; letter-spacing: .02em; color: var(--muted); }
.log-card__msg  { font-size: 13.5px; font-weight: 650; color: var(--navy); margin-top: 3px; line-height: 1.4; }
.log-card__meta { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Colores suaves por gravedad (claro). */
.log-card--crit { background: #fdecec; border-color: #f3b9b9; border-left-color: #d64545; }
.log-card--warn { background: #fbf3d3; border-color: #ecd98f; border-left-color: #cf9d1f; }
.log-card--ok   { background: #e4f7ea; border-color: #b3e2c2; border-left-color: #2f9e5c; }
/* Colores suaves por gravedad (oscuro). */
:root[data-theme="dark"] .log-card--crit { background: #331d20; border-color: #613036; border-left-color: #e06a6a; }
:root[data-theme="dark"] .log-card--warn { background: #33301a; border-color: #5f5729; border-left-color: #e0c24a; }
:root[data-theme="dark"] .log-card--ok   { background: #14311f; border-color: #2a5738; border-left-color: #4fbd7c; }

/* ---------- Aviso de mantenimiento global ---------- */
.maint-banner {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 22px; font-size: 13px; font-weight: 600;
    background: #fbf3d3; color: #7a5c10; border-bottom: 1px solid #eacb73;
}
.maint-banner svg { flex-shrink: 0; }
:root[data-theme="dark"] .maint-banner { background: #33301a; color: #e6cf7a; border-bottom-color: #5f5729; }

/* ---------- Página Configuración ---------- */
.settings { max-width: 840px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.settings__form { display: flex; flex-direction: column; gap: 16px; }
.cfg-card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 18px 20px;
}
.cfg-card__title {
    margin: 0 0 14px; font-size: 15px; font-weight: 750; color: var(--navy);
    padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.cfg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; align-items: end; }
.cfg-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cfg-field > span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.cfg-field input, .cfg-field select {
    width: 100%; box-sizing: border-box; padding: 9px 11px;
    background: var(--field); color: var(--navy);
    border: 1px solid var(--line-2); border-radius: 9px;
    font-size: 13.5px; font-family: inherit;
}
.cfg-field input:focus, .cfg-field select:focus { outline: none; border-color: var(--navy); }
.cfg-field--wide { grid-column: 1 / -1; }
.cfg-field--ro .cfg-ro {
    padding: 9px 11px; border: 1px dashed var(--line-2); border-radius: 9px;
    background: var(--surface-2); color: var(--navy); font-weight: 700; font-size: 14px;
}
.cfg-check { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--navy); }
.cfg-check input { width: 16px; height: 16px; flex-shrink: 0; }
.cfg-check--wide { grid-column: 1 / -1; }
.cfg-check--danger span { color: var(--crit); font-weight: 600; }
.cfg-actions { margin-top: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cfg-hint { font-size: 11.5px; color: var(--muted-2); }
.settings__save { display: flex; justify-content: flex-end; }
@media (max-width: 620px) { .cfg-grid { grid-template-columns: 1fr; } }

/* ---------- Tarjeta clickeable (abre la ficha) ---------- */
.server-card--link { cursor: pointer; }
.server-card--link:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.server-card__sla { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.server-card__slasub { font-size: 11px; color: var(--muted-2); }

/* Chip de disponibilidad (colores suaves, claro + oscuro). */
.sla-chip { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid; }
.sla-chip--green  { background: #e4f7ea; border-color: #b3e2c2; color: #1f7a44; }
.sla-chip--yellow { background: #fbf3d3; border-color: #ecd98f; color: #8a6d12; }
.sla-chip--red    { background: #fdecec; border-color: #f3b9b9; color: #b3352f; }
:root[data-theme="dark"] .sla-chip--green  { background: #14311f; border-color: #2a5738; color: #6fd79b; }
:root[data-theme="dark"] .sla-chip--yellow { background: #33301a; border-color: #5f5729; color: #e0c24a; }
:root[data-theme="dark"] .sla-chip--red    { background: #331d20; border-color: #613036; color: #e79a9a; }

/* ---------- Ficha individual del servidor ---------- */
.ficha { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.ficha-head { display: flex; justify-content: space-between; align-items: center; gap: 16px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.ficha-head__main h2 { margin: 0 0 6px; font-size: 18px; color: var(--navy); }
.ficha-head__meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 12.5px; color: var(--muted); }
.chip-scope { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.ficha-client { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 20px; }
.ficha-client__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.ficha-client__grid span { display: block; font-size: 11.5px; color: var(--muted-2); }
.ficha-client__grid b { font-size: 13.5px; color: var(--navy); font-weight: 650; }

.sla-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.sla-block__title { margin: 0 0 14px; font-size: 15px; font-weight: 750; color: var(--navy); padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.sla-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.sla-tile { border: 1px solid var(--line); border-left: 4px solid var(--line-2); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); }
.sla-tile__label { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.sla-tile__pct { font-size: 22px; font-weight: 800; margin: 4px 0 6px; color: var(--navy); }
.sla-tile__sub { font-size: 11.5px; color: var(--muted); }
.sla-tile--green  { border-left-color: #2f9e5c; } .sla-tile--green  .sla-tile__pct { color: #1f7a44; }
.sla-tile--yellow { border-left-color: #cf9d1f; } .sla-tile--yellow .sla-tile__pct { color: #8a6d12; }
.sla-tile--red    { border-left-color: #d64545; } .sla-tile--red    .sla-tile__pct { color: #b3352f; }
:root[data-theme="dark"] .sla-tile--green  .sla-tile__pct { color: #6fd79b; }
:root[data-theme="dark"] .sla-tile--yellow .sla-tile__pct { color: #e0c24a; }
:root[data-theme="dark"] .sla-tile--red    .sla-tile__pct { color: #e79a9a; }

.sla-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 14px; }
.sla-stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.sla-stat span { display: block; font-size: 11.5px; color: var(--muted-2); }
.sla-stat b { font-size: 14px; color: var(--navy); font-weight: 700; }

/* Historial de incidentes */
.inc-list { max-height: 60vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
.inc-row { display: grid; grid-template-columns: 1.4fr 1.4fr 1fr .8fr 1fr .6fr; gap: 8px; padding: 9px 12px;
    font-size: 12.5px; color: var(--navy); border-bottom: 1px solid var(--line); align-items: center; }
.inc-row:last-child { border-bottom: none; }
.inc-row--head { position: sticky; top: 0; background: var(--surface-2); font-weight: 700; font-size: 11.5px; color: var(--muted); z-index: 1; }
.inc-badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.inc-badge--open   { background: #fdecec; color: #b3352f; }
.inc-badge--closed { background: #e4f7ea; color: #1f7a44; }
:root[data-theme="dark"] .inc-badge--open   { background: #331d20; color: #e79a9a; }
:root[data-theme="dark"] .inc-badge--closed { background: #14311f; color: #6fd79b; }
@media (max-width: 640px) {
    .inc-row--head { display: none; }
    .inc-row { grid-template-columns: 1fr; gap: 3px; padding: 10px 12px; }
    .inc-row span::before { content: attr(data-th) ": "; color: var(--muted-2); font-weight: 600; }
}

@media (prefers-reduced-motion: reduce) {
    .server-card--alert::after { animation: none; opacity: 1; }
    .alert-modal__card { animation: none; }
    .alert-modal__bar.is-counting { transition: none; }
    .server-card .pill--ok .pill__dot { animation: none; } /* queda el glow verde estático */
}

/* ---------- Incidente público en la ficha del servidor (gestión NOC) ---------- */
.incident-block { border-left: 4px solid var(--accent); }
.incident-block__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.incident-tag {
    display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: var(--accent); margin-bottom: 4px;
}
.incident-block .sla-block__title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; }

.inc-state {
    display: inline-flex; align-items: center; padding: 3px 11px; border-radius: 999px;
    font-size: 12px; font-weight: 600; border: 1px solid transparent;
}
.inc-state--sm { padding: 1px 9px; font-size: 11px; }
.inc-state--green { color: var(--ok);   background: var(--ok-bg);   border-color: #cdeadd; }
.inc-state--amber { color: var(--warn, #b9810b); background: #fbf3e2; border-color: #f0e2c2; }
.inc-state--red   { color: var(--crit); background: var(--crit-bg); border-color: #f2caca; }
:root[data-theme="dark"] .inc-state--green { background: #14311f; color: #6fd79b; }
:root[data-theme="dark"] .inc-state--amber { background: #33290f; color: #e6c169; }
:root[data-theme="dark"] .inc-state--red   { background: #331d20; color: #e79a9a; }

.incident-meta { display: flex; flex-wrap: wrap; gap: 22px; margin: 14px 0 4px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.incident-meta div { display: flex; flex-direction: column; gap: 2px; }
.incident-meta span { font-size: 11.5px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .03em; }
.incident-meta b { font-size: 13.5px; color: var(--navy); font-weight: 600; }

.inc-timeline { list-style: none; margin: 16px 0 6px; padding: 0; }
.inc-timeline__item { position: relative; padding: 0 0 14px 18px; border-left: 2px solid var(--line-2); }
.inc-timeline__item:last-child { padding-bottom: 2px; }
.inc-timeline__item::before { content: ""; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--muted-2); }
.inc-timeline__item:first-child::before { border-color: var(--accent); }
.inc-timeline__row { display: flex; align-items: center; gap: 8px; }
.inc-timeline__time { font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; font-size: 13px; }
.inc-timeline__msg { margin: 5px 0 3px; font-size: 13.5px; color: var(--text); }
.inc-timeline__author { font-size: 12px; color: var(--muted-2); }

.incident-form { margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--line); }
.incident-form__title { font-size: 14px; font-weight: 700; color: var(--navy); margin: 0 0 12px; }

/* Edición en línea del nombre visible (listado de usuarios) */
.inline-edit { display: inline-flex; align-items: center; gap: 6px; }
.form-input--sm { padding: 5px 9px; font-size: 12.5px; width: 150px; max-width: 40vw; }

/* ============================================================
   MONITOREO CENTRAL — pantalla operativa central del NOC
   Vista general extensible; hoy muestra el estado de los backups diarios.
   Legible de lejos (TV): números grandes, estados con color + etiqueta + icono.
   Reutiliza los tokens de estado del panel (--ok/--warn/--crit/--accent) para ser
   coherente en claro y oscuro. Los valores con geometría (anillo, barra) los pinta
   assets/js/central.js por CSSOM (la CSP prohíbe estilos en línea).
   ============================================================ */

/* En la vista central no hay grilla de servidores: se ocultan los contadores de
   servidores del topbar (la vista trae su propio resumen). */
body.view-central .topbar__stats { display: none; }

.central { display: flex; flex-direction: column; gap: 18px; }

/* Colores de estado locales (mapean a la paleta del panel). */
.central {
    --c-ok:   var(--ok);
    --c-warn: var(--warn);
    --c-crit: var(--crit);
    --c-run:  var(--accent);
    --c-idle: var(--muted-2);
    --c-track: var(--line-2);
}

/* --- Encabezado --- */
.central-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.central-head h2 { margin: 0; font-size: 18px; font-weight: 800; color: var(--navy); }
.central-head__date { color: var(--muted-2); font-weight: 700; }
.central-head__note {
    font-size: 11.5px; color: var(--muted-2); background: var(--surface-2);
    border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
}
.central-head__note--live { color: var(--c-ok, #17926a); background: var(--ok-bg); border-color: var(--ok-line); }

/* --- Resumen general (tiles) ---
   El color va en el ICONO (con fondo suave), no en una barra decorativa. */
.central-summary {
    display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px;
}
.central-tile {
    display: flex; align-items: center; gap: 13px; min-width: 0;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px 16px;
}
.central-tile__ico {
    flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px;
    display: grid; place-items: center; background: var(--surface-2); color: var(--muted-2);
}
.central-tile__ico svg { width: 23px; height: 23px; }
.central-tile__meta { min-width: 0; }
.central-tile__num { font-size: 30px; line-height: 1; font-weight: 850; color: var(--navy); font-variant-numeric: tabular-nums; }
.central-tile__label { margin-top: 5px; font-size: 12px; color: var(--muted); font-weight: 600; }
/* Color semántico del icono por estado. */
.central-tile--total .central-tile__ico { background: var(--surface-2);     color: var(--muted); }
.central-tile--ok    .central-tile__ico { background: var(--ok-bg);         color: var(--c-ok); }
.central-tile--warn  .central-tile__ico { background: var(--warn-bg);       color: var(--c-warn); }
.central-tile--crit  .central-tile__ico { background: var(--crit-bg);       color: var(--c-crit); }
.central-tile--run   .central-tile__ico { background: var(--accent-soft);   color: var(--c-run); }
.central-tile--idle  .central-tile__ico { background: var(--surface-2);     color: var(--c-idle); }

/* --- Distribución principal (tabla + lateral) --- */
.central-grid { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 18px; align-items: start; }
.central-main, .central-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.central-block__head { padding: 13px 18px; border-bottom: 1px solid var(--line); }
.central-block__head h3 { margin: 0; font-size: 14px; font-weight: 750; color: var(--navy); }
.central-block__head h3 span { color: var(--muted-2); font-weight: 650; }
.central-block__head h3 span b { font-weight: 750; font-variant-numeric: tabular-nums; }
/* Cabecera con título + filtro alineados en una fila. */
.central-block__head--row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Filtro por tipo de servidor (solo afecta al listado y sus incidencias). */
.central-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; flex-shrink: 0; }
.central-seg__btn {
    appearance: none; border: 0; background: var(--field); cursor: pointer;
    font-family: var(--font); font-size: 12px; font-weight: 650; color: var(--muted);
    padding: 5px 12px; transition: background .14s, color .14s;
}
.central-seg__btn + .central-seg__btn { border-left: 1px solid var(--line); }
.central-seg__btn:hover { background: var(--surface-2); color: var(--navy); }
.central-seg__btn.is-active { background: var(--accent); color: #fff; }
:root[data-theme="dark"] .central-seg__btn.is-active { background: #2554c6; }

/* --- Tabla: estado por servidor --- */
.central-table-wrap { overflow-x: auto; }
.central-empty { padding: 26px 18px; color: var(--muted); font-size: 13px; }
.central-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.central-table thead th {
    text-align: left; padding: 10px 16px; font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; color: var(--muted-2); background: var(--surface-2); border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.central-row td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.central-table tbody tr:last-child td { border-bottom: none; }
/* Franja de color a la izquierda: lo problemático "salta" de inmediato. */
.central-row { border-left: 3px solid transparent; }
.central-row.is-crit { border-left-color: var(--c-crit); background: var(--crit-bg); }
.central-row.is-warn { border-left-color: var(--c-warn); }
.central-row.is-run  { border-left-color: var(--c-run); }
.central-row.is-idle { border-left-color: var(--c-idle); }
.central-row.is-stale { border-left-color: var(--c-warn); }

.central-row__server { min-width: 160px; }
.central-row__name { font-weight: 700; color: var(--navy); }
.central-row__os { display: inline-block; margin-left: 8px; font-size: 10.5px; font-weight: 600; color: var(--muted-2); }
.central-flag {
    display: inline-block; margin-left: 8px; font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .03em; color: var(--c-warn); background: var(--warn-bg); border: 1px solid var(--line);
    border-radius: 999px; padding: 1px 7px;
}
.central-row__clock { font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.central-row__rel { display: block; font-size: 11.5px; color: var(--muted); }
.central-row__rel--none { color: var(--c-idle); font-weight: 600; }
.central-row__dur, .central-row__age { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Pastilla de estado (color + icono + etiqueta). */
.central-pill {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px 3px 8px; border-radius: 999px;
    font-size: 11.5px; font-weight: 700; border: 1px solid transparent; white-space: nowrap;
}
.central-pill svg { width: 13px; height: 13px; flex-shrink: 0; }
.central-pill--ok   { color: var(--c-ok);   background: var(--ok-bg);   border-color: var(--ok-line); }
.central-pill--warn { color: var(--c-warn); background: var(--warn-bg); border-color: #f0e2c2; }
.central-pill--crit { color: var(--c-crit); background: var(--crit-bg); border-color: #f2caca; }
.central-pill--run  { color: var(--c-run);  background: var(--accent-soft); border-color: transparent; }
.central-pill--idle { color: var(--muted);  background: var(--surface-2); border-color: var(--line); }
:root[data-theme="dark"] .central-pill--warn { border-color: #4d3d14; }
:root[data-theme="dark"] .central-pill--crit { border-color: #542626; }
/* El icono "en ejecución" gira para transmitir actividad. */
.central-pill--run svg { animation: centralSpin 1.1s linear infinite; }
@keyframes centralSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .central-pill--run svg { animation: none; } }

/* --- Columna lateral --- */
.central-side { display: flex; flex-direction: column; gap: 18px; }

/* Resumen de éxito: anillo + leyenda + barra de composición. */
.central-success__body { display: flex; align-items: center; gap: 18px; padding: 18px; }
.central-ring {
    --pct: 0%;   /* lo fija central.js según el % OK */
    flex-shrink: 0; width: 132px; height: 132px; border-radius: 50%;
    background: conic-gradient(var(--c-ok) 0 var(--pct), var(--c-track) var(--pct) 100%);
    display: grid; place-items: center;
}
.central-ring__hole {
    width: 96px; height: 96px; border-radius: 50%; background: var(--surface);
    /* Centrado real (horizontal y vertical) del %: flex-column centrado en vez de
       grid, para que el número y "OK" queden ópticamente en el centro del anillo. */
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; box-shadow: inset 0 0 0 1px var(--line);
}
.central-ring__pct { font-size: 27px; font-weight: 850; color: var(--navy); line-height: 1.05; font-variant-numeric: tabular-nums; }
.central-ring__cap { margin-top: 2px; font-size: 11px; font-weight: 700; color: var(--c-ok); letter-spacing: .06em; }
.central-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; flex: 1 1 auto; min-width: 0; }
.central-legend li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.central-legend b { margin-left: auto; font-size: 14px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.central-legend__dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.central-legend__dot--ok   { background: var(--c-ok); }
.central-legend__dot--crit { background: var(--c-crit); }
.central-legend__dot--idle { background: var(--c-idle); }
/* Barra de composición (proporciones por CSSOM: flex-grow por data-count). */
.central-splitbar { display: flex; gap: 2px; height: 8px; margin: 0 18px 18px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.central-splitbar__seg { display: block; min-width: 0; height: 100%; }
.central-splitbar__seg--ok   { background: var(--c-ok); }
.central-splitbar__seg--crit { background: var(--c-crit); }
.central-splitbar__seg--idle { background: var(--c-idle); }

/* Incidencias recientes. */
.central-incidents__ok {
    display: flex; align-items: center; gap: 9px; padding: 20px 18px; color: var(--c-ok); font-size: 13px; font-weight: 600;
}
.central-incidents__ok svg { width: 18px; height: 18px; }
.central-inc-list { list-style: none; margin: 0; padding: 6px; display: flex; flex-direction: column; gap: 4px; max-height: 340px; overflow-y: auto; }
.central-inc { display: flex; gap: 10px; padding: 9px 10px; border-radius: 10px; }
.central-inc:hover { background: var(--surface-2); }
.central-inc__bar { flex-shrink: 0; width: 3px; border-radius: 999px; background: var(--c-idle); }
.central-inc--crit .central-inc__bar { background: var(--c-crit); }
.central-inc--warn .central-inc__bar { background: var(--c-warn); }
.central-inc--idle .central-inc__bar { background: var(--c-idle); }
.central-inc__body { min-width: 0; flex: 1 1 auto; }
.central-inc__top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.central-inc__server { font-weight: 700; color: var(--navy); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.central-inc__when { flex-shrink: 0; font-size: 11px; color: var(--muted-2); }
.central-inc__type { font-size: 12px; color: var(--muted); margin-top: 2px; }
.central-inc--crit .central-inc__type { color: var(--c-crit); font-weight: 600; }

/* --- Responsivo ---
   El colapso a 1 columna se baja a 820px para que las TVs (1280px o menos por
   zoom/overscan) conserven las DOS columnas (tabla + Resumen/Incidencias) y no
   empujen el lateral debajo de la tabla, que era lo que "perdía" el Resumen de
   éxito en la pantalla del NOC. */
@media (max-width: 820px) {
    .central-grid { grid-template-columns: 1fr; }
    .central-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
    .central-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .central-success__body { flex-direction: column; }
}
:root[data-theme="dark"] .central-ring__hole { background: var(--surface); }

/* ============================================================
   MONITOREO CENTRAL — MODO VIDEO-WALL (pantalla del NOC)
   La vista central debe entrar ENTERA en una pantalla, sin scroll de página:
   es un muro de monitoreo montado en la pared, sin nadie que haga scroll. Se
   ancla al alto del viewport; los KPIs, el Resumen de éxito y las Incidencias
   quedan SIEMPRE visibles, y solo la tabla (y la lista de incidencias, si hiciera
   falta) hace scroll interno. Las filas problemáticas ya van primero por
   severidad, así que lo importante queda arriba.

   Se aplica SOLO cuando la vista central está activa (body.view-central, que ya
   marca dashboard-rotate.js) y solo desde 820px de ancho hacia arriba: en móviles
   se conserva el desplazamiento normal del documento.
   ============================================================ */
/* Muro del NOC (TV Hisense/VIDAA) — la tabla lista TODOS los servidores de una,
   sin scroll interno ni tope de altura. El navegador de la TV calcula MAL las
   unidades de viewport (vh/dvh salen más chicas que el alto real de la pantalla):
   cualquier tope en vh recortaba la tabla a ~6 filas y dejaba medio muro vacío
   debajo. Por eso NO se acota la tabla: fluye a su alto natural y, como el muro
   tiene lugar de sobra, entran todas las filas. El Resumen de éxito y las
   Incidencias quedan a la derecha (2 columnas) siempre visibles. La cabecera se
   deja sticky por si en algún caso hubiera scroll de página. */
.central-table thead th { position: sticky; top: 0; z-index: 1; }

/* ============================================================
   PANTALLA DE NODOS (nodes.php + assets/js/nodes.js)
   Izquierda 1/3: WAN, relojes del FortiGate, tiempo de respuesta, consumo.
   Derecha 2/3: una tira horizontal por nodo. Estilo Grafana, sin vh/dvh (TVs).
   ============================================================ */
.nodes-board {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 16px;
    align-items: start;
}
@media (max-width: 1100px) { .nodes-board { grid-template-columns: minmax(0, 1fr); } }
.nodes-left, .nodes-right { min-width: 0; }
.nodes-left { display: flex; flex-direction: column; gap: 16px; }

.nd-alert { grid-column: 1 / -1; padding: 10px 14px; border-radius: 10px; font-size: 13px; font-weight: 600; border: 1px solid var(--line); }
.nd-alert[hidden] { display: none; }
.nd-alert--info { background: var(--surface-2); color: var(--muted); }
.nd-alert--warn { background: var(--warn-bg); color: var(--warn); border-color: currentColor; }

.nd-card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 14px 16px 12px;
    box-shadow: var(--shadow); min-width: 0;
}
.nd-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.nd-card__title { margin: 0; font-size: 12.5px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--navy); }
.nd-card__sub { font-size: 11px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nd-card__sub.is-warn { color: var(--warn); font-weight: 600; }

/* Gráficos de líneas (SVG). Colores por clase (CSP: nada de estilos en línea). */
.nd-chart { width: 100%; min-height: 168px; }
.nd-svg { display: block; width: 100%; height: auto; }
.nd-grid { stroke: var(--line); stroke-width: 1; }
.nd-grid--v { stroke-dasharray: 2 4; }
.nd-axis { fill: var(--muted-2); font-size: 10px; font-family: var(--font); }
.nd-axis--empty { font-size: 12px; }
.nd-line { fill: none; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.nd-area { stroke: none; opacity: .12; }
.nd-line.s-rx, .nd-leg__sw.s-rx { stroke: #56a64b; background: #56a64b; }
.nd-area.s-rx { fill: #56a64b; }
.nd-line.s-tx, .nd-leg__sw.s-tx { stroke: #e0b400; background: #e0b400; }
.nd-area.s-tx { fill: #e0b400; }
.nd-line.s-inet, .nd-leg__sw.s-inet { stroke: #3274d9; background: #3274d9; }
.nd-area.s-inet { fill: #3274d9; }
.nd-line.s-forti, .nd-leg__sw.s-forti { stroke: #56a64b; background: #56a64b; }
.nd-area.s-forti { fill: #56a64b; }
.nd-line.s-nodes, .nd-leg__sw.s-nodes { stroke: #a352cc; background: #a352cc; }
.nd-area.s-nodes { fill: #a352cc; opacity: .06; }
:root[data-theme="dark"] .nd-line.s-rx, :root[data-theme="dark"] .nd-line.s-forti { stroke: #73bf69; }
:root[data-theme="dark"] .nd-line.s-tx { stroke: #f2cc0c; }
:root[data-theme="dark"] .nd-line.s-inet { stroke: #5794f2; }
:root[data-theme="dark"] .nd-line.s-nodes { stroke: #b877d9; }
.nd-legend { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.nd-leg { white-space: nowrap; }
.nd-leg b { color: var(--navy); margin: 0 5px; font-variant-numeric: tabular-nums; }
.nd-leg em { font-style: normal; color: var(--muted-2); }
.nd-leg em.is-warn { color: var(--crit); font-weight: 700; }
.nd-leg__sw { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

/* Relojes del FortiGate (gauge de 240°, como Grafana). */
.nd-gauges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.nd-gauge { min-width: 0; text-align: center; }
.nd-gauge__svg { display: block; width: 100%; height: auto; }
.nd-gauge__label { margin-top: -18px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.nd-gtrack { fill: none; stroke: #e6eaf2; stroke-width: 14; }
:root[data-theme="dark"] .nd-gtrack { stroke: #2a3550; }
.nd-gval { fill: none; stroke-width: 14; }
.nd-gval--ok   { stroke: #56a64b; }
.nd-gval--warn { stroke: #e0b400; }
.nd-gval--crit { stroke: #e02f44; }
.nd-gval--acc  { stroke: #3274d9; }
:root[data-theme="dark"] .nd-gval--ok { stroke: #73bf69; }
:root[data-theme="dark"] .nd-gval--acc { stroke: #5794f2; }
.nd-gband { fill: none; stroke-width: 4; }
.nd-gband--ok   { stroke: #56a64b; }
.nd-gband--warn { stroke: #e0b400; }
.nd-gband--crit { stroke: #e02f44; }
.nd-gtext { font-size: 30px; font-weight: 800; font-family: var(--font); fill: var(--navy); }
.nd-gtext--ok   { fill: #56a64b; }
.nd-gtext--warn { fill: #c99a00; }
.nd-gtext--crit { fill: #e02f44; }
.nd-gtext--idle { fill: var(--muted-2); }
:root[data-theme="dark"] .nd-gtext--ok { fill: #73bf69; }
.nd-gsub { font-size: 12px; font-family: var(--font); fill: var(--muted-2); }
.nd-gtext--sm { font-size: 24px; }
.nd-gtrack--inner { stroke-width: 6; }
.nd-gval--inner { stroke-width: 6; }
.nd-gauge__foot { min-height: 15px; margin-top: 2px; font-size: 11px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nd-dotpt { stroke: none; }
.nd-dotpt.s-rx, .nd-dotpt.s-forti { fill: #56a64b; }
.nd-dotpt.s-tx { fill: #e0b400; }
.nd-dotpt.s-inet { fill: #3274d9; }
.nd-dotpt.s-nodes { fill: #a352cc; }

/* Consumo eléctrico: lista por nodo + total. */
.nd-power { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 14px; align-items: center; }
.nd-power__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.nd-power__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(40px, 1fr) 64px; gap: 10px; align-items: center; font-size: 12.5px; }
.nd-power__row--empty { display: block; color: var(--muted-2); }
.nd-power__name { color: var(--navy); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nd-power__bar { display: block; }
.nd-power__fill { display: block; height: 100%; border-radius: 999px; background: #ff9830; }
.nd-power__w { text-align: right; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.nd-power__total { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2px; padding-left: 14px; border-left: 1px solid var(--line); min-width: 0; }
.nd-power__label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.nd-power__value { font-size: 32px; font-weight: 800; color: #e8740c; font-variant-numeric: tabular-nums; line-height: 1.1; }
:root[data-theme="dark"] .nd-power__value { color: #ff9830; }
.nd-power__hint { font-size: 11px; color: var(--muted-2); }

/* Tiras horizontales de nodos (derecha). */
.nd-strips { display: flex; flex-direction: column; gap: 12px; }
.nd-strip {
    display: grid;
    /* nombre | CPU+RAM apiladas | discos (lo más ancho) | consumo | hardware */
    grid-template-columns: minmax(180px, 1.2fr) minmax(0, 1.25fr) minmax(0, 1.9fr) minmax(96px, .65fr) minmax(104px, .7fr);
    gap: 18px; align-items: center;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); min-width: 0;
}
.nd-strip[hidden] { display: none; }
/* Sin barra lateral de color: el estado lo indica el punto. Solo un nodo
   DESCONECTADO se resalta, con el mismo halo rojo (estático) de las tarjetas. */
.nd-strip--crit { border-color: var(--crit); box-shadow: 0 0 0 1px var(--crit), 0 0 18px 2px rgba(214, 69, 69, .3); }
.nd-strip--off  { border-color: #3a2f66; }
.nd-strip--crit .nd-metric, .nd-strip--idle .nd-metric { opacity: .6; }
.nd-strip--crit .nd-perf .nd-metric, .nd-strip--idle .nd-perf .nd-metric { opacity: 1; }
.nd-strip--crit .nd-perf, .nd-strip--idle .nd-perf { opacity: .6; }
@media (max-width: 1500px) {
    .nd-strip { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) minmax(90px, .7fr) minmax(96px, .7fr); }
    .nd-strip__id { grid-column: 1 / -1; }
}
.nd-perf { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
@media (max-width: 640px) { .nd-strip { grid-template-columns: minmax(0, 1fr); } }
.nd-strip__id { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.nd-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 6px; background: var(--muted-2); }
/* Conectado: titila igual que el punto de las tarjetas, animando solo la
   OPACIDAD (la resuelve la GPU, no repinta la página). */
.nd-dot--ok   { background: var(--ok); box-shadow: 0 0 6px 1px rgba(53, 201, 144, .5); animation: connDot 2.2s ease-in-out infinite; will-change: opacity; }
@media (prefers-reduced-motion: reduce) { .nd-dot--ok { animation: none; } }
.nd-dot--crit { background: var(--crit); }
.nd-dot--off  { background: var(--off); }
.nd-strip__names { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 auto; }
.nd-strip__name { font-size: 15.5px; font-weight: 700; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nd-strip__name:hover { text-decoration: underline; }
.nd-strip__names small { font-size: 11px; color: var(--muted-2); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nd-strip__names .nd-strip__model,
.nd-strip__names .nd-strip__report { font-family: var(--font); }
.nd-strip__edit { flex-shrink: 0; }
.nd-metric { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.nd-metric__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.nd-metric__label { font-size: 11px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.nd-metric__value { font-size: 15px; font-weight: 750; color: var(--navy); font-variant-numeric: tabular-nums; }
.nd-metric__value.is-muted { color: var(--muted-2); }
.nd-metric__sub { font-size: 11px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nd-metric__sub.is-crit { color: var(--crit); font-weight: 700; }
.nd-disks { display: flex; flex-direction: column; gap: 4px; }
.nd-disks--2col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; }
.nd-disk { display: grid; grid-template-columns: 26px minmax(0, 1fr) 46px; gap: 6px; align-items: center; font-size: 11.5px; }
.nd-disk__mp { font-family: var(--mono); font-weight: 600; color: var(--navy); }
.nd-disk__bar { display: block; }
.nd-disk__bar .meter__fill { display: block; }
.nd-disk__pct { text-align: right; font-weight: 650; color: var(--navy); font-variant-numeric: tabular-nums; }
.nd-big { font-size: 24px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; line-height: 1.1; }
.nd-chip { align-self: flex-start; font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; border: 1px solid transparent; }
.nd-chip--ok   { background: var(--ok-bg);   color: var(--ok);   border-color: currentColor; }
.nd-chip--warn { background: var(--warn-bg); color: var(--warn); border-color: currentColor; }
.nd-chip--crit { background: var(--crit-bg); color: var(--crit); border-color: currentColor; }
.nd-chip--idle { background: var(--surface-2); color: var(--muted); border-color: var(--line-2); }
.nd-empty { display: flex; flex-direction: column; gap: 6px; padding: 28px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.nd-empty b { color: var(--navy); font-size: 15px; }

/* ---- Detalle al pasar el mouse ----
   Cuadros: CSS puro sobre [data-tip] (nada corre en segundo plano). Gráficos:
   línea vertical + puntos + cuadro con la hora y los valores (nodes.js, solo
   mientras se mueve el mouse). */
.nodes-board [data-tip] { position: relative; cursor: default; }
.nodes-board [data-tip]:hover::after {
    content: attr(data-tip);
    position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
    z-index: 60; pointer-events: none;
    width: max-content; max-width: 320px; white-space: pre-line; text-align: left;
    padding: 8px 11px; border-radius: 8px;
    background: #0b1424; color: #e8eefc; border: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
    font: 500 12px/1.5 var(--font); letter-spacing: 0; text-transform: none;
}
/* En las tiras el detalle abre HACIA ABAJO (la primera tira está pegada arriba)
   y, en las columnas de la derecha, alineado al borde derecho (no se sale). */
.nd-strip [data-tip]:hover::after { bottom: auto; top: calc(100% + 8px); }
.nd-strip .nd-metric--watts[data-tip]:hover::after,
.nd-strip .nd-metric--health [data-tip]:hover::after { left: auto; right: 0; transform: none; }
.nd-strip .nd-strip__names[data-tip]:hover::after { left: 0; transform: none; }
.nd-chart { position: relative; }
.nd-chart__plot { width: 100%; }
.nd-guide { position: absolute; top: 6%; bottom: 13%; width: 1px; margin-left: -.5px; background: var(--muted-2); opacity: .7; pointer-events: none; }
.nd-guide[hidden], .nd-ctip[hidden] { display: none; }
.nd-gdots { position: absolute; inset: 0; pointer-events: none; }
.nd-gdot { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; border: 2px solid var(--surface); }
.nd-gdot.s-rx, .nd-gdot.s-forti { background: #56a64b; }
.nd-gdot.s-tx { background: #e0b400; }
.nd-gdot.s-inet { background: #3274d9; }
.nd-gdot.s-nodes { background: #a352cc; }
.nd-ctip {
    position: absolute; top: 4px; margin-left: 12px; z-index: 5; pointer-events: none;
    padding: 7px 10px; border-radius: 8px; white-space: nowrap;
    background: #0b1424; color: #e8eefc; border: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .35); font-size: 12px; line-height: 1.5;
}
.nd-ctip.is-left { margin-left: 0; transform: translateX(calc(-100% - 12px)); }
.nd-ctip__time { font-weight: 700; margin-bottom: 2px; }
.nd-ctip__row b { margin-left: 4px; font-variant-numeric: tabular-nums; }
.nd-ctip .nd-leg__sw { margin-right: 6px; }

/* Mismo acabado que las tarjetas en el tema oscuro. */
:root[data-theme="dark"] .nd-card,
:root[data-theme="dark"] .nd-strip,
:root[data-theme="dark"] .nd-empty {
    background: linear-gradient(180deg, rgba(255,255,255,.022), rgba(255,255,255,0) 60%), var(--surface);
}

/* Reloj en vivo de la pantalla de Nodos (barra superior, al centro). */
@font-face { font-family: "Geist"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/geist-700.woff2") format("woff2"); }
/* Pastilla con el mismo lenguaje que el buscador: integrada, pero la hora resalta
   (negrita, blanco grisáceo, números de ancho fijo). */
.nd-clock {
    display: inline-flex; align-items: center; gap: 9px;
    height: 38px; padding: 0 16px; border-radius: 10px;
    background: var(--surface-2); border: 1px solid var(--line-2);
    white-space: nowrap;
}
.nd-clock svg { width: 16px; height: 16px; color: var(--muted-2); flex-shrink: 0; }
.nd-clock__time {
    font-family: "Geist", var(--font);
    font-weight: 700; font-size: 19px; line-height: 1; letter-spacing: .06em;
    font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1;
    color: var(--navy);
}
:root[data-theme="dark"] .nd-clock { background: rgba(255, 255, 255, .035); border-color: #24344f; }
:root[data-theme="dark"] .nd-clock__time { color: #d7dee9; }

/* Token del colector en Configuración (se muestra una sola vez). */
.collector-token { flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 12px; }
.collector-token__value { display: block; font-family: var(--mono); font-size: 13px; word-break: break-all; user-select: all; }
