body { overflow-x: hidden; }

/* ===== Sidebar ===== */
.sidebar {
    margin: 0;
    padding: 0;
    background: #f5f5f6;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto; /* чтобы меню скроллилось при длинном контенте */
    z-index: 1040;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* ===== Mobile Header ===== */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    background: #eeeeee;
    padding: 10px 15px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1050;
}
.mobile-header img { height: 40px; }
.menu-toggle {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #000;
}

/* ===== Logo Section ===== */
.logo-section {
    position: sticky;
    top: 0;
    background: #eeeeee;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    text-align: center;
    padding: 15px;
    z-index: 1050;
}
.logo-section img {
    width: 100%;
    max-height: 80px;
    object-fit: contain;
}

/* ===== Menu Links ===== */
.accordion-link, .accordion-button {
    color: #333;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px !important;
    width: 100%;
    border-radius: 6px;
    margin-bottom: 5px;
    height: 42px;
    background: transparent !important;
    transition: background-color 0.2s ease;
}
.sidebar .accordion-link.active, .accordion-button:not(.collapsed) {
    background: rgba(0,0,0,0.08) !important;
    color: #000 !important;
}
.sidebar .accordion-link:hover, .accordion-button:hover {
    background: rgba(0,0,0,0.1) !important;
    color: #000 !important;
}

/* ===== Submenu ===== */
.submenu a {
    padding-left: 80px;
    font-size: 0.95rem;
    margin-bottom: 5px;
    background: transparent !important;
    color: #000 !important;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}
.submenu .accordion-link:hover {
    background: rgba(0,0,0,0.1) !important;
}

/* ===== User Profile ===== */

.user-profile {
    position: fixed;
    bottom: 0;
    left: 0;
    border-top: 1px solid rgba(0,0,0,0.1);
    padding: 10px 16px;
    background: #eeeeee;
    z-index: 1050;
    cursor: pointer;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
}

.user-profile:hover { background: rgba(0,0,0,0.08); }
.user-info { display: flex; align-items: center; gap: 8px; }
.user-info img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.user-menu { display: none; flex-direction: column; margin-top: 10px }
.user-menu.show { display: flex; }
.user-menu a { padding: 6px 16px; color: #333; margin-bottom: 5px; }
.user-menu a:hover { background: rgba(0,0,0,0.1); }

.sidebar-menu {
    padding-bottom: 150px!important;
}

.accordion-button:focus,
.accordion-button:active {
    outline: none !important;
    box-shadow: none !important;
}

@supports ((backdrop-filter: blur(6px)) or (-webkit-backdrop-filter: blur(6px))) {
    .mobile-header {
        background: rgba(0,0,0,0.05);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px)
    }

    .logo-section {
        background: rgba(0,0,0,0.03);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px)
    }

    .user-profile {
        background: rgba(0,0,0,0.03);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px)
    }
}

/* ===== Responsive ===== */
@media (max-width: 767.98px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        transition: left 0.3s;
    }
    .sidebar.show { left: 0; }
    .mobile-header { display: flex; }
    .content { padding-top: 70px; }

    .user-profile {
        bottom: 0;
        left: -100%;
        width: 100%;
        border-top: 1px solid rgba(0,0,0,0.1);
        padding: 10px 16px;
        background: rgba(0,0,0,0.03);
        cursor: pointer;
    }
    .user-profile.show { left: 0; }

    .sidebar-menu {
        margin-top: 70px;
    }
}