/* ═══════════════════════════════════════════
   AstroLunAppVentas — Layout general y estructura
   v2.6 — Sidebar rediseñado, header móvil
   ═══════════════════════════════════════════ */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  font-size: 14px;
  min-height: 100vh;
  transition: background 0.2s, color 0.2s;
}

/* ── App shell ─────────────────────────── */
#app { display: none; min-height: 100vh; }

/* ════════════════════════════════════════
   SIDEBAR — Fondo verde oscuro, logo propio
   ════════════════════════════════════════ */
.sidebar {
  width: 240px;
  background: #0f4d2e;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  height: 100dvh; /* en móvil, 100vh no siempre coincide con el alto visible real */
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* scroll táctil suave en Android/iOS */
  z-index: 100;
  box-shadow: 2px 0 12px rgba(0,0,0,0.15);
}

/* Logo centrado en la parte superior del sidebar */
.sidebar-logo {
  padding: 1.5rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-logo img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
.sidebar-logo span {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}

/* Usuario */
.sidebar-user {
  padding: 10px 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user-name { font-size: 13px; font-weight: 600; color: #fff; }
.sidebar-user-role { font-size: 11px; color: rgba(255,255,255,0.55); text-transform: capitalize; }

/* Nav items */
nav { flex: 1; padding: 0.5rem 0; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 1.25rem;
  font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,0.70);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.12s;
}
.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.nav-item.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-left-color: #5de08a;
  font-weight: 700;
}
.nav-item .nav-icon { font-size: 17px; width: 22px; text-align: center; }

.nav-sub {
  padding-left: 2.25rem;
  font-size: 12.5px;
}

/* Grupos colapsables */
.nav-group-header {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 1.25rem;
  font-size: 11px; font-weight: 700;
  color: rgba(255,255,255,0.40);
  cursor: pointer;
  text-transform: uppercase; letter-spacing: 0.07em;
  transition: color 0.12s;
  user-select: none;
  margin-top: 4px;
}
.nav-group-header:hover { color: rgba(255,255,255,0.70); }
.nav-group-arrow { margin-left: auto; font-size: 10px; transition: transform 0.2s; }
.nav-group-arrow.open { transform: rotate(90deg); }

/* Bottom del sidebar */
.sidebar-bottom {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-bottom .btn-outline {
  border-color: rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.80);
  background: transparent;
}
.sidebar-bottom .btn-outline:hover {
  border-color: #fff;
  color: #fff;
  background: rgba(255,255,255,0.08);
}
.sidebar-bottom .btn-green {
  background: #1a7a4a;
  color: #fff;
}
.sidebar-bottom .btn-green:hover { background: #2d9e62; }

/* Theme toggle dentro del sidebar oscuro */
.theme-toggle {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  color: rgba(255,255,255,0.70);
  display: flex; align-items: center; gap: 6px;
  transition: all 0.15s;
  width: 100%; justify-content: center;
}
.theme-toggle:hover {
  border-color: rgba(255,255,255,0.6);
  color: #fff;
}

/* ── Main content ─────────────────────── */
.sidebar { display: none !important; }
.main { margin-left: 0; padding: 1.5rem; min-height: 100vh; }

/* ══════════════════════════════════════════════
   MENÚ FLOTANTE — reemplaza el sidebar invasivo
   ══════════════════════════════════════════════ */
.fab-menu-trigger, .fab-tema-trigger {
  position: fixed; top: 10px; z-index: 600;
  border: none; border-radius: 16px; background: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  cursor: pointer; padding: 5px;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s ease;
}
.fab-menu-trigger { left: 10px; width: 46px; height: 46px; }
.fab-tema-trigger { right: 10px; width: 42px; height: 42px; border-radius: 14px; }
.fab-menu-trigger:active, .fab-tema-trigger:active { transform: scale(0.92); }
.fab-menu-trigger img, .fab-tema-trigger img { width: 100%; height: 100%; object-fit: contain; }

.overlay-blur {
  display: none; position: fixed; inset: 0; z-index: 480;
  background: rgba(15,30,20,0.35);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.overlay-blur.open { display: block; }

.panel-flotante, .submenu-flotante {
  display: none; position: fixed; z-index: 590;
  left: 10px; top: 62px;
  background: #fff; border-radius: 22px; padding: 16px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.22);
  max-width: 320px;
}
.panel-flotante.open, .submenu-flotante.open { display: block; animation: panelFlotanteIn 0.18s ease; }
@keyframes panelFlotanteIn { from { opacity: 0; transform: translateY(-8px) scale(0.96); } to { opacity: 1; transform: none; } }

.grid-destinos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.destino-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer; padding: 8px 4px;
  border-radius: 14px; transition: background 0.15s ease; width: 88px;
}
.destino-btn:hover, .destino-btn:active { background: var(--gray-50); }
.destino-btn img { width: 46px; height: 46px; object-fit: contain; }
.destino-btn span { font-size: 10.5px; font-weight: 600; color: var(--gray-700); text-align: center; line-height: 1.25; }

.submenu-flotante { min-width: 240px; }
.submenu-titulo { font-weight: 700; font-size: 13.5px; color: var(--green); margin-bottom: 8px; }
.submenu-item {
  display: flex; align-items: center; padding: 10px 8px; border-radius: 10px;
  cursor: pointer; font-size: 13px; color: var(--gray-700);
}
.submenu-item:hover { background: var(--gray-50); }
.submenu-volver { display: block; width: 100%; text-align: left; margin-top: 4px; background: none; border: none; color: var(--gray-400); font-size: 12px; cursor: pointer; padding: 8px; }

@media (max-width: 480px) {
  .panel-flotante, .submenu-flotante { left: 12px; right: 12px; max-width: none; top: 62px; }
  .grid-destinos { grid-template-columns: repeat(3, 1fr); }
  .destino-btn { width: auto; }
}

.page        { display: none; }
.page.active { display: block; }

.page-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap; gap: 8px;
}
.page-title    { font-size: 20px; font-weight: 800; color: var(--gray-900); }
.page-subtitle { font-size: 13px; color: var(--gray-400); margin-top: 2px; }
.page-title-row { display: flex; align-items: center; gap: 12px; }
.page-title-icon {
  width: 42px; height: 42px; flex-shrink: 0; object-fit: contain;
  border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
  background: #fff; padding: 4px;
}
