/* ==========================================================================
   ZENTOX AI - Autonomous Multi-Agent Command Center
   Design System & Styling
   ========================================================================== */

:root {
    --bg-primary: #08090e;
    --bg-secondary: #0d101a;
    --bg-surface: #141824;
    --bg-surface-elevated: #1b2133;
    --bg-glass: rgba(18, 23, 37, 0.72);
    --bg-glass-hover: rgba(28, 35, 56, 0.85);

    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(139, 92, 246, 0.35);
    --border-cyan: rgba(6, 182, 212, 0.35);
    --border-focus: rgba(139, 92, 246, 0.6);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent-purple: #8b5cf6;
    --accent-purple-light: #a78bfa;
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;

    --gradient-brand: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
    --gradient-card: linear-gradient(180deg, rgba(25, 32, 51, 0.6) 0%, rgba(13, 16, 26, 0.8) 100%);
    --gradient-glow: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, rgba(0, 0, 0, 0) 70%);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px rgba(139, 92, 246, 0.25);
    --shadow-cyan-glow: 0 0 25px rgba(6, 182, 212, 0.25);

    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --sidebar-width: 270px;
    --topbar-height: 70px;
    --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Ambient Canvas */
#neural-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 0.65;
}

/* Typography Utilities */
h1, h2, h3, h4, h5 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.gradient-text {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-cyan { color: var(--accent-cyan) !important; }
.text-emerald { color: var(--accent-emerald) !important; }
.text-purple { color: var(--accent-purple) !important; }
.text-amber { color: var(--accent-amber) !important; }

/* Layout Structure */
.app-layout {
    position: relative;
    z-index: 1;
    display: flex;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 60%),
                radial-gradient(circle at 20% 80%, rgba(6, 182, 212, 0.06) 0%, transparent 50%);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100%;
    background: rgba(10, 12, 19, 0.85);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    flex-shrink: 0;
    z-index: 10;
    transition: transform var(--transition-smooth);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 4px 8px 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.brand-logo {
    position: relative;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(6, 182, 212, 0.25));
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--accent-cyan);
    box-shadow: var(--shadow-glow);
}

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--accent-purple);
    animation: pulseRing 3s cubic-bezier(0.24, 0, 0.38, 1) infinite;
    opacity: 0.5;
}

@keyframes pulseRing {
    0% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.15); opacity: 0; }
    100% { transform: scale(1); opacity: 0; }
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    display: block;
}

.brand-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Nav Menu */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 24px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
    position: relative;
}

.nav-item i {
    font-size: 1.25rem;
    transition: transform var(--transition-fast);
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
    color: var(--text-primary);
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.15) 0%, rgba(6, 182, 212, 0.08) 100%);
    border: 1px solid var(--border-accent);
    box-shadow: inset 0 0 16px rgba(139, 92, 246, 0.1);
}

.nav-item.active i {
    color: var(--accent-cyan);
    transform: scale(1.08);
}

.nav-item .badge {
    margin-left: auto;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 2px 7px;
    border-radius: var(--radius-full);
}

.live-dot {
    margin-left: auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-emerald);
    box-shadow: 0 0 8px var(--accent-emerald);
}

.live-dot.pulse {
    animation: liveBlink 1.5s infinite;
}

@keyframes liveBlink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

/* Sidebar Status Card */
.sidebar-status-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.status-indicator.online {
    background: var(--accent-emerald);
    box-shadow: 0 0 6px var(--accent-emerald);
}

.metric-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.metric-val {
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.audio-toggle-container {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
}

.btn-icon-subtle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon-subtle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

/* Main Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background: rgba(10, 12, 19, 0.65);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    flex-shrink: 0;
    z-index: 5;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
}

.header-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.crumb-current {
    color: var(--text-primary);
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.token-status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-family: var(--font-mono);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-brand);
    color: #fff;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
    filter: brightness(1.1);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-subtle {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-subtle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-xs {
    padding: 4px 10px;
    font-size: 0.78rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Glass Card */
.card-glass {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* Viewport & Tab Switcher */
.content-viewport {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    position: relative;
}

/* Custom Scrollbars */
.content-viewport::-webkit-scrollbar,
.terminal-body::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.content-viewport::-webkit-scrollbar-thumb,
.terminal-body::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
}

.content-viewport::-webkit-scrollbar-thumb:hover,
.terminal-body::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.4);
}

.tab-view {
    display: none;
    animation: fadeIn 0.25s ease-out;
}

.tab-view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.section-header h2 {
    font-size: 1.8rem;
    margin-bottom: 6px;
}

.section-header p {
    color: var(--text-secondary);
    max-width: 680px;
}

/* ==========================================================================
   VIEW 1: AGENT ROSTER (HUB)
   ========================================================================== */

.hero-banner {
    background: linear-gradient(135deg, rgba(20, 26, 43, 0.8) 0%, rgba(13, 16, 26, 0.95) 100%);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-lg);
    padding: 36px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-glow);
}

.hero-banner::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    max-width: 620px;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid var(--border-accent);
    color: var(--accent-purple-light);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    margin-bottom: 16px;
}

.hero-heading {
    font-size: 2.3rem;
    line-height: 1.15;
    margin-bottom: 14px;
}

.hero-subtext {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.hero-actions {
    display: flex;
    gap: 14px;
}

.hero-stats {
    display: flex;
    gap: 20px;
    z-index: 1;
}

.stat-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    text-align: center;
    min-width: 120px;
    backdrop-filter: blur(10px);
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.filter-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-chip {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.filter-chip.active {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--accent-purple);
    color: var(--text-primary);
}

.search-box {
    position: relative;
    width: 280px;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
}

.search-box input {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 9px 16px 9px 38px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.88rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.search-box input:focus {
    border-color: var(--accent-purple);
}

/* Agents Grid */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 22px;
}

.agent-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.agent-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-accent);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(139, 92, 246, 0.15);
}

.agent-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.avatar-lg {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(6, 182, 212, 0.15));
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}

.agent-main-meta {
    flex: 1;
}

.agent-main-meta h4 {
    font-size: 1.15rem;
    margin-bottom: 3px;
}

.agent-badge {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
}

.agent-desc {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
    margin-bottom: 16px;
    flex: 1;
}

.agent-model-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    width: fit-content;
}

.agent-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
}

.tool-tag {
    font-size: 0.72rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.agent-card-actions {
    display: flex;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   VIEW 2: SWARM CONTROL (MISSION RUNNER)
   ========================================================================== */

.mission-presets {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.preset-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.preset-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.preset-btn:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--accent-purple);
    color: var(--text-primary);
}

.swarm-workspace {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 24px;
    height: calc(100vh - 240px);
    min-height: 550px;
}

.swarm-dispatch-panel {
    padding: 24px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.panel-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
}

.tag-accent {
    font-size: 0.72rem;
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.1);
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

/* Form Controls */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group textarea,
.form-group input[type="text"] {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    outline: none;
    resize: vertical;
    transition: border-color var(--transition-fast);
}

.form-group textarea:focus,
.form-group input[type="text"]:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.form-row {
    display: flex;
    gap: 14px;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.custom-select {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.86rem;
    outline: none;
    cursor: pointer;
}

.custom-select:focus {
    border-color: var(--accent-purple);
}

.agent-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 4px;
}

.agent-select-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.agent-select-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.agent-select-item input[type="checkbox"] {
    accent-color: var(--accent-purple);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.agent-select-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Swarm Terminal */
.swarm-terminal-panel {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #0a0c14;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.terminal-header {
    background: #0f121d;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
}

.terminal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.terminal-actions {
    display: flex;
    gap: 8px;
}

.terminal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.terminal-placeholder {
    margin: auto;
    text-align: center;
    max-width: 320px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.1);
    margin-bottom: 12px;
}

.terminal-placeholder h4 {
    color: var(--text-secondary);
    margin-bottom: 6px;
}

/* Terminal Log Entry Styles */
.log-step {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
    animation: slideInLog 0.25s ease-out;
}

@keyframes slideInLog {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.log-step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.78rem;
}

.log-agent-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.log-badge-action {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.log-timestamp {
    color: var(--text-muted);
}

.log-thought {
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 8px;
}

.log-code-box {
    background: #06070a;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-top: 8px;
    overflow-x: auto;
    color: #38bdf8;
    font-size: 0.8rem;
}

.log-tool-exec {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-amber);
    font-size: 0.78rem;
    margin-top: 6px;
}

.mission-progress-container {
    background: #0f121d;
    padding: 12px 20px;
    border-top: 1px solid var(--border-subtle);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.progress-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-brand);
    transition: width 0.3s ease;
}

/* ==========================================================================
   VIEW 3: AGENT ARENA & CHAT
   ========================================================================== */

.arena-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    height: calc(100vh - 160px);
}

.arena-sidebar {
    padding: 18px;
    display: flex;
    flex-direction: column;
}

.arena-sidebar-header {
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
}

.arena-sidebar-header h3 {
    font-size: 1.05rem;
}

.arena-sidebar-header p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.arena-target-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    flex: 1;
}

.arena-target-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
}

.arena-target-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.arena-target-btn.active {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--border-accent);
    color: var(--text-primary);
}

.target-meta {
    flex: 1;
    overflow: hidden;
}

.target-name {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.target-role {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Chat Deck */
.chat-deck {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.active-agent-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-sm {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(6, 182, 212, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.agent-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.agent-title-row .agent-name {
    font-weight: 700;
    font-size: 1rem;
}

.tag-role {
    font-size: 0.7rem;
    color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.1);
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
}

.agent-desc-snippet {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.chat-bubble {
    display: flex;
    gap: 14px;
    max-width: 85%;
    animation: fadeIn 0.2s ease-out;
}

.chat-bubble.user-msg {
    margin-left: auto;
    flex-direction: row-reverse;
}

.bubble-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.bubble-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    font-size: 0.92rem;
    line-height: 1.6;
    color: #e2e8f0;
}

.chat-bubble.user-msg .bubble-content {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(6, 182, 212, 0.15));
    border-color: var(--border-accent);
}

.reasoning-box {
    margin-bottom: 12px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.reasoning-header {
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.reasoning-text {
    padding: 10px 12px;
    font-size: 0.8rem;
    color: #94a3b8;
    font-family: var(--font-mono);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* Chat Input Bar */
.chat-input-bar {
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border-subtle);
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    transition: border-color var(--transition-fast);
}

.input-wrapper:focus-within {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.input-wrapper textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.92rem;
    outline: none;
    resize: none;
    max-height: 120px;
}

.send-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--gradient-brand);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.send-btn:hover {
    transform: scale(1.05);
}

.quick-prompts-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
}

.qp-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.qp-chip {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.qp-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   VIEW 4: AGENT FORGE
   ========================================================================== */

.forge-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
}

.forge-form-panel {
    padding: 30px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.tool-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 0.86rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tool-checkbox:hover {
    background: rgba(255, 255, 255, 0.05);
}

.tool-checkbox input {
    accent-color: var(--accent-purple);
}

.forge-preview-panel h3 {
    margin-bottom: 16px;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.preview-card {
    border: 1.5px solid var(--accent-purple);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.2);
    background: linear-gradient(180deg, rgba(20, 26, 43, 0.9) 0%, rgba(13, 16, 26, 0.95) 100%);
}

/* ==========================================================================
   VIEW 5: SWARM TELEMETRY & ANALYTICS
   ========================================================================== */

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.analytics-card {
    padding: 22px;
}

.card-metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.metric-title {
    font-size: 0.84rem;
    color: var(--text-secondary);
}

.card-metric-header i {
    font-size: 1.3rem;
}

.metric-big-num {
    font-size: 2.2rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 8px;
}

.metric-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
}

.metric-trend.positive { color: var(--accent-emerald); }
.metric-trend.neutral { color: var(--text-muted); }

.telemetry-split {
    display: flex;
    gap: 24px;
}

.telemetry-panel {
    padding: 24px;
}

.telemetry-panel h3 {
    font-size: 1.15rem;
    margin-bottom: 20px;
}

.utilization-bars {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.util-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.util-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.84rem;
}

.util-name { font-weight: 500; }
.util-val { font-family: var(--font-mono); color: var(--accent-cyan); }

.util-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.util-fill {
    height: 100%;
    background: var(--gradient-brand);
    border-radius: 4px;
}

.health-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.health-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
}

.health-badge {
    font-size: 0.72rem;
    font-family: var(--font-mono);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.health-badge.good {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ==========================================================================
   RESPONSIVE QUERIES
   ========================================================================== */

@media (max-width: 1024px) {
    .analytics-grid { grid-template-columns: repeat(2, 1fr); }
    .swarm-workspace { grid-template-columns: 1fr; height: auto; }
    .arena-container { grid-template-columns: 1fr; height: auto; }
    .arena-sidebar { max-height: 200px; }
    .telemetry-split { flex-direction: column; }
    .forge-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .app-layout { flex-direction: column; }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .mobile-menu-btn { display: block; }
    .hero-banner { flex-direction: column; align-items: flex-start; gap: 24px; }
    .hero-stats { width: 100%; justify-content: space-between; }
    .stat-box { flex: 1; }
    .topbar { padding: 0 16px; }
    .content-viewport { padding: 16px; }
    .analytics-grid { grid-template-columns: 1fr; }
}
