/* ===== Top Bar ===== */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: 64px;
    background: var(--glass);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    box-shadow: none;
}

.top-bar-brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ===== User Chip ===== */
.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    background: var(--bg-secondary);
    border-radius: 980px;
    font-size: 13px;
    color: var(--text-secondary);
}

.user-avatar {
    width: 24px;
    height: 24px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

/* ===== Main Content ===== */
.main {
    flex: 1;
    max-width: 1380px;
    margin: 0 auto;
    padding: 32px 28px;
    width: 100%;
}

/* ===== Sidebar Layout ===== */
.dashboard-layout {
    display: flex;
    min-height: calc(100vh - 56px);
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--bg-card);
    border-right: none;
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
}

/* ===== Workspace Switcher ===== */
.ws-switcher {
    padding: 12px 12px 0;
    margin-bottom: 8px;
}

.ws-switcher-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius);
    border: none;
    background: var(--bg-secondary);
    cursor: pointer;
    transition: all 0.2s var(--ease);
    font-family: var(--font);
    text-align: left;
}

.ws-switcher-btn:hover {
    background: var(--bg-hover);
}

.ws-switcher-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

.ws-switcher-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ws-switcher-type {
    font-size: 11px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.ws-switcher-arrow {
    width: 16px;
    height: 16px;
    color: var(--text-tertiary);
    flex-shrink: 0;
    transition: transform 0.2s var(--ease);
}

.ws-dropdown {
    position: absolute;
    left: 12px;
    right: 12px;
    top: 100%;
    margin-top: 4px;
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: var(--z-dropdown);
    max-height: 320px;
    overflow-y: auto;
    padding: 4px;
    animation: fadeIn 0.15s var(--ease);
}

.ws-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s var(--ease);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: var(--font);
    font-size: 13px;
    color: var(--text);
}

.ws-dropdown-item:hover {
    background: var(--bg-hover);
}

.ws-dropdown-item.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
}

.ws-dropdown-item .ws-dd-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    flex-shrink: 0;
}

.ws-dropdown-item.active .ws-dd-dot {
    background: var(--accent);
}

.ws-dropdown-item .ws-dd-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ws-dropdown-item .ws-dd-type {
    font-size: 11px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.ws-dropdown-add {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: none;
    margin-top: 4px;
    cursor: pointer;
    font-size: 13px;
    color: var(--accent);
    font-weight: 500;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    transition: background 0.15s var(--ease);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: var(--font);
}

.ws-dropdown-add:hover {
    background: var(--accent-light);
}

.sidebar-divider {
    height: 0;
    background: transparent;
    margin: 6px 16px;
}

.sidebar-section {
    padding: 0 12px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: var(--z-overlay);
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.sidebar-overlay.sidebar-overlay-open {
    opacity: 1;
}

.menu-btn {
    display: none;
    padding: 5px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

.menu-btn:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 8px 12px 6px;
    margin-bottom: 2px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-family: var(--font);
    position: relative;
}

.sidebar-nav-item:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.sidebar-nav-item.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
}

.sidebar-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    background: var(--accent);
    border-radius: 0 4px 4px 0;
    box-shadow: none;
}

.sidebar-nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform 0.3s var(--ease);
}

.sidebar-nav-item.active svg {
    opacity: 1;
}

.sidebar-ws-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.sidebar-ws-item:hover {
    background: var(--bg-secondary);
}

.sidebar-ws-item.active {
    color: var(--accent);
    font-weight: 600;
}

.sidebar-ws-item .ws-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    flex-shrink: 0;
}

.sidebar-ws-item.active .ws-dot {
    background: var(--accent);
}

.sidebar-ws-add {
    font-size: 12px;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px 12px 4px 28px;
}

.sidebar-ws-add:hover {
    color: var(--accent);
}

/* ===== Sidebar Language Switcher ===== */
.sidebar-lang-btn.lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 8px;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    justify-content: center;
}

.sidebar-lang-btn.lang-switcher:hover {
    background: var(--accent-light, rgba(0, 112, 243, 0.08));
    color: var(--accent);
    border-color: var(--accent);
}

.sidebar-lang-btn.lang-switcher svg {
    flex-shrink: 0;
}

.sidebar-spacer {
    flex: 1;
}

.sidebar-user {
    padding: 14px 16px;
    border-top: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    margin-top: 8px;
}

.sidebar-user .user-avatar {
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 58%, var(--console-warm, var(--accent-hover, var(--accent))) 42%));
    box-shadow: none;
}

.sidebar-user:hover {
    background: var(--bg-hover);
}

.profile-popover {
    display: flex;
    flex-direction: column;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 8px;
    right: 8px;
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 4px;
    z-index: var(--z-popover);
}

.profile-popover button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: none;
    background: transparent;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    font-family: var(--font);
    width: 100%;
    text-align: left;
}

.profile-popover button:hover {
    background: var(--bg-hover);
}

