:root {
    --sape-sidebar-width: 260px;
    --sape-primary: #0d6efd;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: #f4f6f9;
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
}

.sape-wrapper {
    display: flex;
    min-height: 100vh;
}

.sape-sidebar {
    width: var(--sape-sidebar-width);
    background-color: #0f1b2d;
    color: #fff;
    flex-shrink: 0;
    /* Sticky (no solo flex-item) para que el menu no se desplace junto con el
       contenido: sin esto, al hacer scroll en una vista larga el sidebar se
       iba con la pagina y habia que subir hasta el inicio para volver a verlo. */
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: margin-left .2s ease;
}

.sape-sidebar .nav-link {
    color: #c9d4e3;
}

.sape-sidebar .nav-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, .1);
    border-radius: .375rem;
}

.sape-sidebar .nav-link.disabled {
    color: #5b6b82;
    pointer-events: none;
}

.sape-sidebar .badge {
    font-weight: 500;
    font-size: .65rem;
}

.sape-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.sape-content {
    padding: 1.5rem;
}

.sape-test-box {
    background: linear-gradient(135deg, var(--sape-primary), #6ea8fe);
    color: #fff;
    padding: 1rem;
    border-radius: .5rem;
    font-weight: 600;
}

/* Bootstrap "lg" (991.98px), no "md" (768px): en md el sidebar fijo de
   260px ya no cabe junto al contenido sin sentirse pegado/apretado en
   tablets y ventanas de laptop angostas. El boton hamburguesa en el header
   usa d-lg-none para coincidir con este mismo punto de quiebre. */
@media (max-width: 991.98px) {
    .sape-sidebar {
        position: fixed;
        z-index: 1030;
        top: 0;
        bottom: 0;
        height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        margin-left: calc(var(--sape-sidebar-width) * -1);
    }

    .sape-wrapper.sidebar-abierto .sape-sidebar {
        margin-left: 0;
    }

    .sape-main {
        width: 100%;
    }
}
