body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 20px;
    background: #f5f7fa;
    color: #333;
}

h1 {
    margin-bottom: 10px;
}

section {
    background: #fff;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* STATUS TABLE */
.status-table {
    width: 100%;
    border-collapse: collapse;
}

.status-table th {
    text-align: left;
    padding: 10px;
    background: #f0f2f5;
    font-weight: 600;
    font-size: 14px;
}

.status-table td {
    padding: 10px;
    border-top: 1px solid #eee;
    font-size: 14px;
}

.status-table tr:hover {
    background: #fafafa;
}

.device-name {
    font-weight: 600;
}

.device-desc {
    font-size: 12px;
    color: #666;
}

/* ALERT BADGES */
.alert-badge {
    background: #ffebee;
    color: #c62828;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    display: inline-block;
}

.ok-badge {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* HISTORY CONTROLS */
.controls {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 10px;
}

#deviceContainer div {
    font-size: 13px;
}

/* CHART */
canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-wrapper {
    max-height: 550px;
}

#chart {
    height: 550px !important;
	width: 800px;
}

.device-name {
    font-weight: 600;
}

.device-desc {
    font-size: 0.85em;
    color: #666;
}

/* =========================
   MOBILE RESPONSIVE STYLES
   ========================= */
@media (max-width: 768px) {

    body {
        margin: 10px;
    }

    h1 {
        font-size: 1.4rem;
    }

    section {
        padding: 12px;
    }

    /* ---- STATUS TABLE → CARD VIEW ---- */
    .status-table,
    .status-table thead,
    .status-table tbody,
    .status-table th,
    .status-table td,
    .status-table tr {
        display: block;
        width: 100%;
    }

    .status-table thead {
        display: none; /* hide header row */
    }

    .status-table tr {
        background: #fff;
        border: 1px solid #eee;
        border-radius: 8px;
        margin-bottom: 12px;
        padding: 10px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    }

    .status-table td {
        border: none;
        padding: 6px 0;
        font-size: 14px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .status-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #666;
        margin-right: 10px;
        font-size: 12px;
    }

    .device-name {
        font-size: 15px;
    }

    .device-desc {
        margin-left: 12px;
        font-size: 12px;
    }

    /* ---- CONTROLS STACK ---- */
    .controls {
        flex-direction: column;
        gap: 10px;
    }

    #deviceContainer {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    /* ---- CHART ---- */
    .chart-wrapper {
        max-height: 280px;
    }

    #chart {
        height: 280px !important;
        width: 100% !important;
    }
}
