/* =============================================================================
   NEXORD PLATFORM · PERSISTENT GLOBAL NAVIGATION & ZENITH DIAL (SCHEMA)
   Barra persistente superior de niveles + Modal Dial Orbital 3-6-9
   ============================================================================= */

:root {
  --nav-bar-h: 36px;
  --neon-cyan: #38BDF8;
  --neon-green: #00FF87;
  --neon-gold: #FFE600;
  --neon-magenta: #FF007F;
  --bg-nav: rgba(7, 12, 28, 0.94);
  --border-nav: rgba(56, 189, 248, 0.3);
}

/* Espaciado superior para evitar solapamiento cuando la barra fija esté activa */
body.has-persistent-nav {
  padding-top: var(--nav-bar-h) !important;
}

/* =============================================================================
   1. BARRA PERSISTENTE SUPERIOR (GLOBAL BREADCRUMBS & LEVEL SWITCHER)
   ============================================================================= */
#nexord-persistent-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: var(--nav-bar-h);
  background: var(--bg-nav);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1.5px solid var(--border-nav);
  z-index: 999998;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  box-sizing: border-box;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.76rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.75);
  user-select: none;
}

/* Zona Izquierda: Dial Trigger + Breadcrumb */
.pnav-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.pnav-dial-btn {
  background: linear-gradient(135deg, rgba(255, 230, 0, 0.18), rgba(0, 255, 135, 0.18));
  border: 1px solid var(--neon-gold);
  color: var(--neon-gold);
  font-weight: 800;
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  letter-spacing: 0.05em;
}
.pnav-dial-btn:hover {
  background: var(--neon-gold);
  color: #070B18;
  box-shadow: 0 0 12px rgba(255, 230, 0, 0.6);
  transform: translateY(-1px);
}
.pnav-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #94A3B8;
  font-size: 0.74rem;
}
.pnav-breadcrumb a {
  color: #CBD5E1;
  text-decoration: none;
  transition: color 0.18s ease;
}
.pnav-breadcrumb a:hover {
  color: var(--neon-cyan);
}
.pnav-breadcrumb .sep {
  color: rgba(255, 255, 255, 0.25);
}
.pnav-breadcrumb .cur {
  color: var(--neon-cyan);
  font-weight: 700;
}

/* Zona Central: Tira Horizontal de Niveles (1 a 8 + Portal) */
.pnav-center {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.pnav-center::-webkit-scrollbar {
  display: none;
}
.pnav-lvl-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #94A3B8;
  padding: 2.5px 8px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  transition: all 0.18s ease;
}
.pnav-lvl-pill:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--neon-cyan);
  color: #FFFFFF;
}
.pnav-lvl-pill.active {
  background: rgba(0, 255, 135, 0.22);
  border-color: var(--neon-green);
  color: var(--neon-green);
  box-shadow: 0 0 10px rgba(0, 255, 135, 0.4);
}

/* Zona Derecha: Accesos Deontología, Custodia e Inicio */
.pnav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.pnav-link {
  color: #94A3B8;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pnav-link:hover {
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
}
.pnav-link.highlight {
  color: var(--neon-green);
  border-color: rgba(0, 255, 135, 0.35);
  background: rgba(0, 255, 135, 0.1);
}
.pnav-link.highlight:hover {
  background: rgba(0, 255, 135, 0.25);
  box-shadow: 0 0 10px rgba(0, 255, 135, 0.35);
}

/* =========================================================================
   2. MODAL CENITAL DEL DIAL 3-6-9 (ZENITH POPOVER)
   ============================================================================= */
#nexord-zenith-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 7, 16, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  animation: zenithFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
#nexord-zenith-modal.open {
  display: flex;
}
@keyframes zenithFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.zenith-box {
  background: #0B132B;
  border: 1.5px solid var(--neon-cyan);
  border-radius: 16px;
  max-width: 900px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(56, 189, 248, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.zenith-header {
  padding: 12px 20px;
  background: rgba(7, 12, 28, 0.95);
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.zenith-title {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.92rem;
  font-weight: 800;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 8px;
}
.zenith-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #CBD5E1;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.zenith-close-btn:hover {
  background: rgba(255, 0, 127, 0.25);
  border-color: var(--neon-magenta);
  color: #FFF;
}

.zenith-body {
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-height: 75vh;
  overflow-y: auto;
}

/* =========================================================================
   VISTA DIAL ORBITAL: MENÚ LATERAL SIMPLIFICADO 1-9 + INSPECTOR DINÁMICO
   ========================================================================= */
.zenith-dial-container {
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 18px 22px;
  gap: 20px;
  min-height: 420px;
}
.zenith-sidebar-col {
  flex: 0 0 350px;
  background: rgba(7, 12, 28, 0.90);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
}
.zenith-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-family: 'Roboto Mono', monospace;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--neon-cyan);
  letter-spacing: 0.05em;
}
.zenith-sidebar-tag {
  color: #94A3B8;
  font-size: 0.68rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
}
.zenith-sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 10px;
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.3) transparent;
}
.zenith-sidebar-menu::-webkit-scrollbar {
  width: 5px;
}
.zenith-sidebar-menu::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.3);
  border-radius: 3px;
}
.zenith-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #CBD5E1;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  width: 100%;
  box-sizing: border-box;
}
.zenith-menu-item:hover {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.45);
  color: #FFFFFF;
  transform: translateX(3px);
}
.zenith-menu-item.selected {
  background: rgba(0, 255, 135, 0.16);
  border-color: var(--neon-green);
  color: #FFFFFF;
  box-shadow: 0 0 14px rgba(0, 255, 135, 0.25);
}
.zenith-menu-item.is-active-page {
  border-left: 3.5px solid var(--neon-gold);
}
.zenith-menu-num {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.88rem;
  font-weight: 900;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1.5px solid;
  background: rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
}
.zenith-menu-info {
  flex: 1;
  min-width: 0;
}
.zenith-menu-title {
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #F1F5F9;
}
.zenith-menu-sub {
  font-size: 0.70rem;
  color: #94A3B8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: 'Roboto Mono', monospace;
}
.zenith-menu-arrow {
  color: #64748B;
  font-size: 0.80rem;
  transition: transform 0.18s ease, color 0.18s ease;
  flex-shrink: 0;
}
.zenith-menu-item:hover .zenith-menu-arrow,
.zenith-menu-item.selected .zenith-menu-arrow {
  color: var(--neon-green);
  transform: translateX(2px);
}

.zenith-inspector-col {
  flex: 1;
  background: rgba(14, 25, 52, 0.90);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 320px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.zenith-insp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.zenith-insp-badge {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--neon-gold);
  background: rgba(255, 230, 0, 0.12);
  border: 1px solid rgba(255, 230, 0, 0.3);
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}
.zenith-insp-key {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.70rem;
  color: #94A3B8;
}
.zenith-insp-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 4px;
}
.zenith-insp-sub {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--neon-cyan);
  margin-bottom: 12px;
}
.zenith-insp-desc {
  font-family: 'Inter', sans-serif;
  font-size: 0.84rem;
  color: #CBD5E1;
  line-height: 1.5;
  margin-bottom: 18px;
}
.zenith-insp-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: auto;
}
.zenith-btn-enter {
  background: rgba(0, 255, 135, 0.18);
  border: 1.5px solid var(--neon-green);
  color: var(--neon-green);
  font-family: 'Roboto Mono', monospace;
  font-size: 0.84rem;
  font-weight: 800;
  padding: 10px 18px;
  border-radius: 6px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}
.zenith-btn-enter:hover {
  background: var(--neon-green);
  color: #030308;
  box-shadow: 0 0 16px rgba(0, 255, 135, 0.8);
  transform: translateY(-1px);
}
.zenith-btn-fullscreen {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38BDF8;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
}
.zenith-btn-fullscreen:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38BDF8;
  color: #FFF;
}

.zenith-footer {
  padding: 10px 20px;
  background: rgba(7, 12, 28, 0.95);
  border-top: 1px solid rgba(56, 189, 248, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.zenith-toggle-view {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #94A3B8;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.74rem;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.zenith-toggle-view:hover {
  color: #FFF;
  border-color: rgba(255, 255, 255, 0.35);
}
.zenith-footer-hint {
  font-size: 0.72rem;
  color: #64748B;
  font-family: 'Roboto Mono', monospace;
}

.zenith-sector-card {
  background: rgba(14, 25, 52, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  padding: 16px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.22s ease;
  position: relative;
  overflow: hidden;
}
.zenith-sector-card:hover {
  background: rgba(20, 38, 80, 0.95);
  border-color: var(--neon-green);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6), 0 0 15px rgba(0, 255, 135, 0.25);
}
.zenith-sector-card.active {
  border-color: var(--neon-green);
  background: rgba(0, 255, 135, 0.12);
}

.zenith-card-num {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--neon-gold);
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.zenith-card-title {
  font-family: 'Inter', sans-serif;
  font-size: 0.98rem;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 6px;
}
.zenith-card-desc {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  color: #94A3B8;
  line-height: 1.4;
  margin-bottom: 10px;
}
.zenith-card-action {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--neon-cyan);
  display: flex;
  align-items: center;
  gap: 4px;
}
.zenith-sector-card:hover .zenith-card-action {
  color: var(--neon-green);
}

/* RESPONSIVE MÓVIL */
@media (max-width: 820px) {
  #nexord-persistent-nav {
    padding: 0 6px;
    font-size: 0.68rem;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  .pnav-breadcrumb {
    display: none; /* Ahorra espacio en pantallas pequeñas */
  }
  .pnav-dial-btn {
    padding: 2px 6px;
    font-size: 0.66rem;
  }
  .pnav-center {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 3px;
  }
  .pnav-center::-webkit-scrollbar {
    display: none;
  }
  .pnav-lvl-pill {
    padding: 2px 6px;
    font-size: 0.68rem;
    flex-shrink: 0;
  }
  .pnav-right {
    gap: 4px;
  }
  .zenith-box {
    max-width: 95vw !important;
    max-height: 90vh !important;
    border-radius: 12px !important;
  }
  .zenith-dial-container {
    flex-direction: column;
    padding: 10px;
    gap: 10px;
    max-height: 78vh;
    overflow-y: auto;
  }
  .zenith-sidebar-col {
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 8px !important;
  }
  .zenith-menu-item {
    padding: 6px 8px !important;
    gap: 8px !important;
  }
  .zenith-wheel-col {
    flex: 0 0 auto;
    width: 270px;
  }
  .zenith-inspector-col {
    min-height: auto;
    padding: 14px;
    width: 100%;
    box-sizing: border-box;
  }
  .zenith-body {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .pnav-link span.link-text {
    display: none;
  }
}

