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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.3);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

h1 {
    color: #667eea;
    font-size: 2em;
}

h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
}

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

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-success {
    background: #4caf50;
    color: white;
}

.btn-success:hover {
    background: #45a049;
}

.btn-warning {
    background: #ff9800;
    color: white;
}

.btn-warning:hover {
    background: #e68900;
}

.status {
    padding: 8px 16px;
    border-radius: 5px;
    font-weight: bold;
    background: #f44336;
    color: white;
}

.status.active {
    background: #4caf50;
}

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

.status-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 10px;
    color: white;
    text-align: center;
}

.status-card h3 {
    font-size: 14px;
    margin-bottom: 10px;
    opacity: 0.9;
    color: white;
}

.status-card .value {
    font-size: 24px;
    font-weight: bold;
}

.settings, .charts, .history, .test-section, .logs-section {
    margin-bottom: 40px;
}

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

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input,
.form-group select {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    transition: border 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.chart-container {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
}

.chart-container canvas {
    max-height: 400px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

table thead {
    background: #667eea;
    color: white;
}

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

table tbody tr:hover {
    background: #f5f5f5;
}

.no-data {
    text-align: center;
    color: #999;
    font-style: italic;
}

.test-result {
    margin-top: 15px;
    padding: 15px;
    border-radius: 5px;
    display: none;
}

.test-result.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.test-result.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.logs-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.logs-controls label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.log-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.log-filter label {
    font-weight: bold;
    color: #555;
}

.log-filter select {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    background: white;
    transition: border 0.3s;
}

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

.logs-container {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 15px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    max-height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.logs-container .log-line {
    padding: 2px 0;
    border-bottom: 1px solid #333;
}

.logs-container .log-line.info {
    color: #4ec9b0;
}

.logs-container .log-line.warning {
    color: #dcdcaa;
}

.logs-container .log-line.error {
    color: #f48771;
}

.logs-container .log-line.debug {
    color: #569cd6;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #da190b;
}

@media (max-width: 768px) {
    .charts {
        grid-template-columns: 1fr;
    }

    .status-header {
        grid-template-columns: 1fr;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }
}
