:root {
    --bg-sidebar: #f2f2f2;
    /* gris claro */
    --accent: #1e88e5;
    /* azul */
    --green: #2e7d32;
    /* verde */
    --overlay: rgba(0, 0, 0, 0.35);
}

/* Botón flotante - Debe estar por debajo de la barra cuando se abre */
.fixed-action-btn {
    position: fixed;
    right: 16px;
    bottom: 20px;
    z-index: 1001;
}

.fixed-action-btn .btn-floating {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Barra lateral - LE SUBÍ EL Z-INDEX A 3000 */
.custom-sidenav {
    position: fixed;
    top: 0;
    left: 0;
    width: min(88vw, 320px);
    height: 100vh;
    background: var(--bg-sidebar);
    transform: translateX(-100%);
    transition: transform 220ms ease;
    box-shadow: 2px 0 18px rgba(0, 0, 0, 0.12);
    z-index: 3000;
    /* Antes 1002, ahora 3000 para tapar el Navbar */
    overflow-y: auto;
}

.custom-sidenav.is-open {
    transform: translateX(0);
}

/* Overlay - LE SUBÍ EL Z-INDEX A 2999 */
.sidenav-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
    z-index: 2999;
    /* Justo debajo de la barra pero arriba del Navbar */
}

.sidenav-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}

/* Encabezado con fondo y perfil */
.user-view {
    position: relative;
}

.user-view .background {
    width: 100%;
    height: 160px;
    overflow: hidden;
}

.user-view .background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-line {
    position: absolute;
    left: 16px;
    bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.35);
    padding: 8px 12px;
    border-radius: 8px;
}

.profile-line .circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
}

.profile-line .name {
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}

/* Menú */
.menu {
    padding: 16px;
}

.menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu a {
    display: block;
    padding: 8px 12px;
    color: #000;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-family: Arial, sans-serif;
}

/* Títulos de sección */
.menu a.section.green {
    font-weight: 800;
    color: var(--green);
    pointer-events: none;
}

.menu a.section.blue {
    font-weight: 800;
    color: var(--accent);
    pointer-events: none;
}

/* Hover en ítems normales */
.menu a:not(.section):hover {
    background: #d6eaf8;
    color: #0d47a1;
    text-decoration: underline;
    box-shadow: inset 0 0 0 1000px rgba(0, 0, 0, 0.05);
}

/* Divisor */
.divider.short {
    width: 60%;
    height: 1px;
    background: #ccc;
    margin: 12px auto;
}

/* Botones de Scroll */
.scroll-actions-btn {
    position: fixed;
    right: 16px;
    bottom: 90px;
    z-index: 999;
    /* Por debajo del botón flotante y la barra */
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.btn-scroll {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background-color: #5c629c;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s, opacity 0.3s;
    text-decoration: none;
    font-size: 1.2em;
}

.scroll-pad-top {
    scroll-margin-top: 20px;
}

@media (max-width: 768px) {
    .scroll-actions-btn {
        right: 10px;
        bottom: 80px;
    }
}