    .sidebar {
        position: fixed;
        top: 70px;
        left: -280px; /* Oculto a la izquierda por defecto */
        width: 280px;
        min-width: 280px !important; /* Forzamos a la barra a mantener su ancho real */
        height: calc(100vh - 70px);
        background: linear-gradient(180deg, #2c3145, #c91f2e);
        transition: left .25s ease-out;
        overflow-y: auto;
        z-index: 999;
        box-sizing: border-box !important;
    }

    /* Cuando JS le agrega .active, se recorre a la vista */
    .sidebar.active {
        left: 0;
    }
    /* =========================================================
    LOGO (Solución al tamaño gigante)
    ========================================================= */
    .logo-area {
        padding: 25px 20px;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        cursor: pointer;
    }

    .logo-area img {
        width: 100px;      /* Reducimos el logo a un tamaño controlado */
        height: auto;      /* Mantiene la proporción perfecta sin deformarse */
        margin-bottom: 15px;
        display: block;
    }

    .logo-area h2 {
        color: #ffffff !important; /* Forzamos el blanco brillante */
        font-size: 20px;           /* Reducimos un poco el tamaño para que encaje bien */
        line-height: 28px;
        font-weight: 600;
        margin: 0;
    }

    /* =========================================================
    TÍTULOS DEL MENÚ (Corregido para títulos largos con flecha)
    ========================================================= */
    .menu-item {
        width: 100% !important;
        display: block !important;
    }

    .menu-title {
        display: flex !important;
        align-items: center !important;
        padding: 15px 45px 15px 20px !important; /* Colchón de 45px a la derecha para proteger la flecha */
        cursor: pointer;
        position: relative;
        color: #ffffff !important;
        transition: background 0.3s;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;   /* Permite que títulos largos bajen de renglón de forma limpia */
        word-break: break-word !important;
    }

    .menu-title i {
        color: #ffffff !important;
        margin-right: 15px;
        font-size: 18px;
        width: 25px;
        text-align: center;
    }

    .menu-title span {
        color: #ffffff !important;
        font-size: 16px;
        font-weight: 500;
    }

    /* Flecha alineada y fija de forma independiente a la derecha */
    .menu-title .arrow {
        position: absolute !important;
        right: 20px !important;
        top: 50% !important;
        transform: translateY(-50%) !important; /* Centrado vertical perfecto siempre */
        margin-right: 0;
        font-size: 14px;
        transition: transform 0.3s ease;
        color: #ffffff !important;
    }

    /* Rotación de la flecha manteniendo su centrado vertical */
    .menu-item.open .menu-title .arrow {
        transform: translateY(-50%) rotate(90deg) !important;
    }

    .menu-title:hover {
        background: rgba(255, 255, 255, 0.08);
    }

    /* =========================================================
    ELEMENTOS DEL SUBMENÚ
    ========================================================= */
    .submenu {
        list-style: none;
        padding: 0;
        margin: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .submenu li {
        color: #ffffff !important;
        opacity: 0.85;
        padding: 8px 20px 8px 45px !important;
        font-size: 14px;
        cursor: pointer;
        transition: all 0.3s ease;
        display: block !important;
        width: 100% !important;
        white-space: normal !important;
        line-height: 1.4 !important;
        box-sizing: border-box !important;
    }

    .submenu li:hover {
        color: #ffffff !important;
        opacity: 1;
        background: rgba(255, 255, 255, 0.1);
    }

    /* =========================================================
    CONTROL DE ACORDEÓN Y SCROLL INTERNO
    ========================================================= */
    .menu-item.open .submenu,
    .menu-item.active .submenu,
    .submenu.open { 
        max-height: 350px;
        overflow-y: auto;
    }

    .submenu::-webkit-scrollbar { width: 5px; }
    .submenu::-webkit-scrollbar-track { background: transparent; }
    .submenu::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 10px; }
    .submenu::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.4); }

    /* =========================================================
    EMPUJE DINÁMICO DEL CONTENIDO PRINCIPAL
    ========================================================= */
    #content, .content, main, .main-content {
    transition: margin-left .35s ease;
    will-change: margin-left;
}

    .sidebar.active ~ #content,
    .sidebar.active ~ .content,
    .sidebar.active ~ main,
    .sidebar.active ~ .main-content,
    body:has(.sidebar.active) #content,
    body:has(.sidebar.active) .content {
        margin-left: 280px !important;
        width: calc(100% - 280px) !important;
    }
    /* =========================================================
   CRÉDITOS DEL SIDEBAR
========================================================= */

.sidebar-creditos {
    margin-top: 30px;
    padding: 24px 20px 28px;
    text-align: center;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.88);
    border-top: 1px solid rgba(255, 255, 255, 0.28);
}

.sidebar-creditos span,
.sidebar-creditos strong,
.sidebar-creditos small {
    display: block;
}

.sidebar-creditos span {
    font-size: 12px;
    font-weight: 400;
}

.sidebar-creditos strong {
    margin-top: 6px;
    color: #ffffff;
    font-size: 13px;
    line-height: 1.5;
    font-weight: 700;
}

.sidebar-creditos small {
    margin-top: 10px;
    font-size: 11px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.72);
}