/* ═══════════════════════════════════════════════════════════════════
   layout.css — Estilo del shell principal (sidebar + área de contenido)
   EmausResort.Web.Gestion
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Variables de paleta ─── */
:root {
    --sidebar-width:   260px;
    --primary:         #1a3a7a;
    --accent:          #2b5ece;
    --bg-dark:         #0d1b3e;
    --sidebar-text:    rgba(255, 255, 255, 0.75);
    --sidebar-hover:   rgba(43, 94, 206, 0.25);
    --sidebar-active:  rgba(43, 94, 206, 0.40);
    --radius:          10px;
}

/* ─── Reset básico ─── */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'DM Sans', sans-serif;
    background: #f0f4fb;
    min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════
   Sidebar
═══════════════════════════════════════════════════════════ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

/* Encabezado del sidebar con logo */
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1.25rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Logo del sidebar: estilos definitivos en _Layout.cshtml como inline <style>
   para garantizar carga. Este bloque se deja vacío para no generar conflictos. */

.sidebar-header .brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.sidebar-header .brand-name {
    color: #fff;
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 0.01em;
}

.sidebar-header .brand-module {
    color: var(--accent);
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Navegación principal */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    list-style: none;
    margin: 0;
}

.sidebar-nav .nav-section-label {
    color: rgba(255, 255, 255, 0.30);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.75rem 0.75rem 0.4rem;
}

.sidebar-nav .nav-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius);
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.sidebar-nav .nav-item a:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-nav .nav-item a.active {
    background: var(--sidebar-active);
    color: #fff;
}

.sidebar-nav .nav-item a .bi {
    font-size: 1.05rem;
    width: 1.2rem;
    text-align: center;
    flex-shrink: 0;
}

/* Badge "Próximamente" para items sin funcionalidad */
.sidebar-nav .nav-badge-soon {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.40);
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 50px;
    padding: 0.15rem 0.5rem;
}

/* ─── Pie del sidebar: usuario + logout ─── */
.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1rem 1.25rem;
}

.sidebar-footer .user-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.sidebar-footer .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
}

.sidebar-footer .user-name {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer .btn-logout {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.65);
    border-radius: var(--radius);
    padding: 0.45rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
}

.sidebar-footer .btn-logout:hover {
    background: rgba(220, 53, 69, 0.20);
    border-color: rgba(220, 53, 69, 0.30);
    color: #ff8a8a;
}

/* ═══════════════════════════════════════════════════════════
   Área de contenido principal
═══════════════════════════════════════════════════════════ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

/* Barra superior del área de contenido */
.topbar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem 1.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Botón hamburguesa (visible en todos los tamaños) */
.btn-sidebar-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--primary);
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    line-height: 1;
}

.topbar .page-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    margin: 0;
}

/* Área del cuerpo de la página */
.page-body {
    flex: 1;
    padding: 1.75rem;
}

/* Toast (alerta) anclada al área de contenido */
.gestion-toast {
    border-radius: var(--radius);
    font-size: 0.88rem;
}

/* ═══════════════════════════════════════════════════════════
   Desktop/tablet landscape (≥ 769px) — sidebar colapsado
═══════════════════════════════════════════════════════════ */
@media (min-width: 769px) {
    body.sidebar-collapsed .sidebar {
        transform: translateX(-100%);
    }

    body.sidebar-collapsed .main-content {
        margin-left: 0;
    }
}

/* ═══════════════════════════════════════════════════════════
   Responsive — móvil / tablet portrait (≤ 768px)
═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    /* Overlay oscuro cuando el sidebar está abierto en móvil */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .page-body {
        padding: 1rem;
    }
}
