:root {
    --primary: #2ecc71;
    --secondary: #3498db;
    --warning: #e67e22;
    --bg: #f0f2f5;
    --card-bg: #ffffff;
    --text: #2c3e50;
    --shadow: 0 10px 30px rgba(0,0,0,0.08);
}

body { 
    font-family: 'Kanit', sans-serif; 
    background: var(--bg); 
    margin: 0; 
    padding: 0; 
    color: var(--text); 
}

nav {
    background: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.logo { font-size: 1.5rem; font-weight: 600; color: var(--primary); display: flex; align-items: center; gap: 10px; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Grid Layout */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 25px; margin-bottom: 30px; }

.card { 
    background: var(--card-bg); 
    border-radius: 24px; 
    padding: 30px; 
    box-shadow: var(--shadow); 
    transition: transform 0.3s ease;
    border: 1px solid rgba(255,255,255,0.3);
}

.card:hover { transform: translateY(-5px); }

/* Status Badges */
.status-badge {
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.online-bg { background: rgba(46, 204, 113, 0.15); color: #27ae60; }
.offline-bg { background: rgba(149, 165, 166, 0.15); color: #7f8c8d; }

/* Displays */
.moisture-display { display: flex; align-items: baseline; gap: 10px; margin: 20px 0; }
.val-number { 
    font-family: 'JetBrains Mono', monospace; 
    font-size: 4.5rem; 
    font-weight: 600; 
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pump-indicator {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 18px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}
.pump-on { background: rgba(52, 152, 219, 0.1); color: #3498db; border: 1px solid rgba(52, 152, 219, 0.2); }

.pulse { animation: pulse-animation 2s infinite; }
@keyframes pulse-animation {
    0% { box-shadow: 0 0 0 0px rgba(52, 152, 219, 0.4); }
    100% { box-shadow: 0 0 0 15px rgba(52, 152, 219, 0); }
}

/* Containers for Charts & Tables */
.content-box {
    background: white;
    border-radius: 24px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}
.header-icon { margin-bottom: 25px; font-weight: 600; font-size: 1.2rem; display: flex; align-items: center; gap: 10px; }

/* Table Section */
.table-wrapper { overflow-x: auto; max-height: 400px; border-radius: 12px; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { background: #f8f9fa; padding: 15px; border-bottom: 2px solid #eee; position: sticky; top: 0; }
td { padding: 12px 15px; border-bottom: 1px solid #eee; }
/* ปุ่มลบข้อมูล */
.btn-delete {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Kanit', sans-serif;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-delete:hover {
    background: #c0392b;
    transform: scale(1.05);
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}