body {
    font-family: Arial, sans-serif;
    background: #f4f6f8;
    margin: 0;
    padding: 0;
}

header {
    background: #1f2937;
    color: white;
    padding: 20px;
    text-align: center;
}

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

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.card h3 {
    margin-top: 0;
    color: #374151;
}

.value {
    font-size: 36px;
    font-weight: bold;
    margin: 15px 0;
}

.unit {
    color: #6b7280;
}

.status {
    margin-top: 30px;
    padding: 15px;
    background: white;
    border-radius: 10px;
}

.last-update {
    margin-top: 10px;
    padding: 15px;
    background: #c4c5c6;
    border-radius: 8px;
    font-size: 14px;
    color: #070202;
    text-align: left;
}

/* ============================= */
/* FILTER PERIODE */
/* ============================= */

.period-filter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 20px 30px 15px 30px;
}

.period-filter label {
    font-size: 14px;
    font-weight: 600;
    color: #555;
}

.period-filter select {
    padding: 9px 32px 9px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: 0.2s ease;
}

.period-filter select:hover {
    border-color: #999;
}

.period-filter select:focus {
    border-color: #555;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

/* ============================= */
/* GRAFIK */
/* ============================= */

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

.chart-card {
    background: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chart-card h2 {
    font-size: 16px;
    margin-bottom: 10px;
}

.chart-card canvas {
    max-height: 220px;
}

/* ============================= */
/* RESPONSIVE */
/* ============================= */

@media (max-width: 768px) {

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

}
/* ========================================
   RIWAYAT DATA SENSOR
======================================== */

.history-section {
    margin: 30px 20px;
    padding: 24px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.history-section h2 {
    margin: 0 0 20px;
    color: #1f2937;
    font-size: 20px;
}

.history-table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

#historyTable {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

#historyTable thead {
    background: #1e40af;
    color: #ffffff;
}

#historyTable th,
#historyTable td {
    padding: 13px 16px;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

#historyTable tbody tr:nth-child(even) {
    background: #f8fafc;
}

#historyTable tbody tr:hover {
    background: #eff6ff;
}

#historyTable tbody tr:last-child td {
    border-bottom: none;
}

@media (max-width: 768px) {
    .history-section {
        margin: 20px 10px;
        padding: 16px;
    }

    .history-section h2 {
        font-size: 18px;
    }

    #historyTable th,
    #historyTable td {
        padding: 10px 12px;
        font-size: 13px;
    }
}
/* Posisi tombol Export CSV */
#exportCsvBtn {
    display: block;
    margin: 15px auto;
    padding: 10px 20px;
    background-color: #1d4ed8;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#exportCsvBtn:hover {
    background-color: #677ec9;
}

/* ========================================
   SMART IRRIGATION - TAMBAHAN TAMPILAN
======================================== */

html {
    scroll-behavior: smooth;
}

body {
    color: #1f2937;
}

header {
    background: linear-gradient(135deg, #313ef6, #374fe8);
    padding: 28px 20px;
}

header h1 {
    margin: 0 0 10px;
}

header p {
    margin: 0;
    color: #dcfce7;
}

.section-heading {
    margin-bottom: 18px;
}

.section-heading h2 {
    margin-bottom: 6px;
    color: #f3f9f5;
}

.section-heading p {
    margin-top: 0;
    color: #6b7280;
    font-size: 14px;
}

.cards .card {
    border: 1px solid #e5e7eb;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cards .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.1);
}

.card .unit {
    font-size: 14px;
}

.status-value {
    font-size: 26px;
}

.recommendation-card {
    background: #ffffff;
    border-left: 5px solid #16a34a;
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
}

.recommendation-card h3 {
    margin-top: 0;
    color: #2b54e8;
}

.recommendation-card p {
    line-height: 1.6;
}

#device-status {
    margin-left: 6px;
}

#exportCsvBtn {
    background-color: #15803d;
}

#exportCsvBtn:hover {
    background-color: #166534;
}

@media (max-width: 768px) {
    header {
        padding: 22px 14px;
    }

    header h1 {
        font-size: 24px;
    }

    .status-value {
        font-size: 23px;
    }

    .recommendation-card {
        padding: 17px;
    }
}
css
/* Membuat teks header Smart Irrigation berwarna putih */
    header h1,
    header p,
    header .subtitle,
    header .eyebrow {
    color: #ffffff;
}
css
/* Teks header Smart Irrigation */
    header h1,
    header p,
    header .subtitle,
    header .eyebrow,
    .page-header h1,
    .page-header p,
    .page-header .subtitle,
    .page-header .eyebrow {
    color: #ffffff !important;
}
css
h1 {
    color: #ffffff !important;
}
css
/* Meratakan ketiga tulisan pada header */
    .main-content .topbar .eyebrow,
    .main-content .topbar h1,
    .main-content .topbar .page-subtitle {
    margin-left: 0;
    padding-left: 0;
    text-align: left;
}

/* Badge status pada tabel histori Smart Irrigation */
.status-normal,
.status-warning,
.status-critical,
.status-unknown {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

/* Kondisi normal */
.status-normal {
    color: #036428;
    background-color: #dcfce7;
    border: 1px solid #bbf7d0;
}

/* Tanah kering atau irigasi berjalan */
.status-warning {
    color: #92400e;
    background-color: #fef3c7;
    border: 1px solid #fde68a;
}

/* Air habis */
.status-critical {
    color: #730303;
    background-color: #fee2e2;
    border: 1px solid #fecaca;
}

/* Data belum lengkap */
.status-unknown {
    color: #475569;
    background-color: #f1f5f9;
    border: 1px solid #cbd5e1;
}

/* Area scroll khusus tabel histori Smart Irrigation */
.history-panel .table-scroll {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
    border-radius: 10px;
}

/* Header tabel tetap terlihat saat isi tabel digulir */
.history-panel #historyTable thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f1f5f9;
}

/* Lebar tabel tetap mengikuti isi kolom */
.history-panel #historyTable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

/* Jaga isi sel tetap rapi */
.history-panel #historyTable th,
.history-panel #historyTable td {
    vertical-align: middle;
}
