:root {
    --bg-base: #050505;
    --glass-bg: rgba(20, 20, 22, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent: #5e6ad2;
    --accent-glow: rgba(94, 106, 210, 0.4);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a5;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Dynamic Mesh Background */
.background-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: 
        radial-gradient(circle at 15% 50%, rgba(94, 106, 210, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.1), transparent 25%);
    filter: blur(60px);
    animation: mesh-breathe 10s ease-in-out infinite alternate;
}

@keyframes mesh-breathe {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.1); opacity: 1; }
}

/* Nav */
.glass-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-dot {
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-glow);
}

.brand h1 {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 6px 12px;
    background: rgba(0,0,0,0.3);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.status-indicator.connected { background: var(--success); box-shadow: 0 0 8px var(--success); }
.status-indicator.disconnected { background: var(--danger); box-shadow: 0 0 8px var(--danger); }

/* Dashboard Layout */
.dashboard {
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Cards */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
}

/* Grid */
.telemetry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
}
.stat-value.highlight {
    color: var(--accent);
}

.stat-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Terminal Feed */
.activity-feed {
    display: flex;
    flex-direction: column;
    height: 50vh;
    min-height: 400px;
}

.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.feed-header h2 {
    font-size: 1rem;
    font-weight: 600;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s;
}
.btn-icon:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.1);
}

.terminal-window {
    flex: 1;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.terminal-line {
    padding: 4px 0;
    word-break: break-all;
    opacity: 0;
    animation: fade-in 0.3s forwards;
    border-bottom: 1px solid rgba(255,255,255,0.02);
}

@keyframes fade-in {
    to { opacity: 1; }
}

.terminal-line.system { color: var(--text-secondary); }
.terminal-line.g3-msg { color: var(--accent); }
.terminal-line.f8-msg { color: var(--success); }

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .dashboard {
        padding: 1rem;
    }
    .telemetry-grid {
        grid-template-columns: 1fr;
    }
    .activity-feed {
        height: 60vh;
    }
}
