.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-right: 1px solid var(--border);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-md);
    background: var(--accent-tint);
    color: var(--accent-text);
    flex-shrink: 0;
}

.sidebar-brand {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: 0.75rem 0;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    color: var(--text-muted);
    border-left: 3px solid transparent;
    transition:
        color var(--transition),
        background var(--transition),
        border-color var(--transition);
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    flex-shrink: 0;
}

.nav-label {
    font-size: var(--text-base);
}

.nav-link:hover {
    color: var(--text);
    background: var(--surface-2);
}

.nav-link.active {
    color: var(--text);
    background: var(--accent-tint);
    border-left-color: var(--accent-text);
}

.nav-link.active .nav-icon {
    color: var(--accent-text);
}

.sidebar-footer {
    padding: var(--space-4);
    border-top: 1px solid var(--border);
}

.theme-label {
    margin: 0 0 0.5rem;
    color: var(--text-muted);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.theme-toggle {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
}

.theme-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2);
    background: transparent;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
    transition:
        background var(--transition),
        color var(--transition);
}

.theme-btn + .theme-btn {
    border-left: 1px solid var(--border);
}

.theme-btn:hover {
    background: var(--surface-2);
    color: var(--text);
}

.theme-btn.active {
    background: var(--accent-tint);
    color: var(--accent-text);
}

.user-block {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    margin-top: var(--space-4);
    padding: var(--space-2) var(--space-2);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    text-align: left;
    cursor: default;
    transition: background var(--transition);
}

.user-block:disabled {
    cursor: default;
    opacity: 1;
}

.user-block:not(:disabled):hover {
    background: var(--surface-2);
    cursor: pointer;
}

.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: var(--accent-tint);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    /* Override accent-tint inheritance so light theme keeps text white */
    color: #ffffff;
}

.user-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.user-name {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-email {
    font-size: var(--text-2xs);
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-caret {
    display: inline-flex;
    align-items: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

.content-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: var(--z-topbar);
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: 0 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.topbar-title {
    margin: 0;
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.main-content {
    padding: var(--space-6);
    flex: 1;
}

