/* Sidebar Container */
.sidebar {
    position: fixed;
    left: 0;
    top: var(--workspace-header-offset);
    width: 240px;
    height: calc(100vh - var(--workspace-header-offset));
    background: var(--bg-sidebar);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    /* Inset edge preserves the existing sidebar and navigation widths. */
    box-shadow: inset -1px 0 0 var(--border-warm), 2px 0 8px rgba(59, 42, 58, 0.1);
}

/* Navigation Menu */
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-item:hover {
    background-color: color-mix(in srgb, var(--accent-soft) 30%, transparent);
    color: var(--text-main);
}

.nav-item.active {
    background-color: var(--accent-soft);
    color: var(--accent-text);
    font-weight: var(--font-weight-semibold);
}

.nav-icon {
    font-size: 18px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
}

.nav-icon i {
    font-size: 16px;
    width: 16px;
    text-align: center;
}

.nav-label {
    font-size: var(--font-size-base);
    font-weight: 450;
    letter-spacing: -0.01em;
}

.nav-item.active .nav-label {
    font-weight: var(--font-weight-semibold);
}

button.nav-item {
    border: none;
    background: none;
    width: 100%;
    font-family: inherit;
    text-align: left;
}

/* User Footer */
.sidebar-status {
    padding: 16px 24px;
    border-top: 1px solid var(--border-warm);
    border-bottom: 1px solid var(--border-warm);
}

.status-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-size: 13px;
}

.status-item:last-child {
    margin-bottom: 0;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 10px;
    flex-shrink: 0;
}

.status-dot.status-active {
    background-color: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.status-dot.status-paused {
    background-color: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.status-label {
    flex: 1;
    color: var(--text-muted);
}

.status-count {
    font-weight: 600;
    color: var(--text-main);
    font-size: 14px;
}

/* User Footer */
.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-warm);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    color: var(--accent-text);
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    font-size: 14px;
    font-weight: var(--font-weight-normal);
    color: var(--text-main);
}

.logout-link {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-normal);
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.logout-link:hover {
    color: var(--accent-text);
}

/* Scrollbar Styling */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--text-muted) 20%, transparent);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--text-muted) 30%, transparent);
}

