.wrapper {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

#sidebar,
#sidebar.active {
    display: flex;
    align-items: center;
    gap: 18px;
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    min-width: 0;
    max-width: none;
    padding: 12px 28px;
    min-height: 68px;
    background: #0f172a;
    color: #e2e8f0;
    border-bottom: 1px solid #1f2937;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(2px);
}

#sidebar > div,
#sidebar > ul {
    position: static;
}

#sidebar > ul li section:hover .sous {
    display: block;
}

#sidebar > ul {
    width: 100%;
    top: auto;
    padding: 0;
    margin: 0;
}

#sidebar .sidebar-header {
    padding: 0;
    margin: 0;
    margin-right: 12px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

#sidebar .sidebar-header a {
    display: inline-flex;
    align-items: center;
}

#sidebar .logo-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    min-width: 54px;
    min-height: 54px;
    background: #0b5ea8;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(11, 94, 168, 0.3);
}

#sidebar .logo-box img {
    height: 34px;
    width: auto;
    display: block;
}

#sidebar .sidebar-header img {
    height: 48px;
    width: auto;
}

#sidebar .sidebar-header h3 {
    margin: 0;
    line-height: 1;
    display: block;
}

#sidebar .sidebar-header p {
    display: none;
}

#sidebar .top-menu {
    width: 100%;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
}

#sidebar .top-menu li {
    list-style: none;
    margin: 0;
    padding: 0;
}

#sidebar .top-menu__links {
    display: flex;
    flex: 1;
    justify-content: center;
    gap: 6px;
    padding: 6px;
    border-radius: 12px;
    background: #111827;
    border: 1px solid #1f2937;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#sidebar .top-menu__links a {
    padding: 8px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #cbd5e1;
    background: none;
    text-decoration: none;
    border-radius: 10px;
    position: relative;
    transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

#sidebar .top-menu__links a::after {
    content: '';
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 4px;
    height: 2px;
    border-radius: 999px;
    background: transparent;
    transition: background 0.2s ease;
}

#sidebar .top-menu__links a:hover {
    color: #f8fafc;
    background: #1f2937;
}

#sidebar .top-menu__links a.active {
    color: #ffffff;
    background: #10b981;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.sous{
    position: absolute;
    top: 4.35em;
    margin-left: 80px;
    background: #111827;
    border-radius: 12px;
    padding: 8px 10px;
}

#sidebar ul li.active {
    background-color: #0f172a;
}

#sidebar ul li.active a {
    font-weight: bold;
    color: #ffff00;
    background-color: #10b981;
}

#sidebar .top-menu__links a.active::after {
    background: rgba(255, 255, 255, 0.7);
}

#sidebar .top-menu__actions .profile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    background: #f59e0b;
    color: #0f172a;
    border-radius: 10px;
    font-size: 0.9rem;
    text-decoration: none;
    box-shadow: 0 6px 14px rgba(245, 158, 11, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#sidebar .top-menu__actions .profile-btn:hover {
    background: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 12px 20px rgba(217, 119, 6, 0.4);
}

#sidebar .top-menu__actions .logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    min-width: 42px;
    min-height: 38px;
    border-radius: 10px;
    border: 1px solid #334155;
    background: transparent;
    color: #e2e8f0;
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

#sidebar .top-menu__actions .logout-btn:hover {
    color: #ffffff;
    border-color: #475569;
    background: #1f2937;
}

@media (max-width: 900px) {
    #sidebar {
        position: relative;
    }

    #sidebar .top-menu {
        flex-direction: column;
        align-items: flex-start;
    }

    #sidebar .top-menu__links {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 10px 12px;
        padding: 6px;
        background: #111827;
        border: 1px solid #1f2937;
        box-shadow: none;
    }

    #sidebar .top-menu__actions {
        width: 100%;
        display: flex;
        justify-content: flex-start;
    }
}