/* Стили боковой панели */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    height: calc(100vh - 45px);
    position: fixed;
    left: 0;
    top: 45px;
    z-index: 999;
    overflow: visible;
    display: flex;
    flex-direction: column;
    /* border: 2px solid purple;  Убрана граница для визуализации */
    box-sizing: border-box; /* Учитываем border в ширине */
}

/* Границы для визуализации - отключены */
/* .sidebar::before {
    content: 'sidebar';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid purple;
    pointer-events: none;
    z-index: 9999;
} */

/* Добавим читаемую подпись для sidebar - отключена */
/* .sidebar::after {
    content: 'sidebar';
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 12px;
    color: #333;
    background: rgba(255,255,255,0.95);
    padding: 4px 8px;
    font-weight: bold;
    border: 1px solid #333;
    border-radius: 4px;
    z-index: 10000;
} */

.logo {
    color: var(--sidebar-text);
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 1; /* Всегда видимый */
}

.sidebar-toggle {
    color: var(--sidebar-text);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: rgba(255,255,255,0.1);
}

.toggle-icon {
    font-size: 14px;
}

.sidebar-nav {
    padding: 8px 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    /* border: 1px solid yellow;  Убрана граница для визуализации */
    position: relative;
}

/* .sidebar-nav::before - отключена подпись */
/* .sidebar-nav::before {
    content: 'sidebar-nav';
    position: absolute;
    top: -1px;
    left: -1px;
    font-size: 10px;
    color: #333;
    background: rgba(255,255,255,0.95);
    padding: 2px 4px;
    font-weight: bold;
    border: 1px solid #333;
    border-radius: 2px;
} */

.nav-section {
    margin-bottom: 8px;
    /* border: 1px solid pink;  Убрана граница для визуализации */
    padding: 5px;
    position: relative;
}

/* .nav-section::before - отключена подпись */
/* .nav-section::before {
    content: 'nav-section';
    position: absolute;
    top: -1px;
    left: -1px;
    font-size: 10px;
    color: #333;
    background: rgba(255,255,255,0.95);
    padding: 2px 4px;
    font-weight: bold;
    border: 1px solid #333;
    border-radius: 2px;
} */

.nav-title {
    color: rgba(255,255,255,0.5);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 12px;
    margin-bottom: 6px;
    opacity: 1; /* Всегда видимый */
    font-weight: 600;
}

/* Compact icon-only sidebar */
.nav-item {
    display: flex;
    align-items: center;
    padding: 8px 8px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
    border-radius: 0;
    margin: 0 4px 1px 4px;
    /* border: 1px solid lime;  Убрана граница для визуализации */
    position: relative;
    justify-content: flex-start;
}

/* .nav-item::before - отключена подпись */
/* .nav-item::before {
    content: 'nav-item';
    position: absolute;
    top: -1px;
    left: -1px;
    font-size: 9px;
    color: #333;
    background: rgba(255,255,255,0.95);
    padding: 2px 4px;
    font-weight: bold;
    border: 1px solid #333;
    border-radius: 2px;
} */

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(51, 122, 183, 0.3);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 16px;
    background: white;
    border-radius: 0 1px 1px 0;
}

.nav-icon {
    font-size: 16px;
    margin-right: 8px;
    min-width: 16px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-text {
    font-size: 13px;
    font-weight: 500;
    opacity: 1; /* Всегда видимый */
    flex: 1;
    min-width: 0;
}

.nav-badge {
    background: var(--accent-color);
    color: white;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 8px;
    min-width: 16px;
    text-align: center;
    font-weight: 600;
    opacity: 1; /* Всегда видимый */
    flex-shrink: 0;
}

.sidebar:hover .nav-badge,
.sidebar.pinned .nav-badge {
    opacity: 1;
}

.nav-item.active .nav-badge {
    background: white;
    color: var(--accent-color);
}

.sidebar-footer {
    padding: 10px 8px;
    border-top: 1px solid rgba(255,255,255,0.1);
    opacity: 1;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 11px;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--sidebar-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-status {
    font-size: 10px;
    color: rgba(255,255,255,0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Убираем подсказки при наведении */
.nav-item[data-tooltip]:hover::after {
    display: none;
}

.nav-item[data-tooltip]:hover::before {
    display: none;
}

/* Мобильная версия */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 128px;
    }
    
    .nav-item {
        padding: 8px 10px;
        margin: 0 6px 1px 6px;
    }
    
    .nav-text {
        font-size: 12px;
    }
    
    .sidebar-footer {
        padding: 8px 6px;
    }
    
    .user-avatar {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
    
    .user-name {
        font-size: 11px;
    }
    
    .user-status {
        font-size: 9px;
    }
}

/* Темная тема */
body.dark-theme .sidebar {
    background: #1a1a1a;
}

body.dark-theme .nav-item:hover {
    background: rgba(255,255,255,0.05);
}

body.dark-theme .nav-item.active {
    background: var(--primary-color);
}

body.dark-theme .user-avatar {
    background: var(--primary-color);
}
