:root{--bg:#f2f5fb;--dark:#0a234b;--navy:#102c58;--ink:#192b47;--muted:#8190a8;--line:#e5eaf3;--blue:#3764f3;--teal:#04b6af;--purple:#805ae7;--shadow:0 6px 26px rgba(21,40,78,.055);--radius:18px}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;font-size:14px;line-height:1.5}button,select{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.42}button:focus-visible,select:focus-visible,input:focus-visible{outline:3px solid #85a9fc;outline-offset:3px}.screen-reader{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}.site-shell{max-width:1920px;margin:0 auto}
.site-header{min-height:110px;background:linear-gradient(112deg,#071d40,#123a77 58%,#165790);display:flex;align-items:center;justify-content:space-between;gap:25px;padding:20px max(42px,calc((100vw - 1430px)/2));color:#fff;box-shadow:0 5px 22px rgba(15,45,90,.11)}.brand-wrap{display:flex;align-items:center;gap:16px}.brand-icon{width:55px;height:55px;display:grid;place-items:center;border-radius:15px;background:linear-gradient(155deg,#4188fb,#18cbcb);border:1px solid #8fcff43d;box-shadow:0 10px 22px rgba(0,24,60,.22)}.brand-icon svg{width:38px;height:38px}.brand-line{font-size:25px;letter-spacing:-1px;line-height:1.15;font-weight:790}.brand-line>span:first-child{color:#78dbeb}.brand-tag{display:inline-block;padding:3px 6px;font-size:10px;color:#d5e7fd;background:#ffffff24;border:1px solid #ffffff30;letter-spacing:.2px;vertical-align:middle;border-radius:6px;margin-left:5px}.brand-sub{font-size:12px;letter-spacing:.15px;color:#becfe9;margin-top:6px}.header-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.mode-badge{padding:8px 14px;background:#ffffff20;border:1px solid #ffffff39;border-radius:30px;font-size:12px;font-weight:700;white-space:nowrap}.mode-badge::before{content:"";display:inline-block;width:7px;height:7px;background:#b6c7da;border-radius:50%;margin-right:8px}.mode-badge.live::before{background:#56eabf;box-shadow:0 0 0 3px #56eabf28}.mode-badge.demo::before{background:#fac36d}.mode-badge.error::before{background:#ff9f9f}.button{border:1px solid transparent;border-radius:9px;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:10px 15px;font-size:12px;font-weight:740;white-space:nowrap;transition:background .17s,transform .17s}.button:active{transform:translateY(1px)}.button svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.button-light{background:#fff;color:#26436b}.button-light:hover{background:#e6f0ff}.button-outline{color:white;background:#ffffff13;border-color:#ffffff50}.button-outline:hover{background:#ffffff25}.button-primary{color:white;background:#3467ed;box-shadow:0 5px 12px #3764f322}.button-primary:hover{background:#2055dc}.button-simple{background:#f1f5fd;border-color:#e0e7f4;color:#496385}.button-simple:hover{background:#e7efff}
.main-content{max-width:1498px;margin:0 auto;padding:32px 34px 38px}.welcome-row{display:flex;justify-content:space-between;align-items:end;gap:24px;margin-bottom:22px}.overline{font-size:10px;font-weight:800;letter-spacing:1.8px;color:#6583af}.welcome-row h1{font-size:28px;line-height:1.15;margin:7px 0 8px;letter-spacing:-.9px;color:#16345f}.welcome-row p{margin:0;color:#8290a5;font-size:13px}.date-chip{font-size:12px;font-weight:700;background:#fff;border:1px solid var(--line);box-shadow:var(--shadow);border-radius:10px;color:#586b88;padding:11px 16px;white-space:nowrap}.notice{display:flex;align-items:center;gap:10px;padding:11px 15px;margin-bottom:21px;border-radius:11px;font-size:12px;font-weight:550}.notice-info{background:#e8f1ff;color:#376092;border:1px solid #d6e8ff}.notice-demo{background:#fff7e8;color:#946a26;border:1px solid #f4e4c6}.notice-error{background:#fff0f0;color:#9b4949;border:1px solid #f2d5d5}.notice-dot{width:9px;height:9px;border-radius:50%;background:#4185e4;flex:none}.notice-demo .notice-dot{background:#dda341}.notice-error .notice-dot{background:#d26161}#noticeText{flex:1}.notice button{border:0;background:transparent;color:inherit;font-size:20px;line-height:1;opacity:.7;padding:0 3px}
.overview-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:17px;margin-bottom:20px}.overview-card{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:20px 22px;box-shadow:var(--shadow);min-height:162px}.overview-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:17px;gap:8px}.overview-icon{display:grid;place-items:center;width:35px;height:35px;border-radius:10px;font-size:21px;font-weight:650}.overview-icon.indigo{color:#466bf3;background:#e9efff}.overview-icon.blue{color:#3b84eb;background:#eaf5ff}.overview-icon.teal{color:#11aba9;background:#e8f9f8}.overview-icon.purple{color:#8756de;background:#f2ecff}.card-hint{color:#adb9ca;font-size:9px;letter-spacing:1.1px;font-weight:800}.kpi-label{font-size:12px;color:#72849c;font-weight:650}.kpi-value{font-size:29px;font-weight:800;color:#1d355d;letter-spacing:-.8px;line-height:1.2;margin:8px 0 6px;overflow-wrap:anywhere}.kpi-foot{font-size:11px;color:#9ba8ba}.state-kpi{display:flex;align-items:center;gap:10px;font-size:22px;letter-spacing:-.3px}.state-dot{width:11px;height:11px;border-radius:50%;background:#b7c1cf;flex:none}.state-dot.online{background:#1dc995;box-shadow:0 0 0 4px #21c59f1a}.state-dot.offline{background:#f1a64b}.state-dot.demo{background:#8b95b1}
.sensor-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin-bottom:20px}.sensor-panel{color:white;border-radius:19px;padding:24px 26px 22px;position:relative;overflow:hidden;box-shadow:0 11px 27px rgba(24,52,114,.13);min-height:327px}.sensor-panel:after{content:"";position:absolute;right:-62px;top:-70px;width:205px;height:205px;border-radius:50%;border:1px solid #ffffff28;box-shadow:0 0 0 37px #ffffff09,0 0 0 72px #ffffff08;pointer-events:none}.panel-load{background:linear-gradient(136deg,#3865e1,#5c49d0)}.panel-water{background:linear-gradient(136deg,#089eb3,#0a70b4)}.panel-atmos{background:linear-gradient(133deg,#7547cf,#a44db8)}.sensor-heading{display:flex;align-items:center;justify-content:space-between;position:relative;z-index:1}.sensor-icon{height:39px;width:39px;display:grid;place-items:center;background:#ffffff2a;border:1px solid #ffffff22;border-radius:11px;color:white;font-size:23px}.panel-eyebrow{font-size:10px;letter-spacing:1.1px;font-weight:760;color:#ffffffb0}.sensor-name{font-size:20px;font-weight:770;margin-top:19px;letter-spacing:-.5px}.sensor-desc{font-size:11px;margin-top:3px;color:#eaf0ffbf;min-height:17px}.primary-readout{display:flex;align-items:baseline;gap:10px;margin-top:22px;line-height:1.1;font-size:40px;font-weight:800;letter-spacing:-1.25px;font-variant-numeric:tabular-nums}.primary-readout small{font-size:17px;font-weight:620;letter-spacing:0;color:#f3f8ffdb}.secondary-readout{font-size:12px;color:#e7efffde;margin-top:12px;min-height:21px}.secondary-readout b{color:#fff}.reading-sep{margin:0 6px;opacity:.6}.meter-track{height:7px;border-radius:20px;overflow:hidden;background:#ffffff40;margin-top:21px}.meter-fill{height:100%;width:0;background:#ffffffdd;border-radius:20px;transition:width .5s}.meter-caption{display:flex;justify-content:space-between;gap:5px;color:#ffffffc4;font-size:10px;margin-top:8px}.meter-caption b{color:#fff}.sensor-divider{height:1px;background:#ffffff32;margin:18px 0 14px}.triplet{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.triplet>div:not(:first-child){border-left:1px solid #ffffff28;padding-left:13px}.triplet small{display:block;color:#e4e9ffba;font-size:10px}.triplet b{display:block;font-size:12px;white-space:nowrap;margin-top:3px;font-variant-numeric:tabular-nums}.split-metrics{display:grid;grid-template-columns:1.1fr .9fr;gap:11px;margin-top:24px}.split-metrics>div+div{border-left:1px solid #ffffff42;padding-left:15px}.split-metrics small{font-size:10px;color:#ecdeffc4;font-weight:740;letter-spacing:.6px}.split-metrics strong{font-size:29px;letter-spacing:-.5px;line-height:1.5;font-variant-numeric:tabular-nums}.split-metrics em{font-size:11px;font-style:normal;margin-left:5px;color:#f0e1fbd6}.small-info{margin-top:11px;font-size:11px;color:#ffffffd1}.small-info span{opacity:.6;margin:0 5px}
.chart-panel,.history-panel{background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden;margin-bottom:20px}.section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:23px 26px 17px}.title-with-icon{display:flex;gap:10px;align-items:center}.title-icon{display:grid;place-items:center;width:30px;height:30px;border-radius:8px;color:#496ef3;background:#eef2ff;font-size:18px;font-weight:800}.section-head h2{font-size:17px;line-height:1.2;letter-spacing:-.3px;color:#193763;margin:0;font-weight:770}.section-head p{font-size:12px;color:#8c9bb0;margin:7px 0 0 40px}.chart-tools,.table-controls{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.chart-tools select{min-width:113px;max-width:210px;cursor:pointer;border:1px solid #e2e9f3;border-radius:9px;color:#44617e;font-size:12px;font-weight:650;background:#f8faff;padding:10px 12px}.chart-legend{display:flex;align-items:center;gap:9px;color:#6c7f9d;padding:1px 26px 0;font-size:12px;font-weight:700}.legend-bullet{width:9px;height:9px;background:#3a75f5;border-radius:50%;box-shadow:0 0 0 3px #3a75f51b}.chart-count{margin-left:auto;font-weight:500;font-size:11px;color:#a0adbf}.chart-holder{height:292px;position:relative;margin:10px 19px 0 15px}.chart-holder canvas{width:100%;height:100%;display:block;cursor:crosshair}.chart-empty{position:absolute;inset:0;display:grid;place-items:center;color:#97a5b9;font-size:13px}.chart-empty[hidden]{display:none}.chart-tooltip{position:absolute;pointer-events:none;background:#102d59;color:#fff;border-radius:8px;box-shadow:0 10px 25px #12315e3b;padding:9px 12px;font-size:11px;white-space:nowrap;z-index:3}.chart-tooltip[hidden]{display:none}.chart-footer{display:flex;justify-content:space-between;color:#abb6c7;font-size:11px;margin:0 33px 20px 65px}
.table-controls{padding-top:2px}.toggle-label{display:flex;align-items:center;gap:10px;color:#657c9d;font-size:11px;font-weight:700;cursor:pointer}.toggle-label input{position:absolute;opacity:0;width:1px;height:1px}.toggle-track{width:32px;height:18px;border-radius:12px;background:#aab7cb;position:relative;transition:background .2s}.toggle-track:after{content:"";position:absolute;left:3px;top:3px;width:12px;height:12px;border-radius:50%;background:#fff;transition:transform .2s}.toggle-label input:checked+.toggle-track{background:#3d73ec}.toggle-label input:checked+.toggle-track:after{transform:translateX(14px)}.toggle-label input:focus-visible+.toggle-track{outline:3px solid #85a9fc}.table-scroll{width:100%;overflow-x:auto}table{width:100%;border-collapse:collapse;font-size:12px;text-align:left;min-width:810px}thead{background:#f7f9fc}th{color:#7688a3;text-transform:uppercase;letter-spacing:.55px;font-size:10px;font-weight:800;padding:15px 22px;white-space:nowrap}td{padding:15px 22px;color:#445877;border-top:1px solid #edf0f5;font-variant-numeric:tabular-nums;white-space:nowrap}tbody tr:hover{background:#f9fbff}.table-status{padding:5px 8px;border-radius:20px;background:#eafaf5;color:#119b75;font-size:10px;font-weight:800}.table-status.needzero{background:#fff6e7;color:#bf8528}.table-status.invalid{background:#f8edf0;color:#b86b7b}.empty-td{text-align:center;padding:50px;color:#98a5b9}.table-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;color:#8fa0b6;font-size:11px;padding:15px 24px;border-top:1px solid #edf1f6}.pagination{display:flex;align-items:center;gap:13px}.pagination button{background:#fff;border:1px solid #e3e9f3;border-radius:8px;color:#506688;font-size:11px;font-weight:750;padding:7px 11px}.pagination button:hover:not(:disabled){background:#eff5ff}.info-strip{display:flex;gap:14px;justify-content:space-between;align-items:center;border:1px solid #dfe9fa;background:#eaf2ff;padding:13px 17px;border-radius:12px;font-size:11px;color:#6581a9}.info-strip>div{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.info-strip strong{color:#48658c}.info-dot{height:8px;width:8px;border-radius:50%;background:#4a8df6}.footer{display:flex;justify-content:space-between;gap:15px;padding:20px 36px 30px;max-width:1498px;margin:auto;font-size:11px;color:#9aa8bb}.footer span{padding:0 6px}
@media (max-width:1190px){.site-header{padding:20px 28px}.overview-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.sensor-panel{padding:23px 20px}.split-metrics strong{font-size:24px}.sensor-name{font-size:18px}.primary-readout{font-size:34px}.main-content{padding:28px}}
@media (max-width:850px){.sensor-grid{grid-template-columns:1fr 1fr}.panel-atmos{grid-column:1/-1}.chart-section-head{flex-direction:column}.chart-tools{width:100%}.sensor-panel{min-height:315px}.site-header{min-height:100px}.brand-line{font-size:21px}.brand-sub{font-size:11px}}
@media (max-width:610px){.site-header{align-items:flex-start;flex-direction:column;gap:16px;padding:20px 17px}.header-actions{width:100%;display:grid;grid-template-columns:1fr 1fr;gap:8px}.header-actions .mode-badge{grid-column:1/-1;text-align:center}.brand-icon{height:46px;width:46px}.brand-line{font-size:20px}.brand-sub{font-size:10px}.main-content{padding:21px 14px 30px}.welcome-row{align-items:start;flex-direction:column;gap:13px}.welcome-row h1{font-size:23px}.welcome-row p{font-size:12px}.date-chip{font-size:11px;padding:7px 12px}.overview-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.overview-card{padding:15px 13px;min-height:147px}.overview-top{margin-bottom:12px}.card-hint{font-size:8px}.kpi-label{font-size:11px}.kpi-value{font-size:23px}.state-kpi{font-size:16px}.kpi-foot{font-size:10px}.sensor-grid{grid-template-columns:1fr;gap:12px}.panel-atmos{grid-column:auto}.sensor-panel{min-height:0;padding:22px}.section-head{padding:20px 16px 17px}.section-head h2{font-size:15px}.section-head p{font-size:11px;margin-left:0}.chart-tools select{flex:1;min-width:0;max-width:none}.chart-tools .button{flex:1}.chart-holder{height:250px;margin:10px 5px 0}.chart-footer{margin:0 17px 20px 44px}.chart-legend{padding:5px 18px 0}.table-controls{justify-content:space-between;width:100%;margin-top:7px}.history-panel>.section-head{flex-direction:column}.footer{padding:14px 18px 25px;flex-direction:column;gap:6px}.info-strip{flex-direction:column;align-items:flex-start}.table-footer{padding:12px;flex-wrap:wrap}.mode-badge{font-size:11px}}
@media (prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;transition-duration:0s!important}}

.notice[hidden],#tableContainer[hidden]{display:none}

/* HiveMQ Live panel */
.mqtt-panel{padding:17px 20px;background:#fff;border:1px solid #dce7f8;border-radius:16px;box-shadow:var(--shadow);margin-bottom:20px}
.mqtt-title{display:flex;justify-content:space-between;align-items:flex-start;gap:14px}.mqtt-title>div:first-child{position:relative;padding-left:23px}.mqtt-title strong{font-size:14px;color:#1b3863}.mqtt-title p{font-size:11px;color:#7c8eaa;margin:5px 0 0}.mqtt-dot{position:absolute;left:0;top:5px;height:11px;width:11px;border-radius:50%;background:#c2ccda}.mqtt-dot.connected{background:#14bc91;box-shadow:0 0 0 4px #14bc9121}.mqtt-dot.error{background:#ed805a}.mqtt-indicator{font-size:11px;color:#486b9f;background:#eaf2ff;border-radius:20px;padding:7px 12px;white-space:nowrap}
.mqtt-form{display:flex;align-items:end;gap:10px;margin-top:14px;flex-wrap:wrap}.mqtt-form label{display:flex;flex-direction:column;gap:6px;flex:1 1 195px;font-size:10px;font-weight:750;color:#647b9b}.mqtt-form input{border:1px solid #dde6f3;border-radius:9px;padding:10px 11px;font-size:12px;color:#203c60;min-width:0;width:100%;background:#fafcff}.mqtt-form input:focus-visible{outline:2px solid #7da8ff}.mqtt-form .button{min-height:38px}.mqtt-foot{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;color:#8899ae;font-size:10px;margin-top:11px}.mqtt-foot span:last-child{color:#7488a6}
@media (max-width:610px){.mqtt-panel{padding:15px}.mqtt-title{flex-direction:column;gap:7px}.mqtt-form{gap:9px}.mqtt-form label{flex:1 1 100%}.mqtt-form .button{flex:1 1 46%}.mqtt-foot{line-height:1.5}}

/* EMQX: panel ringkas dan dialog konfigurasi */
.mqtt-head-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.mqtt-config-button{white-space:nowrap;min-height:37px;font-size:12px}
.mqtt-dialog{width:min(510px,calc(100vw - 24px));max-height:calc(100dvh - 32px);overflow:auto;border:1px solid #dce7f8;border-radius:18px;padding:0;background:#fff;box-shadow:0 25px 80px rgba(11,32,73,.25);color:#203c60}
.mqtt-dialog::backdrop{background:rgba(8,26,55,.58);backdrop-filter:blur(3px)}
.mqtt-dialog-header{display:flex;align-items:start;justify-content:space-between;gap:14px;padding:23px 25px 16px;border-bottom:1px solid #eaf0f8}
.mqtt-dialog-header h2{font-size:19px;letter-spacing:-.4px;margin:0;color:#193763}
.mqtt-dialog-header p{margin:5px 0 0;color:#7b8fab;font-size:12px}
.mqtt-dialog-close{border:0;background:#edf3fa;color:#4a6282;width:30px;height:30px;font-size:22px;border-radius:9px;cursor:pointer}
.mqtt-settings-form{padding:20px 25px 24px;display:grid;gap:15px}
.mqtt-settings-form>label:not(.mqtt-remember){display:grid;gap:7px;color:#547093;font-size:12px;font-weight:750}
.mqtt-settings-form input[type=text],.mqtt-settings-form input[type=password]{border:1px solid #d7e2f1;background:#fafcff;color:#203c60;border-radius:10px;padding:12px;font-size:13px;width:100%;min-width:0}
.mqtt-settings-form input:focus-visible{outline:2px solid #7da8ff;outline-offset:1px}
.mqtt-settings-note{font-size:11px;background:#eef5ff;border-radius:9px;padding:11px 12px;color:#536d91;line-height:1.6}
.mqtt-remember{display:flex;align-items:flex-start;gap:10px;color:#294769;font-size:12px;cursor:pointer}
.mqtt-remember input{margin-top:3px;width:17px;height:17px;accent-color:#3275ed;flex:none}
.mqtt-remember strong,.mqtt-remember small{display:block}
.mqtt-remember small{color:#8193a9;margin-top:4px;font-size:11px;font-weight:400}
.mqtt-security-warning{background:#fff7e9;border:1px solid #f4e1c3;border-radius:9px;padding:10px 12px;color:#845e22;line-height:1.6;font-size:11px;margin:0}
.mqtt-form-error{background:#fff1ef;border:1px solid #fac8c1;border-radius:9px;color:#ae4236;padding:10px 12px;font-size:12px;margin:0}
.mqtt-form-error[hidden]{display:none}
.mqtt-modal-actions{display:flex;justify-content:flex-end;align-items:center;gap:9px;flex-wrap:wrap}
.mqtt-modal-actions .button{min-height:38px}
.mqtt-modal-actions .mqtt-danger{margin-right:auto;color:#bd4650;border-color:#f1ced2}
@media (max-width:610px){.mqtt-head-actions{justify-content:flex-start;width:100%}.mqtt-config-button{flex:1}.mqtt-dialog-header{padding:19px 17px 15px}.mqtt-settings-form{padding:18px 17px 20px}.mqtt-modal-actions .mqtt-danger{flex:1 1 100%}.mqtt-modal-actions .button{flex:1}}

/* Info pengaturan MQTT yang disimpan secara global pada Vercel */
.mqtt-global-explain{margin:0;color:#4b6483;font-size:12px;line-height:1.65}
.mqtt-server-details{border:1px solid #e2eaf5;border-radius:11px;overflow:hidden}
.mqtt-server-details>div{display:flex;justify-content:space-between;gap:16px;align-items:start;padding:11px 13px;border-bottom:1px solid #eaf0f8;font-size:12px}
.mqtt-server-details>div:last-child{border-bottom:0}
.mqtt-server-details span{color:#7186a3;flex:none}
.mqtt-server-details strong{color:#223f66;font-weight:700;text-align:right;overflow-wrap:anywhere}
.mqtt-settings-note code{background:#e4ecfa;padding:1px 4px;border-radius:4px}
@media (max-width:610px){.mqtt-server-details>div{flex-direction:column;gap:4px}.mqtt-server-details strong{text-align:left}}
