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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a1a;
    color: #e0e0e0;
    line-height: 1.6;
    padding: 40px 20px;
    transition: all 0.3s ease;
}

body.light-mode {
    background: #ffffff;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
}

.header-left h1 {
    font-size: 2.5rem;
    font-weight: 300;
    color: #4285f4;
    margin-bottom: 10px;
}

.header-left .subtitle {
    color: #888;
    font-weight: 300;
}

body.light-mode .header-left .subtitle {
    color: #666;
}

.header-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.theme-toggle, .refresh-status {
    background: #333;
    border: 1px solid #555;
    color: #e0e0e0;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

body.light-mode .theme-toggle,
body.light-mode .refresh-status {
    background: #f5f5f5;
    border: 1px solid #ddd;
    color: #333;
}

.theme-toggle:hover {
    background: #444;
    border-color: #666;
}

body.light-mode .theme-toggle:hover {
    background: #e5e5e5;
    border-color: #ccc;
}

.refresh-status {
    cursor: pointer;
    user-select: none;
}

.refresh-status.active {
    background: #4285f4;
    border-color: #4285f4;
    color: white;
}

.refresh-status:hover {
    background: #444;
    border-color: #666;
}

.refresh-status.active:hover {
    background: #3367d6;
}

body.light-mode .refresh-status:hover {
    background: #e5e5e5;
    border-color: #ccc;
}

.filters {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

select {
    padding: 8px 12px;
    border: 1px solid #666;
    border-radius: 4px;
    font-size: 14px;
    background: #444;
    color: #f5f5f5;
}

.light-mode select {
    border: 1px solid #ddd;
    background: white;
    color: #444;
}

option {
    color: #f5f5f5;
}

.light-mode option {
    color: #f5f5f5;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat {
    text-align: center;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 300;
    color: #4285f4;
    display: block;
}

.stat-label {
    color: #666;
    font-size: 14px;
    margin-top: 5px;
}

.section {
    margin-bottom: 40px;
}

.section h2 {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 20px;
    color: #333;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    font-weight: 500;
    color: #f5f5f5;
    background: #444;
}

.light-mode th {
    font-weight: 500;
    color: #666;
    background: #fafafa;
}

tr:hover {
    background: #666;
}

.light-mode tr:hover {
    background: #f9f9f9;
}

.device-row {
    cursor: pointer;
}

.device-details {
    display: none;
    background: #f9f9f9;
    padding: 20px;
    margin: 10px 0;
    border-radius: 4px;
}

.device-details.show {
    display: block;
}

.measurements-table {
    font-size: 12px;
    margin-top: 10px;
    background: #2a2a2a;
    border-radius: 4px;
    overflow: hidden;
}

body.light-mode .measurements-table {
    background: white;
}

.measurements-table th,
.measurements-table td {
    padding: 8px;
    border-bottom: 1px solid #333;
}

body.light-mode .measurements-table th,
body.light-mode .measurements-table td {
    border-bottom: 1px solid #eee;
}

.measurements-table th {
    background: #333;
    color: #bbb;
    font-weight: 500;
}

body.light-mode .measurements-table th {
    background: #fafafa;
    color: #666;
}

.measurements-table tr:hover {
    background: #333;
}

body.light-mode .measurements-table tr:hover {
    background: #f9f9f9;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-online { background: #4caf50; }
.status-warning { background: #ff9800; }
.status-offline { background: #f44336; }

.packet-loss-good { color: #4caf50; font-weight: 500; }
.packet-loss-warning { color: #ff9800; font-weight: 500; }
.packet-loss-bad { color: #f44336; font-weight: 500; }

.chart-container {
    height: 300px;
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
}

.loading {
    text-align: center;
    color: #666;
    padding: 40px;
}

@media (max-width: 768px) {
    .filters { flex-direction: column; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    h1 { font-size: 2rem; }
}