:root {
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --green: #27ae60;
    --yellow: #f1c40f;
    --red: #e74c3c;
    --blue: #3498db;
    --text-dark: #2c3e50;
    --border-light: #e1e4e8;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
    margin: 0;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
}

.point-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.card-header h2 {
    margin-top: 0;
    font-size: 1.4rem;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 10px;
}

.subtitle {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-weight: normal;
}

.parameters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.param-item {
    background: #fff;
    border: 1px solid var(--border-light);
    border-left: 6px solid var(--green);
    padding: 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 70px;
}

.param-item.active {
    background-color: #f8fbff;
    box-shadow: 0 0 0 2px var(--blue);
}

.param-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.param-label {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
}

.param-status-text {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: bold;
}

.param-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
}

.unit {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-left: 4px;
}

.border-green { border-left-color: var(--green) !important; }
.border-yellow { border-left-color: var(--yellow) !important; }
.border-red { border-left-color: var(--red) !important; }

button {
    padding: 10px 18px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    margin-left: 10px;
}

.btn-alert { background: var(--red); color: white; }
.btn-reset { background: var(--blue); color: white; }

.chart-container {
    height: 250px;
    margin-top: 10px;
}

.events-log {
    margin-top: 30px;
    background: #1e1e1e;
    color: #dcdcdc;
    border-radius: 8px;
    padding: 15px;
}

.log-content {
    height: 120px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.log-entry { margin-bottom: 5px; }
.log-time { color: #569cd6; }

.log-entry.red { color: #ff6b6b; font-weight: bold; }
.log-entry.yellow { color: #f1c40f; }
.log-entry.info { color: #569cd6; }

.border-red {
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
    100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}