/* ==========================================================================
   NexNorm · cristal oscuro + dorado
   Paleta: fondo #0B0F1A · vidrio #121A2B · dorado #D4AF6A · cian #5EE6FF
   Tipografías: Space Grotesk (títulos y números) + Inter (texto)
   ========================================================================== */

:root {
  --nx-fondo: #0B0F1A;
  --nx-vidrio: #121A2B;
  --nx-dorado: #D4AF6A;
  --nx-cian: #5EE6FF;

  --nx-dorado-claro: #F2D79B;
  --nx-dorado-oscuro: #9C7A3C;
  --nx-texto: #ECEFF6;
  --nx-texto-2: #AEB8CB;
  --nx-texto-3: #8792A9;
  --nx-rojo: #FF8F8F;
  --nx-verde: #7FE3B9;

  --nx-borde: rgba(212, 175, 106, 0.18);
  --nx-borde-fuerte: rgba(212, 175, 106, 0.38);
  --nx-borde-suave: rgba(255, 255, 255, 0.07);
  --nx-vidrio-fondo: rgba(18, 26, 43, 0.66);
  --nx-vidrio-fondo-2: rgba(22, 32, 52, 0.74);
  --nx-campo-fondo: rgba(7, 10, 19, 0.6);
  --nx-desenfoque: blur(16px) saturate(140%);

  --nx-radio: 20px;
  --nx-radio-m: 14px;
  --nx-radio-s: 10px;
  --nx-sombra: 0 24px 60px -28px rgba(0, 0, 0, 0.85), 0 2px 0 0 rgba(255, 255, 255, 0.02) inset;
  --nx-brillo-oro: 0 0 0 1px rgba(212, 175, 106, 0.32), 0 10px 30px -12px rgba(212, 175, 106, 0.55);

  --nx-f-titulos: "Space Grotesk", "Inter", ui-sans-serif, system-ui, sans-serif;
  --nx-f-texto: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --nx-f-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, monospace;

  --nx-curva: cubic-bezier(0.2, 0.7, 0.2, 1);
  --nx-lateral: 272px;
  --nx-inferior-alto: 64px;

  color-scheme: dark;
}

/* --- Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--nx-fondo);
  scroll-padding-top: 24px;
}

html.nx-sin-scroll { overflow: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--nx-fondo);
  color: var(--nx-texto);
  font: 400 15px/1.6 var(--nx-f-texto);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, .nx-titulo, .nx-subtitulo, .nx-num, .nx-palabra {
  font-family: var(--nx-f-titulos);
}

h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--nx-dorado-claro); text-decoration-color: rgba(212, 175, 106, 0.4); text-underline-offset: 3px; }
a:hover { color: #fff; text-decoration-color: var(--nx-cian); }
code, kbd { font-family: var(--nx-f-mono); }
small { font-size: 0.82em; }
img, svg { max-width: 100%; }

::selection { background: rgba(212, 175, 106, 0.35); color: #fff; }

:focus-visible {
  outline: 2px solid var(--nx-cian);
  outline-offset: 2px;
  border-radius: 6px;
}

.nx-oculto {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.nx-saltar {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: var(--nx-radio-s);
  background: var(--nx-dorado); color: var(--nx-fondo); font-weight: 600; text-decoration: none;
  transition: top 0.2s var(--nx-curva);
}
.nx-saltar:focus { top: 16px; color: var(--nx-fondo); }

.nx-texto-2 { color: var(--nx-texto-2); }
.nx-num { font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.nx-cortar { overflow-wrap: anywhere; word-break: break-word; }

/* --- Fondo: resplandores + retícula fina ------------------------------------ */
.nx-fondo {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(70rem 42rem at 92% -12%, rgba(94, 230, 255, 0.11), transparent 62%),
    radial-gradient(60rem 46rem at -12% 112%, rgba(212, 175, 106, 0.13), transparent 60%),
    radial-gradient(40rem 30rem at 50% 50%, rgba(18, 26, 43, 0.9), transparent 70%),
    var(--nx-fondo);
}
.nx-fondo::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
}
.nx-fondo::after {
  /* Línea de luz diagonal muy tenue que cruza el fondo. */
  content: ""; position: absolute; left: -20%; right: -20%; top: 38%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 106, 0.22) 40%, rgba(94, 230, 255, 0.18) 60%, transparent);
  transform: rotate(-8deg);
  opacity: 0.7;
}

/* --- Vidrio ------------------------------------------------------------------ */
.nx-vidrio {
  position: relative;
  background: linear-gradient(180deg, var(--nx-vidrio-fondo-2), var(--nx-vidrio-fondo));
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(212, 175, 106, 0.18);
  border-radius: var(--nx-radio);
  box-shadow: var(--nx-sombra);
}
.nx-vidrio::before {
  /* Filo de luz dorado→cian en el borde superior. */
  content: ""; position: absolute; top: -1px; left: 12%; right: 12%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(242, 215, 155, 0.85) 35%, rgba(94, 230, 255, 0.55) 70%, transparent);
  opacity: 0.75; pointer-events: none;
}

/* --- Marca ------------------------------------------------------------------- */
.nx-logo {
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--nx-texto); text-decoration: none;
}
.nx-logo:hover { color: var(--nx-texto); }
.nx-marca { width: 40px; height: 40px; flex: none; filter: drop-shadow(0 0 10px rgba(212, 175, 106, 0.25)); }
.nx-palabra { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; color: var(--nx-texto); }
.nx-palabra-oro {
  background: linear-gradient(100deg, var(--nx-dorado-claro), var(--nx-dorado) 55%, var(--nx-cian));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.nx-antetitulo {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 8px;
  font: 600 11.5px/1.2 var(--nx-f-texto);
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--nx-dorado);
}
.nx-antetitulo::before {
  content: ""; width: 22px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--nx-dorado));
}

.nx-titulo { font-size: clamp(26px, 2.4vw, 34px); font-weight: 600; letter-spacing: -0.025em; }
.nx-subtitulo { font-size: 18px; font-weight: 600; margin: 0 0 16px; letter-spacing: -0.01em; }

/* --- Botones ----------------------------------------------------------------- */
.nx-boton {
  --nx-b-fondo: linear-gradient(135deg, #F6E2B0 0%, var(--nx-dorado) 48%, #B48C48 100%);
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 10px 18px;
  border: 0; border-radius: 12px;
  background: var(--nx-b-fondo);
  color: #10131C;
  font: 600 14.5px/1.2 var(--nx-f-texto);
  letter-spacing: 0.005em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  box-shadow: 0 10px 28px -12px rgba(212, 175, 106, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.2s var(--nx-curva), box-shadow 0.2s var(--nx-curva), filter 0.2s;
}
.nx-boton::after {
  /* Destello que barre el botón al pasar el mouse. */
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg); transition: left 0.6s var(--nx-curva); pointer-events: none;
}
.nx-boton:hover { color: #10131C; transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 14px 34px -12px rgba(212, 175, 106, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.5); }
.nx-boton:hover::after { left: 120%; }
.nx-boton:active { transform: translateY(0); }
.nx-boton .nx-ic { width: 18px; height: 18px; }

.nx-boton--fantasma {
  background: rgba(212, 175, 106, 0.06);
  color: var(--nx-dorado-claro);
  box-shadow: inset 0 0 0 1px var(--nx-borde-fuerte);
}
.nx-boton--fantasma:hover { color: #fff; background: rgba(212, 175, 106, 0.12); box-shadow: inset 0 0 0 1px var(--nx-dorado), 0 0 24px -8px rgba(212, 175, 106, 0.6); }

.nx-boton--sutil {
  background: rgba(255, 255, 255, 0.04);
  color: var(--nx-texto);
  box-shadow: inset 0 0 0 1px var(--nx-borde-suave);
}
.nx-boton--sutil:hover { color: #fff; background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 0 0 1px var(--nx-borde-fuerte); }

.nx-boton--peligro {
  background: rgba(255, 143, 143, 0.06);
  color: #FFB3B3;
  box-shadow: inset 0 0 0 1px rgba(255, 143, 143, 0.3);
}
.nx-boton--peligro:hover { color: #fff; background: rgba(255, 143, 143, 0.14); box-shadow: inset 0 0 0 1px rgba(255, 143, 143, 0.55); }

.nx-boton--texto { background: none; box-shadow: none; color: var(--nx-texto-2); }
.nx-boton--texto:hover { background: none; box-shadow: none; color: var(--nx-texto); }
.nx-boton--fantasma::after, .nx-boton--sutil::after, .nx-boton--peligro::after, .nx-boton--texto::after { display: none; }

.nx-boton--chico { min-height: 34px; padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.nx-boton--chico .nx-ic { width: 16px; height: 16px; }
.nx-boton--grande { min-height: 52px; padding: 14px 26px; font-size: 16px; border-radius: 14px; }
.nx-boton--bloque { width: 100%; }

.nx-boton-icono {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; flex: none;
  border: 0; border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px var(--nx-borde-suave);
  color: var(--nx-texto-2); cursor: pointer;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}
.nx-boton-icono:hover { color: var(--nx-dorado-claro); background: rgba(212, 175, 106, 0.08); box-shadow: inset 0 0 0 1px var(--nx-borde-fuerte); }

.nx-ic { width: 20px; height: 20px; flex: none; }

kbd, .nx-tecla {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 6px; border: 1px solid var(--nx-borde-suave); border-bottom-width: 2px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--nx-texto-2);
  font: 500 11px/1 var(--nx-f-texto);
}
.nx-tecla { cursor: pointer; height: 26px; }

/* --- Formularios ------------------------------------------------------------- */
.nx-form { display: grid; gap: 18px; }
.nx-form--rejilla { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.nx-campo--ancho { grid-column: 1 / -1; }

.nx-campo { display: grid; gap: 7px; min-width: 0; }
.nx-etiqueta { font-size: 13px; font-weight: 500; color: var(--nx-texto-2); letter-spacing: 0.01em; }

.nx-input {
  width: 100%; min-height: 46px; padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: var(--nx-campo-fondo);
  color: var(--nx-texto);
  font: 400 15px/1.4 var(--nx-f-texto);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none; appearance: none;
}
.nx-input::placeholder { color: var(--nx-texto-3); }
.nx-input:hover { border-color: rgba(212, 175, 106, 0.3); }
.nx-input:focus {
  outline: none;
  border-color: var(--nx-dorado);
  background: rgba(7, 10, 19, 0.8);
  box-shadow: 0 0 0 3px rgba(212, 175, 106, 0.16), 0 0 28px -8px rgba(94, 230, 255, 0.45);
}
select.nx-input {
  padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23D4AF6A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 16px;
}
select.nx-input option { background: #121A2B; color: var(--nx-texto); }
input[type="search"].nx-input::-webkit-search-cancel-button { filter: invert(0.7) sepia(1) hue-rotate(5deg); }

.nx-campo--error .nx-input { border-color: rgba(255, 143, 143, 0.6); }
.nx-campo--codigo .nx-input { font: 600 22px/1.2 var(--nx-f-titulos); letter-spacing: 0.4em; text-align: center; }

.nx-ayuda { margin: 0; font-size: 12.5px; color: var(--nx-texto-3); }
.nx-error {
  display: flex; gap: 6px; align-items: flex-start; margin: 0;
  font-size: 13px; color: var(--nx-rojo);
}
.nx-error .nx-ic { width: 16px; height: 16px; margin-top: 2px; }

.nx-input-con-icono { position: relative; display: block; }
.nx-input-con-icono .nx-ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--nx-dorado); pointer-events: none; }
.nx-input-con-icono .nx-input { padding-left: 44px; }

.nx-acciones-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 4px 0 0; }
.nx-acciones-form form { margin: 0; }

.nx-nota {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 18px 0 0; font-size: 13px; color: var(--nx-texto-3);
}
.nx-nota .nx-ic { width: 18px; height: 18px; color: var(--nx-dorado); margin-top: 1px; }

/* --- Avisos ------------------------------------------------------------------ */
.nx-avisos { display: grid; gap: 10px; margin: 0 0 20px; }
.nx-aviso {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 16px; margin: 0 0 16px;
  border-radius: var(--nx-radio-m);
  background: rgba(94, 230, 255, 0.06);
  border: 1px solid rgba(94, 230, 255, 0.22);
  color: var(--nx-texto);
  font-size: 14px;
}
.nx-avisos .nx-aviso { margin: 0; }
.nx-aviso .nx-ic { color: var(--nx-cian); margin-top: 1px; }
.nx-aviso a { font-weight: 600; }
.nx-aviso--error { background: rgba(255, 143, 143, 0.07); border-color: rgba(255, 143, 143, 0.32); }
.nx-aviso--error .nx-ic { color: var(--nx-rojo); }
.nx-aviso--clave {
  background: linear-gradient(90deg, rgba(212, 175, 106, 0.16), rgba(212, 175, 106, 0.05));
  border-color: var(--nx-borde-fuerte);
  box-shadow: 0 0 30px -12px rgba(212, 175, 106, 0.6);
  font-weight: 500;
}
.nx-aviso--clave .nx-ic { color: var(--nx-dorado); }
.nx-aviso--ok .nx-ic { color: var(--nx-verde); }

/* --- Chips y estados --------------------------------------------------------- */
.nx-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--nx-borde-suave);
  color: var(--nx-texto-2);
  font-size: 12.5px; font-weight: 500; line-height: 1.5; white-space: nowrap;
}
.nx-chip .nx-ic { width: 14px; height: 14px; color: var(--nx-dorado); }
.nx-chip--oro { color: var(--nx-dorado-claro); background: rgba(212, 175, 106, 0.1); border-color: var(--nx-borde-fuerte); }
.nx-chip--aviso { color: #FFD7A0; background: rgba(255, 190, 100, 0.08); border-color: rgba(255, 190, 100, 0.3); }

.nx-estado-punto { display: inline-flex; align-items: center; gap: 8px; color: var(--nx-texto); font-size: 14px; }
.nx-estado-punto::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--nx-verde); box-shadow: 0 0 10px rgba(127, 227, 185, 0.7); }
.nx-estado-punto--inactivo { color: var(--nx-texto-3); }
.nx-estado-punto--inactivo::before { background: #5B6578; box-shadow: none; }

.nx-avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(140deg, rgba(212, 175, 106, 0.28), rgba(94, 230, 255, 0.12));
  box-shadow: inset 0 0 0 1px var(--nx-borde-fuerte);
  color: var(--nx-dorado-claro);
  font: 600 14px/1 var(--nx-f-titulos); letter-spacing: 0.02em;
}
.nx-avatar--chico { width: 34px; height: 34px; border-radius: 10px; font-size: 12.5px; }
.nx-avatar--grande { width: 72px; height: 72px; border-radius: 20px; font-size: 24px; }

/* --- Layout de acceso (login, código, sin conexión, errores) ----------------- */
.nx-acceso {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  min-height: 100vh; min-height: 100dvh;
}
.nx-acceso-marca {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px clamp(32px, 5vw, 72px);
  border-right: 1px solid var(--nx-borde);
  background:
    radial-gradient(40rem 30rem at 20% 30%, rgba(212, 175, 106, 0.1), transparent 70%),
    linear-gradient(180deg, rgba(18, 26, 43, 0.55), rgba(11, 15, 26, 0.2));
}
.nx-acceso-marca .nx-logo { position: relative; z-index: 1; }
.nx-acceso-lema { position: relative; z-index: 1; max-width: 520px; }
.nx-acceso-estudio {
  margin: 0 0 12px;
  font: 600 clamp(36px, 4vw, 56px)/1.05 var(--nx-f-titulos); letter-spacing: -0.03em;
  background: linear-gradient(100deg, #FFF7E4, var(--nx-dorado-claro) 40%, var(--nx-dorado) 75%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nx-acceso-texto { margin: 0; color: var(--nx-texto-2); font-size: 17px; }

.nx-acceso-principal {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 28px; padding: 48px 24px 24px;
}
.nx-acceso-tarjeta { width: min(440px, 100%); padding: 36px 36px 30px; margin-top: auto; }
.nx-acceso-principal .nx-pie { margin-top: auto; }
.nx-acceso-emblema {
  position: absolute; z-index: 0; right: -60px; top: 50%; transform: translateY(-50%);
  width: min(420px, 60%); aspect-ratio: 1; opacity: 0.22; pointer-events: none;
}
.nx-acceso-emblema .nx-marca { width: 100%; height: 100%; filter: drop-shadow(0 0 40px rgba(212, 175, 106, 0.35)); }

.nx-form-acceso .nx-titulo { margin: 0 0 6px; }
.nx-form-acceso > .nx-texto-2 { margin-bottom: 24px; }
.nx-form-acceso-icono, .nx-estado-icono {
  display: grid; place-items: center;
  width: 48px; height: 48px; margin: 0 0 20px;
  border-radius: 14px;
  background: linear-gradient(140deg, rgba(212, 175, 106, 0.22), rgba(94, 230, 255, 0.08));
  box-shadow: inset 0 0 0 1px var(--nx-borde-fuerte), 0 0 30px -10px rgba(212, 175, 106, 0.6);
  color: var(--nx-dorado-claro);
}
.nx-form-acceso .nx-boton--bloque { margin-top: 6px; }

.nx-estado { text-align: left; }
.nx-estado .nx-titulo { margin: 0 0 10px; }
.nx-estado-codigo {
  margin: 0 0 6px;
  font: 700 76px/1 var(--nx-f-titulos); letter-spacing: -0.04em;
  background: linear-gradient(110deg, var(--nx-dorado-claro), var(--nx-dorado) 50%, var(--nx-cian));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 24px rgba(212, 175, 106, 0.25));
}

/* --- Pie ------------------------------------------------------------------- */
.nx-pie { padding: 20px 24px 24px; text-align: center; }
.nx-firma { margin: 0; font-size: 12.5px; color: var(--nx-texto-3); letter-spacing: 0.01em; }

/* --- Haces de luz (líneas doradas → cian animadas) -------------------------- */
.nx-haces { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.nx-riel {
  position: absolute; left: -10%; right: -10%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 106, 0.16) 30%, rgba(94, 230, 255, 0.1) 70%, transparent);
  overflow: hidden;
}
.nx-riel::after {
  content: ""; position: absolute; top: -1px; bottom: -1px; left: 0; width: 26%;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 106, 0.9) 55%, #F7E6BE 75%, var(--nx-cian) 92%, transparent);
  box-shadow: 0 0 12px rgba(94, 230, 255, 0.5);
  transform: translateX(-110%);
  animation: nx-barrido 8s linear infinite;
}
.nx-riel:nth-child(1) { top: 16%; transform: rotate(-6deg); }
.nx-riel:nth-child(1)::after { animation-duration: 9s; animation-delay: -2s; }
.nx-riel:nth-child(2) { top: 34%; transform: rotate(3deg); }
.nx-riel:nth-child(2)::after { animation-duration: 11s; animation-delay: -6s; }
.nx-riel:nth-child(3) { top: 58%; transform: rotate(-2deg); }
.nx-riel:nth-child(3)::after { animation-duration: 7.5s; animation-delay: -1s; }
.nx-riel:nth-child(4) { top: 76%; transform: rotate(5deg); }
.nx-riel:nth-child(4)::after { animation-duration: 12s; animation-delay: -8s; }
.nx-riel:nth-child(5) { top: 90%; transform: rotate(-4deg); }
.nx-riel:nth-child(5)::after { animation-duration: 10s; animation-delay: -4s; }
.nx-riel:nth-child(6) { top: 46%; transform: rotate(-14deg); }
.nx-riel:nth-child(6)::after { animation-duration: 13s; animation-delay: -3s; }

.nx-riel--v {
  left: auto; right: auto; top: -10% !important; bottom: -10%; width: 1px; height: auto;
  background: linear-gradient(180deg, transparent, rgba(212, 175, 106, 0.14) 30%, rgba(94, 230, 255, 0.1) 70%, transparent);
}
.nx-riel--v::after {
  top: 0; left: -1px; right: -1px; bottom: auto; width: auto; height: 22%;
  background: linear-gradient(180deg, transparent, rgba(212, 175, 106, 0.9) 55%, #F7E6BE 75%, var(--nx-cian) 92%, transparent);
  transform: translateY(-110%);
  animation-name: nx-caida;
}
.nx-riel--v:nth-child(7) { left: 18%; transform: none; }
.nx-riel--v:nth-child(7)::after { animation-duration: 9s; animation-delay: -5s; }
.nx-riel--v:nth-child(8) { left: 82%; transform: none; }
.nx-riel--v:nth-child(8)::after { animation-duration: 12s; animation-delay: -1s; }

@keyframes nx-barrido { from { transform: translateX(-110%); } to { transform: translateX(520%); } }
@keyframes nx-caida { from { transform: translateY(-110%); } to { transform: translateY(560%); } }

/* --- Portada ------------------------------------------------------------------ */
.nx-portada {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100dvh;
}
.nx-portada-barra {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: min(1200px, 100%); margin: 0 auto; padding: 24px;
}
.nx-hero {
  position: relative; z-index: 1;
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px 20px 48px;
}
.nx-hero-emblema { position: relative; display: grid; place-items: center; width: 168px; height: 168px; margin-bottom: 28px; }
.nx-hero-emblema .nx-marca { width: 112px; height: 112px; filter: drop-shadow(0 0 28px rgba(212, 175, 106, 0.45)); }
.nx-halo {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(212, 175, 106, 0.9) 70deg, transparent 140deg, rgba(94, 230, 255, 0.85) 230deg, transparent 300deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1px));
  animation: nx-giro 14s linear infinite;
  opacity: 0.85;
}
.nx-halo::after {
  content: ""; position: absolute; inset: 18px; border-radius: 50%;
  border: 1px solid rgba(212, 175, 106, 0.14);
}
.nx-hero .nx-antetitulo::after {
  content: ""; width: 22px; height: 1px;
  background: linear-gradient(90deg, var(--nx-dorado), transparent);
}
.nx-hero-titulo {
  max-width: 16ch; margin: 6px 0 14px;
  font: 600 clamp(40px, 7vw, 84px)/1.02 var(--nx-f-titulos); letter-spacing: -0.04em;
  background: linear-gradient(105deg, #FFFFFF 0%, #FFF4DA 30%, var(--nx-dorado-claro) 55%, var(--nx-dorado) 80%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 30px rgba(212, 175, 106, 0.18));
}
.nx-hero-lema { margin: 0 0 34px; font-size: clamp(16px, 1.6vw, 20px); color: var(--nx-texto-2); letter-spacing: 0.01em; }
.nx-hero-acciones { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.nx-areas {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px;
  width: min(760px, 100%); margin: 56px 0 0; padding: 0; list-style: none;
}
.nx-area {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; text-align: left;
  border-radius: var(--nx-radio-m);
  transition: transform 0.3s var(--nx-curva), border-color 0.3s;
}
.nx-area:hover { transform: translateY(-3px); border-color: var(--nx-borde-fuerte); }
.nx-area > .nx-ic { width: 26px; height: 26px; color: var(--nx-dorado); }
.nx-area strong { display: block; font: 600 15px/1.3 var(--nx-f-titulos); color: var(--nx-texto); }
.nx-area small { display: block; color: var(--nx-texto-3); font-size: 12.5px; }

.nx-marca--animada .nx-marca-hex { stroke-dasharray: 180; stroke-dashoffset: 180; animation: nx-trazo 2.2s var(--nx-curva) 0.2s forwards; }
.nx-marca--animada .nx-marca-n { stroke-dasharray: 80; stroke-dashoffset: 80; animation: nx-trazo 1.6s var(--nx-curva) 0.9s forwards; }
.nx-marca--animada .nx-marca-nodo { animation: nx-pulso 2.8s ease-in-out 2s infinite; transform-origin: 56.68px 17.75px; }

@keyframes nx-trazo { to { stroke-dashoffset: 0; } }
@keyframes nx-pulso { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.55; transform: scale(1.5); } }
@keyframes nx-giro { to { transform: rotate(360deg); } }

/* --- Panel: barra lateral ----------------------------------------------------- */
.nx-lateral {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 20;
  width: var(--nx-lateral);
  display: flex; flex-direction: column; gap: 18px;
  padding: 24px 16px 16px;
  background: linear-gradient(180deg, rgba(18, 26, 43, 0.82), rgba(12, 17, 29, 0.78));
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-right: 1px solid rgba(212, 175, 106, 0.18);
}
.nx-lateral::after {
  /* Línea de luz vertical sobre el borde derecho. */
  content: ""; position: absolute; top: 10%; bottom: 40%; right: -1px; width: 1px;
  background: linear-gradient(180deg, transparent, rgba(242, 215, 155, 0.8), rgba(94, 230, 255, 0.5), transparent);
}
.nx-lateral-cabeza { padding: 0 8px; }
.nx-lateral-estudio {
  margin: 10px 0 0; padding-top: 12px;
  border-top: 1px solid var(--nx-borde-suave);
  font-size: 13px; color: var(--nx-texto-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.nx-buscar-boton {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border: 0; border-radius: 12px;
  background: var(--nx-campo-fondo);
  box-shadow: inset 0 0 0 1px var(--nx-borde-suave);
  color: var(--nx-texto-3); font: 400 14px/1.2 var(--nx-f-texto);
  cursor: pointer; transition: box-shadow 0.2s, color 0.2s;
}
.nx-buscar-boton span { flex: 1; text-align: left; }
.nx-buscar-boton .nx-ic { width: 18px; height: 18px; color: var(--nx-dorado); }
.nx-buscar-boton:hover { color: var(--nx-texto-2); box-shadow: inset 0 0 0 1px var(--nx-borde-fuerte), 0 0 20px -8px rgba(94, 230, 255, 0.5); }

.nx-menu { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.nx-menu-grupo {
  margin: 18px 12px 8px;
  font: 600 10.5px/1 var(--nx-f-texto); letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--nx-texto-3);
}
.nx-menu-grupo:first-child { margin-top: 4px; }
.nx-menu-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nx-menu-item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px;
  color: var(--nx-texto-2); text-decoration: none; font-weight: 500; font-size: 14.5px;
  transition: background 0.2s, color 0.2s;
}
.nx-menu-item .nx-ic { color: var(--nx-texto-3); transition: color 0.2s; }
.nx-menu-item:hover { color: var(--nx-texto); background: rgba(255, 255, 255, 0.04); }
.nx-menu-item:hover .nx-ic { color: var(--nx-dorado); }
.nx-menu-item[aria-current="page"] {
  color: #fff;
  background: linear-gradient(90deg, rgba(212, 175, 106, 0.18), rgba(212, 175, 106, 0.03) 80%);
  box-shadow: inset 0 0 0 1px rgba(212, 175, 106, 0.16);
}
.nx-menu-item[aria-current="page"] .nx-ic { color: var(--nx-dorado-claro); }
.nx-menu-item[aria-current="page"]::before {
  content: ""; position: absolute; left: -4px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px;
  background: linear-gradient(180deg, var(--nx-dorado-claro), var(--nx-cian));
  box-shadow: 0 0 12px rgba(212, 175, 106, 0.8);
}

.nx-usuario {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--nx-borde-suave);
}
.nx-usuario-datos { display: grid; min-width: 0; flex: 1; line-height: 1.3; }
.nx-usuario-nombre { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-usuario-rol { font-size: 12px; color: var(--nx-dorado); letter-spacing: 0.04em; }
.nx-salir { margin: 0; }

/* --- Panel: marco y contenido ------------------------------------------------ */
.nx-marco {
  display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100dvh;
  margin-left: var(--nx-lateral);
}
.nx-principal {
  flex: 1; width: 100%; max-width: 1180px; margin: 0 auto;
  padding: 40px clamp(20px, 3.5vw, 48px) 24px;
}
.nx-principal:focus { outline: none; }
.nx-barra-movil { display: none; }
.nx-inferior { display: none; }

.nx-cabecera {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin: 0 0 28px;
}
.nx-cabecera-textos { min-width: 0; }
.nx-cabecera-texto { margin: 8px 0 0; color: var(--nx-texto-2); }
.nx-cabecera-acciones { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.nx-cifra-linea { color: var(--nx-texto-2); font-size: 14px; }
.nx-cifra-linea span { font: 600 22px/1 var(--nx-f-titulos); color: var(--nx-dorado-claro); margin-right: 4px; }

.nx-migas { margin: 0 0 16px; }
.nx-migas a {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--nx-texto-2); text-decoration: none; font-size: 14px;
}
.nx-migas a:hover { color: var(--nx-dorado-claro); }
.nx-migas .nx-ic { width: 16px; height: 16px; }

.nx-bloque { padding: 28px; margin: 0 0 22px; }
.nx-bloque--angosto { max-width: 620px; }

/* Cifras animadas */
.nx-cifras { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin: 0 0 22px; }
.nx-cifra {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px;
  align-items: center; padding: 18px 20px; border-radius: var(--nx-radio-m);
}
.nx-cifra-icono {
  grid-row: 1 / 3; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(212, 175, 106, 0.08); box-shadow: inset 0 0 0 1px var(--nx-borde);
  color: var(--nx-dorado);
}
.nx-cifra-valor {
  font: 600 30px/1.05 var(--nx-f-titulos); letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
  background: linear-gradient(100deg, #fff, var(--nx-dorado-claro));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nx-cifra-etiqueta { font-size: 13px; color: var(--nx-texto-2); }

/* Filtros */
.nx-filtros {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(160px, 1fr) auto; gap: 16px; align-items: end;
  padding: 18px 20px; margin: 0 0 22px; border-radius: var(--nx-radio-m);
}
.nx-filtros-acciones { display: flex; gap: 8px; align-items: center; }

/* Tablas */
.nx-tabla-marco { overflow: hidden; margin: 0 0 22px; }
.nx-tabla-resumen { margin: 0; padding: 16px 20px 0; font-size: 13px; color: var(--nx-texto-3); }
.nx-tabla-resumen span { font: 600 15px/1 var(--nx-f-titulos); color: var(--nx-dorado-claro); }
.nx-tabla { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.nx-tabla th {
  padding: 16px 20px 12px; text-align: left;
  font: 600 11px/1.2 var(--nx-f-texto); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--nx-texto-3);
  border-bottom: 1px solid var(--nx-borde);
}
.nx-tabla td { padding: 14px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); vertical-align: middle; color: var(--nx-texto-2); }
.nx-tabla tbody tr { transition: background 0.2s; }
.nx-tabla tbody tr:hover { background: linear-gradient(90deg, rgba(212, 175, 106, 0.06), transparent 70%); }
.nx-tabla tbody tr:last-child td { border-bottom: 0; }
.nx-tabla--densa td { padding: 11px 20px; font-size: 13.5px; }
.nx-celda-principal { color: var(--nx-texto) !important; }
.nx-celda-acciones { text-align: right; white-space: nowrap; }
.nx-celda-acciones > * { vertical-align: middle; }
.nx-celda-acciones form { display: inline-block; margin: 0 0 0 6px; }
.nx-fila-inactiva td { opacity: 0.6; }

.nx-entidad { display: inline-flex; align-items: center; gap: 12px; color: var(--nx-texto); text-decoration: none; font-weight: 500; min-width: 0; }
a.nx-entidad:hover { color: var(--nx-dorado-claro); }
.nx-entidad-textos { display: grid; min-width: 0; line-height: 1.35; }
.nx-entidad-textos small { color: var(--nx-texto-3); font-weight: 400; overflow-wrap: anywhere; }

/* Estado vacío */
.nx-vacio { display: grid; justify-items: center; gap: 6px; padding: 48px 24px; text-align: center; }
.nx-vacio-icono {
  display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 10px; border-radius: 16px;
  background: rgba(212, 175, 106, 0.08); box-shadow: inset 0 0 0 1px var(--nx-borde);
  color: var(--nx-dorado);
}
.nx-vacio-icono .nx-ic { width: 26px; height: 26px; }
.nx-vacio-titulo { margin: 0; font: 600 17px/1.3 var(--nx-f-titulos); }
.nx-vacio-texto { margin: 0; color: var(--nx-texto-2); font-size: 14px; }
.nx-vacio-acciones { margin-top: 14px; }

/* Ficha */
.nx-ficha-cabeza {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  padding: 28px; margin: 0 0 22px;
}
.nx-ficha-titulos { flex: 1; min-width: 220px; }
.nx-ficha-titulos .nx-titulo { overflow-wrap: anywhere; }
.nx-ficha-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }

.nx-datos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; margin: 0; }
.nx-datos > div { padding: 14px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); min-width: 0; }
.nx-datos dt { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 12.5px; color: var(--nx-texto-3); letter-spacing: 0.02em; }
.nx-datos dt .nx-ic { width: 16px; height: 16px; color: var(--nx-dorado); }
.nx-datos dd { margin: 0; color: var(--nx-texto); font-size: 15px; overflow-wrap: anywhere; }
.nx-datos dd .nx-chip { margin: 2px 4px 2px 0; }
.nx-datos--una { grid-template-columns: minmax(0, 1fr); margin-bottom: 20px; }
.nx-codigo {
  display: inline-block; padding: 6px 10px; border-radius: 8px;
  background: var(--nx-campo-fondo); border: 1px solid var(--nx-borde);
  color: var(--nx-dorado-claro); letter-spacing: 0.08em; font-size: 14px; overflow-wrap: anywhere;
}

.nx-areas-ficha { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.nx-area-tarjeta {
  padding: 22px; border-radius: var(--nx-radio-m);
  transition: transform 0.3s var(--nx-curva), border-color 0.3s;
}
.nx-area-tarjeta:hover { transform: translateY(-2px); border-color: var(--nx-borde-fuerte); }
.nx-area-tarjeta > .nx-ic { width: 28px; height: 28px; color: var(--nx-dorado); margin-bottom: 14px; }
.nx-area-tarjeta h3 { font-size: 17px; margin: 0 0 6px; }
.nx-area-tarjeta p { margin: 0; font-size: 13px; color: var(--nx-texto-3); }

/* Paginado */
.nx-paginas { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 0 0 22px; }
.nx-paginas-texto { color: var(--nx-texto-2); font-size: 14px; }

/* --- Diálogos: buscador y menú "Más" ---------------------------------------- */
dialog { color: var(--nx-texto); }
dialog::backdrop { background: rgba(5, 8, 15, 0.66); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

.nx-buscador {
  width: min(640px, calc(100% - 32px)); max-height: min(560px, calc(100dvh - 32px));
  margin: 12vh auto auto; padding: 0;
  border: 1px solid rgba(212, 175, 106, 0.18); border-radius: var(--nx-radio);
  background: linear-gradient(180deg, rgba(22, 32, 52, 0.94), rgba(14, 20, 34, 0.94));
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.02), 0 0 60px -20px rgba(94, 230, 255, 0.25);
  overflow: hidden;
}
.nx-buscador[open] { display: flex; flex-direction: column; animation: nx-aparecer 0.25s var(--nx-curva); }
.nx-buscador-campo {
  display: flex; align-items: center; gap: 12px; margin: 0;
  padding: 16px 18px; border-bottom: 1px solid var(--nx-borde);
}
.nx-buscador-campo > .nx-ic { color: var(--nx-dorado); width: 22px; height: 22px; }
.nx-buscador-input {
  flex: 1; min-width: 0; border: 0; background: none; color: var(--nx-texto);
  font: 400 17px/1.4 var(--nx-f-texto);
}
.nx-buscador-input:focus { outline: none; }
.nx-buscador-input::placeholder { color: var(--nx-texto-3); }
.nx-buscador-input::-webkit-search-cancel-button { display: none; }
.nx-buscador-estado { margin: 0; padding: 12px 20px 4px; font-size: 13px; color: var(--nx-texto-3); }
.nx-cargando .nx-buscador-estado { color: var(--nx-cian); }
.nx-buscador-lista { list-style: none; margin: 0; padding: 6px 10px 10px; overflow-y: auto; flex: 1; }
.nx-resultado {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: var(--nx-texto); text-decoration: none;
}
.nx-resultado:hover, .nx-resultado:focus-visible {
  outline: none; color: #fff;
  background: linear-gradient(90deg, rgba(212, 175, 106, 0.16), rgba(212, 175, 106, 0.03));
  box-shadow: inset 0 0 0 1px rgba(212, 175, 106, 0.25);
}
.nx-resultado-textos { display: grid; line-height: 1.35; min-width: 0; }
.nx-resultado-titulo { font-weight: 500; }
.nx-resultado-sub { font-size: 12.5px; color: var(--nx-texto-3); }
.nx-buscador-pie {
  display: flex; gap: 18px; justify-content: flex-end; margin: 0;
  padding: 10px 18px; border-top: 1px solid var(--nx-borde-suave);
  font-size: 12px; color: var(--nx-texto-3);
}
.nx-buscador-pie span { display: inline-flex; gap: 4px; align-items: center; }

.nx-hoja {
  width: min(420px, calc(100% - 24px)); max-height: calc(100dvh - 24px);
  margin: auto auto 12px; padding: 18px 16px 16px;
  border: 1px solid rgba(212, 175, 106, 0.18); border-radius: 24px;
  background: linear-gradient(180deg, rgba(22, 32, 52, 0.96), rgba(14, 20, 34, 0.96));
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 -20px 80px -30px rgba(0, 0, 0, 0.9);
}
.nx-hoja[open] { display: flex; flex-direction: column; gap: 12px; animation: nx-subir 0.3s var(--nx-curva); }
.nx-hoja-cabeza { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 0 12px; }
.nx-hoja-titulo { margin: 0; font: 600 17px/1 var(--nx-f-titulos); }
.nx-hoja .nx-menu { flex: none; }

@keyframes nx-aparecer { from { opacity: 0; transform: translateY(-8px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes nx-subir { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* --- Entrada suave ----------------------------------------------------------- */
@keyframes nx-entrar { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.nx-entrada { animation: nx-entrar 0.7s var(--nx-curva) both; }
.nx-d1 { animation-delay: 0.07s; }
.nx-d2 { animation-delay: 0.14s; }
.nx-d3 { animation-delay: 0.21s; }
.nx-d4 { animation-delay: 0.28s; }
.nx-d5 { animation-delay: 0.36s; }

/* ==========================================================================
   Responsivo
   ========================================================================== */

/* Tablet y celular: sin barra lateral; barra inferior + "Más". */
@media (max-width: 1023.98px) {
  .nx-lateral { display: none; }
  .nx-marco { margin-left: 0; }

  .nx-barra-movil {
    position: sticky; top: 0; z-index: 15;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    background: linear-gradient(180deg, rgba(11, 15, 26, 0.92), rgba(11, 15, 26, 0.72));
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid var(--nx-borde);
  }
  .nx-barra-movil .nx-marca { width: 34px; height: 34px; }
  .nx-barra-movil .nx-logo { min-width: 0; gap: 10px; }
  .nx-barra-movil-textos { display: grid; min-width: 0; line-height: 1.15; }
  .nx-barra-movil .nx-palabra { font-size: 17px; }
  .nx-barra-movil-estudio { font-size: 12px; color: var(--nx-texto-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .nx-principal { padding: 24px 16px 16px; }
  .nx-pie { padding-bottom: calc(var(--nx-inferior-alto) + 36px + env(safe-area-inset-bottom)); }

  .nx-inferior {
    position: fixed; z-index: 25;
    left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom));
    display: flex; justify-content: space-around; gap: 4px;
    height: var(--nx-inferior-alto); padding: 6px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(22, 32, 52, 0.97), rgba(14, 20, 34, 0.98));
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid rgba(212, 175, 106, 0.18);
    box-shadow: 0 20px 50px -18px rgba(0, 0, 0, 0.9);
  }
  .nx-inferior::before {
    content: ""; position: absolute; top: -1px; left: 18%; right: 18%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(242, 215, 155, 0.8), rgba(94, 230, 255, 0.5), transparent);
  }
  .nx-inferior-item {
    position: relative; flex: 1; min-width: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; border-radius: 16px; background: none; cursor: pointer;
    color: var(--nx-texto-3); text-decoration: none;
    font: 500 11px/1.1 var(--nx-f-texto);
    transition: color 0.2s, background 0.2s;
  }
  .nx-inferior-item span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nx-inferior-item .nx-ic { width: 22px; height: 22px; }
  .nx-inferior-item:hover { color: var(--nx-texto); }
  .nx-inferior-item[aria-current="page"] {
    color: var(--nx-dorado-claro);
    background: linear-gradient(180deg, rgba(212, 175, 106, 0.16), rgba(212, 175, 106, 0.04));
  }
  .nx-inferior-item[aria-current="page"]::before {
    content: ""; position: absolute; top: -7px; left: 30%; right: 30%; height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, var(--nx-dorado-claro), var(--nx-cian));
    box-shadow: 0 0 10px rgba(212, 175, 106, 0.9);
  }

  .nx-buscador { margin-top: 10vh; }
}

@media (min-width: 1024px) {
  .nx-hoja[open] { display: none; } /* el menú completo ya está en la barra lateral */
}

/* Acceso en pantallas medianas y chicas: una sola columna. */
@media (max-width: 899.98px) {
  .nx-acceso { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .nx-acceso-marca {
    min-height: 0; padding: 28px 20px 8px; gap: 22px;
    border-right: 0; background: none;
  }
  .nx-acceso-estudio { font-size: 30px; margin-bottom: 4px; }
  .nx-acceso-texto { font-size: 15px; }
  .nx-acceso-lema .nx-antetitulo, .nx-acceso-emblema { display: none; }
  .nx-acceso-tarjeta { margin-top: 0; }
  .nx-acceso-principal { justify-content: flex-start; padding: 16px 16px 8px; gap: 16px; }
  .nx-acceso-tarjeta { padding: 28px 22px 24px; }
}

/* Celular */
@media (max-width: 719.98px) {
  body { font-size: 15px; }
  .nx-titulo { font-size: 26px; }
  .nx-cabecera { align-items: flex-start; margin-bottom: 20px; }
  .nx-cabecera-acciones { width: 100%; }
  .nx-cabecera-acciones .nx-boton { flex: 1; }
  .nx-bloque { padding: 20px 18px; }
  .nx-form--rejilla { grid-template-columns: minmax(0, 1fr); }
  .nx-filtros { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 16px; }
  .nx-filtros > .nx-campo:first-child { grid-column: 1 / -1; }
  .nx-filtros > .nx-boton { min-height: 46px; }
  .nx-filtros-acciones { grid-column: 1 / -1; }
  .nx-filtros-acciones .nx-boton--sutil { flex: 1; }
  .nx-cifras { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .nx-cifra { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; row-gap: 6px; padding: 14px; }
  .nx-cifra-icono { grid-row: auto; width: 34px; height: 34px; border-radius: 10px; }
  .nx-cifra-icono .nx-ic { width: 18px; height: 18px; }
  .nx-cifra-valor { font-size: 24px; }
  .nx-cifra-etiqueta { font-size: 12px; line-height: 1.25; }
  .nx-datos { grid-template-columns: minmax(0, 1fr); }
  .nx-areas-ficha { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .nx-area-tarjeta { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; padding: 16px 18px; }
  .nx-area-tarjeta > .nx-ic { grid-row: 1 / 3; margin: 0; }
  .nx-area-tarjeta h3 { margin: 0; font-size: 16px; }
  .nx-ficha-cabeza { padding: 22px 18px; gap: 16px; }
  .nx-ficha-cabeza .nx-avatar--grande { width: 56px; height: 56px; font-size: 19px; border-radius: 16px; }
  .nx-ficha-cabeza > .nx-boton { width: 100%; }

  /* Tablas → tarjetas */
  .nx-tabla thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .nx-tabla, .nx-tabla tbody, .nx-tabla tr, .nx-tabla td { display: block; width: 100%; }
  .nx-tabla tbody tr { padding: 14px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
  .nx-tabla tbody tr:last-child { border-bottom: 0; }
  .nx-tabla td, .nx-tabla--densa td {
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    padding: 5px 0; border: 0; font-size: 13.5px; text-align: right;
  }
  .nx-tabla td[data-etiqueta]::before {
    content: attr(data-etiqueta); flex: none;
    color: var(--nx-texto-3); font-size: 12px; text-align: left;
  }
  .nx-tabla td.nx-celda-principal { padding: 0 0 8px; text-align: left; justify-content: flex-start; font-size: 15px; }
  .nx-tabla td.nx-celda-acciones { justify-content: flex-start; padding-top: 10px; gap: 8px; }
  .nx-celda-acciones form { margin: 0; }
  .nx-tabla td:empty { display: none; }
  .nx-tabla-resumen { padding: 14px 16px 4px; }

  .nx-riel--v { display: none; }
  .nx-areas { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 40px; max-width: 360px; }
  .nx-hero { padding-top: 8px; }
  .nx-hero-emblema { width: 132px; height: 132px; margin-bottom: 22px; }
  .nx-hero-emblema .nx-marca { width: 88px; height: 88px; }
  .nx-portada-barra { padding: 18px 16px; }
  .nx-buscador-pie { display: none; }
  .nx-estado-codigo { font-size: 60px; }
}

/* Movimiento reducido: sin animaciones ni transiciones. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .nx-riel::after, .nx-halo { animation: none !important; }
  .nx-riel::after { transform: translateX(150%); opacity: 0.6; }
  .nx-marca--animada .nx-marca-hex, .nx-marca--animada .nx-marca-n { stroke-dashoffset: 0; }
}

/* Panel de inicio */
.nx-cifra--texto .nx-cifra-texto {
  font: 600 17px/1.25 var(--nx-f-titulos); color: var(--nx-dorado-claro); overflow-wrap: anywhere;
}
.nx-cifra-texto--vacio { color: var(--nx-texto-2) !important; font-weight: 500; }
.nx-proximamente { display: flex; align-items: flex-start; gap: 18px; }
.nx-proximamente-titulo { margin: 4px 0 10px; font: 600 20px/1.3 var(--nx-f-titulos); }
.nx-proximamente-texto { margin: 0; }
@media (max-width: 720px) {
  .nx-cifras .nx-cifra--texto { grid-column: 1 / -1; }
  .nx-proximamente { padding: 20px; gap: 14px; }
}
