/* --- VARIABLES PUNTUALIZA --- */
:root {
    --color-primary-orange: #FF6B00;
    --color-primary-navy: #0F223D;
    --color-text-dark: #333333;
    --color-text-light: #ffffff;
    --color-bg-light: #F4F7F6;
    --font-stack: 'Poppins', sans-serif;
    --sidebar-width: 280px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-stack) !important;
    color: var(--color-text-dark);
    background-color: var(--color-bg-light);
    overflow: hidden;
}

.no_scroll {
    overflow: hidden !important;
}

.ErrorControl {
    border: solid 1px red !important;
}

/* --- ESTRUCTURA PRINCIPAL (Flexbox) --- */
.admin-wrapper {
    display: flex;
    height: 100vh;
}

/* --- BARRA LATERAL (SIDEBAR) --- */
.admin-sidebar {
    width: var(--sidebar-width);
    background-color: var(--color-primary-navy);
    color: var(--color-text-light);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow-y: auto;
    z-index: 100;
}
    /* Clase para colapsar el menú */
    .admin-sidebar.collapsed {
        margin-left: calc(var(--sidebar-width) * -1);
    }

.sidebar-profile-container {
    margin-top: auto !important;
}

.sidebar-profile {
    padding: 1rem 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
    color: white !important;
    text-decoration: none;
}

    .sidebar-profile:hover {
        background-color: rgba(255,255,255,0.05);
    }

.profile-name {
    font-size: 0.95rem;
    line-height: 1.3;
    margin-bottom: 0 !important;

}

.sidebar-logo {
    padding: 1rem 2.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.custom-avatar {
    width: 72px;
    height: 72px;
}

.sidebar-nav {
    padding: 1.5rem 0;
}

.nav-section-title {
    padding: 0 1.5rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-link {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 12px 1.5rem !important;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.2s;
}

    .nav-link:hover, .nav-link.active {
        background-color: rgba(255,255,255,0.05);
        color: var(--color-primary-orange);
        border-left: 4px solid var(--color-primary-orange);
    }

    .nav-link .chevron {
        font-size: 0.8rem;
        transition: transform 0.3s;
    }

/* Submenús */
.submenu {
    list-style: none;
    background-color: rgba(0,0,0,0.2);
    display: none; /* Oculto por defecto */
    padding: 10px 0;
}

    .submenu li a {
        display: block;
        padding: 8px 1.5rem 8px 3rem;
        color: rgba(255,255,255,0.6);
        text-decoration: none;
        font-size: 0.9rem;
        transition: color 0.2s;
    }

        .submenu li a:hover {
            color: var(--color-text-light);
        }

    /* Indentación para sub-sub-menús (Nivel 3 en adelante) */
    .submenu .submenu {
        padding-left: 15px; /* Empuja los hijos más a la derecha */
        background-color: rgba(0,0,0,0.1); /* Un tono un poco más oscuro */
    }

/* Ajuste para el icono del link simple en niveles profundos */
.nav-link-simple i {
    width: 20px;
    margin-right: 10px;
    font-size: 0.85rem;
}

/* Resaltado del item activo */
.nav-link-simple.active-link {
    color: var(--color-primary-orange) !important;
    background-color: rgba(255, 107, 0, 0.1); /* Fondo naranja muy sutil */
    font-weight: 600;
    border-right: 3px solid var(--color-primary-orange);
}




/* --- ÁREA PRINCIPAL --- */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Previene desbordamiento flex */
}

/* Cabecera superior blanca */
.admin-header {
    background-color: var(--color-text-light);
    height: 60px;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    z-index: 10;
}

.btn-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-primary-navy);
}

.logout-link {
    text-decoration: none;
    color: #dc3545;
    font-weight: 600;
}

/* Contenedor dinámico */
.admin-content {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
}

.content-card {
    background: var(--color-text-light);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.shadow {
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.rounded {
    border-radius: 8px;
}

ul {
    padding-inline-start: 1px !important;
}

.btn-cerrarsesion {
    text-decoration: none;
    color: white;
    background: #ab0f2a;
    width: 100%;
}



/* Desktop: mostrar siempre */
.desktop-title {
    display: flex !important;
}


/* Mobile: nunca mostrar desktop-title, siempre el mobile */
@media (max-width: 850px) {
    .desktop-title {
        display: none !important;
    }

    .admin-sidebar.collapsed ~ .admin-main .desktop-title {
        display: flex !important;
    }

    .mobile-title-container {
        display: block !important;
        padding: 25px 15px 10px 45px;
        margin: -8px -8px 12px -8px;
    }

    .contenedor-modal {
        overflow-y: auto !important;
        max-height: 99vh;
    }

    .admin-wrapper {
        height: auto; /* ← suelta la altura fija del wrapper */
        min-height: 100vh;
    }

    body {
        overflow: auto !important; /* ← permite scroll en mobile */
    }

    .admin-sidebar {
        overflow-y: visible !important; /* ← el scroll lo maneja el body */
        height: auto !important; /* ← crece con su contenido */
        max-height: none !important;
    }

}

/* Manejo de Logo */

/* Desktop: mostrar lg, ocultar sm */
.logo-lg {
    display: block;
}

.logo-sm {
    display: none !important;
}

/* Mobile: ocultar lg, mostrar sm */
@media (max-width: 850px) {
    .logo-lg {
        display: none !important;
    }

    .logo-sm {
        display: block !important;
    }
}


/* FOOTER */

.admin-footer {
    background: #fbfbfb;
    color: #0F223D;
    font-family: 'Poppins', sans-serif;
    font-size: 0.78rem;
    text-align: center;
    padding: 1.1rem;
    letter-spacing: 0.03em;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: auto;
}

    .admin-footer span {
        font-weight: 600;
    }