:root {
    --primary-green: #14532d;
    --accent-emerald: #10b981;
    --accent-glow: rgba(16, 185, 129, 0.35);
    --bg-surface: #f3f6f4;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
}

body {
    background-color: var(--bg-surface);
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Navbar Modern */
.navbar-jagabawang {
    background: linear-gradient(135deg, #064e3b 0%, #14532d 100%);
    padding: 0.9rem 0;
    box-shadow: 0 4px 20px rgba(6, 78, 59, 0.18);
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.status-pill {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ecfdf5;
    padding: 0.45rem 0.9rem;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 500;
}

.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #34d399;
    border-radius: 50%;
    margin-right: 6px;
    box-shadow: 0 0 0 rgba(52, 211, 153, 0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* Card Desain */
.glass-card {
    background: var(--card-bg);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Frame Kamera */
.cam-frame {
    position: relative;
    width: 100%;
    height: 400px;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cam-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.cam-frame img:hover {
    transform: scale(1.015);
}

.cam-overlay-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    color: #f8fafc;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

/* Panel Kontrol Relay LED */
.control-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    transition: all 0.3s ease;
}

.control-box.active-glow {
    background: #ecfdf5;
    border-color: #6ee7b7;
    box-shadow: 0 0 18px var(--accent-glow);
}

.btn-relay {
    min-width: 145px;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
    border: none;
    transition: all 0.25s ease;
}

.btn-relay-on {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.btn-relay-on:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #ffffff;
}

.btn-relay-off {
    background: #e2e8f0;
    color: #475569;
}

.btn-relay-off:hover {
    background: #cbd5e1;
    color: #1e293b;
}

/* Kartu Metric Sensor */
.metric-card {
    padding: 1.15rem;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.03);
    position: relative;
    overflow: hidden;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.metric-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.icon-temp { background: #fee2e2; color: #dc2626; }
.icon-hum  { background: #dbeafe; color: #2563eb; }
.icon-ldr  { background: #fef3c7; color: #d97706; }
.icon-volt { background: #dcfce7; color: #16a34a; }

.metric-value {
    font-size: 1.65rem;
    font-weight: 800;
    margin: 0.4rem 0 0.15rem;
    color: #0f172a;
}

.metric-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Tabel Riwayat */
.table-modern thead th {
    background-color: #f8fafc;
    color: #475569;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.85rem 1rem;
}

.table-modern tbody td {
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f5f9;
}

.thumb-preview {
    width: 68px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.thumb-preview:hover {
    transform: scale(1.08);
}