/* Shared layout: cards are sized by their grid row, tables scroll within panels. */
:root{color-scheme:dark;--bg:#11191e;--panel:#1a252c;--line:#2a373e;--text:#e9f1f3;--muted:#8e9fa8;--teal:#58d5c3;--amber:#f0bc68}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:14px Inter,"Noto Sans TC","Microsoft JhengHei",Arial,sans-serif}button,select{font:inherit}button,summary{cursor:pointer}button:disabled{opacity:.5;cursor:wait}button:focus-visible,select:focus-visible,a:focus-visible,summary:focus-visible,pre:focus-visible{outline:2px solid var(--teal);outline-offset:4px}[hidden]{display:none!important}
.rail{position:fixed;inset:0 auto 0 0;display:flex;flex-direction:column;background:#172127;border-right:1px solid var(--line);overflow-y:auto}.brand{color:var(--text);text-decoration:none;font-weight:750}.brand span{color:var(--teal)}.shell{min-width:0}header{min-height:62px;padding:14px 30px;display:flex;justify-content:space-between;align-items:center;gap:16px;border-bottom:1px solid var(--line);background:#141e24}.breadcrumb{font-size:12px;color:#b6c3ca}.breadcrumb span{padding:0 10px;color:#51636c}.header-right{display:flex;align-items:center;gap:18px;font-size:11px}.system{color:var(--muted)}#fullscreen{border:1px solid #3a484f;border-radius:5px;background:transparent;color:#c7d3d8;padding:7px 11px;white-space:nowrap}main{max-width:1800px;margin:auto;padding:28px 30px 20px}.heading{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:24px}h1{font-size:26px;font-weight:600;margin:0;line-height:1.5}h1>span{font-size:13px;color:#a0b5c1;border-left:1px solid #43545e;padding-left:14px;margin-left:14px;white-space:nowrap}.date-block{flex-shrink:0;color:var(--muted);font-size:11px}.date-block strong{font-size:13px;font-weight:400;white-space:nowrap}
.metrics{display:grid;gap:18px;align-items:stretch;margin-bottom:20px}.metrics{grid-template-columns:repeat(4,minmax(0,1fr))}.metric,.panel{min-width:0;border:1px solid var(--line);border-radius:9px;background:var(--panel);overflow:hidden}.metric{padding:22px;display:flex;flex-direction:column;gap:14px}.metrics>.metric{min-height:148px;display:grid;grid-template-rows:24px 1fr 20px;gap:10px}.metrics .metric-value{align-self:center}.metrics .metric-foot{margin-top:0}.metric-top{display:flex;justify-content:space-between;align-items:center;gap:8px;color:#b5c7d0;font-size:13px;line-height:1.5;min-height:20px}.metric-value{font-size:38px;font-weight:600;line-height:1.2;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.metric-value small{font-size:12px;font-weight:400;color:var(--muted);margin-left:4px}.metric-value em{font-size:22px;font-style:normal;color:#7a919e}.metric-message{font-size:25px;font-weight:500}.metric-foot{display:flex;align-items:center;flex-wrap:wrap;gap:8px;font-size:11px;line-height:1.7;color:var(--muted);margin-top:auto}.metric-foot b{color:var(--teal);font-weight:400}.right-text{margin-left:auto}
.main-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:20px;align-items:stretch}.main-grid>.panel{display:flex;flex-direction:column;align-self:stretch;margin:0;min-width:0}.main-grid>.events,.main-grid>.anomalies,.main-grid>.log-history,.main-grid>.servers{grid-column:1/-1}.panel-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:22px 22px 18px;flex-wrap:wrap;min-height:88px}.panel-head>div{min-width:0}h2{font-size:16px;font-weight:600;margin:0;line-height:1.5}.panel-head p{font-size:11px;color:var(--muted);margin:6px 0 0;line-height:1.5}.camera-refresh,.log-view{border:1px solid #3a4e58;background:#24363e;color:#bde3dd;border-radius:5px;padding:7px 11px;font-size:11px;white-space:nowrap}.camera-refresh:hover,.log-view:hover{background:#2c454d}.visitor-controls{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.segmented{display:flex;border:1px solid #33464f;padding:3px;border-radius:5px;gap:3px}.segmented button{font-size:11px;padding:5px 10px;background:transparent;color:#8fa5af;border:0;border-radius:3px;white-space:nowrap}.segmented .selected{background:#314c50;color:#8de6d7}.chart-legend{display:flex;gap:17px;font-size:11px;padding:0 22px;color:#a5b7c0}.chart-legend>span{display:flex;align-items:center;gap:6px}.chart-legend i{display:inline-block;width:13px;height:3px}.teal{background:var(--teal)}.visitor-chart{min-width:0;min-height:240px;display:flex;align-items:center;margin:12px 14px;color:var(--muted)}.visitor-chart svg{width:100%;height:auto;display:block}.chart{height:264px;min-width:0}.chart-summary{margin:0 22px 18px;padding-top:12px;border-top:1px solid var(--line);color:var(--muted);font-size:11px;line-height:1.6}.visitor-traffic>.table-footer{margin-top:auto}#traffic-chart{overflow-x:auto;overflow-y:hidden;padding:0 10px}.hourly-triggers{display:flex;align-items:flex-end;gap:5px;min-width:620px;height:240px;padding:18px 8px}.trigger-column{display:flex;flex:1;min-width:19px;flex-direction:column;align-items:center;justify-content:flex-end;gap:8px;height:100%;color:#829ba8;font-size:9px}.trigger-column i{display:block;width:60%;max-width:25px;background:var(--teal);border-radius:3px 3px 0 0}.trigger-column strong{color:var(--teal);font-size:10px;font-weight:500}.trigger-column span{white-space:nowrap}.camera-note{font-size:11px;line-height:1.7;color:var(--muted);margin:0 22px 18px}
.service-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:13px 22px;margin:0;border-top:1px solid var(--line);font-size:12px;color:#b6c8d2}.service-row strong{color:var(--teal);font-weight:500;font-variant-numeric:tabular-nums}.services #service-groups{padding-bottom:8px}.camera-message,#camera-groups:empty{padding:18px 22px;color:var(--muted)}#camera-groups{display:grid;grid-template-columns:1fr;min-width:0;font-size:12px;color:var(--muted)}.device-row{margin:0 22px;padding:12px 0;display:flex;align-items:center;gap:12px;border-top:1px solid var(--line)}.device-icon{display:grid;place-items:center;background:#243a40;border:1px solid #345158;color:#81bcb8;width:32px;height:32px;flex-shrink:0;border-radius:6px;font-size:18px}.device-row>div:nth-child(2){min-width:0}.device-row strong{font-size:12px;font-weight:500}.device-count{margin-left:auto;font-size:17px;text-align:right;color:#dfeded;flex-shrink:0}.device-count span{font-size:11px;color:#718c9b}.device-count small{display:block;font-size:10px;color:#91a7b4;margin-top:5px}.device-count .warn{color:var(--amber)}.camera-totals{display:flex;justify-content:space-between;flex-wrap:wrap;gap:12px;margin:16px 22px;padding:12px;background:#142128;border-radius:5px;color:var(--muted);font-size:11px}.camera-totals strong{color:var(--text);font-size:16px;font-weight:500;margin-left:8px}#camera-pending{font-size:12px}.camera-meta{display:flex;justify-content:space-between;gap:10px;font-size:10px;color:#88a1ad;margin:0 22px 18px}.camera-error{margin:12px 22px 18px;background:#453a28;color:#e6bd78;padding:12px;font-size:11px;line-height:1.6;overflow-wrap:anywhere}.anomaly-status{margin:0 22px 20px;padding:14px 16px;border:1px solid #3c505c;border-radius:6px;font-size:12px;line-height:1.7;color:#a5bac6;overflow-wrap:anywhere}.anomaly-status.healthy{background:#1b3430;border-color:#315b50;color:#9cdbbd}
.table-wrap{overflow:auto;min-width:0}.event-scroll{max-height:340px;overscroll-behavior:contain}table{border-collapse:collapse;width:100%;text-align:left;white-space:nowrap;font-size:12px}th{font-size:11px;color:#8da5b2;background:#172229;font-weight:400;padding:13px 20px;white-space:nowrap}td{padding:15px 20px;border-bottom:1px solid var(--line);color:#bbced7;vertical-align:middle}td:first-child{font-variant-numeric:tabular-nums}.event-scroll thead{position:sticky;top:0;z-index:1}.events table,.anomalies table{table-layout:fixed;min-width:800px;white-space:normal}.events th:first-child,.anomalies th:first-child{width:170px}.events th:nth-child(2){width:110px}.events th:nth-child(3){width:38%}.events td,.anomalies td{line-height:1.6;overflow-wrap:anywhere}.events td:nth-child(3){font:11px/1.6 ui-monospace,monospace}.trigger-record td:nth-child(2){color:var(--teal)}.table-footer{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;padding:16px 22px;color:#8ba2af;font-size:10px;line-height:1.6}.filter select{background:#202e36;color:#b2c6ce;border:1px solid #3a4e58;font-size:11px;padding:7px 10px;border-radius:5px}.empty-record{text-align:center;padding:28px!important;color:var(--muted)}.server-summary{display:flex;align-items:center;gap:20px;flex-wrap:wrap;padding:0 22px 18px;font-size:12px;color:var(--muted)}.server-summary strong{color:var(--teal);font-size:21px;font-weight:500;margin-left:9px}.servers table{min-width:800px}.servers td:first-child{color:#dce6ea}.resource-meter{height:4px;width:90px;background:#34454e;border-radius:4px;margin-top:7px}.resource-meter i{display:block;height:100%;background:var(--teal);border-radius:4px}.resource-meter.elevated i{background:var(--amber)}.server-warning{color:var(--amber)}.status{font-size:11px;display:inline-block}.status.done{color:#83c9bb}.status.pending{color:#e6bd78}.stale-data{opacity:.5}
.log-history table{width:100%;min-width:1000px;table-layout:fixed}.log-history th:first-child{width:16%}.log-history th:nth-child(2){width:29%}.log-history th:nth-child(3){width:18%}.log-history th:nth-child(4){width:19%}.log-history th:nth-child(5){width:8%}.log-history th:last-child{width:10%}.log-history td{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;height:64px}.log-source strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--amber);font-size:13px;font-weight:500}.log-pod span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font:11px ui-monospace,monospace;color:#a8bac5}
footer{display:flex;justify-content:space-between;gap:12px;padding:0 0 6px;color:#718a98;font-size:10px}
@media(max-width:1250px){.metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.main-grid{grid-template-columns:1fr}}
@media(max-width:1000px){header,main{padding-left:22px;padding-right:22px}.header-right .system{display:none}.heading{align-items:flex-start;flex-wrap:wrap}.date-block strong{font-size:12px}}
@media(max-width:600px){header{padding:12px 16px;min-height:52px}.breadcrumb{font-size:11px}.breadcrumb span{padding:0 6px}#fullscreen span{display:none}#fullscreen{padding:5px 8px}main{padding:20px 16px}.heading{gap:10px;margin-bottom:20px}h1{font-size:23px}h1>span{font-size:12px;margin-left:10px;padding-left:10px}.metrics,.main-grid{gap:14px}.metric{padding:16px;gap:12px}.metrics>.metric{min-height:130px}.metric-top{font-size:12px;min-height:36px}.metric-value{font-size:30px}.metric-message{font-size:23px}.metric-value em{font-size:19px}.metric-foot{font-size:10px}.right-text{margin-left:0}.panel-head{padding:18px 16px 14px;gap:12px;min-height:78px}.panel-head p{font-size:10px}.panel-head h2{font-size:15px}.visitor-controls{gap:8px}.camera-refresh{font-size:10px;padding:6px 8px}.segmented button{font-size:10px;padding:5px 8px}.chart-legend{padding:0 16px}.visitor-chart{min-height:160px;margin:10px 8px}.table-footer{padding:14px 16px}.event-scroll{max-height:280px}.chart-summary{margin-left:16px;margin-right:16px}.anomaly-status,.camera-error{margin-left:16px;margin-right:16px}.camera-meta{margin-left:16px;margin-right:16px}}
@media(max-width:360px){.metrics{grid-template-columns:1fr}.visitor-controls{width:100%;justify-content:space-between}}

/* Photo cards for store navigation. */
.rail{width:184px;align-items:stretch;padding:26px 16px 20px}.rail .brand{display:flex;gap:5px;font-size:20px;letter-spacing:-.6px;align-items:center;justify-content:center;margin-bottom:30px}.rail .brand span{font-size:16px}.store-nav-label{font-size:11px;color:#a3b5bd;margin:0 2px 14px}#store-list{display:grid;grid-template-columns:minmax(0,1fr);gap:14px;overflow-y:auto;padding:3px;max-height:calc(100vh - 170px)}.store-option{position:relative;display:flex;flex-direction:column;aspect-ratio:1;min-width:0;overflow:hidden;border:1px solid #34434c;border-radius:12px;background:#1e2c34;color:#c5d2d8;text-decoration:none;transition:border-color .18s,background .18s,transform .18s}.store-thumbnail{display:block;width:100%;height:0;flex:1;min-height:0;object-fit:cover}.store-card-name{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:42px;padding:10px 12px;font-size:13px;font-weight:500;line-height:1.5}.store-option:hover{transform:translateY(-2px);border-color:#7b9b9e;background:#283e45;color:#fff}.store-option.selected{border-color:var(--teal);background:#203e39;color:#91ebdb;box-shadow:0 0 0 1px var(--teal)}.store-option.selected .store-card-name::after{content:'✓';display:grid;place-items:center;width:18px;height:18px;flex-shrink:0;border-radius:50%;background:var(--teal);color:#14312c;font-size:11px;font-weight:700}.store-placeholder{display:grid;place-items:center;background:linear-gradient(135deg,#29444b,#182830);color:#98bebd;font-size:25px}#store-load-status,.store-loading{font-size:11px;color:#859da9;line-height:1.7;padding:12px 2px}.rail .rail-line{width:auto;margin:20px 2px}.shell{margin-left:184px}h1 [data-store-name]{font-weight:400}@media(prefers-reduced-motion:reduce){.store-option{transition:none}.store-option:hover{transform:none}}@media(max-width:850px) and (min-width:601px){.rail{width:156px;padding:22px 12px}.rail .brand{font-size:17px}.rail .brand span{font-size:12px}.shell{margin-left:156px}.store-card-name{padding:9px 10px}}@media(max-width:600px){.rail{position:relative;inset:auto;width:100%;padding:16px;display:block;border-right:0;border-bottom:1px solid var(--line)}.rail .brand{justify-content:flex-start;margin-bottom:18px}.rail .rail-line{display:none}.store-nav-label{margin-bottom:10px}#store-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;max-height:none;overflow:visible}.store-option{aspect-ratio:auto;height:126px}.store-card-name{min-height:36px;padding:7px 10px;font-size:12px}#store-load-status{padding:8px 0 0}.shell{margin-left:0}}

/* Store image stays uncropped beside the page heading. */
.heading{display:grid;grid-template-columns:minmax(0,1fr) minmax(240px,360px);column-gap:28px;row-gap:12px;align-items:end}.heading>.date-block{grid-column:1;align-self:start}.store-preview{grid-column:2;grid-row:1/span 2;margin:0;overflow:hidden;border:1px solid var(--line);border-radius:9px;background:var(--panel)}.store-preview img{display:block;width:100%;height:auto}@media(max-width:1000px){.heading{grid-template-columns:minmax(0,1fr) minmax(220px,300px);column-gap:20px}.heading h1>span{display:block;border:0;padding:0;margin:6px 0 0}}@media(max-width:700px){.heading{grid-template-columns:minmax(0,1fr);gap:12px;align-items:start}.store-preview{grid-column:1;grid-row:auto;width:100%;max-width:420px}.heading>.date-block{grid-column:1}}

/* Visitor totals and live occupancy share one row. */
.visitor-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;align-items:stretch;margin-bottom:20px}.visitor-metrics>.metric{min-height:170px}.visitor-metrics .metric-value{margin-top:8px}@media(max-width:600px){.visitor-metrics{gap:14px}}@media(max-width:360px){.visitor-metrics{grid-template-columns:1fr}}

.heading.without-preview{grid-template-columns:minmax(0,1fr)}
