:root {
    --bg-primary: #0b0f19;
    --bg-secondary: #131a2a;
    --bg-card: #1a2332;
    --border-light: #2a3647;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-yellow: #f59e0b;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.2rem;
}
.nav-logo { width: 32px; height: 32px; }
.nav-menu { display: flex; list-style: none; gap: 32px; }
.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.nav-link:hover, .nav-link.active { color: var(--accent-blue); }
.nav-status {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    padding: 8px 16px;
    border-radius: 40px;
    font-size: 0.9rem;
    border: 1px solid var(--border-light);
}
.status-indicator { width: 10px; height: 10px; border-radius: 50%; }
.status-indicator.online { background: var(--accent-green); box-shadow: 0 0 8px var(--accent-green); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }

/* Dashboard Layout */
.dashboard-container { max-width: 1400px; margin: 0 auto; padding: 32px 24px; width: 100%; flex: 1; }
.dashboard-header { margin-bottom: 40px; }
.dashboard-header h1 { font-size: 2.2rem; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 8px; }
.subtitle { color: var(--text-secondary); font-size: 1.1rem; margin-bottom: 16px; }
.connection-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 8px 18px;
    border-radius: 40px;
    font-size: 0.9rem;
    color: var(--accent-green);
}
.pulse { width: 8px; height: 8px; background: var(--accent-green); border-radius: 50%; animation: pulse 1.5s infinite; }

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}
.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    gap: 16px;
    transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--accent-blue); }
.stat-icon { font-size: 2.5rem; line-height: 1; }
.stat-content { flex: 1; }
.stat-label { color: var(--text-secondary); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 2.5rem; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.unit { font-size: 1rem; font-weight: 400; color: var(--text-secondary); margin-left: 4px; }
.stat-meta { margin-top: 8px; font-size: 0.85rem; color: var(--text-secondary); }

/* Charts */
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 32px; }
.chart-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 24px;
}
.chart-card h2 { font-size: 1.2rem; font-weight: 500; margin-bottom: 20px; color: var(--text-primary); }
.chart-wrapper { height: 240px; position: relative; }

/* Process Panel */
.panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 24px;
}
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.panel-header h2 { font-size: 1.2rem; font-weight: 500; }
.badge {
    background: var(--bg-card);
    padding: 6px 14px;
    border-radius: 40px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}
.process-table { width: 100%; border-collapse: collapse; }
.process-table th { text-align: left; padding: 12px 16px; color: var(--text-secondary); font-weight: 500; border-bottom: 1px solid var(--border-light); }
.process-table td { padding: 12px 16px; border-bottom: 1px solid #1e293b; }
.process-table tr:last-child td { border-bottom: none; }

/* About Page */
.page-container { max-width: 1000px; margin: 0 auto; padding: 48px 24px; flex: 1; }
.about-header { text-align: center; margin-bottom: 48px; }
.profile-img { width: 140px; height: 140px; border-radius: 50%; border: 3px solid var(--accent-blue); margin-bottom: 24px; }
.tagline { font-size: 1.3rem; color: var(--text-secondary); margin: 8px 0 16px; }
.social-links { color: var(--text-secondary); }
.social-link { color: var(--accent-blue); text-decoration: none; margin: 0 8px; }
.about-section { margin-bottom: 40px; }
.about-section h2 { font-size: 1.5rem; margin-bottom: 20px; border-bottom: 1px solid var(--border-light); padding-bottom: 12px; }
.about-section p { margin-bottom: 16px; color: var(--text-secondary); }

/* 404 Page */
.error-page { display: flex; align-items: center; justify-content: center; }
.error-container { text-align: center; max-width: 600px; padding: 48px; }
.error-code { font-size: 8rem; font-weight: 700; color: var(--accent-blue); line-height: 1; }
.error-container h1 { font-size: 2rem; margin: 16px 0; }
.error-container p { color: var(--text-secondary); margin-bottom: 32px; }
.error-actions { display: flex; gap: 16px; justify-content: center; margin-bottom: 24px; }
.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}
.btn-primary { background: var(--accent-blue); color: white; }
.btn-primary:hover { background: #2563eb; }
.btn-secondary { background: transparent; border: 1px solid var(--border-light); color: var(--text-primary); }
.btn-secondary:hover { background: var(--bg-card); }

/* Footer */
.footer {
    margin-top: auto;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    padding: 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.footer a { color: var(--accent-blue); text-decoration: none; }

/* Responsive */
@media (max-width: 1000px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-row { grid-template-columns: 1fr; }
    .nav-menu { display: none; } /* simplified for mobile; could add hamburger later */
}
@media (max-width: 600px) {
    .stats-grid { grid-template-columns: 1fr; }
    .dashboard-header h1 { font-size: 1.8rem; }
}