:root {
  --ink:#172b3a;
  --muted:#637586;
  --line:#dce4e9;
  --paper:#fff;
  --background:#f4f7f9;
  --primary:#006f79;
  --primary-dark:#00545d;
  --primary-light:#e8f4f4;
  --danger:#b32934;
  --danger-light:#fff1f2;
  --focus:#2b879b;
  --radius:12px;
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:var(--ink);
  background:var(--background);
  font-size:14px;
  line-height:1.5
}

* {
  box-sizing:border-box
}

body {
  margin:0
}

button,input,select {
  font:inherit
}

button,a,input,select,summary {
  -webkit-tap-highlight-color:transparent
}

button {
  cursor:pointer
}

button:disabled {
  cursor:default;
  opacity:.5
}

a {
  color:var(--primary)
}

h1,h2,p {
  margin-top:0
}

h1 {
  font-size:2rem;
  letter-spacing:-.04em;
  line-height:1.2;
  margin-bottom:10px
}

h2 {
  font-size:1.35rem;
  letter-spacing:-.025em;
  line-height:1.3;
  margin-bottom:0
}

p {
  margin-bottom:14px
}

code,pre,.mono {
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace
}

code {
  font-size:.9em
}

small {
  color:var(--muted);
  font-size:.82rem
}

label {
  display:block;
  font-weight:600;
  font-size:.9rem;
  margin-bottom:6px
}

input,select {
  width:100%;
  min-height:42px;
  border:1px solid #bdcbd4;
  border-radius:7px;
  background:#fff;
  color:var(--ink);
  padding:9px 11px
}

input::placeholder {
  color:#7d8c98
}

input:focus-visible,select:focus-visible,button:focus-visible,a:focus-visible,summary:focus-visible {
  outline:3px solid #b4dee4;
  outline-offset:2px;
  border-color:var(--focus)
}

input[type=checkbox] {
  width:17px;
  min-height:17px;
  accent-color:var(--primary)
}

[hidden] {
  display:none!important
}

.muted {
  color:var(--muted)
}

.eyebrow {
  font-size:.75rem;
  font-weight:700;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--primary);
  margin-bottom:10px
}

.button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  min-height:40px;
  border:1px solid #c9d5dc;
  border-radius:7px;
  padding:8px 14px;
  background:var(--paper);
  color:var(--ink);
  font-size:.9rem;
  font-weight:600;
  white-space:nowrap;
  text-decoration:none
}

.button:hover:enabled {
  background:#f1f5f7;
  border-color:#9eb2bf
}

.button.primary {
  background:var(--primary);
  border-color:var(--primary);
  color:#fff
}

.button.primary:hover:enabled {
  background:var(--primary-dark);
  border-color:var(--primary-dark)
}

.button.subtle {
  background:transparent;
  border-color:transparent;
  color:var(--muted)
}

.button.subtle:hover:enabled {
  background:#edf2f5
}

.button.danger {
  background:var(--danger);
  border-color:var(--danger);
  color:#fff
}

.button.danger:hover:enabled {
  background:#8d1e28
}

.button.danger-outline {
  color:var(--danger);
  border-color:#e5bac0;
  background:#fff
}

.button.danger-outline:hover:enabled {
  background:var(--danger-light);
  border-color:var(--danger)
}

.button.compact {
  min-height:32px;
  padding:5px 10px;
  font-size:.82rem
}

.button-group {
  display:flex;
  flex-wrap:wrap;
  gap:8px
}

.full-width {
  width:100%
}

.brand-mark {
  width:36px;
  height:36px;
  border-radius:11px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:var(--primary);
  color:#fff;
  font-weight:800;
  font-size:1.3rem;
  flex-shrink:0
}

.app-header {
  height:76px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  padding:0 34px;
  border-bottom:1px solid var(--line);
  background:#fff
}

.brand {
  display:flex;
  align-items:center;
  gap:11px;
  text-decoration:none;
  color:var(--ink);
  font-size:1.15rem;
  letter-spacing:-.02em
}

.brand strong {
  font-weight:400;
  color:var(--muted)
}

.account {
  display:flex;
  align-items:center;
  gap:12px;
  font-size:.85rem;
  color:var(--muted)
}

.app-shell {
  display:grid;
  grid-template-columns:215px minmax(0,1fr);
  min-height:calc(100vh - 76px)
}

.navigation {
  padding:34px 18px;
  border-right:1px solid var(--line);
  background:#fbfcfd
}

.navigation>.eyebrow {
  padding-left:12px;
  color:var(--muted);
  font-size:.68rem
}

.nav-item {
  width:100%;
  text-align:left;
  border:0;
  border-radius:8px;
  background:transparent;
  padding:12px 13px;
  margin-bottom:6px;
  color:var(--muted);
  font-weight:600
}

.nav-item:hover {
  background:#eef3f5
}

.nav-item.active {
  background:var(--primary-light);
  color:var(--primary)
}

.navigation-note {
  font-size:.78rem;
  color:var(--muted);
  padding:22px 12px;
  max-width:180px
}

.main-content {
  min-width:0;
  width:100%;
  max-width:1540px;
  padding:35px 38px 65px
}

.page-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  margin-bottom:25px
}

.page-heading p:last-child {
  margin-bottom:0
}

.panel {
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:var(--radius);
  overflow:hidden;
  box-shadow:0 2px 5px #102b3d03
}

.toolbar {
  display:flex;
  align-items:flex-end;
  gap:12px;
  padding:21px 23px;
  border-bottom:1px solid var(--line);
  flex-wrap:wrap
}

.field {
  display:flex;
  flex-direction:column;
  gap:0;
  min-width:150px
}

.field.grow {
  flex:1;
  max-width:420px
}

.field small {
  display:block;
  margin-top:7px
}

.table-wrap {
  overflow-x:auto
}

table {
  border-collapse:collapse;
  width:100%;
  text-align:left;
  font-size:.88rem
}

th {
  background:#f8fafb;
  color:#5c7080;
  font-size:.72rem;
  letter-spacing:.045em;
  text-transform:uppercase;
  font-weight:700;
  padding:13px 22px;
  border-bottom:1px solid var(--line);
  white-space:nowrap
}

td {
  padding:17px 22px;
  border-bottom:1px solid #e9eef1;
  vertical-align:top
}

tbody tr:last-child td {
  border-bottom:0
}

tbody tr.selected {
  background:#f1f9f9
}

tbody tr:hover {
  background:#fafcfd
}

.empty-state {
  text-align:center;
  color:var(--muted);
  padding:37px 22px!important
}

.pagination {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:15px;
  border-top:1px solid var(--line);
  padding:15px 22px;
  font-size:.82rem
}

.pagination>div {
  display:flex;
  gap:8px
}

.detail-section {
  margin-top:35px
}

.section-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  margin-bottom:17px
}

.badge {
  display:inline-flex;
  align-items:center;
  padding:3px 9px;
  border-radius:999px;
  font-size:.76rem;
  font-weight:600;
  white-space:nowrap;
  background:#edf2f5;
  color:#526a7b
}

.badge.enabled {
  background:#e5f3ed;
  color:#246d4c
}

.badge.disabled {
  background:#f2ecee;
  color:#8e4a57
}

.timestamp {
  white-space:nowrap
}

.timestamp-epoch {
  display:block;
  color:var(--muted);
  font-size:.76rem;
  margin-top:4px
}

.telemetry-table td {
  padding-top:17px;
  padding-bottom:17px
}

.json-details {
  min-width:200px;
  max-width:560px
}

.json-details summary {
  cursor:pointer;
  font-weight:600;
  color:var(--primary);
  padding:2px 0;
  white-space:nowrap
}

.json-details pre {
  margin:12px 0 2px;
  background:#f4f7f9;
  border:1px solid var(--line);
  border-radius:7px;
  padding:14px;
  font-size:.78rem;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  max-height:400px;
  overflow:auto;
  min-width:250px
}

.notice {
  border:1px solid #bddad8;
  background:#eff8f7;
  border-radius:8px;
  padding:12px 16px;
  color:#1d625f;
  font-size:.9rem;
  margin-bottom:22px;
  overflow-wrap:anywhere
}

.notice.error {
  background:var(--danger-light);
  color:#8b222c;
  border-color:#e9c4c8
}

.notice.info {
  background:#f0f6fa;
  border-color:#d5e3ee;
  color:#415f74
}

.form-panel {
  padding:25px
}

.form-help {
  max-width:780px;
  color:var(--muted);
  margin-bottom:24px
}

.form-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:22px;
  max-width:950px;
  margin-bottom:25px
}

.form-grid .full-span {
  grid-column:1/-1
}

.input-action {
  display:flex;
  gap:8px
}

.input-action input {
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
  min-width:0
}

.checkbox-label {
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:0;
  font-weight:500;
  cursor:pointer
}

.form-actions {
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:23px
}

.form-panel>.notice {
  margin-bottom:0;
  max-width:950px
}

.key-value {
  display:block;
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
  font-size:.76rem;
  overflow-wrap:anywhere;
  max-width:420px;
  margin-bottom:8px
}

.row-actions {
  display:flex;
  flex-wrap:wrap;
  gap:7px
}

.key-controls {
  display:flex;
  flex-wrap:wrap;
  gap:6px
}

.danger-text {
  color:var(--danger)
}

dialog {
  width:min(510px,calc(100vw - 32px));
  max-height:calc(100vh - 50px);
  padding:29px;
  border:1px solid var(--line);
  border-radius:14px;
  color:var(--ink);
  box-shadow:0 24px 100px #172b3a35
}

dialog::backdrop {
  background:#17324070
}

dialog h2 {
  margin-bottom:15px
}

dialog p {
  color:var(--muted)
}

dialog .delete-device {
  background:var(--danger-light);
  border-radius:7px;
  padding:12px;
  color:var(--danger);
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace
}

dialog .form-actions {
  flex-wrap:wrap
}

.login-page {
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:35px 20px;
  background:radial-gradient(ellipse at 20% 10%,#e5f2f2 0,transparent 55%),var(--background)
}

.login-card {
  width:min(440px,100%);
  background:#fff;
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow:0 15px 70px #1735480b;
  padding:36px
}

.login-card>.brand-mark {
  margin-bottom:25px;
  width:45px;
  height:45px;
  font-size:1.6rem
}

.login-card h1 {
  font-size:1.7rem
}

.login-card .muted {
  margin-bottom:25px
}

.login-card input {
  margin-bottom:17px
}

.login-card input[type=hidden] {
  margin:0
}

.login-card .full-width {
  margin-top:7px
}

.login-footer {
  font-size:.78rem;
  color:var(--muted);
  margin:24px 0 0;
  padding-top:20px;
  border-top:1px solid var(--line)
}

.sr-only {
  position:absolute;
  left:0;
  top:0;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0
}

@media(max-width:1050px) {
  .app-shell {
    grid-template-columns:185px minmax(0,1fr)
  }
  .main-content {
    padding:28px 24px 50px
  }
  .app-header {
    padding:0 24px
  }
  .toolbar {
    padding:18px
  }
  td,th {
    padding-left:17px;
    padding-right:17px
  }
  .toolbar .field.grow {
    max-width:none
  }
}

@media(max-width:760px) {
  .app-header {
    height:auto;
    min-height:70px;
    flex-wrap:wrap;
    padding:15px 20px;
    gap:10px
  }
  .brand {
    font-size:1rem
  }
  .account {
    margin-left:auto;
    gap:5px
  }
  .app-shell {
    display:block;
    min-height:calc(100vh - 70px)
  }
  .navigation {
    display:flex;
    gap:7px;
    padding:12px 20px;
    border-right:0;
    border-bottom:1px solid var(--line)
  }
  .navigation>.eyebrow,.navigation-note {
    display:none
  }
  .nav-item {
    width:auto;
    margin:0;
    padding:9px 12px;
    font-size:.87rem
  }
  .main-content {
    padding:25px 17px 45px
  }
  .page-heading,.section-heading {
    align-items:flex-start;
    flex-direction:column;
    gap:15px
  }
  .page-heading {
    margin-bottom:20px
  }
  .page-heading h1 {
    font-size:1.75rem
  }
  .toolbar {
    gap:10px;
    padding:16px
  }
  .toolbar .field {
    min-width:140px;
    flex:1
  }
  .toolbar .field.grow {
    min-width:100%;
    max-width:none
  }
  .form-grid {
    grid-template-columns:1fr;
    gap:19px
  }
  .form-grid .full-span {
    grid-column:auto
  }
  .form-panel {
    padding:20px
  }
  .pagination {
    padding:14px 16px
  }
  .pagination>span {
    font-size:.76rem
  }
  .telemetry-table {
    min-width:890px
  }
  th,td {
    padding-left:16px;
    padding-right:16px
  }
  .login-card {
    padding:29px
  }
  .detail-section {
    margin-top:27px
  }
  .button-group {
    gap:7px
  }
  dialog {
    padding:23px
  }
}
