/* ---- MOBILE SIDEBAR ---- */
@media (max-width: 767px) {
    #main-sidebar {
        position: fixed;
        top: 0;
        width: 230px;
        height: 100vh;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
        transform: translateX(-230px);
        transition: transform 0.3s ease-in-out;
        z-index: 1000;
    }
    .sidebar-open #main-sidebar {
        transform: translateX(0);
    }
    .sidebar-open .content-wrapper {
        transform: none;
    }
}

#main-sidebar {
    position: fixed;
    top: auto;
}

/* ---- MENU PRINCIPAL ---- */
.sidebar-menu {
    margin: 0;
    padding: 0;
    list-style: none;
    background: #222d32;
    width: 100%;
}

.sidebar-menu > li {
    border-bottom: 1px solid #202830;
}

.sidebar-menu > li > a {
    display: flex;
    align-items: center;
    color: #b0bec5;
    font-size: 16px;
    padding: 12px 18px;
    text-decoration: none;
    transition: background 0.2s;
}

.sidebar-menu > li > a:hover,
.sidebar-menu > li.menu-open > a,
.sidebar-menu > li.active > a {
    background: #1a2226;
    color: #fff;
}

/* ---- SUBMENUS ---- */
.treeview-menu {
    display: none;
    list-style: none;
    margin: 0;
    padding-left: 18px;
    background: #263238;
}

.treeview.menu-open > .treeview-menu {
    display: block;
    animation: fadeInDown 0.25s;
}

.treeview-menu > li > a {
    display: flex;
    align-items: center;
    color: #b0bec5;
    font-size: 15px;
    padding: 10px 16px;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background 0.2s, border-color 0.2s;
    cursor: pointer;
}

.treeview-menu > li > a:hover,
.treeview-menu > li > a.active {
    background: #1a2226;
    color: #fff;
    border-left: 3px solid #03a9f4;
}

/* ---- ICONOS ---- */
.menu-btn {
    margin-right: 12px;
    min-width: 22px;
    text-align: center;
}

/* ---- FLECHA DEL SUBMENÚ ---- */
.pull-right-container {
    margin-left: auto;
    display: flex;
    align-items: center;
}

/* ---- HEADER ---- */
.sidebar-menu .header {
    color: #90a4ae;
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    padding: 16px 18px 8px 18px;
    letter-spacing: 1px;
    background: #232e36;
    border-bottom: 1px solid #263238;
}

/* ---- OCULTAR SCROLLBAR (opcional) ---- */
#main-sidebar {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #263238 #222d32;
}

/* ---- CURSOR ---- */
.treeview > a {
    cursor: pointer;
}

/* ---- ANIMACIÓN SUBMENÚ ---- */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px);}
    to   { opacity: 1; transform: translateY(0);}
}
