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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* Login Page */
.login-page {
    background-color: #1a1a1a;
    background-image:
        /* Circuit trace grid — horizontal lines */
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 39px,
            rgba(255,255,255,0.04) 39px,
            rgba(255,255,255,0.04) 40px
        ),
        /* Circuit trace grid — vertical lines */
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 39px,
            rgba(255,255,255,0.04) 39px,
            rgba(255,255,255,0.04) 40px
        ),
        /* Subtle vignette overlay */
        radial-gradient(ellipse at center, #2a2a2a 0%, #111 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    position: relative;
}

/* Circuit node dots at grid intersections */
.login-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.12) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

.login-container {
    position: relative;
    z-index: 1;
    background: #f5f5f5;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    width: 100%;
    max-width: 420px;
    border-top: 3px solid #555;
}

.login-container h1 {
    color: #2d2d2d;
    text-align: center;
    margin-bottom: 10px;
    font-size: 1.7em;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.subtitle {
    text-align: center;
    color: #777;
    margin-bottom: 30px;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.error {
    background: #fce8e8;
    color: #7a1a1a;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 13px;
    border-left: 3px solid #c0392b;
}

.info {
    background: #e8e8e8;
    color: #555;
    padding: 10px;
    border-radius: 6px;
    margin-top: 20px;
    font-size: 12px;
    text-align: center;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 11px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #d0d0d0;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: #2d2d2d;
    transition: border-color 0.15s;
}

.form-group input:focus {
    outline: none;
    border-color: #555;
    background: #fff;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    border: none;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
    text-transform: uppercase;
}

.btn-primary {
    background: #2d2d2d;
    color: #f5f5f5;
    width: 100%;
}

.btn-primary:hover {
    background: #444;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}

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

.btn-secondary:hover {
    background: rgba(255,255,255,0.3);
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar h1 {
    font-size: 1.5em;
    margin: 0;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.connected { background-color: #4ade80; }
.status-dot.disconnected { background-color: #f87171; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.username {
    font-weight: 500;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab-button {
    background: white;
    border: 2px solid #e5e7eb;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-button:hover {
    border-color: #667eea;
    color: #667eea;
}

.tab-button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
}

.site-location {
    display: block;
    font-size: 11px;
    font-weight: 400;
    opacity: 0.8;
}

/* Site Content */
.site-content {
    display: none;
}

.site-content.active {
    display: block;
}

/* Controls */
.controls {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.controls label {
    font-weight: 600;
    color: #666;
}

.controls select {
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.controls select:focus {
    outline: none;
    border-color: #667eea;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.metric-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.metric-label {
    font-size: 0.9em;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.metric-value {
    font-size: 3em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.metric-unit {
    font-size: 1.2em;
    color: #9ca3af;
}

.metric-time {
    font-size: 0.8em;
    color: #9ca3af;
    margin-top: 10px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stat-card h4 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row span:first-child {
    color: #6b7280;
    font-weight: 500;
}

.stat-row span:last-child {
    color: #667eea;
    font-weight: 600;
}

/* Charts */
.chart-container {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.chart-container h3 {
    margin-bottom: 15px;
    color: #667eea;
}

canvas {
    max-height: 350px;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .nav-right {
        flex-direction: column;
        gap: 10px;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-button {
        width: 100%;
    }
    
    .metrics-grid, .stats-grid {
        grid-template-columns: 1fr;
    }
}
.chart-section-title {
    font-size: 1.1em;
    font-weight: 700;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 30px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
}
