/* Modern tokens mínimos */
:root{
    --brand:#f57c00;
    --sidebar-bg:#111827;
    --sidebar-border:rgba(255,255,255,.08);
    --sidebar-muted:#94a3b8;
    --sidebar-text:#e5e7eb;
}

.modern-sidebar{
    background: var(--sidebar-bg) !important;
}

.modern-sidebar-brand{
    min-height: 42px;
    padding: 4px 2px 10px;
    border-bottom: 1px solid var(--sidebar-border);
}

.modern-sidebar-brand-mark{
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(255,255,255,.07);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.modern-sidebar-brand-logo{
    max-width: 34px;
    max-height: 34px;
    object-fit: contain;
}

.modern-sidebar-brand-text{
    min-width: 0;
    display: grid;
    gap: 1px;
}

.modern-sidebar-brand-title{
    color: #fff;
    font-weight: 700;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modern-sidebar-brand-subtitle{
    color: var(--sidebar-muted);
    font-size: .74rem;
    line-height: 1.1;
}

.modern-sidebar-user{
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 10px;
    background: rgba(255,255,255,.035);
}

.modern-sidebar-user-logo{
    width: 42px;
    height: 42px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255,255,255,.06);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.modern-sidebar-user-body{
    min-width: 0;
    flex: 1 1 auto;
}

.modern-sidebar-user-name{
    color: #fff;
    font-size: .92rem;
    font-weight: 600;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.modern-sidebar-user-status{
    color: #22c55e;
    font-size: .78rem;
    margin-top: 3px;
}

.modern-sidebar-user-status span{
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #22c55e;
    margin-right: 6px;
}

.modern-sidebar-user-img{
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.modern-sidebar-user-img.is-profile-photo{
    height: 100%;
    max-height: none;
    max-width: none;
    object-fit: cover;
    width: 100%;
}

.modern-sidebar-nav{
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.modern-sidebar-section{
    color: var(--sidebar-muted);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 12px 12px 4px;
}

.modern-sidebar-link{
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 9px 12px;
    border-radius: 8px;
    color: #cbd5e1;
    text-decoration: none;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}

.modern-sidebar-link i{
    width: 20px;
    min-width: 20px;
    text-align: center;
    font-size: 1rem;
    color: #9ca3af;
}

.modern-sidebar-link span{
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modern-sidebar-link:hover,
.modern-sidebar-link:focus{
    background: rgba(255,255,255,.07);
    color: #fff;
    transform: translateX(1px);
}

.modern-sidebar-link:hover i,
.modern-sidebar-link:focus i{
    color: #fff;
}

.modern-sidebar-link.is-active{
    background: rgba(245,124,0,.16);
    color: #fff;
    font-weight: 600;
}

.modern-sidebar-link.is-active::before{
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 999px;
    background: var(--brand);
}

.modern-sidebar-link.is-active i{
    color: #ffb74d;
}

.modern-sidebar-link.is-secondary{
    background: rgba(255,255,255,.045);
    color: #cbd5e1;
}

.modern-sidebar-meta{
    display: grid;
    gap: 7px;
    color: var(--sidebar-muted);
    font-size: .76rem;
    border-top: 1px solid var(--sidebar-border);
}

.modern-sidebar-meta-row{
    display: grid;
    grid-template-columns: minmax(82px, auto) minmax(0, 1fr);
    align-items: start;
    gap: 8px;
}

.modern-sidebar-meta-row span{
    color: #64748b;
}

.modern-sidebar-meta-row strong{
    color: #cbd5e1;
    font-weight: 600;
    text-align: right;
    overflow-wrap: anywhere;
}

/* --- Sidebar responsive (offcanvas) --- */
#modernSidebar{
    transition: transform .2s ease, width .2s ease, min-width .2s ease, padding .2s ease;
}

@media (min-width: 992px){
    #modernSidebar.is-collapsed{
        width: 0 !important;
        min-width: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        overflow: hidden;
    }
}

#sidebarOverlay{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 1040;
}

/* móvil: sidebar fuera de pantalla por defecto */
@media (max-width: 991.98px){
    #modernSidebar{
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        transform: translateX(-105%);
        z-index: 1050;
        box-shadow: 0 20px 60px rgba(0,0,0,.35);
    }
    #modernSidebar.is-open{
        transform: translateX(0);
    }
    #sidebarOverlay.is-open{
        opacity: 1;
        pointer-events: auto;
    }
    body.sidebar-open{
        overflow: hidden; /* evita scroll del contenido detrás */
    }
}
/* Select2 + Bootstrap 5 feel */
.select2-container .select2-selection--single{
    height: 38px;
    border: 1px solid #ced4da;
    border-radius: .375rem;
}
.select2-container--default .select2-selection--single .select2-selection__rendered{
    line-height: 36px;
    padding-left: .75rem;
}
.select2-container--default .select2-selection--single .select2-selection__arrow{
    height: 36px;
    right: 8px;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder{
    color: #6c757d;
}
