/* ── Sidebar Kindergarten ─────────────────────────────────────────
   Restyle coerente con l'estetica della home moderna:
   palette verde primaria, accent border sinistro su hover/active,
   tipografia coordinata (Titillium), section-titles uppercase.
*/

.sidebar {
    position: absolute;
    top: 84px;
    bottom: 0;
    left: 0;
    padding: 14px 10px 30px;
    width: 280px;
    z-index: 600;
    background-color: #fbfdf9;
    border-right: 1px solid #e3ece0;
    box-shadow: 2px 0 12px rgba(69, 130, 58, 0.08);
    overflow-y: auto;
}

@media (max-width: 600px) {
    .sidebar {
        width: 100%;
    }
}

/* Riga di menu: estetica "list item" con accent verde a sinistra */
.sidebar .menu-item,
.sidebar .nav-item > a.btn,
.sidebar .navbar-nav li > a.btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: auto;
    min-height: 44px;
    padding: 8px 12px;
    margin-bottom: 3px;

    background-color: transparent;
    border: none;
    border-radius: 10px;
    border-left: 3px solid transparent;

    color: #2f4f29;
    font-family: TitilliumWeb-Regular, inherit;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    line-height: 1.2;
    transition: background-color .18s ease, color .18s ease, border-left-color .18s ease, transform .18s ease;
}

/* Hover delicato verde con accent sinistro */
.sidebar .menu-item:hover,
.sidebar .nav-item > a.btn:hover,
.sidebar .navbar-nav li > a.btn:hover {
    background-color: #e9f4e3;
    color: #1d5313;
    border-left-color: var(--color-accent);
}

/* Sezione di primo livello (collassabile): card-like con peso visivo */
.sidebar > .container-fluid > .side-bar > .bg-light > ul > li > .menu-item,
.sidebar .nav-item > a.menu-item[data-bs-toggle="collapse"] {
    font-family: TitilliumWeb-Bold, inherit;
    font-weight: 700;
    font-size: 14px;
    color: #1d5313;
    background: linear-gradient(90deg, #f1f7ee 0%, #f7faf4 100%);
    border: 1px solid #dfeada;
    border-left: 3px solid var(--color-accent);
    box-shadow: 0 1px 2px rgba(69, 130, 58, 0.05);
}

.sidebar .nav-item > a.menu-item[data-bs-toggle="collapse"]:hover {
    background: linear-gradient(90deg, #d4e9d1 0%, #e3f1de 100%);
    border-color: #b9d8b4;
    border-left-color: var(--color-brand);
    transform: translateX(1px);
}

/* Voce di "Configurazione guidata": evidenza marcata gialla */
.sidebar .btn-outline-info.menu-item {
    background: linear-gradient(90deg, #fff7e0 0%, #fffbe9 100%);
    border: 1px solid #e8c87f;
    border-left: 3px solid var(--theme-orange-l);
    color: #7a5318;
    font-weight: 600;
}
.sidebar .btn-outline-info.menu-item:hover {
    background: linear-gradient(90deg, #ffe9b3 0%, #fff2c9 100%);
    border-left-color: var(--theme-orange-d);
    color: #4a3210;
}

/* Voce attiva: gradient verde pieno */
.sidebar .menu-item.active {
    background: linear-gradient(90deg, var(--color-brand) 0%, #6cb35f 100%);
    color: #fff;
    border-left-color: #2a4a1a;
    box-shadow: 0 2px 6px rgba(69, 130, 58, 0.3);
}
.sidebar .menu-item.active:hover {
    background: linear-gradient(90deg, #386a2f 0%, #5fa052 100%);
    color: #fff;
}
.sidebar .menu-item.active .menu-icons {
    color: #fff;
}

/* Voce disabilitata */
.sidebar .menu-item.disabled,
.sidebar a.disabled {
    color: #b9b9b9 !important;
    background-color: transparent !important;
    cursor: not-allowed;
    border-style: dashed !important;
    border-color: #ececec !important;
}
.sidebar .menu-item.disabled:hover {
    background-color: transparent !important;
    transform: none;
}

/* Icone Material Symbols allineate */
.sidebar .menu-icons {
    float: none !important;
    font-size: 22px !important;
    color: var(--color-brand-text);
    flex-shrink: 0;
    width: 24px;
    text-align: center;
    line-height: 1;
    transition: color .18s ease;
}
.sidebar .btn-outline-info.menu-item .menu-icons {
    color: #c7841f;
}

/* Sottomenu (collapse): indentazione pulita con accento laterale verde */
.sidebar .navbar-nav.collapse,
.sidebar .navbar-nav.collapsing {
    margin-left: 14px !important;
    margin-top: 4px !important;
    margin-bottom: 16px !important;
    padding-left: 10px;
    border-left: 2px solid #d4e9d1;
}

/* Item dentro sottomenu: leggermente più piccoli e meno enfatici */
.sidebar .navbar-nav.collapse .menu-item,
.sidebar .navbar-nav.collapsing .menu-item {
    font-family: TitilliumWeb-Regular, inherit;
    font-size: 13px;
    font-weight: 500;
    min-height: 38px;
    padding: 6px 10px;
    background-color: transparent;
    border: none;
    border-left: 3px solid transparent;
    border-radius: 8px;
}
.sidebar .navbar-nav.collapse .menu-item:hover {
    background-color: #e9f4e3;
    border-left-color: var(--color-accent);
}

/* Sotto-sottomenu (es. Anagrafiche amministrazione dentro Accounting) */
.sidebar .navbar-nav.collapse .navbar-nav.collapse {
    margin-top: 2px !important;
    margin-bottom: 6px !important;
    border-left-color: #b9d8b4;
}

/* Section title (uppercase) per separare gruppi - coerente con home */
.sidebar .sidebar-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: TitilliumWeb-Bold, inherit;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
    margin: 18px 4px 6px;
}
.sidebar .sidebar-section-title .material-symbols-outlined {
    font-size: 1.05rem !important;
    color: var(--color-accent);
}
.sidebar .sidebar-section-title:first-child {
    margin-top: 4px;
}

/* Mini-rifinitura: rimuove il bordo bottom giallo del bg-light Bootstrap */
.sidebar .bg-light {
    background-color: transparent !important;
}

/* Scrollbar discreta */
.sidebar::-webkit-scrollbar {
    width: 6px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background: #cfe1ca;
    border-radius: 3px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
    background: #a9c9a3;
}
