/* Fix barra lateral:
   - Mantiene el scroll propio del menú izquierdo.
   - Mantiene el fondo negro hasta abajo.
   - Corrige que el color negro se pase hacia el contenido.
*/

html,
body {
    min-height: 100%;
}

body {
    overflow-y: auto;
}

/* Ajusta aquí si tu menú cambia de ancho.
   Debe coincidir con el ancho real de .vm-sidebar. */
:root {
    --vm-sidebar-real-width: 300px;
}

.vm-shell {
    min-height: 100vh !important;
    align-items: flex-start !important;
    position: relative;
}

/* Fondo negro detrás de la barra, pero limitado al ancho exacto del menú. */
.vm-shell::before {
    content: "";
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--vm-sidebar-real-width) !important;
    background: linear-gradient(180deg, #050708 0%, #020404 100%);
    z-index: 0;
    pointer-events: none;
}

/* Menú con scroll propio. */
.vm-sidebar {
    position: sticky !important;
    top: 0 !important;
    align-self: flex-start !important;

    width: var(--vm-sidebar-real-width) !important;
    min-width: var(--vm-sidebar-real-width) !important;
    max-width: var(--vm-sidebar-real-width) !important;

    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;

    overflow-y: auto !important;
    overflow-x: hidden !important;

    background: linear-gradient(180deg, #050708 0%, #020404 100%) !important;
    padding-bottom: 90px !important;
    box-sizing: border-box !important;

    z-index: 2 !important;
    scrollbar-gutter: stable;
    overscroll-behavior: contain;
}

/* El contenido empieza después del ancho real del menú.
   Evita que el fondo negro invada el área blanca. */
.vm-main {
    position: relative;
    z-index: 1;
    min-width: 0;
    min-height: 100vh;
    flex: 1 1 auto;
    background: #eef2f5;
}

.vm-sidebar .vm-nav-bottom {
    padding-bottom: 80px !important;
}

.vm-sidebar .vm-nav-bottom a:last-child {
    margin-bottom: 48px !important;
}

.vm-content {
    padding-bottom: 90px !important;
}

/* Tarjetas sin subrayado. */
.vm-module-card,
.vm-module-card:hover,
.vm-module-card:focus,
.vm-module-card:visited {
    text-decoration: none !important;
}

.vm-module-card h3,
.vm-module-card p,
.vm-module-card span {
    text-decoration: none !important;
}

/* Scrollbar lateral. */
.vm-sidebar::-webkit-scrollbar {
    width: 10px;
}

.vm-sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, .045);
    border-radius: 999px;
}

.vm-sidebar::-webkit-scrollbar-thumb {
    background: rgba(8, 170, 162, .68);
    border-radius: 999px;
    border: 2px solid rgba(0, 0, 0, .35);
}

.vm-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(8, 170, 162, .95);
}

.vm-sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(8, 170, 162, .8) rgba(255, 255, 255, .045);
}

@media (max-width: 900px) {
    :root {
        --vm-sidebar-real-width: 100%;
    }

    .vm-shell::before {
        display: none;
    }

    .vm-sidebar {
        position: relative !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        padding-bottom: 30px !important;
    }

    .vm-content {
        padding-bottom: 70px !important;
    }
}
