:root {
  color-scheme:light;
  --bg:#f4f6f6;
  --surface:#fff;
  --ink:#203532;
  --muted:#687c77;
  --line:#e1e8e5;
  --accent:#23695a;
  --tint:#eaf3ef;
  --radius:14px;
  font-family:"Segoe UI Variable","Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  color:var(--ink);
  background:var(--bg);
  font-size:14px
}
* {
  box-sizing:border-box
}
body {
  margin:0
}
button,input,select,textarea {
  font:inherit
}
textarea {
  border:1px solid var(--line);
  border-radius:8px;
  padding:10px;
  resize:vertical;
  width:100%;
}
.notice-inline {
  padding:16px;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--tint);
  overflow-wrap:anywhere;
  user-select:all;
}
[hidden] {
  display:none!important
}
button,a,input,select,summary {
  touch-action:manipulation
}
button {
  border:1px solid transparent;
  border-radius:8px;
  padding:10px 17px;
  background:var(--accent);
  color:white;
  font-weight:600;
  cursor:pointer;
  white-space:nowrap;
  transition:background .18s,box-shadow .18s,transform .18s
}
button:hover {
  background:#195346
}
button:active {
  transform:translateY(1px)
}
button:disabled {
  opacity:.48;
  cursor:default;
  transform:none
}
button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible,a:focus-visible,.table-wrap:focus-visible {
  outline:3px solid #6bab97;
  outline-offset:3px
}
.secondary {
  background:var(--surface);
  border-color:var(--line);
  color:var(--ink)
}
.secondary:hover {
  background:var(--tint);
  border-color:#c4d6cf
}
.text-button {
  background:transparent;
  color:var(--accent);
  padding:6px 9px
}
.text-button:hover {
  background:var(--tint)
}
.app-header {
  height:60px;
  position:sticky;
  top:0;
  z-index:20;
  display:flex;
  align-items:center;
  gap:18px;
  padding:0 24px;
  background:var(--surface);
  border-bottom:1px solid var(--line)
}
.brand {
  display:flex;
  align-items:center;
  gap:9px;
  flex-shrink:0
}
.brand-mark {
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  background:var(--accent);
  color:#fff;
  border-radius:9px;
  font-size:19px;
  font-weight:700
}
.brand-name {
  font-size:19px;
  font-weight:700;
  letter-spacing:-.8px
}
.header-label {
  border-left:1px solid var(--line);
  padding-left:18px;
  color:var(--muted);
  font-size:13px
}
.account {
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:18px
}
#identity {
  font-size:13px;
  color:var(--muted)
}
#logout,#password-button {
  font-size:12px;
  padding:7px 12px
}
.telemetry-note {
  margin:0 0 14px;
  color:var(--muted);
  font-size:12px;
  line-height:1.6;
}
.skip-link {
  position:fixed;
  top:-100px;
  left:20px;
  z-index:40;
  padding:12px;
  background:var(--accent);
  color:white
}
.skip-link:focus {
  top:8px
}
#workspace {
  display:grid;
  grid-template-columns:224px minmax(0,1fr);
  min-height:calc(100dvh - 60px)
}
aside {
  position:sticky;
  top:60px;
  height:calc(100dvh - 60px);
  display:flex;
  flex-direction:column;
  padding:30px 16px 20px;
  background:#f9fbfa;
  border-right:1px solid var(--line);
  min-width:0
}
.nav-label {
  margin:0 14px 16px;
  font-size:11px;
  color:#7b8d87;
  letter-spacing:1.4px;
  font-weight:600
}
nav {
  display:grid;
  gap:6px
}
nav button {
  display:flex;
  align-items:center;
  gap:11px;
  position:relative;
  padding:12px 14px;
  text-align:left;
  background:transparent;
  color:#63766e;
  font-size:13px;
  font-weight:500
}
nav button:hover {
  background:#eef3f0;
  color:var(--ink)
}
nav button.active {
  background:#e4efe9;
  color:#215d4f;
  font-weight:650
}
nav button.active:after {
  content:"";
  position:absolute;
  right:0;
  top:14px;
  bottom:14px;
  width:3px;
  background:var(--accent);
  border-radius:2px
}
.nav-icon {
  width:19px;
  height:19px;
  opacity:.72
}
.nav-footer {
  margin-top:auto;
  padding:28px 14px 0
}
.nav-footer strong {
  display:block;
  font-size:12px;
  font-weight:600;
  color:#526b60
}
.nav-footer p {
  font-size:11px;
  margin:6px 0 0;
  color:#87978f;
  line-height:1.8
}
#workspace>main {
  width:100%;
  max-width:1640px;
  margin:0 auto;
  padding:24px 34px 48px;
  min-width:0
}
.toolbar {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  min-height:35px;
  margin-bottom:25px
}
.service-status {
  display:flex;
  flex-wrap:wrap;
  gap:9px 18px;
  color:var(--muted);
  font-size:12px
}
.service-item {
  display:inline-flex;
  align-items:center;
  gap:7px
}
.service-dot,.status-dot {
  width:6px;
  height:6px;
  display:inline-block;
  border-radius:50%;
  background:currentColor;
  flex-shrink:0
}
.service-item.good {
  color:#326f55
}
.service-item.warning {
  color:#986c30
}
#refresh {
  font-size:12px;
  padding:8px 12px
}
.page-heading {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:20px;
  margin:0 0 25px
}
.page-heading h1 {
  margin:0 0 9px;
  font-size:27px;
  line-height:1.4;
  font-weight:650;
  letter-spacing:-.8px
}
.page-heading p {
  margin:0;
  max-width:72ch;
  font-size:13px;
  color:var(--muted);
  line-height:1.8
}
.page-aside {
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
  padding-top:12px
}
.live-label {
  display:inline-flex;
  align-items:center;
  gap:7px
}
.live-label .status-dot {
  color:var(--accent)
}
h2 {
  font-size:16px;
  font-weight:650;
  margin:0 0 18px;
  letter-spacing:-.2px
}
p {
  line-height:1.8;
  color:var(--muted);
  text-wrap:pretty
}
.muted {
  color:var(--muted);
  font-size:12px
}
.metrics {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
  margin-bottom:25px
}
.metric {
  padding:20px 22px;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  min-width:0
}
.metric:first-child {
  background:#eaf2ee;
  border-color:#d9e7df
}
.metric-label {
  font-size:12px;
  color:var(--muted)
}
.metric-value {
  display:block;
  font-size:32px;
  line-height:1.4;
  letter-spacing:-1px;
  font-weight:600;
  margin:8px 0 1px;
  font-variant-numeric:tabular-nums
}
.metric-note {
  font-size:11px;
  color:#7d8e85
}
.metric-online .metric-value {
  color:#2e7857
}
.metric-offline .metric-value {
  color:#8c6841
}
.metric-fresh .metric-value {
  color:#3f7066
}
.panel {
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  overflow:hidden
}
.panel-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:21px 23px 0
}
.panel-heading h2 {
  margin:0;
  font-size:15px
}
.panel-heading span {
  font-size:11px;
  color:var(--muted)
}
form {
  display:grid;
  gap:17px;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:24px;
  margin:20px 0
}
form h2 {
  margin:0 0 2px
}
form p {
  font-size:12px;
  margin:0;
  max-width:75ch
}
form button {
  justify-self:start
}
label {
  display:grid;
  gap:8px;
  font-size:12px;
  color:#50655c;
  font-weight:500
}
input,select {
  width:100%;
  min-width:0;
  min-height:40px;
  padding:10px 12px;
  border:1px solid #d4dfd9;
  border-radius:7px;
  background:#fff;
  color:var(--ink);
  font-size:13px;
  transition:border-color .18s,box-shadow .18s
}
input:hover,select:hover {
  border-color:#9dbbae
}
input::placeholder {
  color:#96a69d
}
input[type=file] {
  padding:7px;
  font-size:12px
}
input::file-selector-button {
  border:0;
  padding:5px 10px;
  margin-right:10px;
  background:var(--tint);
  color:var(--accent);
  border-radius:4px;
  cursor:pointer
}
.inline {
  display:flex;
  gap:12px;
  align-items:end;
  flex-wrap:wrap
}
.inline label {
  flex:1;
  min-width:150px
}
.columns {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:20px;
  align-items:start;
  margin:20px 0
}
.columns form {
  margin:0
}
.device-create-fields {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px
}
.filter-form {
  margin:0;
  padding:20px 23px;
  border:0;
  border-radius:0;
  background:transparent
}
.filter-form label {
  flex:0 1 300px
}
.filter-form button {
  height:40px
}
.filter-form .filter-select {
  flex:0 1 170px
}
.pagination {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:15px;
  padding:16px 23px;
  border-top:1px solid var(--line);
  font-size:12px;
  color:var(--muted)
}
.pagination-controls {
  display:flex;
  align-items:center;
  gap:12px
}
.pagination button {
  padding:7px 12px;
  font-size:12px
}
.section-note {
  padding:0 2px;
  font-size:12px;
  line-height:1.8;
  color:var(--muted);
  margin-top:16px
}
.section-note strong {
  font-weight:600;
  color:#516c5e
}
.table-wrap {
  overflow:auto;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:10px;
  margin:20px 0;
  min-width:0
}
.panel>.table-wrap {
  border:0;
  border-radius:0;
  margin:0;
  min-height:170px
}
table {
  width:100%;
  border-collapse:collapse;
  font-size:12px;
  font-variant-numeric:tabular-nums
}
th {
  text-align:left;
  padding:13px 18px;
  background:#f6f9f7;
  font-size:11px;
  font-weight:600;
  color:#7a8b81;
  white-space:nowrap;
  border-bottom:1px solid var(--line)
}
td {
  padding:19px 18px;
  border-bottom:1px solid #edf1ee;
  max-width:330px;
  overflow-wrap:anywhere;
  color:#4f645a;
  vertical-align:middle
}
tbody tr:last-child td {
  border-bottom:0
}
tbody tr:hover {
  background:#fbfdfb
}
td button {
  padding:6px 9px;
  font-size:12px;
  font-weight:500
}
.cell-primary {
  display:block;
  font-weight:600;
  font-size:13px;
  color:var(--ink)
}
.cell-secondary {
  display:block;
  font-size:11px;
  color:#85958c;
  margin-top:5px
}
.mono {
  font-family:Consolas,"SFMono-Regular",monospace;
  letter-spacing:.2px
}
.status-badge {
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:5px 8px;
  font-size:11px;
  font-weight:500;
  border-radius:5px;
  white-space:nowrap;
  background:#f0f3f1;
  color:#75857b
}
.status-badge.success {
  color:#327653;
  background:#eaf4ed
}
.status-badge.warning {
  color:#976728;
  background:#faf2e4
}
.status-badge.danger {
  color:#a84942;
  background:#faeeec
}
.status-badge.neutral {
  color:#76847b;
  background:#edf1ef
}
.status-badge.info {
  color:#406c60;
  background:#ebf1ee
}
.cell-actions {
  display:flex;
  align-items:center;
  gap:4px
}
.cell-actions button {
  background:transparent;
  color:var(--accent);
  padding:7px 8px
}
.cell-actions button:hover {
  background:var(--tint)
}
td details summary {
  cursor:pointer;
  color:var(--accent)
}
td pre {
  max-width:340px;
  white-space:pre-wrap;
  font-size:11px;
  line-height:1.7;
  background:var(--bg);
  padding:12px;
  border-radius:6px
}
.empty {
  padding:48px 20px;
  text-align:center;
  color:var(--muted)
}
.empty strong {
  display:block;
  font-size:14px;
  font-weight:600;
  color:#536b5d;
  margin-bottom:9px
}
.empty p {
  font-size:12px;
  max-width:50ch;
  margin:0 auto
}
.loading-row {
  display:block;
  height:12px;
  background:#edf2ee;
  border-radius:4px;
  margin:17px 24px;
  max-width:70%
}
.loading-row:nth-child(2) {
  max-width:90%
}
.form-disclosure {
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--surface);
  margin:20px 0;
  overflow:hidden
}
.form-disclosure>summary {
  padding:21px 24px;
  font-size:14px;
  font-weight:600;
  cursor:pointer;
  list-style-position:inside
}
.form-disclosure>summary span {
  font-size:12px;
  color:var(--muted);
  font-weight:400;
  margin-left:15px
}
.form-disclosure>form {
  margin:0;
  border:0;
  border-top:1px solid var(--line);
  border-radius:0
}
.model-management-form {
  gap:22px
}
.catalog-create-row {
  display:flex;
  align-items:end;
  gap:12px
}
.catalog-create-row label {
  flex:1;
  min-width:0
}
.catalog-create-row button {
  height:40px;
  flex:0 0 auto
}
.model-list-section h2 {
  margin:0 0 12px
}
.model-list-section .table-wrap {
  margin:0
}
#device-models-table th,#device-models-table td,
#customer-numbers-table th,#customer-numbers-table td {
  text-align:center;
  vertical-align:middle
}
#device-models-table table,#customer-numbers-table table {
  table-layout:fixed;
  width:100%
}
.entry-actions {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:15px;
  padding:21px 24px;
  background:var(--tint);
  border:1px solid #d9e7de;
  border-radius:var(--radius);
  margin:0 0 20px
}
.entry-actions h2 {
  margin:0 0 5px
}
.entry-actions p {
  margin:0;
  font-size:12px
}
.entry-actions button {
  flex-shrink:0
}
#notice {
  position:fixed;
  top:86px;
  left:50%;
  transform:translateX(-50%);
  z-index:30;
  max-width:min(640px,calc(100% - 32px));
  width:max-content;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  line-height:1.7;
  border-radius:10px;
  font-size:13px
}
#notice:not(:empty) {
  padding:13px 48px 13px 20px;
  background:#fff8e9;
  border:1px solid #e9d6aa;
  color:#785f2d;
  box-shadow:0 8px 24px #334f3914;
  cursor:text;
  user-select:text
}
#notice .notice-close {
  position:absolute;
  top:8px;
  right:8px;
  min-height:30px;
  width:30px;
  padding:0;
  border:0;
  background:transparent;
  color:inherit;
  box-shadow:none;
  font-size:20px;
  line-height:30px;
  cursor:pointer
}
#notice[data-kind=error] {
  background:#fff1ef;
  border-color:#edc4bf;
  color:#963f37
}
#notice[data-kind=success] {
  background:#edf7ef;
  border-color:#c9dfcd;
  color:#36684a
}
.runtime-dialog {
  border:1px solid var(--line);
  border-radius:18px;
  padding:0;
  width:min(660px,calc(100% - 32px));
  max-height:80dvh;
  box-shadow:0 24px 80px #14332733;
  color:var(--ink)
}
.runtime-dialog::backdrop {
  background:#1c34294d;
  backdrop-filter:blur(2px)
}
.dialog-header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  padding:22px 26px;
  border-bottom:1px solid var(--line)
}
.dialog-header h2 {
  margin:0
}
.dialog-content {
  padding:12px 26px 24px;
  overflow-wrap:anywhere
}
.runtime-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:0 24px;
  margin:0
}
.runtime-field {
  padding:15px 0;
  border-bottom:1px solid var(--line)
}
.runtime-field dt {
  font-size:12px;
  color:var(--muted);
  margin-bottom:6px
}
.runtime-field dd {
  margin:0;
  font-size:14px;
  white-space:pre-wrap;
  overflow-wrap:anywhere
}
.dialog-content details {
  font-size:12px;
  color:var(--muted);
  margin-top:20px
}
.dialog-content pre {
  white-space:pre-wrap;
  font-size:11px
}
#login-panel {
  max-width:1200px;
  margin:0 auto;
  min-height:calc(100dvh - 72px);
  display:grid;
  grid-template-columns:1.1fr 1fr;
  align-items:center;
  gap:80px;
  padding:70px 48px
}
.login-story {
  padding:45px 0
}
.login-story .eyebrow {
  font-size:12px;
  letter-spacing:2px;
  color:var(--accent);
  font-weight:600
}
.login-story h1 {
  font-size:46px;
  letter-spacing:-2px;
  line-height:1.4;
  font-weight:600;
  margin:23px 0
}
.login-story h1 span {
  color:var(--accent)
}
.login-story>p {
  font-size:14px;
  max-width:33ch;
  line-height:1.9
}
.login-features {
  display:grid;
  gap:22px;
  margin-top:46px
}
.login-feature {
  display:flex;
  align-items:center;
  gap:16px
}
.login-feature img {
  width:21px;
  height:21px;
  opacity:.6
}
.login-feature strong {
  display:block;
  font-size:13px;
  font-weight:600
}
.login-feature span {
  font-size:12px;
  color:var(--muted);
  display:block;
  margin-top:4px
}
.login-card {
  background:var(--surface);
  padding:38px;
  border:1px solid var(--line);
  border-radius:20px;
  box-shadow:0 16px 48px #264e3410
}
.login-card h2 {
  font-size:24px;
  letter-spacing:-.5px;
  margin:0 0 8px
}
.login-card>p {
  font-size:13px;
  margin:0
}
.login-card form {
  border:0;
  padding:0;
  margin:30px 0 20px;
  gap:22px
}
.login-card input {
  min-height:46px
}
.login-card button {
  width:100%;
  min-height:46px;
  margin-top:5px
}
.login-card .login-footnote {
  font-size:11px;
  padding-top:18px;
  border-top:1px solid var(--line);
  color:#8a998f
}
.login-error {
  font-size:12px;
  color:#ad433c;
  margin-top:12px;
  line-height:1.7
}
@media(min-width:1600px) {
  #workspace>main {
    padding:30px 44px 60px
  }
  .metric {
    padding:23px 25px
  }
  td {
    padding-top:23px;
    padding-bottom:23px
  }
}
@media(max-width:1100px) {
  #workspace {
    grid-template-columns:194px minmax(0,1fr)
  }
  aside {
    padding-left:10px;
    padding-right:10px
  }
  nav button {
    padding:12px 10px;
    font-size:12px;
    gap:8px
  }
  #workspace>main {
    padding:22px
  }
  .metric {
    padding:16px
  }
  .metric-value {
    font-size:29px
  }
  .page-aside {
    display:none
  }
  #login-panel {
    gap:40px;
    padding:40px
  }
  .login-story h1 {
    font-size:37px
  }
}
@media(max-width:768px) {
  .app-header {
    height:64px;
    padding:0 18px;
    gap:12px
  }
  .header-label {
    display:none
  }
  .brand-name {
    font-size:19px
  }
  .account {
    gap:10px
  }
  #identity {
    max-width:145px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:11px
  }
  #workspace {
    grid-template-columns:minmax(0,1fr);
    min-height:calc(100dvh - 64px)
  }
  aside {
    position:sticky;
    top:64px;
    z-index:10;
    display:block;
    height:auto;
    padding:8px 12px;
    border-right:0;
    border-bottom:1px solid var(--line);
    overflow:hidden
  }
  nav {
    display:flex;
    overflow-x:auto;
    gap:5px
  }
  nav button {
    flex-shrink:0;
    padding:10px;
    font-size:12px
  }
  nav button.active:after {
    display:none
  }
  .nav-icon {
    width:16px;
    height:16px
  }
  .nav-label,.nav-footer {
    display:none
  }
  #workspace>main {
    padding:19px 16px 36px
  }
  .toolbar {
    margin-bottom:22px;
    align-items:flex-start
  }
  .service-status {
    gap:7px 12px;
    font-size:10px;
    max-width:230px
  }
  #refresh {
    font-size:11px;
    padding:7px 10px
  }
  .page-heading {
    margin-bottom:20px
  }
  .page-heading h1 {
    font-size:24px
  }
  .page-heading p {
    font-size:12px
  }
  .metrics {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
    margin-bottom:20px
  }
  .metric {
    padding:15px 17px
  }
  .metric-value {
    font-size:28px
  }
  .metric-label,.metric-note {
    font-size:11px
  }
  .panel-heading {
    padding:18px 16px 0
  }
  .panel-heading span {
    font-size:10px
  }
  .filter-form {
    padding:16px;
    gap:10px
  }
  .filter-form label,.filter-form .filter-select {
    flex:1 1 140px
  }
  .pagination {
    padding:14px 16px;
    flex-wrap:wrap
  }
  .pagination-controls {
    gap:8px
  }
  .columns {
    grid-template-columns:minmax(0,1fr);
    gap:16px
  }
  .device-create-fields {
    grid-template-columns:1fr
  }
  form {
    padding:20px
  }
  .entry-actions {
    padding:18px;
    align-items:flex-start
  }
  .entry-actions p {
    font-size:11px
  }
  .entry-actions button {
    padding:9px 12px;
    font-size:12px
  }
  .form-disclosure>summary span {
    display:block;
    margin:8px 0 0 16px
  }
  .catalog-create-row {
    align-items:stretch;
    flex-direction:column
  }
  .catalog-create-row button {
    height:auto;
    align-self:flex-start
  }
  .runtime-grid {
    grid-template-columns:1fr
  }
  #login-panel {
    grid-template-columns:1fr;
    gap:20px;
    padding:32px 20px 44px;
    max-width:500px;
    align-content:center
  }
  .login-story {
    padding:0
  }
  .login-story .eyebrow,.login-features {
    display:none
  }
  .login-story h1 {
    font-size:29px;
    letter-spacing:-.8px;
    margin:0 0 12px
  }
  .login-story h1 br {
    display:none
  }
  .login-story>p {
    font-size:12px;
    max-width:none
  }
  .login-card {
    padding:27px
  }
  .login-card h2 {
    font-size:22px
  }
  #notice {
    top:76px
  }
  .dialog-header {
    padding:18px
  }
  .dialog-content {
    padding:8px 18px 20px
  }
}
@media(prefers-reduced-motion:reduce) {
  *,*:before,*:after {
    transition:none!important;
    animation:none!important;
    scroll-behavior:auto!important
  }
}
/* Keep operational data legible on desktop displays. */
label,table,.cell-primary {
  font-size:13px
}
th,.cell-secondary,.metric-note,.metric-label,.status-badge {
  font-size:12px
}
.cell-primary {
  font-weight:600
}
.metric-label {
  color:#5d7267
}
.metric-note,.cell-secondary {
  color:#6c8174
}
/* Secondary text still meets normal-text contrast on the light surfaces. */
.metric-note,.cell-secondary,th,.panel-heading span,.nav-footer p,.login-card .login-footnote {
  color:#607267
}
.status-badge.neutral {
  color:#4b5c52;
  background:#dce4df
}

/* Real-time status: compact controls and fully exposed telemetry columns. */
#workspace main .page-heading { display:none; }
[data-page="devices"] { margin-top:-24px !important; }
[data-page="logs"] { margin-top:-10px; }
[data-page="logs"] #logs-form { position:relative; z-index:3; overflow:visible; margin:0 0 12px; padding:0; border:0; background:transparent; }
[data-page="logs"] #logs-form .log-device-search { position:relative; flex:0 1 220px; min-width:180px; }
[data-page="logs"] #logs-form .log-device-search > label { display:block; margin-bottom:7px; }
[data-page="logs"] #logs-form .log-time-field { flex:0 1 190px; min-width:170px; }
.log-quick-ranges { display:flex; align-items:center; gap:6px; min-height:40px; }
.log-quick-ranges button { height:40px; padding:0 11px; white-space:nowrap; }
.log-quick-ranges button.active { border-color:#78a692; background:#e4efe9; color:#215d4f; }
[data-page="logs"] #logs-table { margin-top:12px; }
[data-page="logs"] #logs-table th, [data-page="logs"] #logs-table td { text-align:center; }
[data-page="devices"] .page-heading { margin-bottom: 18px; }
[data-page="devices"] .metrics { gap:12px; margin-bottom:14px; }
[data-page="devices"] .metric { display:flex; align-items:baseline; justify-content:space-between; gap:10px; padding: 10px 18px; white-space:nowrap; }
[data-page="devices"] .metric-label, [data-page="devices"] .metric-value { white-space:nowrap; }
[data-page="devices"] .metric-value { font-size: 32px; line-height:1; font-weight:700; margin:0; }
#search-form { position:relative; z-index:3; overflow:visible; }
#search-form .sn-search { position:relative; flex:0 1 190px; min-width:140px; align-self:flex-end; }
.search-suggestions {
  position:absolute;
  z-index:30;
  top:calc(100% + 5px);
  left:0;
  width:220px;
  max-width:calc(100vw - 48px);
  max-height:328px;
  overflow:auto;
  padding:5px;
  border:1px solid var(--line);
  border-radius:7px;
  background:var(--surface);
  box-shadow:0 12px 28px rgba(35,65,52,.14)
}
.search-suggestion {
  display:flex;
  align-items:center;
  gap:6px;
  width:100%;
  min-height:38px;
  padding:8px 10px;
  border:0;
  border-radius:4px;
  background:transparent;
  color:var(--ink);
  text-align:left
}
.search-suggestion:hover,.search-suggestion.active { background:var(--tint); color:var(--accent); }
.search-suggestion-sn,.search-suggestion-terminal { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.search-suggestion-sn { flex:0 1 auto; }
.search-suggestion-terminal { flex:0 1 auto; }
.search-suggestion-sn { font-family:Consolas,"SFMono-Regular",monospace; font-size:12px; }
.search-suggestion-terminal { color:var(--muted); font-size:11px; }
.search-suggestion:hover .search-suggestion-terminal,.search-suggestion.active .search-suggestion-terminal { color:inherit; }
.search-suggestion-empty { padding:10px; color:var(--muted); font-size:12px; text-align:center; }
#devices-table { max-height: 65dvh; }
#devices-table table { table-layout: fixed; min-width: 1550px; }
#devices-table th { position: sticky; top: 0; z-index: 1; }
#devices-table td { padding: 15px 12px; vertical-align: top; }
#devices-table th { padding: 13px 12px; }
#devices-table th:nth-child(1) { width: 54px; }
#devices-table th:nth-child(2) { width: 144px; }
#devices-table th:nth-child(3) { width: 100px; }
#devices-table th:nth-child(4) { width: 80px; }
#devices-table th:nth-child(5) { width: 135px; }
#devices-table th:nth-child(6) { width: 86px; }
#devices-table th:nth-child(7) { width: 100px; }
#devices-table th:nth-child(8) { width: 160px; }
#devices-table th:nth-child(9) { width: 68px; }
#devices-table th:nth-child(10) { width: 95px; }
#devices-table th:nth-child(11) { width: 200px; }
#devices-table th:nth-child(12) { width: 228px; }
.runtime-state { justify-content: center; padding: 5px 8px; }
.runtime-text { display: block; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; }
#device-load-error { color: #a84942; }
@media(max-width:768px) {
  [data-page="devices"] .metric-value { font-size:26px; }
}
@media(min-width:1536px) {
  #workspace>main { max-width: none; padding-left: 30px; padding-right: 30px; }
}

/* Compact telemetry grid: keep one device to one row while retaining full values on hover. */
#devices-table th:first-child,#devices-table td:first-child { text-align:center; }
#devices-table table { min-width: 1380px; }
#devices-table th:nth-child(1) { width:42px; }
#devices-table th:nth-child(2) { width:105px; }
#devices-table th:nth-child(3) { width:105px; }
#devices-table th:nth-child(4) { width:68px; }
#devices-table th:nth-child(5) { width:78px; }
#devices-table th:nth-child(6),#devices-table th:nth-child(7) { width:86px; }
#devices-table th:nth-child(8) { width:105px; }
#devices-table th:nth-child(9) { width:120px; }
#devices-table th:nth-child(10),#devices-table th:nth-child(11) { width:65px; }
#devices-table th:nth-child(12) { width:145px; }
#devices-table th:nth-child(13) { width:145px; }
#devices-table th:nth-child(14) { width:160px; }
#devices-table th:last-child { width:200px; }
#devices-table th,#devices-table td { text-align:center; }
#devices-table th { padding-left:8px; padding-right:8px; }
#devices-table td { padding-left:8px; padding-right:8px; }
#devices-table td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#devices-table td:nth-child(5),#devices-table td:nth-child(12),#devices-table td:nth-child(13),#devices-table td:nth-child(14) { position:relative; }
.compact-cell,.runtime-text { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; }
.compact-cell[title],.runtime-text[title] { cursor:help; }
.runtime-copyable { cursor:copy !important; }
.compact-cell.artifact-download { cursor:pointer; color:var(--accent); text-decoration:underline; }
.destination-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:-4px; }
.destination-actions button { font-size:12px; padding:7px 10px; }
.file-input-row { display:flex; align-items:end; gap:12px; }
.file-input-row label { flex:1; }
.file-input-row button { flex-shrink:0; }
  #import-form select:invalid, #add-device-form select:invalid { color:#b54842; border-color:#d99c97; }
  #import-form select:valid, #add-device-form select:valid { color:var(--ink); }
@media(max-width:768px) { #devices-table table { min-width:1380px; } }

/* OTA task table uses a compact centered status layout. */
.task-selection-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin:12px 0; }
.task-selection-toolbar button { padding:7px 12px; font-size:12px; }
#task-selection-count { font-weight:600; font-variant-numeric:tabular-nums; }
#task-cancel-progress { font-size:12px; color:var(--muted); }
#tasks-table input[type="checkbox"] { width:16px; height:16px; min-height:16px; padding:0; margin:0; vertical-align:middle; accent-color:var(--accent); cursor:pointer; }
#tasks-table th:first-child, #tasks-table td:first-child { width:30px; padding-left:4px; padding-right:2px; }
#tasks-table th:nth-child(2), #tasks-table td:nth-child(2) { padding-left:2px; }

/* Compact laptop workspace chrome without changing the content hierarchy. */
.app-header { height:48px; gap:12px; padding-left:18px; padding-right:18px; }
.brand-mark { width:26px; height:26px; border-radius:7px; font-size:17px; }
.brand-name { font-size:17px; }
.header-label { padding-left:13px; font-size:12px; }
#logout { padding:5px 10px; }
#workspace { grid-template-columns:144px minmax(0,1fr); min-height:calc(100dvh - 48px); }
aside { top:48px; height:calc(100dvh - 48px); padding:12px 10px 16px; }
.nav-label { display:none; }
nav { gap:4px; }
nav button { gap:8px; padding:10px 8px; font-size:12px; }
.nav-icon { width:17px; height:17px; }
#tasks-table .table-sort, #devices-table .table-sort, #firmware-table .table-sort { padding:3px 5px; background:transparent; color:inherit; font:inherit; border-radius:4px; }
#tasks-table .table-sort:hover, #devices-table .table-sort:hover, #firmware-table .table-sort:hover { color:var(--accent); background:var(--tint); }
#tasks-table tr.task-selected { background:var(--tint); }
#tasks-table th, #tasks-table td { text-align: center; vertical-align: middle; }
#tasks-table table { min-width: 1320px; }
#tasks-table td { white-space: nowrap; }

#history-table table { min-width:1620px; table-layout:fixed; }
#history-table th, #history-table td { text-align:center; vertical-align:middle; padding-left:10px; padding-right:10px; }
#history-table td { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#history-table th:nth-child(1) { width:140px; }
#history-table th:nth-child(2), #history-table th:nth-child(3) { width:105px; }
#history-table th:nth-child(4) { width:75px; }
#history-table th:nth-child(5) { width:85px; }
#history-table th:nth-child(6), #history-table th:nth-child(7) { width:100px; }
#history-table th:nth-child(8) { width:90px; }
#history-table th:nth-child(9) { width:180px; }
#history-table th:nth-child(10) { width:110px; }
#history-table th:nth-child(11) { width:180px; }
#history-table th:nth-child(12) { width:160px; }
#history-table th:nth-child(13) { width:150px; }

/* Firmware inventory remains compact as the package catalog grows. */
#firmware-form { grid-template-columns:minmax(140px,180px) minmax(190px,230px) minmax(260px,1fr); align-items:end; }
#firmware-form h2, #firmware-form p, #firmware-form button { grid-column:1/-1; }
#firmware-form button { justify-self:start; }
#firmware-table table { min-width:1120px; table-layout:fixed; }
#firmware-table th, #firmware-table td { text-align:center; vertical-align:middle; padding-left:10px; padding-right:10px; }
#firmware-table td { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#firmware-table th:nth-child(1) { width:48px; }
#firmware-table th:nth-child(2) { width:90px; }
#firmware-table th:nth-child(3) { width:180px; }
#firmware-table th:nth-child(4) { width:86px; }
#firmware-table th:nth-child(5) { width:118px; }
#firmware-table th:nth-child(6), #firmware-table th:nth-child(7) { width:150px; }
#firmware-table th:nth-child(8) { width:92px; }
#firmware-table th:nth-child(9) { width:70px; }
.hash-copy { display:flex; align-items:center; justify-content:center; gap:4px; min-width:0; }
.hash-copy .compact-cell { flex:1; min-width:0; }
.hash-copy-button { flex:0 0 26px; width:26px; height:26px; min-height:26px; padding:4px; border-radius:4px; background:transparent; }
.hash-copy-button:hover { background:var(--tint); }
.hash-copy-button img { display:block; width:16px; height:16px; opacity:.72; }
.task-firmware-fields { display:grid; grid-template-columns:minmax(140px,200px) minmax(260px,1fr); gap:17px; }
#task-configuration-fields { display:grid; gap:17px; }
.task-expiry-field > label { display:block; margin-bottom:7px; }
.task-expiry-controls, .task-expiry-presets { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.task-expiry-controls input { width:auto; min-width:200px; }
.task-expiry-presets button { min-height:34px; padding:5px 11px; }
@media(max-width:768px) {
  #firmware-form { grid-template-columns:1fr; }
  #firmware-form h2, #firmware-form p, #firmware-form button { grid-column:auto; }
  .task-firmware-fields { grid-template-columns:1fr; }
  .catalog-create-row { flex-direction:column; align-items:stretch; }
  .catalog-create-row button { align-self:flex-start; }
  #search-form .sn-search { flex:1 1 100%; width:100%; }
  [data-page="logs"] #logs-form .log-device-search { flex:1 1 100%; width:100%; }
  .log-quick-ranges { flex:1 1 100%; flex-wrap:wrap; }
  .search-suggestions { width:100%; max-width:100%; }
}

/* Keep every workspace page on the same top rhythm as Real-time status. */
#workspace > main > [data-page]:not([data-page="devices"]) { margin-top: -10px; }
#workspace > main > [data-page]:not([data-page="devices"]) > form:first-child,
#workspace > main > [data-page]:not([data-page="devices"]) > .columns > form:first-child,
#workspace > main > [data-page]:not([data-page="devices"]) > div:first-child form:first-of-type {
  margin-top: 0;
}

/* Align secondary workspace pages directly below the sticky brand header. */
#workspace > main > [data-page="firmware"],
#workspace > main > [data-page="tasks"],
#workspace > main > [data-page="history"],
#workspace > main > [data-page="audit"],
#workspace > main > [data-page="organizations"],
#workspace > main > [data-page="groups"],
#workspace > main > [data-page="logs"] {
  margin-top: -24px !important;
}
#workspace > main > [data-page="firmware"] > form:first-of-type,
#workspace > main > [data-page="tasks"] > form:first-of-type,
#workspace > main > [data-page="history"] > form:first-of-type,
#workspace > main > [data-page="logs"] > form:first-of-type,
#workspace > main > [data-page="organizations"] form:first-of-type,
#workspace > main > [data-page="groups"] form:first-of-type {
  margin-top: 0 !important;
}
/* Compact device status table spacing. Keep serial number and SN visually close. */
#devices-table th, #devices-table td { padding-top: 10px; padding-bottom: 10px; padding-left: 6px; padding-right: 6px; }
#devices-table th:nth-child(1), #devices-table td:nth-child(1) { width: 34px; padding-left: 2px; padding-right: 2px; }
#devices-table th:nth-child(2), #devices-table td:nth-child(2) { width: 96px; padding-left: 4px; padding-right: 4px; }
#devices-table th:last-child, #devices-table td:last-child { width: 200px; padding-left: 4px; padding-right: 4px; position: sticky; right: 0; z-index: 1; background: var(--surface); box-shadow: -1px 0 0 var(--line); }
#devices-table th:last-child { z-index: 2; background: #f6f9f7; }
#devices-table tbody tr:hover td:last-child { background: #fbfdfb; }
#devices-table .device-disabled td:last-child { background: #eef1ef; }
.device-disabled { filter: grayscale(1); opacity: .55; }
.device-disabled td { background: #eef1ef; }

.device-actions { display:flex; align-items:center; justify-content:center; gap:6px; white-space:nowrap; }
/* Batch device transfer */
.managed-devices-toolbar { display:flex; align-items:center; gap:12px; margin:0 0 14px; flex-wrap:wrap; }
.managed-device-filter { display:flex; align-items:center; gap:6px; }
.managed-device-filter input { width:220px; min-width:160px; }
.managed-device-filter .secondary { white-space:nowrap; }
.managed-devices-toolbar .muted, .modal-form .muted { color:var(--muted,#667085); font-size:.9rem; }
#bulk-transfer-dialog { width:min(640px, calc(100vw - 32px)); max-height:calc(100vh - 32px); border:0; border-radius:14px; padding:0; box-shadow:0 18px 60px rgba(16,24,40,.24); }
#bulk-transfer-dialog::backdrop { background:rgba(15,23,42,.48); }
.modal-form { display:grid; gap:14px; padding:24px; overflow:auto; max-height:calc(100vh - 32px); }
.modal-form h2 { margin:0; }
.modal-form fieldset { border:1px solid var(--border,#d0d5dd); border-radius:10px; padding:12px; display:grid; gap:12px; }
.modal-form legend { padding:0 6px; font-weight:600; }
.modal-actions { display:flex; justify-content:flex-end; gap:10px; }
.modal-form textarea { resize:vertical; min-height:88px; }
.notice-inline:empty { display:none; }
.organization-tree-panel { margin-top:16px; }
.organization-device-tree { display:grid; gap:4px; padding:4px 0; }
.organization-tree-node { border-left:1px solid var(--line,#e1e8e5); margin-left:10px; padding-left:12px; }
.organization-tree-node > summary { cursor:pointer; list-style-position:outside; padding:2px 0; }
.organization-tree-node > summary::marker { color:var(--muted,#687c77); }
.organization-tree-branch { display:grid; gap:3px; margin:3px 0 5px 16px; }
.tree-node-row { display:flex; align-items:center; gap:6px; width:100%; }
.tree-node-select { display:inline-flex; align-items:center; justify-content:flex-start; gap:4px; width:auto; border:0; background:transparent; border-radius:8px; color:inherit; cursor:pointer; padding:8px 10px; text-align:left; }
.tree-node-row .tree-node-select { flex:1; min-width:0; }
.tree-node-select:hover { background:var(--tint,#eaf3ef); }
.tree-node-select.active { background:var(--tint,#eaf3ef); color:var(--accent,#23695a); font-weight:600; }
.tree-node-count { color:var(--muted,#687c77); font-variant-numeric:tabular-nums; font-weight:600; white-space:nowrap; }
.tree-node-actions { display:inline-flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:4px; flex:none; margin-right:8px; }
.tree-node-action { border:0; border-radius:6px; background:transparent; color:var(--muted,#687c77); cursor:pointer; font-size:.82rem; padding:4px 6px; }
.tree-node-action:hover { background:var(--tint,#eaf3ef); color:var(--accent,#23695a); }
.tree-node-action.danger:hover { color:var(--danger,#b42318); background:#fff1f0; }
.organization-management-tree { display:grid; gap:4px; padding:4px 0 12px; }
#org-table + h2 { margin-top:42px; }
.account-management-tree { padding-top:12px; }
.management-tree-node { margin-left:0; }
.organization-management-tree .organization-tree-branch { margin-left:24px; }
.account-tree-org-label { display:flex; align-items:center; gap:8px; padding:8px 10px; }
.account-tree-org-label .tree-node-count { font-size:.88rem; }
.account-tree-user { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:38px; border-radius:8px; padding:4px 8px 4px 12px; background:var(--surface-subtle,#f7faf9); }
.account-tree-user:hover { background:var(--tint,#eaf3ef); }
.account-tree-identity { color:var(--text,#172b26); font-size:.92rem; }
.account-tree-actions { display:inline-flex; align-items:center; gap:4px; flex:none; }
.group-node { font-size:.94rem; }
#managed-devices-table input[type="checkbox"] { width:14px; height:14px; min-height:14px; padding:0; margin:0; border:0; vertical-align:middle; accent-color:var(--accent); cursor:pointer; }
.managed-status-filter { margin:0; }
.managed-status-filter select { min-width:132px; }
.managed-row-actions { display:flex; align-items:center; flex-wrap:wrap; gap:6px; }
.managed-row-actions > button { white-space:nowrap; }
.managed-more { display:flex; align-items:center; }
.managed-more summary { display:inline-block; padding:6px 7px; border-radius:6px; font-size:12px; list-style:none; cursor:pointer; }
.managed-more summary::-webkit-details-marker { display:none; }
.managed-more summary::after { content:" ▾"; }
.managed-more[open] summary::after { content:" ▴"; }
.managed-more[open] button { margin-left:4px; }
.managed-more summary:hover { background:var(--tint); }
.danger-text { color:var(--danger,#b42318) !important; }
button.danger-action { background:var(--danger,#b42318); }
button.danger-action:hover { background:#912018; }
#managed-devices-table table { min-width:900px; }
#managed-devices-table td:first-child, #managed-devices-table th:first-child { width:34px; text-align:center; }
#managed-devices-table td:last-child, #managed-devices-table th:last-child { min-width:178px; }
.managed-device-disabled td { background:#f6f8f7; color:var(--muted); }
.managed-load-error { color:var(--danger,#b42318); margin:0 0 12px; }
#device-lifecycle-dialog { width:min(560px, calc(100vw - 32px)); max-height:calc(100vh - 32px); border:0; border-radius:14px; padding:0; box-shadow:0 18px 60px rgba(16,24,40,.24); }
#device-lifecycle-dialog::backdrop { background:rgba(15,23,42,.48); }
#sn-note-dialog { width:min(560px, calc(100vw - 32px)); max-height:calc(100vh - 32px); border:0; border-radius:14px; padding:0; box-shadow:0 18px 60px rgba(16,24,40,.24); }
#sn-note-dialog::backdrop { background:rgba(15,23,42,.48); }
#sn-batch-form textarea, #factory-token-form textarea { width:100%; min-height:68px; padding:10px 12px; border:1px solid #d4dfd9; border-radius:7px; color:var(--ink); background:#fff; font:inherit; resize:vertical; }
.sn-note-cell { width:200px; max-width:200px; }
.sn-row-actions { display:flex; flex-wrap:wrap; gap:6px; }
#sn-batches-table table { min-width:1220px; }
#factory-tokens-table table { min-width:1280px; }
.factory-token-cell { display:flex; align-items:center; gap:8px; }
.factory-token-cell .factory-token-value { display:block; width:260px; min-width:200px; max-width:260px; white-space:normal; overflow:visible; overflow-wrap:anywhere; text-overflow:clip; }
.factory-token-cell button { flex:0 0 auto; }
.factory-token-unavailable { width:200px; }
#factory-token-secret { overflow-wrap:anywhere; }
.lifecycle-summary { font-size:1rem; color:var(--ink); margin:0; }
.lifecycle-sn-list { color:var(--muted); font-size:.9rem; }
.lifecycle-sn-list summary { cursor:pointer; }
#device-lifecycle-sns { max-height:128px; overflow:auto; overflow-wrap:anywhere; line-height:1.6; }
#device-lifecycle-status:empty { display:none; }
#device-lifecycle-status { color:var(--danger,#b42318); margin:0; }
.disabled-device-identity { display:grid; justify-items:center; gap:2px; }
.device-disabled-label { color:var(--muted); font-size:10px; letter-spacing:0; font-family:inherit; }

.parameter-page {
  width:min(860px, 100% - 32px);
  max-width:none;
  margin:32px auto;
  padding:0;
}
.parameter-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  flex-wrap:wrap;
  margin-bottom:20px;
}
.parameter-heading h1 { margin:0 0 6px; }
.parameter-heading p, .parameter-card p { color:var(--muted); margin:0; }
.parameter-card {
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:20px;
  margin-bottom:16px;
}
.parameter-card h2 { font-size:16px; margin:0 0 16px; }
.parameter-card dl {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(190px,100%),1fr));
  gap:16px;
  margin:0;
}
.parameter-card dt { color:var(--muted); }
.parameter-card dd { margin:4px 0 0; overflow-wrap:anywhere; }
