/* ══════════════════════════════════════════════════
   DocenteIA — Barra de navegación compartida
   Se enlaza DESPUÉS del <style> de cada página, para
   que estas reglas ganen sobre las antiguas.
   Editar aquí cambia el menú en todo el sitio.
   ══════════════════════════════════════════════════ */

.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--gray-200, #e2e6f0);
  box-shadow: var(--shadow-sm, 0 2px 12px rgba(13,31,78,.07));
  overflow: visible;
}
.navbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 80px;
}
.nav-logo { overflow: hidden; height: 68px; }
.nav-logo img { height: 88px; width: auto; }

.nav-links { display: flex; align-items: center; gap: 30px; list-style: none; }
.nav-links a {
  font-size: 14px; font-weight: 600;
  color: var(--gray-700, #3d4466);
  transition: color .15s; white-space: nowrap; text-decoration: none;
}
.nav-links a:hover, .nav-links a.active { color: var(--navy, #0d1f4e); }
.nav-drop-btn.active { color: var(--navy, #0d1f4e); }

/* Botón de sesión */
.nav-auth a {
  font-weight: 800; color: var(--navy, #0d1f4e);
  background: rgba(201,168,76,.18);
  padding: 8px 15px; border-radius: 9px; white-space: nowrap;
}
.nav-auth a:hover { background: rgba(201,168,76,.30); color: var(--navy, #0d1f4e); }

/* Acceso al historial de registros: solo lo ve quien administra el sitio */
.nav-auth a.nav-admin {
  font-weight: 600; background: transparent;
  color: var(--navy, #0d1f4e); opacity: .72;
  padding: 8px 10px; margin-right: 2px;
}
.nav-auth a.nav-admin:hover { background: rgba(13,31,78,.07); opacity: 1; }

/* ── Desplegables ── */
.nav-drop { position: relative; }
.nav-drop-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  color: var(--gray-700, #3d4466); background: none; border: none;
  cursor: pointer; padding: 0; transition: color .15s;
}
.nav-drop-btn:hover, .nav-drop.open .nav-drop-btn { color: var(--navy, #0d1f4e); }
.nav-drop-btn svg { transition: transform .2s; }
.nav-drop.open .nav-drop-btn svg { transform: rotate(180deg); }

.nav-drop-menu {
  position: absolute; top: calc(100% + 18px); left: 50%;
  transform: translateX(-50%) translateY(-8px);
  min-width: 310px; background: #fff;
  border: 1px solid var(--gray-200, #e2e6f0); border-radius: 16px;
  box-shadow: 0 18px 50px rgba(13,31,78,.16);
  padding: 10px; z-index: 200;
  opacity: 0; visibility: hidden;
  transition: opacity .18s, transform .18s, visibility .18s;
}
/* Puente invisible: evita que se cierre al mover el ratón hacia el panel */
.nav-drop-menu::before {
  content: ''; position: absolute; top: -18px; left: 0; right: 0; height: 18px;
}
.nav-drop.open .nav-drop-menu {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}

.nav-drop-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 12px; border-radius: 11px;
  transition: background .14s; text-decoration: none;
}
.nav-drop-item:hover { background: var(--gray-50, #f8f9fc); }
.nav-drop-ico {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold-pale, #fdf3d7); color: var(--navy, #0d1f4e);
}
.nav-drop-txt strong {
  display: block; font-size: 14px; font-weight: 800;
  color: var(--navy, #0d1f4e); margin-bottom: 2px; white-space: nowrap;
}
.nav-drop-txt span { font-size: 12.5px; color: var(--gray-400, #5a6380); line-height: 1.45; }

.nav-drop-pill {
  display: inline-block; font-size: 10px; font-weight: 800;
  letter-spacing: .05em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 20px; margin-left: 7px; vertical-align: 1px;
}
.nav-drop-pill.pro  { background: var(--gold-pale, #fdf3d7); color: #8a6d12; }
.nav-drop-pill.inst { background: var(--navy, #0d1f4e); color: var(--gold-lt, #e8c96a); }

.nav-mobile-toggle { display: none; cursor: pointer; padding: 4px; }
.nav-mobile-menu { display: none; }

/* ── Móvil y tableta ── */
@media (max-width: 1000px) {
  .navbar-inner { height: 72px; }
  .nav-logo { height: 54px; }
  .nav-logo img { height: 70px; }
  .nav-links { display: none; }
  .nav-mobile-toggle { display: flex; align-items: center; justify-content: center; }

  .nav-mobile-menu {
    display: none; position: absolute; top: 72px; left: 0; right: 0;
    background: #fff; box-shadow: 0 8px 32px rgba(13,31,78,.12);
    z-index: 999; border-top: 2px solid var(--gold, #c9a227);
    max-height: calc(100vh - 72px); overflow-y: auto;
    animation: navSlideDown .2s ease;
  }
  @keyframes navSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .nav-mobile-menu.open { display: block; }
  .nav-mobile-menu ul { list-style: none; margin: 0; padding: 8px 0; }
  .nav-mobile-menu ul li a {
    display: block; padding: 14px 24px;
    font-size: 15px; font-weight: 600; color: var(--gray-700, #3d4466);
    border-bottom: 1px solid #f0f4f8;
    transition: background .15s, color .15s; text-decoration: none;
  }
  .nav-mobile-menu ul li a:hover { background: #f0f4f8; color: var(--navy, #0d1f4e); }

  /* Encabezado de grupo */
  .nav-m-group {
    padding: 14px 24px 6px;
    font-size: 11px; font-weight: 800; letter-spacing: .1em;
    text-transform: uppercase; color: var(--gold, #c9a227);
    background: var(--gray-50, #f8f9fc); border-bottom: 1px solid #f0f4f8;
  }
  .nav-mobile-menu ul li.nav-m-sub a { padding-left: 36px; }
  .nav-m-tag {
    font-size: 10px; font-weight: 800; text-transform: uppercase;
    letter-spacing: .05em; padding: 2px 7px; border-radius: 20px; margin-left: 8px;
    background: var(--gold-pale, #fdf3d7); color: #8a6d12;
  }
}

@media (max-width: 600px) {
  .nav-logo { height: 46px; }
  .nav-logo img { height: 60px; }
}
