/* Sidebar a icone espandibile (DDVR v2). Layout condiviso fra i 3 temi:
   sfondo scuro neutro, accento = --bs-primary del tema corrente. */
:root {
    --ddvr-sb-w: 60px;
    --ddvr-sb-w-exp: 250px;
    --ddvr-sb-bg: #1f2a37;
    --ddvr-sb-bg-hover: rgba(255, 255, 255, .08);
    --ddvr-sb-fg: #c3cdd9;
    --ddvr-sb-muted: #7d8b9a;
}

.ddvr-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--ddvr-sb-w);
    background: var(--ddvr-sb-bg);
    color: var(--ddvr-sb-fg);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: width .15s ease;
}
.ddvr-sidebar:hover,
.ddvr-sidebar:focus-within {
    width: var(--ddvr-sb-w-exp);
    box-shadow: .25rem 0 1.5rem rgba(0, 0, 0, .25);
}

.ddvr-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem .95rem;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.ddvr-brand i { font-size: 1.4rem; }

.ddvr-nav {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: .5rem 0;
}

.ddvr-link {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .55rem .95rem;
    color: var(--ddvr-sb-fg);
    text-decoration: none;
    white-space: nowrap;
    border-left: 3px solid transparent;
}
.ddvr-link i {
    font-size: 1.15rem;
    min-width: 1.45rem;
    text-align: center;
    flex-shrink: 0;
}
.ddvr-link:hover { background: var(--ddvr-sb-bg-hover); color: #fff; }
.ddvr-link.active {
    color: #fff;
    background: var(--ddvr-sb-bg-hover);
    border-left-color: var(--bs-primary, #0d6efd);
}

.ddvr-section {
    padding: .75rem .95rem .25rem;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ddvr-sb-muted);
    white-space: nowrap;
    overflow: hidden;
    min-height: 1.2rem;
}

.ddvr-footer {
    border-top: 1px solid rgba(255, 255, 255, .08);
    padding: .35rem 0;
}
.ddvr-footer .dropdown-menu { font-size: .9rem; }
.ddvr-footer .ddvr-link .label { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }

/* Etichette: nascoste (no spill) quando il rail è collassato, visibili in hover/focus */
.ddvr-sidebar .label { display: none; }
.ddvr-sidebar:hover .label,
.ddvr-sidebar:focus-within .label { display: inline; }

/* Contenuto a destra del rail */
.ddvr-content { margin-left: var(--ddvr-sb-w); min-height: 100vh; }
.ddvr-content--full { margin-left: 0; }

/* Topbar e overlay solo mobile */
.ddvr-topbar { display: none; }
.ddvr-overlay { display: none; }

@media (max-width: 991.98px) {
    .ddvr-topbar {
        display: flex;
        align-items: center;
        gap: .5rem;
        position: sticky;
        top: 0;
        z-index: 1035;
        background: var(--ddvr-sb-bg);
        color: #fff;
        padding: .35rem .6rem;
    }
    .ddvr-topbar .navbar-brand { font-size: 1.05rem; }

    .ddvr-sidebar {
        width: var(--ddvr-sb-w-exp);
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: .25rem 0 1.5rem rgba(0, 0, 0, .3);
    }
    .ddvr-sidebar .label { display: inline; }

    body.ddvr-sb-open .ddvr-sidebar { transform: translateX(0); }
    body.ddvr-sb-open .ddvr-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .45);
        z-index: 1039;
    }
    .ddvr-content { margin-left: 0; }
}
