/* ============================================================
   Topbar
   48px tall, pinned to top, per design guidelines
   ============================================================ */
.topbar {
    position: fixed;
    top: 0;
    left: 220px;
    right: 0;
    height: 48px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
    z-index: 40;
}

/* --- Left side container --- */
.topbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* --- Breadcrumb (left side) --- */
.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 13px;
}

.breadcrumb-segment {
    color: var(--text-muted);
}

.breadcrumb-separator {
    color: var(--text-muted);
    font-size: 12px;
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
}

/* --- Right side controls --- */
.topbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Live connection indicator */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-default);
}

.live-indicator.connected {
    color: var(--status-green);
    border-color: color-mix(in srgb, var(--status-green) 30%, transparent);
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
}

.live-indicator.connected .live-dot {
    background: var(--status-green);
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Theme toggle button */
.btn-theme-toggle {
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-fast) var(--ease-out);
}

.btn-theme-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-subtle);
}

.btn-theme-toggle svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Main content offset for topbar */
.main {
    margin-left: 220px;
    margin-top: 48px;
    flex: 1;
    position: relative;
    z-index: 10;
    padding: var(--space-xl);
    min-height: calc(100vh - 48px);
}

/* --- Page Header --- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
}

.page-title {
    font-family: var(--font-body);
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: var(--space-xs);
    font-weight: 400;
}

@media (max-width: 768px) {
    .topbar {
        left: 56px;
        padding: 0 var(--space-md);
    }

    .main {
        margin-left: 56px;
    }

    .topbar-breadcrumb {
        font-size: 12px;
    }

    .breadcrumb-segment {
        display: none;
    }

    .breadcrumb-separator {
        display: none;
    }
}

@media (max-width: 480px) {
    .topbar {
        padding: 0 var(--space-sm);
    }

    .live-label {
        display: none;
    }

    #console-trigger {
        display: none !important;
    }
}
