/* =========================================
   css/layout/dashboard.css
   Layout del Dashboard: sidebar, topbar,
   área de contenido y header móvil.
========================================= */

/* --- Layout raíz --- */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

/* ─── Sidebar ─────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-slate-900);
  color: var(--text-white);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform var(--transition-base);
}

.sidebar-header {
  height: 104px;
  background-color: var(--bg-slate-950);
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid #1e293b;
  position: relative;
}

.sidebar-logo {
  height: 50px;
  mix-blend-mode: screen;
}

.close-sidebar {
  display: none;
  background: none;
  border: none;
  color: var(--text-white);
  font-size: 1.5rem;
  position: absolute;
  right: 15px;
  cursor: pointer;
  line-height: 1;
}

/* ─── Navegación del Sidebar ──────────── */
.nav-container {
  flex: 1;
  padding-top: 1rem;
}

.nav-heading {
  padding: 0 20px;
  font-size: 0.75rem;
  color: var(--text-slate-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--text-white);
  text-decoration: none;
  border-radius: var(--radius-md);
  margin: 4px 16px;
  transition: background-color var(--transition-fast);
}

.nav-item.active {
  background-color: var(--color-blue-600);
}

.nav-item:hover:not(.active) {
  background-color: #1e293b;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ─── Perfil de usuario en Sidebar ───── */
.user-profile {
  padding: 20px;
  border-top: 1px solid #1e293b;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  background-color: #1e293b;
  width: 50px;
  height: 50px;
  border-radius: var(--radius-full);
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.user-name {
  font-size: 1rem;
  font-weight: 600;
}

.user-status {
  font-size: 0.75rem;
  color: var(--text-slate-500);
  display: flex;
  align-items: center;
  gap: 5px;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background-color: var(--color-green-600);
  border-radius: var(--radius-full);
}

/* ─── Área de contenido principal ─────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-slate-50);
  overflow: hidden;
}

/* Topbar (solo desktop) */
.topbar {
  height: var(--topbar-height);
  background-color: var(--bg-white);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.topbar-title {
  font-size: 1.5rem;
  color: var(--text-slate-900);
}

/* Área de scroll de contenido */
.content-area {
  padding: 2rem;
  flex: 1;
  overflow-y: auto;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-slate-900);
  margin-bottom: 1.5rem;
  display: block;
}

/* ─── Header Móvil ────────────────────── */
.mobile-header {
  display: none;
  height: var(--mobile-header-height);
  background-color: var(--bg-slate-900);
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
  color: var(--text-white);
  flex-shrink: 0;
}

.mobile-logo {
  height: 40px;
  mix-blend-mode: screen;
}

.menu-btn {
  background: none;
  border: none;
  color: var(--text-white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
  width: 32px;
  text-align: center;
}

.mobile-spacer {
  width: 32px;
}

/* ─── Overlay para cerrar sidebar en móvil */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
}

/* ─── Secciones de contenido (navegación) */
.content-section--hidden {
  display: none !important;
}

/* ─── Responsive ──────────────────────── */
@media (max-width: 768px) {
  .app-layout {
    flex-direction: column;
  }

  .mobile-header {
    display: flex;
  }

  .topbar {
    display: none;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    height: 100%;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .close-sidebar {
    display: block;
  }

  .overlay.open {
    display: block;
  }

  .content-area {
    padding: 1.5rem 1rem;
  }
}

@media (min-width: 769px) {
  .mobile-only-title {
    display: none !important;
  }
}
