/* ═══════════════════════════════════════════════════════════════════════════════
   styles/nav.css — Menú lateral de navegación
   Se importa en todas las páginas excepto login.
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── LAYOUT GENERAL ──────────────────────────────────────────────────────────── */
body {
  display: flex !important;
  flex-direction: row !important;
  min-height: 100vh;
  padding: 0 !important;
  margin: 0;
}

/* ── SIDEBAR ─────────────────────────────────────────────────────────────────── */
#sidebar {
  width: 240px;
  min-height: 100vh;
  background: #0b1e3d;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 300;
  box-shadow: 2px 0 16px rgba(0,0,0,0.15);
}

/* ── HEADER DEL SIDEBAR ──────────────────────────────────────────────────────── */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}

.sidebar-brand {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.sidebar-brand span {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 400;
  color: rgba(255,255,255,0.45);
  margin-top: 2px;
  letter-spacing: 0.3px;
}

/* ── NAVEGACIÓN ──────────────────────────────────────────────────────────────── */
.sidebar-nav {
  flex: 1;
  padding: 14px 0;
  overflow-y: auto;
}

.sidebar-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li {
  margin: 2px 10px;
}

/* ── ENLACES ─────────────────────────────────────────────────────────────────── */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: rgba(255,255,255,0.65);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.18s, color 0.18s;
}

.sidebar-link i {
  width: 18px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.07);
  color: #ffffff;
}

/* Página activa */
.sidebar-link--active {
  background: linear-gradient(135deg, #1565c0, #00b4d8);
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0,180,216,0.25);
}

.sidebar-link--active:hover {
  background: linear-gradient(135deg, #1565c0, #00b4d8);
}

/* ── FOOTER DEL SIDEBAR ──────────────────────────────────────────────────────── */
.sidebar-footer {
  padding: 14px 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: rgba(255,100,100,0.8);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.sidebar-logout i {
  width: 18px;
  text-align: center;
  font-size: 15px;
}

.sidebar-logout:hover {
  background: rgba(229,57,53,0.1);
  color: #ff6b6b;
}

/* ── CONTENIDO PRINCIPAL ─────────────────────────────────────────────────────── */
.page-content {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: calc(100% - 240px);
}

/* ── AJUSTES PARA TOPBAR EN LAS PÁGINAS INTERNAS ─────────────────────────────── */
/* Quitar el topbar fijo ya que ahora usamos sidebar */
body.body-consultas::before { display: none !important; }

/* El contenido ya no necesita compensar el topbar */
.section-consultasCliente {
  margin-top: 0 !important;
  padding-top: 36px;
}


.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 8px;
  overflow: hidden;       
  min-width: 0;            
}

.sidebar-user i {
  color:#ffffff;
  font-size: 1.4rem;
  opacity: 0.85;
  flex-shrink: 0; 
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;  
  line-height: 1.3;
  overflow: hidden;
  min-width: 0;
}

.sidebar-user-nombre {
  color:#ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  text-overflow: ellipsis;
}

.sidebar-user-rol {
  color: #ffffff;
  font-size: 0.75rem;
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ── BOTÓN HAMBURGUESA ────────────────────────────────────────────────────────── */
#btn-hamburguesa {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 400;
  background: #0b1e3d;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 20px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ── OVERLAY ─────────────────────────────────────────────────────────────────── */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 299;
}

#sidebar-overlay.activo { display: block; }

/* ── RESPONSIVE ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  #btn-hamburguesa {
    display: flex;
  }

  #sidebar {
    width: 240px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    min-height: 100vh;
    height: auto;
  }

  #sidebar.abierto {
    transform: translateX(0);
  }

  .page-content {
    margin-left: 0;
    width: 100%;
    padding-top: 64px; /* espacio para el botón hamburguesa */
  }

  /* Hamburguesa no tapa contenido */
  .section-consultasCliente {
    padding-top: 8px !important;
  }
}