/* ODS Sidebar V2 — PATCH 2: corriger l'affichage des sous-menus
 * Le JS ajoute/retire la classe .open au clic, le CSS doit respecter ça. */

/* Par défaut: sous-menus CACHÉS */
body aside.ods-sidebar .ods-sb-sub {
    display: none !important;
    overflow: hidden !important;
    max-height: 0 !important;
    opacity: 0 !important;
    transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s ease,
                padding 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    padding: 0 0 0 36px !important;
    margin: 0 0 0 24px !important;
    border-left: 2px solid rgba(226, 232, 240, 0.8) !important;
}

/* Quand le JS ajoute la classe .open → sous-menu VISIBLE */
body aside.ods-sidebar .ods-sb-sub.open {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    max-height: 1000px !important;
    opacity: 1 !important;
    padding: 6px 0 6px 36px !important;
    margin: 4px 0 8px 24px !important;
}

/* Items du sous-menu (inchangé, déjà OK dans le patch précédent) */
body aside.ods-sidebar .ods-sb-sub a {
    display: flex !important;
    align-items: center !important;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #64748B !important;
    padding: 8px 14px !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    transition: all 0.15s !important;
    line-height: 1.4 !important;
}

body aside.ods-sidebar .ods-sb-sub a:hover {
    background: #F1F5F9 !important;
    color: #2D7A1F !important;
    transform: translateX(2px) !important;
}

/* Chevron qui tourne quand toggler a la classe .open */
body aside.ods-sidebar .ods-sb-toggle.open .ods-sb-chev {
    transform: rotate(90deg) !important;
    color: #2D7A1F !important;
    stroke: #2D7A1F !important;
}

/* Active state sur le toggler quand son sous-menu est ouvert */
body aside.ods-sidebar .ods-sb-toggle.open {
    background: #F0F7ED !important;
    border-color: rgba(45, 122, 31, 0.3) !important;
    color: #2D7A1F !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(45, 122, 31, 0.08) !important;
}

body aside.ods-sidebar .ods-sb-toggle.open > svg:first-of-type {
    color: #2D7A1F !important;
    stroke: #2D7A1F !important;
}
