/* V9 administrator sensor data hub.  Kept separate so its responsive cards
   do not disturb the collection console or the mobile memory interface. */
.sensor-hub { --sensor-green:#159562; --sensor-green-dark:#097946; --sensor-mint:#e9f8ef; --sensor-blue:#1677ff; --sensor-ink:#183047; --sensor-muted:#6c7b8e; --sensor-border:#e1eaf1; --sensor-card:#fff; --sensor-bg:#f5f8fb; }
.sensor-hub-heading { display:flex; justify-content:space-between; gap:22px; align-items:flex-start; margin:0 0 16px; padding:22px 24px; overflow:hidden; border:1px solid #dcebe4; border-radius:20px; color:#fff; background:linear-gradient(127deg,#0e9b65 0%,#2aae80 47%,#62c797 100%); box-shadow:0 11px 26px rgba(28,132,87,.16); }
.sensor-hub-heading > div { min-width:0; }
.sensor-hub-eyebrow { display:block; margin-bottom:5px; color:rgba(255,255,255,.84); font-size:12px; font-weight:700; letter-spacing:.07em; }
.sensor-hub-heading h2 { margin:0; color:#fff !important; font-size:25px; line-height:1.2; }
.sensor-hub-heading p { max-width:760px; margin:8px 0 0; color:rgba(255,255,255,.91); font-size:14px; line-height:1.55; }
.sensor-hub-heading .btn-secondary { flex:0 0 auto; border-color:rgba(255,255,255,.64); color:#0d8351; background:#fff; box-shadow:0 5px 14px rgba(0,0,0,.1); }
.sensor-scope-card, .sensor-mqtt-card, .sensor-section { margin:0 0 16px; padding:18px 20px; border:1px solid var(--sensor-border); border-radius:17px; background:var(--sensor-card); box-shadow:0 5px 14px rgba(39,65,87,.045); }
.sensor-scope-card { display:flex; align-items:end; gap:18px; padding:14px 18px; background:linear-gradient(104deg,#f7fcf9,#f6faff); }
.sensor-scope-fields { display:flex; flex:1; flex-wrap:wrap; gap:12px; }
.sensor-scope-fields label, .sensor-detail-controls label, .sensor-import-fields label { display:grid; min-width:178px; gap:6px; color:#5b6d80; font-size:12px; font-weight:700; }
.sensor-scope-fields select, .sensor-detail-controls input, .sensor-detail-controls select, .sensor-import-fields select, .sensor-import-fields input { min-height:38px; padding:7px 10px; border:1px solid #d9e5ef; border-radius:10px; outline:0; color:var(--sensor-ink); background:#fff; font:inherit; }
.sensor-scope-fields select:focus, .sensor-detail-controls input:focus, .sensor-detail-controls select:focus, .sensor-import-fields select:focus, .sensor-import-fields input:focus { border-color:#4fb986; box-shadow:0 0 0 3px rgba(50,173,113,.12); }
.sensor-muted { margin:0; color:var(--sensor-muted); font-size:13px; line-height:1.55; }
.sensor-scope-card .sensor-muted { flex:1; min-width:210px; padding-bottom:8px; }
.sensor-mqtt-card { position:relative; overflow:hidden; background:linear-gradient(105deg,#f8fcff,#f5fbf7); }
.sensor-mqtt-card::after { position:absolute; top:-58px; right:-26px; width:155px; height:155px; border:1px solid rgba(23,154,99,.11); border-radius:50%; content:""; box-shadow:0 0 0 26px rgba(23,154,99,.035),0 0 0 52px rgba(23,154,99,.02); pointer-events:none; }
.sensor-card-title-row, .sensor-section-head { display:flex; justify-content:space-between; align-items:flex-start; gap:15px; }
.sensor-card-title-row > div { display:flex; align-items:center; gap:9px; }
.sensor-card-title-row h3, .sensor-section-head h3 { margin:0; color:var(--sensor-ink); font-size:17px; }
.sensor-card-icon { display:grid; width:31px; height:31px; place-items:center; border-radius:10px; color:#087b49; background:#ddf7e8; font-size:21px; font-weight:800; }
.sensor-status-badge { z-index:1; flex:0 0 auto; padding:5px 10px; border-radius:999px; font-size:12px; font-weight:800; }
.sensor-status-badge.online { color:#087849; background:#dff8e9; }
.sensor-status-badge.stale { color:#9e5c14; background:#fff2d8; }
.sensor-status-badge.unknown { color:#5f7285; background:#edf2f6; }
#sensor-mqtt-status { position:relative; z-index:1; margin:12px 0 5px 40px; }
.sensor-credential-note { position:relative; z-index:1; margin:4px 0 0 40px; color:#728297; font-size:12px; }
.sensor-mqtt-actions { position:relative; z-index:1; display:flex; align-items:center; flex-wrap:wrap; gap:9px; margin:13px 0 0 40px; }
.sensor-mqtt-actions .btn-secondary { min-height:34px; padding:6px 11px; border-color:#acd9c0; color:#08784a; background:#fff; font-size:12px; font-weight:800; }
.sensor-mqtt-config-summary { color:#718295; font-size:12px; line-height:1.45; }
.sensor-mqtt-dialog { width:min(640px,calc(100vw - 28px)); max-height:calc(100dvh - 28px); margin:auto; padding:0; overflow:auto; border:0; border-radius:21px; color:#183727; background:#fff; box-shadow:0 28px 76px rgba(10,48,29,.33); }
.sensor-mqtt-dialog::backdrop { background:rgba(13,47,29,.45); backdrop-filter:blur(3px); }
.sensor-mqtt-dialog-shell { padding:22px; }
.sensor-mqtt-dialog-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:17px; }
.sensor-mqtt-dialog-eyebrow { display:block; margin-bottom:5px; color:#159562; font-size:11px; font-weight:800; letter-spacing:.08em; }
.sensor-mqtt-dialog h2 { margin:0; color:#183727; font-size:21px; line-height:1.25; }
.sensor-mqtt-dialog-head p { max-width:510px; margin:7px 0 0; color:#5e7567; font-size:13px; line-height:1.55; }
.sensor-mqtt-dialog-close { flex:0 0 auto; min-width:35px; min-height:35px; padding:4px 9px; color:#35604a; font-size:20px; line-height:1; }
.sensor-mqtt-security-note { display:flex; gap:10px; margin:0 0 16px; padding:11px 12px; border:1px solid #ccebd7; border-radius:13px; background:#f1fbf5; }
.sensor-mqtt-security-note > span { font-size:18px; }
.sensor-mqtt-security-note strong,.sensor-mqtt-security-note small { display:block; }
.sensor-mqtt-security-note strong { color:#147346; font-size:13px; }
.sensor-mqtt-security-note small { margin-top:2px; color:#597567; font-size:12px; line-height:1.45; }
.sensor-mqtt-security-note code { padding:1px 4px; border-radius:4px; color:#0d7546; background:#e0f6e8; }
.sensor-mqtt-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:13px; }
.sensor-mqtt-form-grid label { display:grid; min-width:0; gap:6px; color:#456253; font-size:12px; font-weight:800; }
.sensor-mqtt-form-grid input[type=text],.sensor-mqtt-form-grid input[type=password],.sensor-mqtt-form-grid input[type=number] { width:100%; min-height:40px; padding:8px 10px; border:1px solid #d3e2da; border-radius:10px; outline:0; color:#193d2a; background:#fff; font:inherit; font-weight:500; }
.sensor-mqtt-form-grid input:focus { border-color:#35a76e; box-shadow:0 0 0 3px rgba(43,166,104,.13); }
.sensor-mqtt-form-grid small { color:#809189; font-size:11px; font-weight:500; line-height:1.38; }
.sensor-mqtt-form-grid em { color:#ce4a3c; font-style:normal; }
.sensor-mqtt-wide { grid-column:1 / -1; }
.sensor-mqtt-optional { padding:1px 5px; border-radius:99px; color:#688075; background:#edf7f0; font-size:10px; font-weight:700; }
.sensor-mqtt-advanced { margin-top:16px; overflow:hidden; border:1px solid #e1ece5; border-radius:13px; background:#fbfdfc; }
.sensor-mqtt-advanced summary { padding:12px 13px; color:#2c6042; font-size:13px; font-weight:800; cursor:pointer; }
.sensor-mqtt-advanced[open] summary { border-bottom:1px solid #e3eee7; background:#f2faf5; }
.sensor-mqtt-advanced-grid { padding:13px; }
.sensor-mqtt-tls-label { grid-column:1 / -1; grid-template-columns:auto 1fr; align-items:start; column-gap:8px; }
.sensor-mqtt-tls-label input { width:16px; height:16px; margin:1px 0 0; accent-color:#159562; }
.sensor-mqtt-tls-label small { grid-column:2; }
.sensor-mqtt-config-message { min-height:20px; margin:15px 0 0; color:#708478; font-size:12px; line-height:1.5; }
.sensor-mqtt-config-message[data-state=success] { color:#087b49; }.sensor-mqtt-config-message[data-state=error] { color:#bd3a3a; }
.sensor-mqtt-dialog-actions { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:9px; margin-top:13px; }
.sensor-mqtt-dialog-actions button { min-height:38px; padding:7px 13px; }.sensor-mqtt-dialog-actions .btn-tertiary { border:0; color:#5d7768; background:transparent; }
.sensor-section-head { margin:0 0 14px; }
.sensor-section-head p { margin-top:4px; }
.sensor-device-scope-section { background:linear-gradient(120deg,#fff,#f7fcf9); }
.sensor-device-scope-toolbar { display:flex; align-items:end; gap:16px; margin:0 0 12px; padding:12px; border:1px solid #dfece5; border-radius:13px; background:#f8fcfa; }
.sensor-device-scope-toolbar label { display:grid; flex:0 0 min(260px,100%); gap:6px; color:#5b6d80; font-size:12px; font-weight:700; }
.sensor-device-scope-toolbar select { min-height:38px; padding:7px 10px; border:1px solid #d9e5ef; border-radius:10px; outline:0; color:var(--sensor-ink); background:#fff; font:inherit; }
.sensor-device-scope-toolbar select:focus,.sensor-device-mapping-row select:focus { border-color:#4fb986; box-shadow:0 0 0 3px rgba(50,173,113,.12); }
.sensor-device-scope-toolbar p { max-width:720px; margin:0; color:#6c7b8e; font-size:12px; line-height:1.5; }
.sensor-device-mapping-list { display:grid; gap:9px; }
.sensor-device-mapping-row { display:grid; grid-template-columns:minmax(190px,1.2fr) minmax(170px,.8fr) minmax(180px,.8fr) auto; align-items:center; gap:10px; padding:11px 12px; border:1px solid #e2ece7; border-radius:13px; background:#fff; }
.sensor-device-mapping-identity { display:flex; align-items:center; min-width:0; gap:9px; }
.sensor-device-mapping-identity .sensor-device-icon { flex:0 0 auto; }
.sensor-device-mapping-identity strong,.sensor-device-mapping-identity small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sensor-device-mapping-identity strong { color:#294759; font-size:13px; }
.sensor-device-mapping-identity small { margin-top:2px; color:#8090a1; font-size:11px; }
.sensor-device-mapping-current { min-width:0; color:#6f8290; font-size:12px; line-height:1.4; }
.sensor-device-mapping-current b { display:block; overflow:hidden; color:#2e654d; font-weight:800; text-overflow:ellipsis; white-space:nowrap; }
.sensor-device-mapping-controls { display:grid; min-width:0; gap:7px; }
.sensor-device-mapping-row label { display:grid; min-width:0; gap:5px; color:#647989; font-size:11px; font-weight:700; }
.sensor-device-mapping-row select { width:100%; min-height:37px; padding:7px 9px; border:1px solid #d9e5ef; border-radius:9px; outline:0; color:var(--sensor-ink); background:#fff; font:inherit; }
.sensor-device-mapping-row small { color:#8090a1; font-size:10px; font-weight:500; line-height:1.3; }
.sensor-device-backfill { grid-template-columns:auto 1fr; align-items:start; column-gap:7px; padding:7px 8px; border:1px solid #d5ebdd; border-radius:8px; color:#35604a !important; background:#f5fcf7; cursor:pointer; }
.sensor-device-backfill input { width:15px; height:15px; margin:0; accent-color:#159562; }
.sensor-device-backfill span { line-height:1.25; }
.sensor-device-backfill small { grid-column:2; }
.sensor-device-mapping-row button { min-height:37px; padding:6px 10px; white-space:nowrap; font-size:12px; }
.sensor-device-mapping-message { min-height:20px; margin:10px 0 0; color:#718295; font-size:12px; line-height:1.5; }
.sensor-device-mapping-message[data-state=success] { color:#087a47; }.sensor-device-mapping-message[data-state=error] { color:#bd3a3a; }
.sensor-count-pill { flex:0 0 auto; padding:5px 9px; border-radius:999px; color:#1a7d52; background:#ebf8f0; font-size:12px; font-weight:800; }
.sensor-device-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(245px,1fr)); gap:12px; }
.sensor-device-card { position:relative; display:block; width:100%; min-height:197px; padding:14px 15px; overflow:hidden; border:1px solid #e1eaf0; border-radius:16px; color:var(--sensor-ink); text-align:left; background:#fff; box-shadow:0 3px 9px rgba(30,60,85,.035); transition:border-color .16s ease,transform .16s ease,box-shadow .16s ease; cursor:pointer; }
.sensor-device-card:hover { border-color:#91d2ae; transform:translateY(-2px); box-shadow:0 10px 21px rgba(20,113,74,.1); }
.sensor-device-card.selected { border:2px solid #1ca46a; background:linear-gradient(145deg,#fff,#f4fdf7); box-shadow:0 9px 19px rgba(20,148,94,.12); }
.sensor-device-top { display:flex; align-items:center; gap:7px; min-width:0; margin-bottom:9px; }
.sensor-device-icon { display:grid; width:31px; height:31px; place-items:center; border-radius:10px; background:#f0f8f3; font-size:18px; }
.sensor-device-kind { overflow:hidden; color:#5f7285; font-size:12px; font-weight:700; text-overflow:ellipsis; white-space:nowrap; }
.sensor-device-state { margin-left:auto; padding:3px 7px; border-radius:999px; font-size:11px; font-weight:800; white-space:nowrap; }
.sensor-device-state.online { color:#087848; background:#e2f8eb; }.sensor-device-state.stale { color:#96601d; background:#fff2d9; }
.sensor-device-card > strong { display:block; overflow:hidden; font-size:16px; line-height:1.3; text-overflow:ellipsis; white-space:nowrap; }
.sensor-device-id { display:block; margin-top:2px; color:#8090a1; font-size:12px; letter-spacing:.04em; }
.sensor-card-metrics, .sensor-latest-metrics { display:flex; min-height:57px; margin:13px 0 9px; }
.sensor-card-metrics > span, .sensor-latest-metrics > span { display:grid; flex:1 1 0; min-width:0; padding:0 7px; border-right:1px solid #ebf0f4; text-align:center; }
.sensor-card-metrics > span:first-child, .sensor-latest-metrics > span:first-child { padding-left:0; }.sensor-card-metrics > span:last-child, .sensor-latest-metrics > span:last-child { padding-right:0; border-right:0; }
.sensor-card-metrics b, .sensor-latest-metrics b { overflow:hidden; color:#21394f; font-size:19px; line-height:1.08; text-overflow:ellipsis; white-space:nowrap; }.sensor-card-metrics small, .sensor-latest-metrics small { margin-left:2px; color:#718397; font-size:10px; }.sensor-card-metrics em, .sensor-latest-metrics em { overflow:hidden; margin-top:4px; color:#7d8ea0; font-size:11px; font-style:normal; text-overflow:ellipsis; white-space:nowrap; }
.sensor-card-metrics .sensor-no-metrics { display:block; padding:10px 0; color:#8392a1; font-size:13px; text-align:left; }
.sensor-device-foot { display:flex; justify-content:space-between; gap:8px; padding-top:9px; border-top:1px solid #edf1f4; color:#8492a2; font-size:11px; }.sensor-device-foot > * { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.sensor-device-foot time { text-align:right; }
.sensor-chart-actions { display:flex; gap:6px; flex-wrap:wrap; }.sensor-chart-actions .btn-sm { min-height:31px; padding:5px 9px; font-size:12px; }
.sensor-detail-controls { display:flex; align-items:end; flex-wrap:wrap; gap:10px; margin:0 0 14px; padding:12px; border:1px solid #e6edf3; border-radius:13px; background:#f8fafc; }.sensor-detail-controls label { min-width:150px; flex:1 1 150px; }.sensor-detail-controls label:nth-child(3) { max-width:245px; }.sensor-detail-controls button { min-height:38px; }
.sensor-trend-chart { min-height:285px; padding:13px; border:1px solid #e6edf2; border-radius:14px; background:linear-gradient(180deg,#fcfefd,#f9fcfb); }.sensor-chart-caption { display:flex; justify-content:space-between; gap:8px; padding:0 6px 4px; color:#446075; font-size:12px; }.sensor-chart-caption strong { color:#245040; font-size:14px; }.sensor-trend-chart svg { display:block; width:100%; height:auto; min-height:235px; }.sensor-grid-line { stroke:#dfeae4; stroke-width:1; stroke-dasharray:4 4; }.sensor-axis-label { fill:#8291a0; font-size:11px; }.sensor-area { fill:url(#sensor-trend-fill); }.sensor-line { fill:none; stroke:#13935c; stroke-width:3; stroke-linecap:round; stroke-linejoin:round; }.sensor-point { fill:#fff; stroke:#159562; stroke-width:1.8; }
.sensor-reading-grid { display:grid; grid-template-columns:minmax(230px,.8fr) minmax(410px,1.7fr); gap:12px; margin-top:13px; }.sensor-reading-card { min-width:0; padding:14px; border:1px solid #e7edf2; border-radius:13px; background:#fff; }.sensor-reading-card h4 { margin:0 0 10px; color:#334f63; font-size:14px; }.sensor-latest-reading > time { display:block; margin-bottom:5px; color:#798b9c; font-size:12px; }.sensor-latest-metrics { flex-wrap:wrap; margin:6px 0 0; }.sensor-latest-metrics > span { flex:0 1 33.333%; min-width:78px; margin:4px 0; }.sensor-latest-metrics b { font-size:18px; }.sensor-table-scroll { overflow:auto; max-height:235px; }.sensor-reading-table table { width:100%; border-collapse:collapse; color:#40556a; font-size:12px; }.sensor-reading-table th { position:sticky; top:0; padding:7px; color:#708093; text-align:right; background:#f5f8fb; font-size:11px; }.sensor-reading-table th:first-child,.sensor-reading-table td:first-child { text-align:left; white-space:nowrap; }.sensor-reading-table th small { display:block; color:#97a5b2; font-weight:500; }.sensor-reading-table td { padding:8px 7px; border-top:1px solid #edf1f4; text-align:right; white-space:nowrap; }
.sensor-import-section { background:linear-gradient(120deg,#fff,#f9fdfb); }.sensor-import-fields { display:grid; grid-template-columns:repeat(4,minmax(160px,1fr)); gap:12px; }.sensor-import-fields .sensor-file-field { grid-column:span 2; }.sensor-import-fields input[type=file] { min-height:40px; padding:6px; background:#fafcfd; }.sensor-import-actions { display:flex; gap:9px; margin:14px 0 10px; }.sensor-import-preview { margin:10px 0; padding:13px; border:1px solid #bde8ce; border-radius:12px; background:#f1fbf5; }.sensor-import-preview-head { display:flex; justify-content:space-between; gap:12px; color:#0d7042; font-size:13px; }.sensor-import-preview dl { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:12px 0 0; }.sensor-import-preview dl div { min-width:0; }.sensor-import-preview dt { margin-bottom:3px; color:#6c8275; font-size:11px; font-weight:700; }.sensor-import-preview dd { margin:0; overflow-wrap:anywhere; color:#315646; font-size:12px; }.sensor-import-preview code { display:inline-block; margin:1px; padding:1px 4px; border-radius:4px; color:#37705a; background:#e1f5e8; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:11px; }.sensor-import-warnings { margin:10px 0 0; padding-left:19px; color:#8c631f; font-size:12px; }.sensor-import-message { min-height:20px; margin:0; color:#718295; font-size:13px; }.sensor-import-message[data-state=success] { color:#087a47; }.sensor-import-message[data-state=error] { color:#bd3a3a; }
.sensor-empty-state { display:grid; min-height:92px; place-content:center; gap:7px; padding:20px; border:1px dashed #cbdbe5; border-radius:13px; color:#718295; text-align:center; background:#fbfcfd; font-size:13px; }.sensor-empty-state strong { color:#435d70; font-size:14px; }.sensor-empty-state small { color:#96a4b2; }
@media (max-width:850px) { .sensor-scope-card { display:block; }.sensor-scope-card .sensor-muted { margin-top:9px; padding:0; }.sensor-device-scope-toolbar { display:block; }.sensor-device-scope-toolbar label { margin-bottom:9px; }.sensor-device-mapping-row { grid-template-columns:minmax(190px,1fr) minmax(170px,1fr); }.sensor-device-mapping-controls { grid-column:1 / -1; }.sensor-device-mapping-row button { width:100%; }.sensor-reading-grid { grid-template-columns:1fr; }.sensor-import-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }.sensor-import-fields .sensor-file-field { grid-column:span 2; } }
@media (max-width:620px) { .sensor-hub-heading { display:block; padding:18px; border-radius:16px; }.sensor-hub-heading h2 { font-size:22px; }.sensor-hub-heading .btn-secondary { width:100%; margin-top:13px; }.sensor-scope-card,.sensor-mqtt-card,.sensor-section { padding:14px; border-radius:14px; }.sensor-scope-fields { display:grid; grid-template-columns:1fr; }.sensor-scope-fields label { min-width:0; }.sensor-device-grid { grid-template-columns:1fr; }.sensor-device-scope-toolbar label { width:100%; }.sensor-device-mapping-row { grid-template-columns:1fr; gap:8px; }.sensor-device-mapping-row button { margin-top:2px; }.sensor-detail-controls { display:grid; grid-template-columns:1fr; }.sensor-detail-controls label,.sensor-detail-controls label:nth-child(3) { min-width:0; max-width:none; }.sensor-detail-controls button { width:100%; }.sensor-chart-actions { margin-top:7px; }.sensor-chart-actions .btn-sm { flex:1; }.sensor-trend-chart { min-height:250px; padding:7px; }.sensor-trend-chart svg { min-width:560px; }.sensor-trend-chart { overflow:auto; }.sensor-reading-grid { grid-template-columns:1fr; }.sensor-latest-metrics > span { flex-basis:33.333%; }.sensor-import-fields { grid-template-columns:1fr; }.sensor-import-fields .sensor-file-field { grid-column:auto; }.sensor-import-preview dl { grid-template-columns:1fr; }.sensor-import-preview-head { display:block; }.sensor-import-preview-head span { display:block; margin-top:4px; }.sensor-import-actions { display:grid; grid-template-columns:1fr; }.sensor-import-actions button { width:100%; }.sensor-mqtt-actions { display:grid; margin-left:0; }.sensor-mqtt-actions .btn-secondary { width:100%; margin-top:0; }.sensor-mqtt-dialog-shell { padding:17px; }.sensor-mqtt-form-grid { grid-template-columns:1fr; }.sensor-mqtt-wide,.sensor-mqtt-tls-label { grid-column:auto; }.sensor-mqtt-dialog-actions { display:grid; }.sensor-mqtt-dialog-actions button { width:100%; } }
