/* ════════════════════════════════════════════════════
   top-bar — breadcrumb (Org/Workspace/Space), search center, notifications, user
   ════════════════════════════════════════════════════ */

.shell-top-bar {
    display: flex;
    align-items: center;
    height: 36px;
    padding: 0 12px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 20;
    gap: 0;
}

/* ── Left section (breadcrumb) ──────────────────── */
.topbar-left {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    min-width: 0;
    padding-right: 8px;
}

/* ── Center section (search) ────────────────────── */
.topbar-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

/* ── Right section (notif, signin, user) ────────── */
.topbar-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 8px;
}

/* ── Breadcrumb ─────────────────────────────────── */
.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
}
.topbar-bc-sep {
    color: var(--text-muted);
    font-weight: 300;
    opacity: 0.4;
    font-size: 14px;
    margin: 0 1px;
    flex-shrink: 0;
    pointer-events: none;
    user-select: none;
}
.topbar-bc-segment {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s;
    white-space: nowrap;
    min-width: 0;
    max-width: 160px;
}
.topbar-bc-segment:hover { background: var(--bg-hover); }
.topbar-bc-segment svg { flex-shrink: 0; color: var(--text-muted); }
.topbar-bc-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.topbar-bc-org-icon {
    width: 16px; height: 16px;
    border-radius: 3px;
    background: #10b981;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 700;
    flex-shrink: 0;
}
.topbar-bc-space-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

/* Non-interactive workspace segment (local = "Local", linked = "Personal") */
.topbar-bc-fixed {
    cursor: default;
    color: var(--text-muted);
    opacity: 0.75;
}
.topbar-bc-fixed:hover { background: none; }

/* ── Search bar ─────────────────────────────────── */
.topbar-search {
    width: 100%;
    max-width: 460px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    height: 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    transition: border-color 0.15s;
}
.topbar-search:hover { border-color: var(--text-muted); }
.topbar-search-text { flex: 1; text-align: left; }
.topbar-search-kbd {
    font-size: 11px;
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-muted);
    font-family: inherit;
    flex-shrink: 0;
}

/* ── Notifications icon ─────────────────────────── */
.topbar-notif {
    background: none; border: none; cursor: pointer; padding: 4px;
    color: var(--text-muted);
    display: flex; align-items: center;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}
.topbar-notif:hover { color: var(--text-primary); background: var(--bg-hover); }

/* ── Sign In button ─────────────────────────────── */
.topbar-signin {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 3px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    white-space: nowrap;
}
.topbar-signin:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}

/* ── User avatar ────────────────────────────────── */
.topbar-user {
    background: none; border: none; cursor: pointer; padding: 2px;
    color: var(--text-muted);
    display: flex; align-items: center;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}
.topbar-user:hover { color: var(--text-primary); background: var(--bg-hover); }

/* ── Breadcrumb dropdown menus ──────────────────── */
.topbar-bc-menu {
    position: fixed;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35);
    width: 240px;
    z-index: 500;
    padding: 8px;
    animation: topbar-menu-in 0.12s ease-out;
}
@keyframes topbar-menu-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.topbar-bc-menu-header {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 6px 10px;
}
.topbar-bc-menu-icon {
    width: 32px; height: 32px;
    border-radius: 6px;
    background: #10b981;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700;
    flex-shrink: 0;
}
.topbar-bc-menu-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.topbar-bc-menu-meta { font-size: 11px; color: var(--text-muted); }
.topbar-bc-menu-separator { height: 1px; background: var(--border); margin: 4px 0; }
.topbar-bc-menu-label {
    font-size: 10px; font-weight: 500; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.05em;
    padding: 6px 8px 4px;
}
.topbar-bc-menu-item {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px; font-weight: 500;
    color: var(--text-primary);
    transition: background 0.1s;
}
.topbar-bc-menu-item:hover { background: var(--bg-hover); }
.topbar-bc-menu-item.active { background: rgba(255,255,255,0.04); }
.topbar-bc-menu-check { margin-left: auto; color: var(--accent); font-size: 13px; }
.topbar-bc-menu-create { color: var(--text-muted); }
.topbar-bc-menu-create:hover { color: var(--text-primary); }
.topbar-bc-menu-body { max-height: 280px; overflow-y: auto; }
.topbar-bc-menu-loading { padding: 10px 8px; color: var(--text-muted); font-size: 13px; }
.topbar-bc-menu-empty { padding: 8px 8px; color: var(--text-muted); font-size: 13px; font-style: italic; }
.topbar-bc-space-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}

/* ── Unified search/AI/command modal ─────────────── */
.usearch-overlay {
    position: fixed; inset: 0; z-index: 600;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: 60px;
}
.usearch-dialog {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 640px; max-width: 90vw;
    box-shadow: 0 16px 48px rgba(0,0,0,0.4);
    overflow: hidden;
    display: flex; flex-direction: column;
    max-height: 70vh;
}
.usearch-input-row {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px; border-bottom: 1px solid var(--border);
}
.usearch-mode-badge {
    font-size: 11px; font-weight: 600;
    padding: 2px 8px; border-radius: 4px;
    background: var(--bg-surface); color: var(--text-muted);
    flex-shrink: 0; white-space: nowrap;
}
.usearch-mode-ai { background: rgba(168,85,247,0.15); color: #a855f7; }
.usearch-mode-command { background: rgba(59,130,246,0.15); color: #3b82f6; }
.usearch-input {
    flex: 1; border: none; background: none;
    color: var(--text-primary); font-size: 15px;
    outline: none; font-family: inherit;
}
.usearch-input::placeholder { color: var(--text-muted); }
.usearch-input:disabled { opacity: 0.5; }
.usearch-ai-btn {
    background: none; border: 1px solid rgba(168,85,247,0.3);
    color: #a855f7; padding: 3px 10px; border-radius: 6px;
    font-size: 12px; font-weight: 500; cursor: pointer;
    white-space: nowrap; transition: all 0.15s;
}
.usearch-ai-btn:hover { background: rgba(168,85,247,0.1); }
.usearch-tabs {
    display: flex; gap: 4px;
    padding: 6px 16px;
    border-bottom: 1px solid var(--border);
}
.usearch-tab {
    padding: 4px 12px; border-radius: 6px;
    border: none; background: none;
    color: var(--text-muted); font-size: 13px;
    cursor: pointer; transition: all 0.1s;
}
.usearch-tab:hover { color: var(--text-primary); }
.usearch-tab.active { background: var(--bg-surface); color: var(--text-primary); font-weight: 500; }
.usearch-results {
    flex: 1; overflow-y: auto;
    padding: 8px; min-height: 180px;
}
.usearch-hint {
    color: var(--text-muted); font-size: 14px;
    text-align: center; padding: 40px 0;
}
.usearch-footer {
    display: flex; align-items: center;
    padding: 8px 16px;
    border-top: 1px solid var(--border);
    font-size: 12px; color: var(--text-muted);
}
.usearch-footer kbd {
    padding: 1px 5px; border: 1px solid var(--border);
    border-radius: 3px; font-size: 11px; margin: 0 2px;
}

/* Search results */
.usearch-result-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: 8px;
    cursor: pointer; transition: background 0.1s;
}
.usearch-result-item:hover { background: var(--bg-hover); }
.usearch-result-icon { font-size: 16px; flex-shrink: 0; }
.usearch-result-name { font-size: 14px; color: var(--text-primary); }
.usearch-result-meta { font-size: 12px; color: var(--text-muted); }

/* Command items */
.usearch-section-label {
    font-size: 11px; font-weight: 500; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.05em;
    padding: 8px 10px 4px;
}
.usearch-cmd-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: 8px;
    cursor: pointer; transition: background 0.1s;
}
.usearch-cmd-item:hover { background: var(--bg-hover); }
.usearch-cmd-icon { font-size: 16px; flex-shrink: 0; }
.usearch-cmd-name { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.usearch-cmd-desc { font-size: 12px; color: var(--text-muted); }

/* AI mini-chat */
.usearch-ai-exchange { padding: 8px; }
.usearch-ai-user {
    font-size: 14px; color: var(--text-primary);
    padding: 8px 12px; background: var(--bg-surface);
    border-radius: 8px; margin-bottom: 12px;
}
.usearch-ai-response {
    font-size: 14px; line-height: 1.6;
    color: var(--text-primary);
    padding: 0 4px;
}
.usearch-ai-response p { margin: 6px 0; }
.usearch-ai-response code { background: rgba(255,255,255,0.06); padding: 2px 5px; border-radius: 4px; font-size: 13px; }
.usearch-ai-response pre { background: #09090b; border-radius: 8px; padding: 12px; margin: 8px 0; overflow-x: auto; }
.usearch-ai-response pre code { background: none; padding: 0; }
.usearch-ai-thinking {
    color: var(--text-muted); font-style: italic; font-size: 13px;
    padding: 12px 0;
    animation: usearch-pulse 1.5s ease-in-out infinite;
}
@keyframes usearch-pulse { 0%,100%{ opacity:1; } 50%{ opacity:0.4; } }
.usearch-ai-error { color: #f87171; font-size: 13px; padding: 8px 0; }
.usearch-ai-actions {
    display: flex; justify-content: flex-end;
    margin-top: 12px; padding-top: 8px;
    border-top: 1px solid var(--border);
}
.usearch-ai-open-chat {
    background: none; border: 1px solid var(--border);
    color: var(--text-secondary); padding: 6px 14px;
    border-radius: 6px; font-size: 13px; cursor: pointer;
    transition: all 0.15s;
}
.usearch-ai-open-chat:hover { border-color: var(--accent); color: var(--accent); }

/* Responsive rules for top bar are in core.css alongside other shell breakpoints */
