/* ========================================
   Sidebar + Mobile Menu (from source.css)
   ======================================== */

#sidebarMenu,
.sidebar {
    position: fixed !important;
    top: var(--header-height) !important;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 0 !important;
    margin: 0 !important;
    background: #23282d !important;
    height: calc(100vh - var(--header-height)) !important;
    width: var(--sidebar-width) !important;
    max-width: var(--sidebar-width) !important;
    border: none;
    border-top: none !important;
    display: block !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
}

#sidebarMenu.collapsed,
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width) !important;
}

.sidebar-content {
    padding: 0 !important;
    margin: 0 !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* WordPress Menu */
.wp-menu {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.wp-menu .nav-item {
    margin: 0;
    border-bottom: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.wp-menu .nav-link {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: white;
    text-decoration: none;
    font-size: 13px;
    line-height: 18px;
    margin: 0;
    border-radius: 0;
    position: relative;
    transition: all 0.2s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-weight: 400;
}

.wp-menu .nav-link:hover {
    color: white !important;
    background-color: #32373c !important;
}

.wp-menu .nav-link.active {
    color: white !important;
    background-color: #0073aa !important;
}

.wp-menu .nav-link.active i {
    color: white !important;
}

.wp-menu .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #00a0d2;
}

.wp-menu .nav-link i {
    width: 20px;
    height: 20px;
    font-size: 16px;
    text-align: center;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.wp-menu .menu-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar.collapsed .menu-text {
    display: none;
}

/* Субменю */
.sidebar .has-submenu {
    position: relative;
}

.sidebar .submenu-toggle {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.sidebar .has-submenu.open .submenu-toggle {
    transform: rotate(180deg);
}

.sidebar .submenu-arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.3s ease;
}

.sidebar .has-submenu.open .submenu-arrow {
    transform: rotate(180deg);
}

.sidebar .submenu {
    max-height: 0;
    overflow: hidden;
    background: #1a1d21;
    transition: max-height 0.3s ease;
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border-top: 1px solid #32373c;
}

.sidebar .has-submenu.open .submenu,
.sidebar .has-submenu .submenu.show {
    max-height: 500px;
    border-top: 1px solid #32373c;
}

/* Пустое состояние сайдбара */
.sidebar-empty-state {
    padding: 40px 20px;
    text-align: center;
}

.sidebar-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: #32373c;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 1.5rem;
}

.sidebar-empty-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: #a0a5aa;
    margin: 0 0 8px 0;
}

.sidebar-empty-hint {
    font-size: 0.875rem;
    color: #6c757d;
    margin: 0;
    line-height: 1.5;
}

.sidebar .submenu li {
    margin: 0;
    border-bottom: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.sidebar .submenu li:last-child {
    border-bottom: none;
}

.sidebar .submenu a {
    display: flex;
    align-items: center;
    padding: 7px 15px 7px 12px;
    color: white;
    text-decoration: none;
    font-size: 13px;
    line-height: 18px;
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-weight: 400;
}

.sidebar .submenu a i {
    width: 20px;
    height: 20px;
    font-size: 14px;
    text-align: center;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.9;
    color: white;
}

.sidebar .submenu a:hover {
    color: white;
    background-color: #32373c;
}

.sidebar .submenu a:hover::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #00a0d2;
}

.sidebar .submenu a.active {
    color: white;
    background-color: #32373c;
    font-weight: 400;
}

.sidebar .submenu a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: white;
}

.sidebar .submenu a.active::after {
    content: '\f054';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 10px;
}

.sidebar .submenu a.active i {
    color: white;
}

/* ========================================
   МОБИЛЬНОЕ МЕНЮ
   ======================================== */

.mobile-menu-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(160,165,170,0.12);
    border-radius: 6px;
    color: #a0a5aa;
    display: none;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: none;
}

.mobile-menu-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
    box-shadow: none;
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

.mobile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 767.98px) {
    .sidebar {
        display: block !important;
        left: -280px !important;
        transition: left 0.3s ease !important;
        z-index: 1050 !important;
        top: var(--header-height-mobile, var(--header-height)) !important;
        height: calc(100vh - var(--header-height-mobile, var(--header-height))) !important;
        width: 280px !important;
        max-width: 280px !important;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3) !important;
        position: fixed !important;
    }

    .sidebar.mobile-show {
        left: 0 !important;
    }

    .mobile-menu-btn {
        display: flex !important;
    }

    .mobile-sidebar-overlay {
        display: block !important;
        z-index: 1040 !important;
    }
}

@media (min-width: 768px) {
    .mobile-menu-btn {
        display: none !important;
    }

    .mobile-sidebar-overlay {
        display: none !important;
    }
}
