/* ============================================
   Sidebar Navigation
   ============================================ */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--dts-primary) 0%, var(--dts-primary-dark) 100%);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-slow);
    overflow: hidden;
}

/* --- Header / Logo --- */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-lg) var(--space-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.logo-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
}

.logo-subtitle {
    color: var(--dts-secondary);
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.9;
}

/* Toggle Button */
.sidebar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.sidebar-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 1px;
    transition: all var(--transition-fast);
}

/* --- Navigation --- */
.sidebar-nav {
    flex: 1;
    padding: var(--space-md) var(--space-sm);
    overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar {
    width: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

.nav-group-label {
    display: block;
    padding: var(--space-md) var(--space-md) var(--space-xs);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.35);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 11px var(--space-md);
    margin: 2px var(--space-xs);
    border-radius: var(--radius-md);
    color: var(--text-on-dark);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    border: none;
    background: none;
    width: calc(100% - var(--space-sm));
    text-align: left;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.nav-item.active {
    background: rgba(0, 176, 185, 0.15);
    color: var(--dts-secondary);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: var(--dts-secondary);
    border-radius: 2px;
}

.nav-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.nav-label {
    flex: 1;
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--dts-secondary);
    color: white;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
}

/* --- Footer --- */
.sidebar-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.sidebar-settings {
    display: flex;
    gap: var(--space-sm);
}

.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px;
    cursor: pointer;
    color: var(--text-on-dark);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--dts-secondary);
}

.theme-toggle-btn svg {
    width: 18px;
    height: 18px;
}

.icon-moon { display: none; }

[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

.sidebar-copy {
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.7rem;
}

/* --- Mobile --- */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.3);
    }

    .sidebar-toggle {
        display: flex;
    }
}

/* Overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    display: block;
}
