/* ==========================================================================
   Navka Portal — Premium Design System
   ========================================================================== */

/* ---------- Custom Properties ---------- */
:root {
    /* Core palette */
    --portal-primary: #3b82f6;
    --portal-primary-hover: #60a5fa;
    --portal-primary-glow: rgba(59, 130, 246, 0.35);

    /* Backgrounds - Deep, rich navy/black */
    --portal-bg: #030712;
    --portal-bg-dark: #020617;
    --portal-surface: #0f172a;
    --portal-surface-hover: #1e293b;
    --portal-surface-elevated: #1e293b;

    /* Borders - Subtle and semi-transparent */
    --portal-border: rgba(255, 255, 255, 0.08);
    --portal-border-light: rgba(255, 255, 255, 0.12);
    --portal-border-hover: rgba(255, 255, 255, 0.2);

    /* Text */
    --portal-text: #f8fafc;
    --portal-text-primary: #e2e8f0;
    --portal-text-secondary: #94a3b8;
    --portal-text-muted: #64748b;

    /* Status colors */
    --portal-status-active: #22c55e;
    --portal-status-idle: #f59e0b;
    --portal-status-training: #3b82f6;
    --portal-status-offline: #ef4444;
    --portal-status-healthy: #22c55e;
    --portal-status-degraded: #f59e0b;
    --portal-status-unhealthy: #ef4444;
    --portal-status-maintenance: #8b5cf6;

    /* Spacing & sizing */
    --portal-radius: 12px;
    --portal-radius-sm: 8px;
    --portal-radius-lg: 16px;
    --portal-radius-xl: 24px;

    /* Transitions */
    --portal-transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Global Reset & Typography ---------- */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--portal-bg);
    color: var(--portal-text);
    -webkit-font-smoothing: antialiased;
}

.portal-heading {
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #fff;
}

/* ---------- Scrollbar Hide Utility ---------- */
.scrollbar-hide {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--portal-bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--portal-border-light);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--portal-border-hover);
}

/* ---------- Card Styles ---------- */
.portal-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.8) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius);
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
    transition: all var(--portal-transition);
    position: relative;
    overflow: hidden;
}
.portal-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(255,255,255,0.03) 0%, transparent 40%);
    pointer-events: none;
}
.portal-card:hover {
    border-color: var(--portal-border-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.6);
}

.portal-card-premium {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(15, 23, 42, 0.9) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
}
.portal-card-premium:hover {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.1);
}

/* ---------- Stat Card ---------- */
.portal-stat-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.portal-stat-card .stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--portal-text);
    margin: 8px 0;
}
.portal-stat-card .stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--portal-text-secondary);
}

/* ---------- Status Effects & Dots ---------- */
.portal-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.portal-status-dot.active {
    background: var(--portal-status-active);
    box-shadow: 0 0 10px var(--portal-status-active);
}
.portal-status-dot.idle {
    background: var(--portal-status-idle);
    box-shadow: 0 0 10px var(--portal-status-idle);
}
.portal-status-dot.offline {
    background: var(--portal-status-offline);
    box-shadow: 0 0 10px var(--portal-status-offline);
}

.portal-glow-green { box-shadow: 0 0 15px rgba(34, 197, 94, 0.3); }
.portal-glow-blue { box-shadow: 0 0 15px rgba(59, 130, 246, 0.3); }
.portal-glow-orange { box-shadow: 0 0 15px rgba(245, 158, 11, 0.3); }

/* ---------- Navigation Refinement ---------- */
.portal-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 12px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--portal-text-secondary);
    transition: all 0.2s ease;
    text-decoration: none;
    cursor: pointer;
}
.portal-nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}
.portal-nav-link.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1) 0%, transparent 100%);
    border-left: 3px solid var(--portal-primary);
    color: #fff;
}
.portal-nav-link .mud-icon-root {
    font-size: 20px;
    transition: color 0.2s ease;
}
.portal-nav-link:hover .mud-icon-root,
.portal-nav-link.active .mud-icon-root {
    color: var(--portal-primary) !important;
}

/* ---------- Tags & Chips ---------- */
.portal-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.portal-tag.primary { background: rgba(59, 130, 246, 0.1); color: var(--portal-primary); }
.portal-tag.success { background: rgba(34, 197, 94, 0.1); color: var(--portal-status-active); }

/* ---------- Avatar ---------- */
.portal-avatar {
    border-radius: var(--portal-radius-sm);
    border: 1px solid var(--portal-border);
    overflow: hidden;
}

/* ---------- MudBlazor Overrides ---------- */
.mud-paper.portal-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.8) 100%) !important;
    backdrop-filter: blur(16px);
    border: 1px solid var(--portal-border) !important;
}

.portal-search-bar {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-sm);
    padding: 8px 16px 8px 40px;
    color: #fff;
    transition: all 0.2s ease;
}
.portal-search-bar:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--portal-primary);
    outline: none;
}

/* ---------- Settings Layout ---------- */
.portal-settings-layout {
    display: flex;
    gap: 0;
    min-height: calc(100vh - 56px);
}
.portal-settings-sidebar {
    width: 260px;
    flex-shrink: 0;
    padding: 24px;
    border-right: 1px solid var(--portal-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.portal-settings-sidebar .settings-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--portal-text);
    margin-bottom: 4px;
}
.portal-settings-sidebar .settings-subtitle {
    font-size: 0.8125rem;
    color: var(--portal-text-secondary);
    margin-bottom: 16px;
}
.portal-settings-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--portal-radius);
    font-size: 0.875rem;
    color: var(--portal-text-secondary);
    cursor: pointer;
    transition: all var(--portal-transition);
}
.portal-settings-nav-item:hover {
    background: var(--portal-surface);
    color: var(--portal-text);
}
.portal-settings-nav-item.active {
    background: var(--portal-primary);
    color: #fff;
}
.portal-settings-content {
    flex: 1;
    padding: 24px 40px;
    overflow-y: auto;
}
.profile-stats-sidebar {
    width: 260px;
    flex-shrink: 0;
}
@media (max-width: 960px) {
    .portal-settings-layout {
        flex-direction: column;
    }
    .portal-settings-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--portal-border);
        flex-direction: row;
        flex-wrap: wrap;
        padding: 16px;
    }
    .portal-settings-sidebar .settings-title,
    .portal-settings-sidebar .settings-subtitle {
        width: 100%;
    }
    .portal-settings-content {
        padding: 16px 20px;
    }
    .profile-stats-sidebar {
        width: 100%;
    }
}

/* ---------- Horizontal Tabs ---------- */
.portal-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--portal-border);
}
.portal-tab {
    padding: 12px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--portal-text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--portal-transition);
    white-space: nowrap;
}
.portal-tab:hover {
    color: var(--portal-text);
}
.portal-tab.active {
    color: var(--portal-primary);
    border-bottom-color: var(--portal-primary);
}

/* ---------- Dark Inputs ---------- */
.portal-input .mud-input {
    background: var(--portal-surface-elevated) !important;
    border: 1px solid var(--portal-border) !important;
    border-radius: var(--portal-radius) !important;
}
.portal-input .mud-input:hover {
    border-color: var(--portal-border-hover) !important;
}
.portal-input .mud-input.mud-input-outlined:focus-within {
    border-color: var(--portal-primary) !important;
}

/* ---------- Card Variants ---------- */
.portal-card-clickable {
    cursor: pointer;
}
.portal-card-clickable:hover {
    border-color: var(--portal-primary);
}

/* ---------- Avatar Sizes ---------- */
.portal-avatar {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}
.portal-avatar .avatar-img {
    border-radius: var(--portal-radius-sm);
    object-fit: cover;
}
.portal-avatar .avatar-fallback {
    border-radius: var(--portal-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--portal-text);
    background: var(--portal-surface-elevated);
}
.portal-avatar .avatar-status {
    position: absolute;
    bottom: -2px;
    right: -2px;
    border: 2px solid var(--portal-surface);
}
.portal-avatar.sm .avatar-img,
.portal-avatar.sm .avatar-fallback { width: 32px; height: 32px; font-size: 0.75rem; }
.portal-avatar.md .avatar-img,
.portal-avatar.md .avatar-fallback { width: 40px; height: 40px; font-size: 0.875rem; }
.portal-avatar.lg .avatar-img,
.portal-avatar.lg .avatar-fallback { width: 56px; height: 56px; font-size: 1.25rem; }
.portal-avatar.xl .avatar-img,
.portal-avatar.xl .avatar-fallback { width: 80px; height: 80px; font-size: 1.5rem; }

/* ---------- MudNavMenu Sidebar Override ---------- */
.portal-flat-nav .mud-nav-link {
    padding: 8px 12px !important;
    border-radius: var(--portal-radius) !important;
    font-size: 0.875rem !important;
    margin: 1px 0 !important;
    min-height: 38px !important;
    color: var(--portal-text-secondary);
}
.portal-flat-nav .mud-nav-link:hover {
    background: var(--portal-surface-hover) !important;
    color: var(--portal-text) !important;
}
.portal-flat-nav .mud-nav-link:hover .mud-nav-link-icon {
    color: var(--portal-primary) !important;
}
.portal-flat-nav .mud-nav-link.active {
    background: var(--portal-surface-hover) !important;
    color: var(--portal-text) !important;
    border-left: 2px solid var(--portal-primary) !important;
}
.portal-flat-nav .mud-nav-link.active .mud-nav-link-icon {
    color: var(--portal-primary) !important;
}
.portal-flat-nav .mud-navmenu .mud-nav-link-icon {
    font-size: 20px !important;
}

/* ---------- Tag Category Colors ---------- */
.portal-tag.data { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.portal-tag.development { background: rgba(34, 197, 94, 0.1); color: #22c55e; }
.portal-tag.research { background: rgba(168, 85, 247, 0.1); color: #a855f7; }
.portal-tag.security { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.portal-tag.operations { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.portal-tag.design { background: rgba(236, 72, 153, 0.1); color: #ec4899; }
.portal-tag.default { background: rgba(100, 116, 139, 0.1); color: #64748b; }

/* ---------- Utility Classes ---------- */
.gap-portal { gap: 24px; }
.gap-portal-sm { gap: 16px; }
.gap-portal-xs { gap: 8px; }
.text-portal-secondary { color: var(--portal-text-secondary) !important; }
.text-portal-muted { color: var(--portal-text-muted) !important; }
.bg-portal-surface { background: var(--portal-surface) !important; }
.bg-portal-elevated { background: var(--portal-surface-elevated) !important; }
.border-portal { border: 1px solid var(--portal-border) !important; }
.rounded-portal { border-radius: var(--portal-radius) !important; }

.skeleton-shimmer {
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0) 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==========================================================================
   Command Center — Phase 1-5 Additions
   ========================================================================== */

/* ---------- Command Palette ---------- */
.command-palette {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    justify-content: center;
    padding-top: 100px;
    z-index: 1301;
    pointer-events: none;
}
.command-palette > * { pointer-events: auto; }
.command-palette-dialog {
    width: 620px;
    max-height: 520px;
    border-radius: var(--portal-radius-lg);
    overflow: hidden;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.97) 0%, rgba(3, 7, 18, 0.98) 100%);
    backdrop-filter: blur(24px);
    border: 1px solid var(--portal-border-light);
    box-shadow: 0 24px 64px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255,255,255,0.05);
    animation: palette-enter 150ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes palette-enter {
    from { opacity: 0; transform: scale(0.96) translateY(-8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.command-palette-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 16px;
    font-weight: 500;
    color: var(--portal-text);
    font-family: 'Inter', sans-serif;
}
.command-palette-input::placeholder {
    color: var(--portal-text-muted);
}
.command-palette-section {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--portal-text-muted);
    padding: 10px 16px 6px;
}
.command-palette-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    border-radius: 8px;
    margin: 2px 8px;
    transition: all 120ms ease;
}
.command-palette-item:hover,
.command-palette-item.selected {
    background: rgba(59, 130, 246, 0.1);
}
.command-palette-item.selected {
    border: 1px solid rgba(59, 130, 246, 0.2);
}
.command-palette-item .item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}
.command-palette-item .item-icon.agents { background: rgba(139, 92, 246, 0.1); color: #a78bfa; }
.command-palette-item .item-icon.projects { background: rgba(34, 197, 94, 0.1); color: #4ade80; }
.command-palette-item .item-icon.workflows { background: rgba(59, 130, 246, 0.1); color: #60a5fa; }
.command-palette-item .item-icon.admin { background: rgba(239, 68, 68, 0.1); color: #f87171; }
.command-palette-item .item-icon.tools { background: rgba(245, 158, 11, 0.1); color: #fbbf24; }
.command-palette-item .item-icon.action { background: rgba(59, 130, 246, 0.15); color: var(--portal-primary); }
.command-palette-kbd {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--portal-border);
    color: var(--portal-text-muted);
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
}

/* ---------- Connection Health Indicator ---------- */
.connection-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    transition: all var(--portal-transition);
    cursor: default;
}
.connection-indicator.connected {
    background: rgba(34, 197, 94, 0.06);
    border: 1px solid rgba(34, 197, 94, 0.12);
}
.connection-indicator.reconnecting {
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.12);
}
.connection-indicator.disconnected {
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.12);
}
.connection-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
}
.connection-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    opacity: 0.3;
    animation: connection-ping 2s infinite;
}
.connection-dot.connected { background: #22c55e; color: #22c55e; }
.connection-dot.reconnecting { background: #f59e0b; color: #f59e0b; animation: pulse-dot 1s infinite; }
.connection-dot.disconnected { background: #ef4444; color: #ef4444; }
.connection-dot.disconnected::after { animation: none; }
@keyframes connection-ping {
    0% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.4); opacity: 0; }
    100% { transform: scale(1); opacity: 0; }
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ---------- Live Feed Panel ---------- */
.live-feed-rail {
    position: fixed;
    right: 0;
    top: 56px;
    bottom: 0;
    width: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 16px;
    gap: 6px;
    z-index: 100;
    cursor: pointer;
    transition: all var(--portal-transition);
}
.live-feed-rail:hover { background: rgba(255, 255, 255, 0.02); }
.live-feed-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    transition: all 300ms ease;
}
.live-feed-dot.success { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, 0.4); }
.live-feed-dot.warning { background: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, 0.4); }
.live-feed-dot.error { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.4); }
.live-feed-dot.info { background: #3b82f6; box-shadow: 0 0 6px rgba(59, 130, 246, 0.4); }
.live-feed-dot.neutral { background: #64748b; }

.live-feed-panel {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(3, 7, 18, 0.99) 100%);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--portal-border);
    height: 100%;
    display: flex;
    flex-direction: column;
}
.live-feed-item {
    display: flex;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 150ms ease;
}
.live-feed-item:hover {
    background: rgba(255, 255, 255, 0.02);
}
.live-feed-severity {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

/* ---------- Keyboard Shortcut Hints ---------- */
.kbd-hint {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--portal-text-muted);
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    line-height: 1.4;
}
.shortcut-help-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 24px;
}
.shortcut-help-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* ---------- Cost Preview ---------- */
.cost-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}
.cost-badge.low { background: rgba(34, 197, 94, 0.1); color: #4ade80; }
.cost-badge.medium { background: rgba(245, 158, 11, 0.1); color: #fbbf24; }
.cost-badge.high { background: rgba(239, 68, 68, 0.1); color: #f87171; }

/* ---------- Daily Brief ---------- */
.brief-section {
    padding: 16px;
    border-radius: var(--portal-radius);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    margin-bottom: 12px;
}
.brief-section h4 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--portal-text-secondary);
    margin-bottom: 10px;
}

/* ---------- Neural Office ---------- */
.neural-office-container {
    position: relative;
    width: 100%;
    border-radius: var(--portal-radius-lg);
    overflow: hidden;
    border: 1px solid var(--portal-border);
    background: #0a0e1a;
}
.neural-office-canvas {
    width: 100%;
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    cursor: grab;
}
.neural-office-canvas:active { cursor: grabbing; }
.neural-office-overlay {
    position: absolute;
    pointer-events: none;
    z-index: 10;
}
.neural-office-tooltip {
    position: absolute;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--portal-border-light);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 20;
    animation: tooltip-enter 150ms ease;
}
@keyframes tooltip-enter {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
.neural-office-minimap {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 160px;
    height: 100px;
    border-radius: 8px;
    background: rgba(3, 7, 18, 0.85);
    border: 1px solid var(--portal-border);
    overflow: hidden;
    pointer-events: auto;
}
.office-status-bubble {
    position: absolute;
    transform: translate(-50%, -100%);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    animation: bubble-float 2s ease-in-out infinite;
    pointer-events: none;
}
.office-status-bubble.active { background: rgba(34, 197, 94, 0.9); color: #fff; }
.office-status-bubble.waiting { background: rgba(245, 158, 11, 0.9); color: #fff; }
.office-status-bubble.error { background: rgba(239, 68, 68, 0.9); color: #fff; }
.office-status-bubble.idle { background: rgba(100, 116, 139, 0.7); color: #fff; }
@keyframes bubble-float {
    0%, 100% { transform: translate(-50%, -100%) translateY(0); }
    50% { transform: translate(-50%, -100%) translateY(-3px); }
}

/* Matrix spawn/despawn effect overlay */
.matrix-rain {
    position: absolute;
    pointer-events: none;
    overflow: hidden;
}
.matrix-column {
    position: absolute;
    width: 2px;
    animation: matrix-fall 0.4s linear forwards;
}
@keyframes matrix-fall {
    from { transform: translateY(-100%); opacity: 1; }
    to { transform: translateY(100%); opacity: 0; }
}

/* ---------- Agent Communication Graph ---------- */
.agent-comms-container {
    position: relative;
    width: 100%;
    min-height: 400px;
    border-radius: var(--portal-radius);
    overflow: hidden;
    background: radial-gradient(circle at center, rgba(15, 23, 42, 1) 0%, rgba(3, 7, 18, 1) 100%);
    border: 1px solid var(--portal-border);
}
.agent-comms-node {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: transform 200ms ease;
}
.agent-comms-node:hover { transform: scale(1.08); }
.agent-comms-node .node-ring {
    border-radius: 50%;
    padding: 3px;
    background: conic-gradient(from 0deg, var(--node-color) 0%, transparent 70%);
    animation: ring-rotate 3s linear infinite;
}
@keyframes ring-rotate {
    to { background: conic-gradient(from 360deg, var(--node-color) 0%, transparent 70%); }
}

/* ---------- Quality Gate Badge ---------- */
.quality-gate-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.quality-gate-badge.locked {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}
.quality-gate-badge.approved {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
}
.quality-gate-badge.rejected {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ---------- View Mode Toggle ---------- */
.view-mode-toggle {
    display: inline-flex;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--portal-border);
    overflow: hidden;
}
.view-mode-btn {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--portal-text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 200ms ease;
    display: flex;
    align-items: center;
    gap: 6px;
}
.view-mode-btn:hover { color: var(--portal-text); }
.view-mode-btn.active {
    background: rgba(59, 130, 246, 0.15);
    color: var(--portal-primary);
}
