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

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar__header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar__logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: white;
}

.sidebar__logo:hover { color: white; }

.sidebar__logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar__logo-icon svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.sidebar__title {
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.2;
}

.sidebar__subtitle {
    font-size: 0.6875rem;
    opacity: 0.5;
    margin-top: 1px;
}

.sidebar__nav {
    flex: 1;
    padding: 1rem 0.75rem;
}

.sidebar__section {
    margin-bottom: 1.5rem;
}

.sidebar__section-title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0 0.625rem;
    margin-bottom: 0.375rem;
    opacity: 0.4;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.625rem;
    border-radius: var(--radius-xs);
    text-decoration: none;
    color: var(--sidebar-text);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 2px;
    min-height: 44px;
}

.sidebar__link:hover {
    background: var(--sidebar-hover);
    color: white;
}

.sidebar__link--active {
    background: rgba(99, 102, 241, 0.15);
    color: #c7d2fe;
}

.sidebar__link-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    flex-shrink: 0;
}

.sidebar__link-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar__link--active .sidebar__link-icon,
.sidebar__link:hover .sidebar__link-icon {
    opacity: 1;
}

.sidebar__footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.75rem;
    opacity: 0.4;
}

/* ============ Mobile Toggle ============ */

.sidebar__toggle {
    display: none;
    position: fixed;
    top: 0.875rem;
    left: 0.875rem;
    z-index: 200;
    width: 44px;
    height: 44px;
    border: none;
    background: var(--surface);
    border-radius: var(--radius-xs);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--text);
}

.sidebar__toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.sidebar__toggle svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
}

.sidebar__overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
}

.sidebar__overlay--visible {
    display: block;
}

@media (prefers-reduced-motion: no-preference) {
    .sidebar__overlay--visible {
        backdrop-filter: blur(2px);
    }
}

@media (max-width: 860px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar--open {
        transform: translateX(0);
    }

    .sidebar__toggle {
        display: flex;
    }
}
