/* ================================================================
   HOSPITALITO — SHELL LAYOUT (sidebar + contenido + footer slim)
   Cargado DESPUÉS de styles.css y mobile.css: sus reglas mandan.

   Principios (Biblia UX-UI):
   - Navegación siempre visible con TEXTO (nada de iconos misteriosos)
   - Touch targets ≥ 44px
   - Animaciones funcionales de 150–200ms
   - Sin espacios muertos: el contenido empieza arriba
   ================================================================ */

:root {
  --sb-width: 240px;
}

/* ----------------------------------------------------------------
   SIDEBAR
   ---------------------------------------------------------------- */
.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sb-width);
  display: flex;
  flex-direction: column;
  background: var(--panel, #ffffff);
  border-right: 1px solid var(--border, #e0b3b3);
  z-index: 90;
  overflow: hidden;
}

.app-sidebar.hidden { display: none; }

/* --- Marca --- */
.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border, #e0b3b3);
  min-height: 64px;
}

.sb-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border, #e0b3b3);
  background: var(--panel-2, #fff0f0);
}

.sb-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sb-brand-short {
  font-size: 17px;
  font-weight: 800;
  color: var(--brand, #a81a1a);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.sb-brand-name {
  font-size: 10px;
  line-height: 1.25;
  color: var(--muted, #7a5555);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Navegación --- */
.sb-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px 16px;
}

.sb-nav::-webkit-scrollbar { width: 4px; }
.sb-nav::-webkit-scrollbar-thumb { background: var(--border, #e0b3b3); border-radius: 2px; }

.sb-section { margin-bottom: 6px; }

.sb-section-label {
  display: block;
  padding: 14px 10px 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #7a5555);
}

.snav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  margin-bottom: 2px;
  border-radius: 10px;
  border-left: 3px solid transparent;
  color: var(--text, #3b1111);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.snav-item svg {
  flex-shrink: 0;
  opacity: 0.75;
}

.snav-item:hover {
  background: var(--panel-2, #fff0f0);
}

.snav-item.active {
  background: rgba(var(--brand-rgb, 168, 26, 26), 0.09);
  border-left-color: var(--brand, #a81a1a);
  color: var(--brand, #a81a1a);
  font-weight: 700;
}

.snav-item.active svg { opacity: 1; }

/* --- Pie de la sidebar: usuario + salir --- */
.sb-footer {
  border-top: 1px solid var(--border, #e0b3b3);
  padding: 12px;
}

.sb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px 12px;
  min-width: 0;
}

.sb-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand, #a81a1a);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sb-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sb-user-email {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text, #3b1111);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-user-role {
  font-size: 11px;
  color: var(--muted, #7a5555);
  text-transform: capitalize;
}

.sb-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border, #e0b3b3);
  border-radius: 10px;
  background: transparent;
  color: var(--muted, #7a5555);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sb-logout:hover {
  background: rgba(239, 68, 68, 0.07);
  border-color: var(--danger, #ef4444);
  color: var(--danger, #ef4444);
}

/* ----------------------------------------------------------------
   ÁREA DE CONTENIDO
   ---------------------------------------------------------------- */
.app-main {
  margin-left: var(--sb-width);
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Sin sesión (sidebar oculta): login centrado a pantalla completa */
.app-sidebar.hidden ~ .app-main {
  margin-left: 0;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100vh;
}

#shell.hidden { display: none; }

#app-outlet {
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 24px 32px;
}

/* ----------------------------------------------------------------
   FOOTER SLIM — una sola línea, sin espacio muerto
   ---------------------------------------------------------------- */
.sfooter {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 10px 24px;
  border-top: 1px solid var(--border, #e0b3b3);
  background: var(--panel, #ffffff);
}

.sfooter-text {
  font-size: 12px;
  color: var(--muted, #7a5555);
}

.sfooter-links {
  display: flex;
  gap: 16px;
}

.sfooter-links a {
  font-size: 12px;
  color: var(--muted, #7a5555);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sfooter-links a:hover { color: var(--brand, #a81a1a); }

/* ----------------------------------------------------------------
   LOGIN — marca visible sobre el formulario
   ---------------------------------------------------------------- */
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.login-brand-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--border, #e0b3b3);
  background: var(--panel-2, #fff0f0);
}

.login-brand-logo:not([src]), .login-brand-logo[src=""] { display: none; }

.login-brand-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--brand, #a81a1a);
}

/* ----------------------------------------------------------------
   ACCESO RESTRINGIDO — con salida clara
   ---------------------------------------------------------------- */
.restricted-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  max-width: 480px;
  margin: 48px auto;
  padding: 40px 28px;
  background: var(--panel, #ffffff);
  border: 1px dashed var(--border, #e0b3b3);
  border-radius: 14px;
}

.restricted-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--panel-2, #fff0f0);
  color: var(--brand, #a81a1a);
  margin-bottom: 6px;
}

.restricted-state h3 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--text, #3b1111);
}

.restricted-state p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted, #7a5555);
}

.restricted-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 14px;
  padding: 10px 22px;
  border-radius: 10px;
  background: var(--brand, #a81a1a);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease;
}

.restricted-back:hover { background: var(--accent, #c62424); }

/* ----------------------------------------------------------------
   ACCESIBILIDAD — foco visible para navegación con teclado
   ---------------------------------------------------------------- */
.snav-item:focus-visible,
.sb-logout:focus-visible,
.restricted-back:focus-visible,
.sfooter-links a:focus-visible {
  outline: 2px solid var(--brand, #a81a1a);
  outline-offset: 2px;
  border-radius: 10px;
}

/* ----------------------------------------------------------------
   MÓVIL (≤768px): la sidebar desaparece, manda el drawer existente
   ---------------------------------------------------------------- */
@media (max-width: 768px) {
  .app-sidebar { display: none !important; }

  .app-main,
  .app-sidebar.hidden ~ .app-main {
    margin-left: 0;
  }

  #shell { min-height: auto; }

  #app-outlet {
    padding: 12px 12px 24px;
  }

  .sfooter { padding: 10px 16px; }
}
