:root{color-scheme:light;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;background:#eef2f3;color:#17212b;font-synthesis:none;text-rendering:optimizeLegibility;--bg: #eef2f3;--panel: #ffffff;--panel-soft: #f8faf9;--text: #17212b;--muted: #64717d;--border: #dbe2e5;--line: #e9eef0;--ok: #14845f;--ok-soft: #e7f6ef;--warn: #b76211;--warn-soft: #fff3df;--danger: #c5332e;--danger-soft: #fdeceb;--blue: #2563a8;--blue-soft: #e8f1fb;--shadow: 0 14px 36px rgba(25, 39, 52, .08)}*{box-sizing:border-box}body{margin:0;min-width:320px;min-height:100vh;background:var(--bg)}button,input,select,textarea{font:inherit}button{cursor:pointer}.boot,.login-screen{min-height:100vh;display:grid;place-items:center;padding:24px}.boot{font-size:22px;font-weight:800}.login-panel{width:min(420px,100%);background:var(--panel);border:1px solid var(--border);box-shadow:var(--shadow);border-radius:8px;padding:28px;display:grid;gap:18px}.brand-lockup,.side-brand{display:flex;align-items:center;gap:12px}.brand-mark{width:42px;height:42px;display:grid;place-items:center;border-radius:8px;background:#0f766e;color:#fff;flex:0 0 auto}.brand-lockup h1,.topbar h1,.section-head h2{margin:0;letter-spacing:0}.brand-lockup h1{font-size:24px;line-height:1.1}.brand-lockup p,.topbar p,.section-head p{margin:4px 0 0;color:var(--muted);font-size:14px;line-height:1.4}label{display:grid;gap:7px;color:#2b3a45;font-size:13px;font-weight:700}input,select,textarea{width:100%;border:1px solid var(--border);background:#fff;color:var(--text);border-radius:6px;padding:11px 12px;outline:none}input:focus,select:focus,textarea:focus{border-color:#0f766e;box-shadow:0 0 0 3px #0f766e1f}.primary-button,.secondary-button,.icon-button,.text-button,.logout-button,.nav-button{border:0;border-radius:6px;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:38px;font-size:14px;font-weight:800}.primary-button{background:#0f766e;color:#fff}.secondary-button{background:#17313f;color:#fff;padding:0 14px}.icon-button{width:40px;background:var(--panel);color:var(--text);border:1px solid var(--border)}.text-button{background:transparent;color:#0f766e;padding:0}.form-error{color:var(--danger);margin:0;font-weight:700}.success-message{margin:10px 0 0;color:var(--ok);font-weight:700}.app-shell{min-height:100vh;display:grid;grid-template-columns:248px 1fr}.sidebar{background:#17212b;color:#e7edf0;padding:20px 14px;display:flex;flex-direction:column;gap:22px;position:sticky;top:0;height:100vh}.side-brand{padding:2px 6px 12px;font-weight:900;font-size:18px}.sidebar nav{display:grid;gap:6px}.nav-button,.logout-button{width:100%;justify-content:flex-start;background:transparent;color:#b9c5cc;padding:10px 12px}.nav-button svg,.logout-button svg{width:19px}.nav-button.active{background:#263644;color:#fff}.nav-button b{margin-left:auto;min-width:24px;height:22px;border-radius:999px;display:grid;place-items:center;color:#fff;background:var(--danger);font-size:12px}.logout-button{margin-top:auto}.workspace{padding:22px;display:grid;align-content:start;gap:18px}.topbar{display:flex;align-items:center;justify-content:space-between;gap:18px}.topbar h1{font-size:28px;line-height:1.05}.top-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}.health-pill{height:38px;display:inline-flex;align-items:center;gap:7px;border-radius:999px;padding:0 12px;font-size:13px;font-weight:800;border:1px solid transparent}.health-pill.ok{background:var(--ok-soft);color:var(--ok)}.health-pill.warn{background:var(--warn-soft);color:var(--warn)}.health-pill.danger{background:var(--danger-soft);color:var(--danger)}.health-pill.muted{background:#eef2f3;color:var(--muted)}.error-banner{background:var(--danger-soft);color:var(--danger);border:1px solid #f3c4c1;padding:12px 14px;border-radius:8px;font-weight:800}.data-banner{display:flex;align-items:center;gap:10px;border-radius:8px;padding:12px 14px;border:1px solid var(--border)}.data-banner strong{flex:0 0 auto;font-size:14px}.data-banner span{color:inherit;font-size:14px;font-weight:700;line-height:1.35}.data-banner.warn{background:var(--warn-soft);color:var(--warn);border-color:#f0c98f}.data-banner.danger{background:var(--danger-soft);color:var(--danger);border-color:#f3c4c1}.dashboard-grid{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:18px}.dashboard-grid>.main-panel:not(.full),.dashboard-grid>.alert-panel{align-self:start}.history-panel{overflow:hidden}.metric-row,.health-band{grid-column:1 / -1;display:grid;gap:12px}.metric-row{grid-template-columns:repeat(6,minmax(0,1fr))}.metric,.main-panel,.alert-panel,.health-card{background:var(--panel);border:1px solid var(--border);border-radius:8px;box-shadow:0 1px 1px #10182808}.metric{padding:16px;display:grid;grid-template-columns:42px 1fr;grid-template-rows:auto auto;gap:3px 12px}.metric div{grid-row:1 / 3;width:42px;height:42px;border-radius:8px;display:grid;place-items:center}.metric.ok div{background:var(--ok-soft);color:var(--ok)}.metric.warn div{background:var(--warn-soft);color:var(--warn)}.metric.danger div{background:var(--danger-soft);color:var(--danger)}.metric.neutral div{background:var(--blue-soft);color:var(--blue)}.metric span{color:var(--muted);font-weight:800;font-size:13px}.metric strong{font-size:28px;line-height:1}.range-control{display:inline-flex;align-items:center;gap:4px;padding:4px;background:#eef2f3;border:1px solid var(--border);border-radius:8px;flex:0 0 auto}.range-control button{border:0;min-width:48px;height:32px;border-radius:6px;background:transparent;color:#42505c;font-size:13px;font-weight:900}.range-control button.active{background:var(--panel);color:#0f766e;box-shadow:0 1px 3px #1018281a}.history-layout{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(220px,.7fr);gap:18px;align-items:stretch}.trend-chart{min-width:0;display:grid;gap:10px}.chart-legend{display:flex;flex-wrap:wrap;gap:12px;color:var(--muted);font-size:12px;font-weight:900}.chart-legend span{display:inline-flex;align-items:center;gap:6px}.legend-dot{width:10px;height:10px;border-radius:999px;display:inline-block}.legend-dot.temp{background:#0f766e}.legend-dot.humidity{background:#b76211}.legend-band{width:18px;height:8px;display:inline-block;border-radius:3px;background:#14845f1c}.trend-chart svg{width:100%;height:clamp(230px,30vw,320px);display:block}.comfort-band{fill:#14845f1a}.grid-line{stroke:#e2e8ea;stroke-width:1}.axis-label{fill:#6a7782;font-size:12px;font-weight:800}.humidity-axis{fill:#9a5a13}.history-line{fill:none;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round}.history-line.temp{stroke:#0f766e}.history-line.humidity{stroke:#b76211;stroke-dasharray:7 7}.history-point.temp{fill:#fff;stroke:#0f766e;stroke-width:2.5}.history-summary{display:grid;align-content:stretch;gap:10px}.history-stat{min-height:88px;display:grid;align-content:center;gap:4px;padding:13px 14px;border-left:4px solid var(--border);background:var(--panel-soft);border-radius:6px}.history-stat.ok{border-color:var(--ok)}.history-stat.warn{border-color:var(--warn)}.history-stat.danger{border-color:var(--danger)}.history-stat.muted{border-color:#98a5ae}.history-stat span{color:var(--muted);font-size:12px;text-transform:uppercase;font-weight:900}.history-stat strong{font-size:24px;line-height:1}.history-stat p{margin:0;color:var(--muted);font-size:12px;font-weight:800}.main-panel,.alert-panel{padding:18px;min-width:0}.alert-panel{grid-column:2;grid-row:3 / span 2;display:grid;grid-template-rows:auto minmax(0,1fr);max-height:min(560px,calc(100vh - 180px));overflow:hidden}.main-panel.full,.health-band,.admin-grid .full{grid-column:1 / -1}.section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:14px}.section-head.tight{align-items:center}.section-head h2{font-size:18px}.table-wrap{overflow-x:auto}.equipment-table{width:100%;border-collapse:collapse;min-width:720px}.equipment-table th{text-align:left;color:var(--muted);font-size:12px;text-transform:uppercase;padding:10px 8px;border-bottom:1px solid var(--line)}.equipment-table td{padding:13px 8px;border-bottom:1px solid var(--line);font-size:14px;vertical-align:middle}.equipment-table td strong,.wide-row strong,.alert-item strong{display:block;font-size:14px}.equipment-table td span{display:block;color:var(--muted);font-size:12px;margin-top:2px}.number{font-weight:900;font-variant-numeric:tabular-nums}.state{display:inline-flex;align-items:center;min-height:24px;border-radius:999px;padding:0 9px;font-size:12px;font-weight:900}.state.ok{background:var(--ok-soft);color:var(--ok)}.state.warn{background:var(--warn-soft);color:var(--warn)}.state.danger{background:var(--danger-soft);color:var(--danger)}.state.muted{background:#eef2f3;color:var(--muted)}.value-cell.danger{color:var(--danger)}.value-cell.warn{color:var(--warn)}.mode-code{display:inline-flex;align-items:center;min-height:24px;border-radius:6px;padding:0 8px;background:#eef2f3;color:#42505c;font-size:12px;font-weight:900}.alert-list,.stack-list{display:grid;gap:10px}.alert-panel .alert-list{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding-right:4px;scrollbar-gutter:stable}.alert-item,.wide-row{display:grid;grid-template-columns:10px 1fr auto;gap:12px;align-items:start;border:1px solid var(--line);border-radius:8px;padding:12px;background:var(--panel-soft)}.alert-item{grid-template-columns:10px 1fr}.alert-item p,.wide-row p,.health-card p{margin:4px 0 0;color:var(--muted);font-size:13px;line-height:1.4}.alert-item small,.wide-row small{display:block;color:var(--muted);font-weight:700;line-height:1.35}.alarm-actions{display:grid;justify-items:end;gap:8px;min-width:132px}.alarm-actions span{color:var(--muted);font-size:12px;font-weight:800;white-space:nowrap}.clear-alarm-button{display:inline-flex;align-items:center;justify-content:center;min-height:30px;border:1px solid #f0c98f;border-radius:6px;background:#fff9ee;color:var(--warn);padding:0 10px;font-size:12px;font-weight:900}.alert-item .clear-alarm-button{margin-top:9px}.status-dot{width:10px;height:10px;border-radius:999px;margin-top:5px;background:var(--muted)}.status-dot.warn{background:var(--warn)}.status-dot.danger{background:var(--danger)}.health-band{grid-column:1;grid-row:4;grid-template-columns:repeat(2,minmax(0,1fr))}.history-insights{grid-row:5}.health-card{padding:16px}.health-card span{color:var(--muted);font-size:12px;text-transform:uppercase;font-weight:900}.health-card strong{display:block;margin-top:8px;font-size:20px}.history-insights{grid-column:1 / -1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.insight-panel{min-width:0}.insight-list{display:grid;gap:8px}.insight-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;min-height:76px;padding:10px 0;border-bottom:1px solid var(--line)}.insight-row:last-child{border-bottom:0}.insight-row strong{display:block;font-size:14px}.insight-row span,.insight-row p{display:block;margin:2px 0 0;color:var(--muted);font-size:12px;line-height:1.35}.insight-row b{color:#17313f;font-size:22px;font-variant-numeric:tabular-nums}.empty-state{border:1px dashed var(--border);border-radius:8px;padding:20px;color:var(--muted);text-align:center;font-weight:800}.search-input{max-width:300px}.equipment-actions{display:grid;justify-items:end;gap:10px;min-width:min(560px,100%)}.filter-chips{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px}.filter-chip{border:1px solid var(--border);background:var(--panel);color:#42505c;border-radius:999px;min-height:30px;padding:0 10px;font-size:12px;font-weight:900}.filter-chip.active{border-color:#0f766e;background:#e7f6ef;color:#0f766e}.admin-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.csv-box{min-height:220px;resize:vertical;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.rules-grid{display:grid;gap:8px}.rule-row{display:grid;grid-template-columns:1.4fr 1fr 110px 60px;gap:10px;align-items:center;padding:10px;border:1px solid var(--line);border-radius:8px}.rule-row label{display:flex;align-items:center;gap:8px}.rule-row input[type=checkbox]{width:16px}.spin{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media(max-width:980px){.app-shell{grid-template-columns:1fr}.sidebar{position:static;height:auto;padding:12px;display:grid;grid-template-columns:1fr}.sidebar nav{display:flex;overflow-x:auto}.side-brand{padding-bottom:0}.logout-button{display:none}.nav-button{width:auto;white-space:nowrap}.workspace{padding:14px}.topbar,.section-head{flex-direction:column;align-items:stretch}.top-actions{justify-content:flex-start}.dashboard-grid,.history-layout,.history-insights,.admin-grid{grid-template-columns:1fr}.metric-row{grid-template-columns:repeat(3,minmax(0,1fr))}.health-band{grid-template-columns:1fr 1fr}.equipment-actions{justify-items:stretch;min-width:0}.filter-chips{justify-content:flex-start}.range-control{width:max-content}.alert-panel,.main-panel{grid-column:1}.dashboard-grid>.main-panel:not(.full),.dashboard-grid>.alert-panel,.health-band,.history-insights{grid-row:auto}.alert-panel{max-height:none;overflow:visible}.alert-panel .alert-list{overflow:visible;padding-right:0}}@media(max-width:620px){.health-band,.form-grid,.rule-row{grid-template-columns:1fr}.metric-row,.history-summary{grid-template-columns:1fr 1fr}.range-control{width:100%}.range-control button{flex:1;min-width:0}.trend-chart svg{height:240px}.metric{padding:14px;grid-template-columns:36px 1fr;gap:2px 10px}.metric div{width:36px;height:36px}.metric strong{font-size:24px}.metric span{font-size:12px}.topbar h1{font-size:24px}.health-pill{height:34px;font-size:12px}.data-banner{align-items:flex-start;flex-direction:column}.equipment-table{min-width:0}.equipment-table th:nth-child(4),.equipment-table th:nth-child(5),.equipment-table th:nth-child(6),.equipment-table td:nth-child(4),.equipment-table td:nth-child(5),.equipment-table td:nth-child(6){display:none}.equipment-table th,.equipment-table td{padding:11px 6px}.wide-row{grid-template-columns:10px 1fr}.alarm-actions{grid-column:2;justify-items:start}.equipment-table th{font-size:11px}.equipment-table td{font-size:13px}}@media(max-width:440px){.history-summary{grid-template-columns:1fr}.insight-row{align-items:start}.insight-row b{font-size:19px}}
