/* Header workspace toolbar — progress backup (matches theme picker) */

.header-toolbar-end {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.top-header-bar .header-toolbar-end .header-theme-picker {
    margin-left: 0;
}

.header-workspace-cluster {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-workspace-divider {
    width: 1px;
    height: 22px;
    background: var(--glass-border, rgba(255, 255, 255, 0.08));
    flex-shrink: 0;
}

.header-workspace-dropdown {
    position: relative;
}

.header-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    min-height: 32px;
    background: var(--bg-tertiary, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.header-toolbar-btn:hover {
    background: var(--bg-secondary, rgba(255, 255, 255, 0.08));
    color: var(--text-primary);
    border-color: var(--text-muted, rgba(255, 255, 255, 0.18));
}

.header-toolbar-btn:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

.header-toolbar-btn svg {
    flex-shrink: 0;
    color: var(--accent-blue);
}

.header-toolbar-btn .header-toolbar-chevron {
    opacity: 0.55;
    color: var(--text-muted);
    transition: transform 0.15s ease;
}

.header-workspace-dropdown.is-open .header-toolbar-chevron {
    transform: rotate(180deg);
}

.header-toolbar-label {
    max-width: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-toolbar-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06);
}

.header-toolbar-btn.is-connected .header-toolbar-status-dot {
    background: #34d399;
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.45);
}

.header-progress-io[data-authed="1"] .header-toolbar-status-dot {
    background: #34d399;
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.45);
}

.header-toolbar-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 240px;
    max-width: 280px;
    padding: 6px;
    background: var(--bg-secondary, #12141c);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    z-index: 1002;
}

.header-workspace-dropdown.is-open .header-toolbar-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header-toolbar-menu-title {
    padding: 8px 10px 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.header-toolbar-menu-hint {
    padding: 0 10px 8px;
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.header-toolbar-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    margin: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s ease;
}

.header-toolbar-menu-item:hover:not(:disabled):not(.is-locked) {
    background: var(--bg-tertiary, rgba(255, 255, 255, 0.06));
}

.header-toolbar-menu-item:disabled,
.header-toolbar-menu-item.is-locked {
    opacity: 0.45;
    cursor: not-allowed;
}

.header-toolbar-menu-item svg {
    flex-shrink: 0;
    color: var(--accent-blue);
    opacity: 0.9;
}

.header-toolbar-menu-item .item-sub {
    display: block;
    font-size: 0.6875rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 2px;
}

.header-toolbar-menu-divider {
    height: 1px;
    margin: 4px 8px;
    background: var(--border-color, rgba(255, 255, 255, 0.08));
}

@media (max-width: 900px) {
    .header-toolbar-label {
        display: none;
    }

    .header-toolbar-btn {
        padding: 6px 8px;
    }
}

@media (max-width: 640px) {
    .header-workspace-divider {
        display: none;
    }

    .header-toolbar-menu-hint {
        font-size: 0.6875rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .header-toolbar-btn,
    .header-toolbar-menu,
    .header-toolbar-chevron {
        transition: none;
    }
}

.light-theme .header-toolbar-menu {
    box-shadow: 0 12px 32px rgba(87, 70, 184, 0.12);
}
