/* =============================================================
   Modern Sidebar — Inhandout3
   Override moderno del menu' laterale (Gentelella/p4a)
   Caricato DOPO custom.min.css e professional.css
   ============================================================= */

:root {
    --sb-bg-1: #16222f;
    --sb-bg-2: #22364a;
    --sb-accent: #1abb9c;
    --sb-accent-soft: rgba(26, 187, 156, 0.14);
    --sb-text: #b8c4d0;
    --sb-text-bright: #ffffff;
    --sb-hover-bg: rgba(255, 255, 255, 0.06);
    --sb-radius: 10px;
    --sb-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Colonna laterale ---------- */
.left_col {
    background: linear-gradient(175deg, var(--sb-bg-1) 0%, var(--sb-bg-2) 55%, #1d2f40 100%) !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

/* Titolo app */
.left_col .navbar.nav_title a.site_title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: var(--sb-text-bright);
    transition: opacity var(--sb-transition);
}
.left_col .navbar.nav_title a.site_title:hover {
    opacity: 0.85;
}

/* Profilo utente: card soft */
.left_col .profile {
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.left_col .profile .profile_pic a.profile_img {
    background: linear-gradient(135deg, var(--sb-accent), #0f9d8a);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(26, 187, 156, 0.35);
}
.left_col .profile .profile_info span {
    color: var(--sb-text);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.left_col .profile .profile_info h2 {
    color: var(--sb-text-bright);
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 600;
}

/* Sezione menu' */
#sidebar-menu .menu_section h3 {
    color: rgba(255, 255, 255, 0.38);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    padding: 14px 18px 8px;
    margin: 0;
}

/* ---------- Voci principali ---------- */
.nav.side-menu > li > a {
    margin: 2px 8px;
    padding: 11px 14px;
    border-radius: var(--sb-radius);
    color: var(--sb-text);
    font-family: 'Inter', sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    transition: background var(--sb-transition), color var(--sb-transition), transform var(--sb-transition);
}
.nav.side-menu > li > a:hover {
    background: var(--sb-hover-bg);
    color: var(--sb-text-bright);
    transform: translateX(2px);
}
.nav.side-menu > li > a:active {
    transform: translateX(0) scale(0.99);
}

/* Voce attiva (parent aperto) */
.nav.side-menu > li.active > a {
    background: var(--sb-accent-soft);
    color: var(--sb-text-bright);
    box-shadow: inset 0 0 0 1px rgba(26, 187, 156, 0.25);
}

/* Indicatore laterale della voce attiva */
.nav.side-menu > li.active > a::before,
.nav.side-menu > li > a.current-page::before {
    content: '';
    position: absolute;
    left: 0;
    top: 18%;
    height: 64%;
    width: 3px;
    border-radius: 3px;
    background: var(--sb-accent);
    box-shadow: 0 0 8px rgba(26, 187, 156, 0.8);
}

/* Chevron rotante quando il submenu e' aperto */
.nav.side-menu > li > a span.fa.fa-chevron-down {
    transition: transform var(--sb-transition);
}
.nav.side-menu > li.active > a span.fa.fa-chevron-down {
    transform: rotate(180deg);
}

/* ---------- Sottomenu (child_menu) ---------- */
.nav.child_menu {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 0 0 var(--sb-radius) var(--sb-radius);
    margin: 0 8px 4px;
    padding: 4px 0 !important;
}
.nav.child_menu li a {
    color: var(--sb-text);
    font-family: 'Inter', sans-serif;
    font-size: 12.5px;
    padding: 8px 16px 8px 26px;
    margin: 1px 4px;
    border-radius: 7px;
    position: relative;
    transition: background var(--sb-transition), color var(--sb-transition), padding-left var(--sb-transition);
}
.nav.child_menu li a:hover {
    background: var(--sb-hover-bg);
    color: var(--sb-text-bright);
    padding-left: 30px;
}
/* Voce child selezionata */
.nav.child_menu li.current-page > a {
    background: linear-gradient(90deg, rgba(26, 187, 156, 0.22), rgba(26, 187, 156, 0.06));
    color: var(--sb-text-bright);
    font-weight: 600;
}
.nav.child_menu li.current-page > a::before {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--sb-accent);
    box-shadow: 0 0 6px rgba(26, 187, 156, 0.9);
}

/* ---------- Icone dinamiche sulle sottovoci (al posto dei pallini) ---------- */
/* Nasconde i pallini/linee verticali generati dal tema base per le sottovoci */
.nav-md ul.nav.child_menu li::before,
.nav-md ul.nav.child_menu li::after {
    display: none !important;
}
/* Icona iniettata da modern-sidebar.js in base al nome della voce */
.nav.child_menu > li > a .sb-child-icon {
    color: var(--sb-accent);
    font-size: 12px;
    width: 16px;
    text-align: center;
    margin-right: 8px;
    flex-shrink: 0;
}
.nav.child_menu > li.current-page > a .sb-child-icon {
    color: var(--sb-text-bright);
}

/* ---------- Icone ---------- */
.nav.side-menu > li > a i[class*="fa-"],
.nav.child_menu > li > a i[class*="fa-"] {
    color: var(--sb-accent) !important;
}

/* ---------- Scrollbar dedicata ---------- */
.left_col .scroll-view::-webkit-scrollbar,
#sidebar-menu::-webkit-scrollbar {
    width: 6px;
}
.left_col .scroll-view::-webkit-scrollbar-thumb,
#sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}
.left_col .scroll-view::-webkit-scrollbar-thumb:hover {
    background: rgba(26, 187, 156, 0.5);
}

/* ---------- Footer sidebar ---------- */
.sidebar-footer {
    background: rgba(0, 0, 0, 0.22);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar-footer a {
    color: var(--sb-text) !important;
    transition: background var(--sb-transition), color var(--sb-transition);
}
.sidebar-footer a:hover {
    background: var(--sb-hover-bg) !important;
    color: var(--sb-accent) !important;
}

/* ---------- Box di ricerca maschere (iniettato da JS) ---------- */
.sb-search-wrap {
    padding: 8px 12px 4px;
}
.sb-search {
    position: relative;
}
.sb-search input {
    width: 100%;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--sb-text-bright);
    font-family: 'Inter', sans-serif;
    font-size: 12.5px;
    padding: 8px 30px 8px 32px;
    outline: none;
    transition: border-color var(--sb-transition), background var(--sb-transition), box-shadow var(--sb-transition);
}
.sb-search input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}
.sb-search input:focus {
    border-color: var(--sb-accent);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(26, 187, 156, 0.15);
}
.sb-search .sb-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    pointer-events: none;
    display: none;
}
.sb-search .sb-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    font-size: 12px;
    display: none;
    background: none;
    border: none;
    padding: 2px;
}
.sb-search .sb-search-clear:hover {
    color: var(--sb-text-bright);
}
.sb-search .sb-search-clear.visible {
    display: block;
}
.sb-no-results {
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    padding: 10px 18px;
    display: none;
}

/* ---------- Effetto ripple ---------- */
.sb-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transform: scale(0);
    animation: sb-ripple-anim 0.55s ease-out forwards;
    pointer-events: none;
}
@keyframes sb-ripple-anim {
    to {
        transform: scale(2.6);
        opacity: 0;
    }
}

/* ---------- Modalita' compressa (nav-sm) ---------- */
.nav-sm .sb-search-wrap {
    display: none;
}
.nav-sm .nav.side-menu > li > a {
    margin: 2px 10px;
}

/* ---------- Tooltip in modalita' compressa ---------- */
.nav-sm .nav.side-menu > li > a::after {
    content: attr(data-sb-title);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%) scale(0.95);
    background: #1d2f40;
    color: var(--sb-text-bright);
    font-size: 11.5px;
    padding: 5px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.nav-sm .nav.side-menu > li > a:hover::after {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

/* Animazione ingresso voci menu */
@keyframes sb-item-in {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
.nav.side-menu > li {
    animation: sb-item-in 0.3s ease-out backwards;
}
.nav.side-menu > li:nth-child(1) { animation-delay: 0.02s; }
.nav.side-menu > li:nth-child(2) { animation-delay: 0.04s; }
.nav.side-menu > li:nth-child(3) { animation-delay: 0.06s; }
.nav.side-menu > li:nth-child(4) { animation-delay: 0.08s; }
.nav.side-menu > li:nth-child(5) { animation-delay: 0.10s; }
.nav.side-menu > li:nth-child(6) { animation-delay: 0.12s; }
.nav.side-menu > li:nth-child(7) { animation-delay: 0.14s; }
.nav.side-menu > li:nth-child(8) { animation-delay: 0.16s; }
.nav.side-menu > li:nth-child(n+9) { animation-delay: 0.18s; }
