/* Portal de Socios F7ERP — tokens calcados de NextERP/wwwroot/assets/css/nexterp-theme.css (backoffice Blazor).
   Chips rectangulares (sin ovalos), tipografia Nunito, marca navy #092C4C + azul #1E6BB8. */
:root {
    --nex-brand-primary: #092C4C;
    --nex-brand-primary-hover: #0B3A63;
    --nex-brand-accent: #1E6BB8;
    --nex-brand-accent-hover: #165594;
    --nex-brand-tint: #E9EFF5;
    --nex-surface-page: #F3F3F3;
    --nex-surface-card: #FFFFFF;
    --nex-surface-alt: #F4F6F8;
    --nex-surface-border: #E2E6EA;
    --nex-surface-divider: #E5E9EE;
    --nex-text-primary: #1F2937;
    --nex-text-muted: #5A6B7B;
    --nex-positive: #2E9E55;
    --nex-danger: #DC2626;
    --nex-warning: #E08C00;
    --nex-drawer-bg: #06223A;
    --nex-drawer-item: #C2D2E0;
    --nex-radius-card: 10px;
    --nex-radius-control: 6px;
    --nex-radius-chip: 4px;
    --nex-shadow-card: 0 2px 14px rgba(15, 23, 42, .07);
    --nex-shadow-card-hover: 0 2px 14px rgba(15, 23, 42, .14);
    --nex-font-family: "Nunito", "Segoe UI", -apple-system, sans-serif;
    --nex-ico-win: #1E6BB8;
    --nex-ico-mac: #1F2937;
    /* Contraste (WCAG AA >= 4.5:1, auditoría 13-11): texto sobre el botón primario y colores de las alertas. */
    --nex-on-accent: #FFFFFF;
    --nex-alerta-bg: #FFF6E5; --nex-alerta-txt: #7A4B00; --nex-alerta-borde: #F3D9A4;
    --nex-error-bg: #FDECEC;  --nex-error-txt: #8F1D1D;  --nex-error-borde: #F5C2C2;
}

@media (prefers-color-scheme: dark) {
    :root {
        --nex-brand-primary: #6CB4F0;
        --nex-brand-primary-hover: #8CC5F4;
        --nex-brand-accent: #6CB4F0;
        --nex-brand-accent-hover: #8CC5F4;
        --nex-brand-tint: #10243A;
        --nex-surface-page: #1B1B1B;
        --nex-surface-card: #272727;
        --nex-surface-alt: #1F1F1F;
        --nex-surface-border: #3A3A3A;
        --nex-surface-divider: #333333;
        --nex-text-primary: #F5F5F5;
        --nex-text-muted: #C2C2C2;
        --nex-shadow-card: 0 2px 14px rgba(0, 0, 0, .35);
        --nex-shadow-card-hover: 0 2px 14px rgba(0, 0, 0, .55);
        --nex-ico-win: #6CB4F0;
        --nex-ico-mac: #F5F5F5;
        /* En oscuro el acento es celeste claro: el texto del botón va oscuro (blanco sobre #6CB4F0 da 2.2:1). */
        --nex-on-accent: #08192B;
        --nex-alerta-bg: #33270F; --nex-alerta-txt: #F6D69A; --nex-alerta-borde: #6B5226;
        --nex-error-bg: #3D1A1A;  --nex-error-txt: #F8C4C4;  --nex-error-borde: #7A2E2E;
    }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--nex-font-family);
    background: var(--nex-surface-page);
    color: var(--nex-text-primary);
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--nex-brand-accent); }
h1, h2, h3 { margin: 0; font-weight: 800; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
.nx-muted { color: var(--nex-text-muted); }
.nx-mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: .78rem; color: var(--nex-text-muted); word-break: break-all; }

/* ---------- topbar (como el header del backoffice: logo sobre blanco + franja navy) ---------- */
.nx-topbar {
    background: #FFFFFF;
    border-bottom: 4px solid #092C4C;
    box-shadow: var(--nex-shadow-card);
    position: sticky; top: 0; z-index: 10;
}
.nx-topbar-in {
    max-width: 1240px; margin: 0 auto; padding: 10px 20px;
    display: flex; align-items: center; gap: 16px;
}
.nx-logo img { height: 34px; display: block; }
.nx-topbar-titulo {
    font-weight: 800; color: #092C4C; padding-left: 16px;
    border-left: 1px solid #E2E6EA; font-size: 1.05rem;
}
.nx-topbar-der { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.nx-usuario { display: flex; align-items: center; gap: 10px; }
.nx-avatar {
    width: 34px; height: 34px; border-radius: var(--nex-radius-control);
    background: #092C4C; color: #FFFFFF; display: grid; place-items: center; font-weight: 800;
}
.nx-usuario-txt { display: flex; flex-direction: column; line-height: 1.15; color: #1F2937; }
.nx-usuario-txt small { color: #5A6B7B; font-size: .78rem; }

/* ---------- layout ---------- */
.nx-main { max-width: 1240px; margin: 0 auto; padding: 24px 20px 40px; display: flex; flex-direction: column; gap: 20px; }
.nx-pie { text-align: center; color: var(--nex-text-muted); font-size: .8rem; padding: 0 0 24px; }
.nx-encabezado { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.nx-encabezado p { margin: 6px 0 0; }
.nx-selector { display: flex; flex-direction: column; min-width: 240px; }
.nx-dos-col { display: grid; grid-template-columns: 1fr 1.3fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .nx-dos-col { grid-template-columns: 1fr; } }

/* ---------- tarjetas ---------- */
.nx-card {
    background: var(--nex-surface-card);
    border: 1px solid var(--nex-surface-border);
    border-radius: var(--nex-radius-card);
    box-shadow: var(--nex-shadow-card);
    padding: 18px 20px;
}
.nx-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px solid var(--nex-surface-divider); }
.nx-destacado { border-left: 4px solid var(--nex-brand-accent); background: linear-gradient(0deg, var(--nex-surface-card), var(--nex-surface-card)); }
.nx-vacio { color: var(--nex-text-muted); padding: 14px 0; margin: 0; }

/* ---------- chips RECTANGULARES (sin ovalos) ---------- */
.nx-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: var(--nex-radius-chip);
    font-size: .78rem; font-weight: 700; white-space: nowrap;
    background: var(--nex-brand-tint); color: var(--nex-brand-primary);
    border: 1px solid rgba(30, 107, 184, .25);
}
.nx-chip-suave { background: var(--nex-surface-alt); color: var(--nex-text-muted); border-color: var(--nex-surface-border); font-weight: 600; }
.nx-chip-marca { background: #092C4C; color: #FFFFFF; border-color: #092C4C; text-transform: uppercase; font-size: .85rem; padding: 4px 12px; }

/* ---------- botones / formularios ---------- */
.nx-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: var(--nex-brand-accent); color: var(--nex-on-accent); border: 1px solid transparent;
    border-radius: var(--nex-radius-control); padding: 8px 16px; font-weight: 700; font-size: .9rem;
    text-decoration: none; cursor: pointer; font-family: inherit; white-space: nowrap;
    transition: background .15s ease;
}
.nx-btn:hover { background: var(--nex-brand-accent-hover); }
.nx-btn:focus-visible, .nx-input:focus-visible, .nx-manual:focus-visible { outline: 2px solid var(--nex-brand-accent); outline-offset: 2px; }
.nx-btn-ghost { background: transparent; color: var(--nex-brand-primary); border-color: var(--nex-surface-border); }
.nx-btn-ghost:hover { background: var(--nex-brand-tint); }
/* El topbar es blanco también en oscuro (logo): sus controles conservan los colores claros. */
.nx-topbar .nx-btn-ghost { color: #092C4C; border-color: #E2E6EA; }
.nx-topbar .nx-btn-ghost:hover { background: #E9EFF5; }
.nx-topbar .nx-btn:focus-visible, .nx-topbar a:focus-visible { outline: 2px solid #1E6BB8; outline-offset: 2px; }
.nx-btn-block { width: 100%; margin-top: 18px; padding: 11px 16px; font-size: 1rem; }
.nx-label { display: block; font-weight: 700; font-size: .85rem; margin: 12px 0 4px; color: var(--nex-text-primary); }
.nx-input {
    width: 100%; padding: 9px 12px; font: inherit; color: var(--nex-text-primary);
    background: var(--nex-surface-card); border: 1px solid var(--nex-surface-border); border-radius: var(--nex-radius-control);
}
.nx-alerta { padding: 10px 12px; border-radius: var(--nex-radius-control); background: var(--nex-alerta-bg); color: var(--nex-alerta-txt); border: 1px solid var(--nex-alerta-borde); font-size: .88rem; margin: 10px 0; }
/* POS sin satélite (13-11): aviso suave (no rojo), chip y marca en el diagrama (borde punteado, además del color de estado). */
.nx-alerta-sin-satelite { border-style: dashed; }
.nx-chip-sin-satelite { border-style: dashed; }
.nodo.pos-sin-satelite rect { stroke-dasharray: 5 3; stroke-width: 2px; }
.ar.ar-sin-satelite { stroke-dasharray: 2 4; opacity: .55; }
.nx-check { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0 12px; font-size: .9rem; }
.nx-alerta-error { background: var(--nex-error-bg); color: var(--nex-error-txt); border-color: var(--nex-error-borde); }
.nx-alerta a { color: inherit; font-weight: 700; text-decoration: underline; }

/* ---------- iconos de plataforma ---------- */
.nx-ico { width: 24px; height: 24px; display: block; }
.nx-ico-wrap { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center;
    border-radius: var(--nex-radius-control); background: var(--nex-surface-alt); border: 1px solid var(--nex-surface-border); }
.nx-ico-win { color: var(--nex-ico-win); }
.nx-ico-mac { color: var(--nex-ico-mac); }
.nx-ico-paq { color: var(--nex-positive); }
.nx-ico-doc { color: var(--nex-danger); }

/* ---------- instaladores ---------- */
.nx-grupo { padding: 14px 0 4px; border-bottom: 1px solid var(--nex-surface-divider); }
.nx-grupo:last-child { border-bottom: 0; }
.nx-grupo-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.nx-grupo-head h3 { color: var(--nex-brand-primary); }
.nx-fila { display: flex; align-items: center; gap: 14px; padding: 10px 8px; border-radius: var(--nex-radius-control); }
.nx-fila:hover { background: var(--nex-surface-alt); }
.nx-fila-txt { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.nx-notas { color: var(--nex-text-muted); font-size: .82rem; margin-top: 2px; }
.nx-fila-meta { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 720px) {
    .nx-fila { flex-wrap: wrap; }
    .nx-fila-meta { justify-content: flex-start; width: 100%; padding-left: 58px; }
    .nx-fila .nx-btn { margin-left: 58px; }
    .nx-topbar-titulo { display: none; }
    .nx-usuario-txt small { display: none; }
}

/* ---------- manuales ---------- */
.nx-grilla-manuales { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; padding-top: 12px; }
.nx-manual { display: flex; align-items: center; gap: 12px; padding: 12px; text-decoration: none; color: var(--nex-text-primary);
    border: 1px solid var(--nex-surface-border); border-radius: var(--nex-radius-control); background: var(--nex-surface-card);
    transition: box-shadow .15s ease, border-color .15s ease; }
.nx-manual:hover { box-shadow: var(--nex-shadow-card-hover); border-color: var(--nex-brand-accent); }
.nx-manual-txt { display: flex; flex-direction: column; min-width: 0; }
.nx-manual-txt small { color: var(--nex-text-muted); font-size: .8rem; }
.nx-manual-lista { margin-top: 10px; }

/* ---------- log de cambios ---------- */
.nx-linea { list-style: none; margin: 0; padding: 6px 0 0; }
.nx-linea li { position: relative; padding: 10px 0 10px 18px; border-left: 2px solid var(--nex-surface-divider); margin-left: 6px; }
.nx-linea li::before { content: ""; position: absolute; left: -6px; top: 16px; width: 10px; height: 10px;
    background: var(--nex-brand-accent); border-radius: 2px; }
.nx-linea-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.nx-linea p { margin: 4px 0 0; color: var(--nex-text-muted); font-size: .9rem; white-space: pre-line; }

/* ---------- login (como AuthPage/Login del backoffice: panel de marca + tarjeta) ---------- */
.nx-login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.nx-login-lado { background: var(--nex-drawer-bg); color: var(--nex-drawer-item);
    background-image: linear-gradient(160deg, #092C4C 0%, #06223A 70%); display: flex; align-items: center; padding: 48px; }
.nx-login-lado-in { max-width: 440px; margin-left: auto; }
.nx-login-lado h1 { color: #FFFFFF; font-size: 2rem; margin-bottom: 12px; }
.nx-login-lado ul { padding-left: 18px; margin: 18px 0 0; }
.nx-login-lado li { margin: 6px 0; }
.nx-login-form-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; }
.nx-login-card { width: 100%; max-width: 400px; padding: 28px; }
.nx-login-card h2 { margin-top: 18px; font-size: 1.35rem; }
.nx-login-card p { margin: 6px 0 4px; }
.nx-login-logo { height: 46px; display: block; }
@media (prefers-color-scheme: dark) { .nx-login-logo { background: #FFFFFF; padding: 6px 10px; border-radius: var(--nex-radius-control); } }
.nx-pie-login { color: var(--nex-text-muted); font-size: .8rem; margin-top: 16px; }
@media (max-width: 860px) {
    .nx-login { grid-template-columns: 1fr; }
    .nx-login-lado { padding: 28px 20px; }
    .nx-login-lado-in { margin: 0; }
    .nx-login-lado ul { display: none; }
}

/* ---------- navegación del topbar ---------- */
.nx-nav { display: flex; gap: 4px; margin-left: 12px; }
.nx-nav a { padding: 6px 12px; border-radius: var(--nex-radius-control); color: #092C4C; font-weight: 700; text-decoration: none; font-size: .92rem; }
.nx-nav a:hover { background: #E9EFF5; }
.nx-nav a.activo { background: #092C4C; color: #FFFFFF; }
.nx-main-ancho { max-width: 1840px; }
@media (max-width: 720px) { .nx-nav { margin-left: 0; } }

/* ---------- centro de instalaciones: tokens de estado ---------- */
:root {
    --est-enlinea: #2E9E55;      --est-enlinea-bg: #E8F6EE;
    --est-sinsenal: #C42020;     --est-sinsenal-bg: #FDECEC;
    --est-revocado: #C42020;     --est-revocado-bg: #FDECEC;
    --est-pendiente: #D9A400;    --est-pendiente-bg: #FFF3BF;   --est-pendiente-txt: #6B4A00;
    --est-inactivo: #A7B0BA;     --est-inactivo-bg: #EEF0F2;
    --est-nube: #092C4C;         --est-nube-bg: #E9EFF5;
    --est-arista: #9AA8B6;
    --est-enlinea-txt: #1B6B3A; --est-sinsenal-txt: #B42318; --est-revocado-txt: #B42318;
    --est-inactivo-txt: #555E69;
}
@media (prefers-color-scheme: dark) {
    :root {
        --est-enlinea: #4CC27A;   --est-enlinea-bg: #173323;
        --est-sinsenal: #F26B6B;  --est-sinsenal-bg: #3D1A1A;
        --est-revocado: #F26B6B;  --est-revocado-bg: #3D1A1A;
        --est-pendiente: #F2C94C; --est-pendiente-bg: #3A3210;  --est-pendiente-txt: #F2C94C;
        --est-inactivo: #6B7480;  --est-inactivo-bg: #24272B;
        --est-nube: #6CB4F0;      --est-nube-bg: #10243A;
        --est-arista: #5D6772;
        --est-enlinea-txt: #5FD08C; --est-sinsenal-txt: #FF8A8A; --est-revocado-txt: #FF8A8A;
        --est-inactivo-txt: #A3ACB6;
    }
}

.nx-alerta-ok { background: var(--est-enlinea-bg); color: var(--nex-text-primary); border-color: var(--est-enlinea); }
.nx-chip.est-enlinea { background: var(--est-enlinea-bg); color: var(--est-enlinea-txt); border-color: var(--est-enlinea); }
.nx-chip.est-sinsenal { background: var(--est-sinsenal-bg); color: var(--est-sinsenal-txt); border-color: var(--est-sinsenal); }
.nx-chip.est-revocado { background: var(--est-revocado-bg); color: var(--est-revocado-txt); border-color: var(--est-revocado); }
.nx-chip.est-pendiente { background: var(--est-pendiente-bg); color: var(--est-pendiente-txt); border: 1px solid var(--est-pendiente); }
.nx-chip.est-sin { background: transparent; color: var(--nex-text-muted); border: 1px dashed var(--est-arista); }
.nx-chip.est-inactivo { background: var(--est-inactivo-bg); color: var(--est-inactivo-txt); border-color: var(--est-inactivo); }
.nx-chip-aviso { background: var(--est-sinsenal-bg); color: var(--est-sinsenal-txt); border-color: var(--est-sinsenal); }

.nx-btn-peligro { background: var(--nex-danger); color: #FFFFFF; }
.nx-btn-peligro:hover { background: #B91C1C; }
.nx-btn-mini { padding: 4px 10px; font-size: .8rem; }
.nx-btn[disabled] { opacity: .55; cursor: not-allowed; }

/* leyenda */
.nx-leyenda { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: .82rem; }
.nx-leyenda .ley { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.nx-leyenda .ley::before { content: ""; width: 14px; height: 10px; border-radius: 2px; border: 2px solid currentColor; }
.ley.est-enlinea { color: var(--est-enlinea-txt); }
.ley.est-sinsenal { color: var(--est-sinsenal-txt); }
.ley.est-revocado { color: var(--est-revocado-txt); }
.ley.est-pendiente { color: var(--est-pendiente-txt); }
.ley.est-pendiente::before { background: var(--est-pendiente-bg); border-color: var(--est-pendiente); }
.ley.est-enlinea::before { background: var(--est-enlinea-bg); }
.ley.est-sinsenal::before { background: var(--est-sinsenal-bg); }
.ley.est-sin { color: var(--nex-text-muted); }
.ley.est-sin::before { border-style: dashed; border-color: var(--est-arista); background: transparent; }

/* diagrama + panel lateral (abajo en pantallas angostas) */
.nx-diagrama-cuerpo { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; padding-top: 12px; align-items: start; }
@media (max-width: 1100px) { .nx-diagrama-cuerpo { grid-template-columns: 1fr; } }
.nx-diagrama-svg svg { display: block; width: 100%; height: auto; font-family: var(--nex-font-family); }
.nx-panel { border: 1px solid var(--nex-surface-border); border-radius: var(--nex-radius-control); padding: 14px; background: var(--nex-surface-alt);
    position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; }
.nx-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.nx-datos { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 0 0 12px; font-size: .88rem; }
.nx-datos dt { color: var(--nex-text-muted); font-weight: 700; }
.nx-datos dd { margin: 0; word-break: break-word; }
.nx-accion { border: 1px solid var(--nex-surface-border); border-radius: var(--nex-radius-control); background: var(--nex-surface-card); margin: 8px 0; }
.nx-accion summary { cursor: pointer; padding: 8px 12px; font-weight: 700; color: var(--nex-brand-accent); }
.nx-accion form { padding: 0 12px 12px; display: flex; flex-direction: column; }
.nx-accion form .nx-btn { margin-top: 12px; align-self: flex-start; }
.nx-nota { font-size: .82rem; margin: 6px 0; }
.nx-check { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-size: .88rem; }

/* nodos SVG (textos >= 12 px en unidades del viewBox; el layout ajusta columnas al ancho) */
svg .marco-local { fill: var(--nex-surface-alt); stroke: var(--nex-surface-border); stroke-width: 1; }
svg .ar { fill: none; stroke: var(--est-arista); stroke-width: 2; }
svg .ar.est-enlinea { stroke: var(--est-enlinea); }
svg .ar.est-sinsenal { stroke: var(--est-sinsenal); }
svg .ar.est-revocado { stroke: var(--est-revocado); stroke-dasharray: 2 4; }
svg .ar.est-pendiente { stroke: var(--est-pendiente); stroke-dasharray: 6 5; }
svg .ar.est-sin, svg .ar.est-nuevo, svg .ar.est-inactivo { stroke-dasharray: 6 5; opacity: .6; }
svg .nodo { cursor: pointer; outline: none; }
svg .nodo rect { stroke-width: 2; }
svg .nodo text { fill: var(--nex-text-primary); }
svg .nodo .t1 { font-size: 14px; font-weight: 800; }
svg .nodo .t2 { font-size: 12.5px; font-weight: 600; fill: var(--nex-text-muted); }
svg .nodo .t3 { font-size: 12px; fill: var(--nex-text-muted); }
svg .nodo .t-alerta { font-size: 12px; font-weight: 800; fill: var(--est-revocado-txt); }
svg .nodo:hover rect, svg .nodo:focus-visible rect { filter: drop-shadow(0 2px 6px rgba(15, 23, 42, .25)); }
svg .nodo.sel rect:first-of-type, svg .nodo:focus-visible rect:first-of-type { stroke: var(--nex-brand-accent); stroke-width: 3; }
svg .nodo-nube rect { fill: var(--est-nube-bg); stroke: var(--est-nube); }
svg .nodo-nube .t1 { font-size: 16px; fill: var(--est-nube); }
svg .nodo-local .cab-local { fill: var(--nex-brand-primary); stroke: var(--nex-brand-primary); }
svg .nodo-local .t1 { fill: var(--nex-on-accent); font-size: 14px; }
svg .nodo-local .chip-alerta { fill: #FDE2E2; stroke: var(--est-revocado); stroke-width: 1; filter: none; }
svg .nodo-local .t-alerta { fill: #9B1C1C; pointer-events: none; }
svg .est-enlinea rect { fill: var(--est-enlinea-bg); stroke: var(--est-enlinea); }
svg .est-sinsenal rect { fill: var(--est-sinsenal-bg); stroke: var(--est-sinsenal); }
svg .est-revocado rect { fill: var(--est-revocado-bg); stroke: var(--est-revocado); }
svg .est-pendiente rect { fill: var(--est-pendiente-bg); stroke: var(--est-pendiente); }
svg .est-sin rect { fill: transparent; stroke: var(--est-arista); stroke-dasharray: 6 4; }
svg .est-inactivo rect { fill: var(--est-inactivo-bg); stroke: var(--est-inactivo); }
svg .est-nuevo rect { fill: transparent; stroke: var(--est-arista); stroke-dasharray: 4 4; }
svg .est-nuevo .t1 { fill: var(--nex-brand-accent); }
svg .nodo-crear .t1 { fill: var(--nex-brand-accent); text-decoration: underline; }
svg .nodo-crear rect:first-of-type { stroke: var(--nex-brand-accent); stroke-width: 2; stroke-dasharray: 5 4; fill: transparent; }
svg a.enlace-crear { cursor: pointer; outline: none; }
svg a.enlace-crear:hover .nodo-crear rect:first-of-type { fill: var(--nex-surface-2, rgba(30,107,184,.10)); }
svg a.enlace-crear:focus-visible .nodo-crear rect:first-of-type { stroke-width: 4; stroke-dasharray: none; filter: drop-shadow(0 0 3px var(--nex-brand-accent)); }
svg .nodo .barra { stroke: none; stroke-dasharray: none; }
svg .est-enlinea .barra { fill: var(--est-enlinea); }
svg .est-sinsenal .barra { fill: var(--est-sinsenal); }
svg .est-revocado .barra { fill: var(--est-revocado); }
svg .est-pendiente .barra { fill: var(--est-pendiente); }
svg .est-sin .barra { fill: var(--est-arista); }
svg .est-inactivo .barra { fill: var(--est-inactivo); }

/* tablas */
.nx-tabla { width: 100%; border-collapse: collapse; font-size: .88rem; margin-top: 8px; }
.nx-tabla th { text-align: left; color: var(--nex-text-muted); font-weight: 800; padding: 8px; border-bottom: 2px solid var(--nex-surface-divider); }
.nx-tabla td { padding: 8px; border-bottom: 1px solid var(--nex-surface-divider); vertical-align: top; }
.nx-tabla td .nx-chip { margin: 0 4px 4px 0; }
.nx-filtro { max-width: 340px; }
.nx-acciones-fila { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* código generado (se muestra una sola vez) */
.nx-codigo-grande { font-family: Consolas, "Cascadia Mono", monospace; font-size: 2.4rem; font-weight: 800; letter-spacing: .08em;
    text-align: center; padding: 18px; margin: 10px 0; border: 2px dashed var(--nex-brand-accent); border-radius: var(--nex-radius-control);
    background: var(--nex-brand-tint); color: var(--nex-brand-primary); user-select: all; }
.nx-codigo-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nx-destino { font-size: 1rem; margin: 14px 0 0; }
.nx-sub { margin: 18px 0 6px; font-size: .95rem; }
.nx-comando { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.nx-comando pre { flex: 1 1 520px; margin: 0; padding: 12px; background: #0F1B26; color: #E6EDF3; border-radius: var(--nex-radius-control);
    font-size: .82rem; white-space: pre-wrap; word-break: break-all; user-select: all; }

/* ---------- Prerrequisitos Windows 7 ---------- */
.nx-paso { margin-top: 16px; }
.nx-paso-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.nx-paso-enlaces { margin: 6px 0 10px; padding-left: 20px; }
.nx-paso-cmd { background: var(--nex-surface-alt); border: 1px solid var(--nex-surface-border); border-radius: 4px;
    padding: 10px 12px; overflow-x: auto; font-size: .9rem; margin: 8px 0; }

/* ---------- inicio: vistazo y estado por farmacia ---------- */
.nx-vistazo { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: baseline; font-size: 1rem; padding: 12px 20px; }
.nx-vistazo strong { font-size: 1.35rem; margin-right: 4px; }
.nx-vistazo-alerta strong { color: var(--est-revocado-txt); }
.nx-diagrama-sola { grid-template-columns: 1fr; }
.nx-diagrama-sola .nodo { cursor: pointer; }
.nx-farmacia { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(260px, 1.2fr) minmax(300px, 2fr); gap: 8px 16px; align-items: center;
    padding: 10px 8px; border-bottom: 1px solid var(--nex-surface-divider); }
.nx-farmacia:last-child { border-bottom: 0; }
.nx-farmacia-problema { border-left: 3px solid var(--est-sinsenal); padding-left: 12px; }
.nx-farmacia-nombre, .nx-farmacia-sat, .nx-farmacia-pos { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.nx-farmacia-nombre a { color: inherit; text-decoration: none; }
.nx-farmacia-nombre a:hover { text-decoration: underline; }
@media (max-width: 1100px) { .nx-farmacia { grid-template-columns: 1fr; } }

/* ---------- Instalar: ficha por farmacia ---------- */
.nx-instalar { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 16px; }
.nx-lista-farmacias { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--nex-surface-border); border-radius: var(--nex-radius-control);
    background: var(--nex-surface-card); padding: 10px; max-height: 80vh; overflow-y: auto; position: sticky; top: 8px; }
.nx-lista-farmacias h2 { font-size: 1rem; margin: 0 0 6px; }
.nx-lf { display: flex; flex-direction: column; gap: 3px; padding: 8px; border-radius: 4px; text-decoration: none; color: inherit; border-left: 3px solid transparent; }
.nx-lf:hover { background: var(--nex-surface-alt); }
.nx-lf.sel { background: var(--nex-brand-tint); border-left-color: var(--nex-brand-accent); }
.nx-lf-nombre { font-weight: 700; font-size: .88rem; }
.nx-lf .nx-chip { align-self: flex-start; font-size: .72rem; }
.nx-lf-todas { margin-top: 6px; font-size: .85rem; }
.nx-ficha-col { min-width: 0; }
.nx-ficha-sat { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.nx-ficha-sat .nx-datos { flex: 1 1 340px; min-width: 0; }
.nx-tabla-pos td { vertical-align: middle; }
.nx-tabla-pos td.nx-acciones-fila { gap: 4px; }
.nx-af { border: 1px solid var(--nex-brand-accent); border-radius: var(--nex-radius-control); background: var(--nex-surface-card); padding: 12px 16px; margin: 0 0 16px; max-width: 620px; }
.nx-af[hidden] { display: none; }
.nx-af-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.nx-af form { display: flex; flex-direction: column; }
.nx-af form .nx-btn { margin-top: 12px; align-self: flex-start; }
.nx-pendientes-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.nx-pendiente { border: 1px dashed var(--est-pendiente); border-radius: var(--nex-radius-control); padding: 10px 14px; }
.nx-pendiente h4 { margin: 0 0 6px; font-size: .95rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nx-pasos { margin: 6px 0; padding-left: 20px; font-size: .88rem; }
@media (max-width: 1000px) { .nx-instalar { grid-template-columns: 1fr; } .nx-lista-farmacias { position: static; max-height: 260px; } }

/* ---------- buscador de farmacias ---------- */
.nx-buscador { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.nx-buscador .nx-input { max-width: 360px; }
.nx-buscador-estado { font-size: .85rem; color: var(--nex-text-muted, #5b6b7a); }
.nx-oculto { display: none !important; }

/* ---------- firma Developed by Argentis ---------- */
.nx-firma { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; opacity: .8; font-size: .75rem; letter-spacing: .02em; }
.nx-firma img { height: 18px; width: auto; display: block; }
.nx-pie .nx-firma, .nx-pie-login .nx-firma { display: flex; justify-content: center; }

/* ===== Mapa animado de la instancia (estilo NOC) ===== */
svg .nodo rect { transition: fill .8s ease, stroke .8s ease; }
svg .nodo .barra { transition: fill .8s ease; }
svg .nodo { transform-box: fill-box; }

/* EN LÍNEA: latido suave, brillo verde que respira */
@keyframes nx-latido {
    0%, 100% { filter: drop-shadow(0 0 0 rgba(46, 158, 85, 0)); stroke-opacity: .85; }
    50% { filter: drop-shadow(0 0 7px rgba(46, 158, 85, .75)); stroke-opacity: 1; }
}
svg .est-enlinea rect:first-of-type { animation: nx-latido 3s ease-in-out infinite; }
/* SIN SEÑAL: titila lento */
@keyframes nx-titila { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
svg .est-sinsenal { animation: nx-titila 3.4s ease-in-out infinite; }
/* REVOCADO: fijo, sin animación */
/* PENDIENTE: borde punteado en movimiento (marching ants) */
@keyframes nx-hormigas { to { stroke-dashoffset: -20; } }
svg .est-pendiente rect:first-of-type, svg .est-sin rect:first-of-type { animation: nx-hormigas 1.6s linear infinite; }

/* LÍNEAS: flujo de datos hacia la nube solo si ambos extremos están en línea; si no, quietas y grises */
@keyframes nx-flujo { to { stroke-dashoffset: 16; } }
svg .ar:not(.flujo) { stroke: var(--est-arista); animation: none; }
svg .ar.flujo { stroke: var(--est-enlinea); stroke-dasharray: 8 8; animation: nx-flujo .9s linear infinite; }

/* CAMBIOS DE ESTADO: destello + color que se desliza */
@keyframes nx-barrido {
    0% { clip-path: inset(0 100% 0 0); opacity: .55; }
    60% { clip-path: inset(0 0 0 0); opacity: .45; }
    100% { clip-path: inset(0 0 0 0); opacity: 0; }
}
@keyframes nx-destello {
    0% { transform: scale(1); opacity: .9; stroke-width: 3; }
    100% { transform: scale(1.22, 1.45); opacity: 0; stroke-width: 1; }
}
svg rect.nx-barrido { fill: var(--est-enlinea); stroke: none; animation: nx-barrido 1.2s ease-out forwards; }
svg rect.nx-destello { fill: none; stroke: var(--est-enlinea); transform-box: fill-box; transform-origin: center; animation: nx-destello 1.1s ease-out forwards; }
@keyframes nx-cambio { 0% { opacity: .35; } 100% { opacity: 1; } }
svg g.nx-cambio { animation: nx-cambio .9s ease-out; }

/* Contadores del vistazo */
@keyframes nx-contador { 0% { transform: scale(1); } 35% { transform: scale(1.22); } 100% { transform: scale(1); } }
.nx-vistazo [data-vis] { display: inline-block; }
.nx-vistazo .nx-contador-cambio { animation: nx-contador .7s ease-out; }
.nx-vistazo .nx-contador-cambio.sube strong { color: var(--est-enlinea-txt); }
.nx-vistazo .nx-contador-cambio.baja strong { color: var(--est-sinsenal-txt); }
.nx-vistazo strong { transition: color .8s ease; }

@media (prefers-reduced-motion: reduce) {
    svg .est-enlinea rect:first-of-type, svg .est-sinsenal, svg .est-pendiente rect:first-of-type, svg .est-sin rect:first-of-type,
    svg .ar.flujo, svg g.nx-cambio, .nx-vistazo .nx-contador-cambio { animation: none !important; }
    svg .nodo rect, svg .nodo .barra, .nx-vistazo strong { transition: none; }
    svg rect.nx-barrido, svg rect.nx-destello { display: none; }
}

/* Marca Argentis visible */
.nx-login-lado { position: relative; }
.nx-login-lado-firma { position: absolute; bottom: 32px; left: 48px; right: 48px; width: auto; display: flex; flex-direction: column; gap: 8px; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--nex-drawer-item); }
.nx-login-lado-firma img { height: 40px; width: auto; display: block; }
.nx-firma-login img { height: 26px; }
.nx-firma-pie { opacity: .9; margin-top: 10px; }
.nx-firma-pie img { height: 24px; }
.nx-by { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--nex-surface-border); color: var(--nex-text-muted); font-size: .72rem; }
.nx-topbar .nx-by { color: #5A6B7B; border-left-color: #E2E6EA; }
.nx-by img { height: 19px; width: auto; display: block; }
@media (max-width: 800px) { .nx-login-lado-firma { position: static; margin-top: 18px; } .nx-by { display: none; } }

/* Marca Argentis: tamaños reforzados */
.nx-login-lado-firma { font-size: .9rem; }
.nx-login-lado-firma img { height: 54px; }
.nx-firma-login { font-size: .875rem; }
.nx-firma-login img { height: 32px; }
.nx-firma-pie { font-size: .875rem; opacity: 1; margin-top: 14px; }
.nx-firma-pie img { height: 30px; }
.nx-login-lado-firma { left: auto; right: 48px; width: 440px; align-items: flex-start; }
.nx-login-lado-firma img { object-fit: contain; object-position: left center; }
@media (max-width: 800px) { .nx-login-lado-firma { width: auto; } }

/* Pie: firma Argentis grande (12-11, el header ya no la lleva) */
.nx-firma-pie { font-size: 1rem; opacity: 1; margin-top: 16px; }
.nx-firma-pie img { height: 40px; }
.nx-aviso-instalar { background: var(--nex-brand-tint); color: var(--nex-text-primary); border-left: 4px solid var(--nex-brand-accent); padding: 10px 14px; border-radius: 6px; margin: 4px 0 14px; }

/* ---------- Instalar: agregar POS (tipo obligatorio) y re-mostrar código ---------- */
.nx-form-inline { display: inline-flex; margin: 0; }
.nx-f7sync-tabla { overflow-x: auto; }
.nx-f7sync-alta { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.nx-f7sync-alta > div { flex: 1 1 180px; }
.nx-f7sync-alta .nx-input { width: 100%; }
.nx-af form.nx-form-inline .nx-btn, .nx-acciones-fila .nx-form-inline .nx-btn { margin-top: 0; }
.nx-tipos-pos { border: 0; padding: 0; margin: 4px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.nx-tipos-pos legend { padding: 0; }
.nx-tipo-pos { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--nex-surface-border);
    border-radius: var(--nex-radius-control); cursor: pointer; font-size: .88rem; background: var(--nex-surface-card); }
.nx-tipo-pos:hover { border-color: var(--nex-brand-accent); }
.nx-tipo-pos:has(input:checked) { border-color: var(--nex-brand-accent); background: var(--nex-brand-tint); }
.nx-tipo-pos input { margin-top: 3px; accent-color: var(--nex-brand-accent); }
.nx-tipo-pos input:focus-visible { outline: 2px solid var(--nex-brand-accent); outline-offset: 2px; }
.nx-existentes .nx-card-head .nx-muted { max-width: 60ch; }

/* Bodegas centrales (BODEGA POR CÓDIGO): pestañas y tarjetas rectangulares, sin óvalos. */
.nx-pestanas { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.nx-bodega { margin-bottom: 14px; }
.nx-bodega h3 { margin: 10px 0 6px; font-size: .95rem; }
.nx-bodega-gen { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.nx-bodega details { margin: 4px 0; }
.nx-bodega details summary { cursor: pointer; }

/* 16-11: una sola firma Argentis (pie rojo en páginas internas, panel en login) y páginas más cortas */
.nx-main { padding: 16px 20px 16px; gap: 16px; }
.nx-pie { padding: 4px 0 14px; }
.nx-firma-pie { margin-top: 0; font-size: .875rem; }
.nx-firma-pie img { height: 30px; }
.nx-login-body { min-height: 100vh; display: grid; place-items: center; padding: 20px; box-sizing: border-box; }
.nx-login { min-height: 0; width: 100%; max-width: 980px; border-radius: 6px; overflow: hidden;
    box-shadow: 0 10px 30px rgba(9, 44, 76, .14); background: var(--nex-surface-card, #FFFFFF); }
.nx-login-lado { padding: 40px; }
.nx-login-form-wrap { padding: 32px 28px; }
.nx-login-lado { flex-direction: column; justify-content: center; align-items: flex-end; }
.nx-login-lado-in { width: 100%; }
.nx-login-lado-firma { position: static; width: 100%; max-width: 440px; margin-top: 36px; }
.nx-login-lado-firma img { height: 44px; }
@media (max-width: 860px) { .nx-login-body { padding: 0; } .nx-login { border-radius: 0; box-shadow: none; } .nx-login-lado { align-items: stretch; padding: 24px 20px; } }
.nx-login .nx-login-card { border: 0; box-shadow: none; padding: 8px 4px; }
