@import url("./tokens.css");
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  color: var(--text);
}
#sidebar {
  width: 244px;
  overflow-y: auto;
  position: fixed;
  inset: 0 auto 0 0;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.brand {
  --brand-ink: #e2effb;
  --brand-signal: #91c42c;
  --brand-parent: #a3cf59;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.9px;
  color: var(--brand-ink);
}
.brand-mark {
  display: block;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
}
.brand-monogram { fill: var(--brand-ink); }
.brand-signal { fill: none; stroke: var(--brand-signal); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }
.brand-node { fill: var(--brand-signal); }
.brand-name { display: block; line-height: 1.1; white-space: nowrap; }
.brand small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2px;
  color: var(--muted);
  margin-top: 5px;
}
.brand small b { font-weight: 700; color: var(--brand-ink); }
.brand small b span { color: var(--brand-parent); }
.brand--stacked { flex-direction:column; text-align:center; gap:.2em; }
.brand.brand--stacked .brand-mark { width:6.4em; height:6.4em; }
:root[data-theme="light"] .brand { --brand-ink: #0a416f; --brand-signal: #85b826; --brand-parent: #527719; }
.workspace-label,
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
  color: var(--muted);
}
.workspace-label {
  margin-top: 24px;
}
.workspace {
  margin-top: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: left;
  padding: 12px 10px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
}
nav {
  margin-top: 26px;
  display: grid;
  gap: 6px;
}
nav button {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 12px 10px;
  border-radius: 7px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 11px;
  align-items: center;
}
nav button span {
  font-size: 19px;
  width: 22px;
}
nav button.active {
  background: var(--accent-dim);
  color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}
nav b {
  margin-left: auto;
  background: var(--red-dim);
  color: var(--red);
  padding: 0 6px;
  border-radius: 4px;
}
.edge-note {
  margin-top: auto;
  padding: 22px 8px 16px;
  font-size: 11px;
  border-bottom: 1px solid var(--border);
}
.edge-note p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 6px;
}
.profile {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 20px;
  font-size: 12px;
}
.profile small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}
.avatar {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px;
  color: var(--accent);
  font-size: 11px;
}
.shell {
  margin-left: 244px;
}
header {
  height: 73px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  border-bottom: 1px solid var(--border);
  background: var(--sidebar);
}
.breadcrumb {
  font-size: 12px;
  color: var(--muted);
}
.breadcrumb span {
  padding: 0 14px;
  color: var(--border);
}
.breadcrumb strong {
  font-weight: 500;
  color: var(--text);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 22px;
}
.time-zone {
  font-size: 11px;
  color: var(--muted);
}
.icon-button {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 7px;
  min-height: 36px;
  min-width: 36px;
  font-size: 18px;
}
#menu {
  display: none;
}
.demo-banner {
  padding: 9px 34px;
  background: var(--accent-dim);
  color: var(--muted);
  font-size: 10px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid var(--border);
}
.demo-banner strong {
  color: var(--accent);
  letter-spacing: 0.6px;
}
main {
  padding: 32px 34px;
  max-width: 1700px;
  margin: auto;
  min-height: 80vh;
}
.title-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 27px;
}
h1 {
  font-size: 28px;
  letter-spacing: -0.8px;
  margin: 5px 0;
  font-weight: 650;
}
h2 {
  font-size: 16px;
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.2px;
}
h3 {
  font-size: 14px;
  margin: 0;
}
.subtitle {
  color: var(--muted);
  font-size: 12px;
  margin: 7px 0;
}
.live {
  font-size: 11px;
  color: var(--green);
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 8px 12px;
  border-radius: 20px;
  white-space: nowrap;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.kpi {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 18px 20px;
}
.kpi-top {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}
.kpi-icon {
  color: var(--cyan);
  font-size: 17px;
}
.kpi-value {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -1px;
  margin: 9px 0 2px;
}
.kpi-value small {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0;
}
.kpi-foot {
  font-size: 10px;
  color: var(--muted);
}
.green {
  color: var(--green);
}
.amber {
  color: var(--amber);
}
.cyan {
  color: var(--cyan);
}
.red {
  color: var(--red);
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0;
}
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
input,
select {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  padding: 9px 11px;
  min-height: 40px;
  font-size: 12px;
  max-width: 100%;
}
input::placeholder {
  color: var(--muted);
}
.muted {
  color: var(--muted);
  font-size: 11px;
}
.device-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.device-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 11px;
  overflow: hidden;
}
.device-head {
  padding: 17px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}
.device-name {
  display: flex;
  gap: 10px;
  align-items: center;
}
.device-icon {
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 22px;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
}
.device-head small {
  font-size: 10px;
  color: var(--muted);
}
.badge {
  font-size: 9px;
  font-weight: 600;
  padding: 4px 7px;
  border-radius: 5px;
  white-space: nowrap;
}
.badge.online {
  color: var(--green);
  background: var(--green-dim);
}
.badge.stale {
  color: var(--amber);
  background: var(--amber-dim);
}
.badge.offline,
.badge.unknown {
  color: var(--red);
  background: var(--red-dim);
}
.device-body {
  padding: 17px 18px;
}
.location {
  font-size: 11px;
  color: var(--muted);
}
.measurements {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 18px 0;
}
.measurement span {
  font-size: 10px;
  color: var(--muted);
  display: block;
}
.measurement strong {
  font-size: 23px;
  font-weight: 600;
}
.measurement small {
  font-size: 11px;
  color: var(--muted);
  margin-left: 4px;
}
.sparkline {
  width: 100%;
  height: 42px;
  color: var(--cyan);
  opacity: 0.85;
  display: block;
  margin: 5px 0 10px;
}
.device-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--border);
  gap: 8px;
}
.link-button {
  background: transparent;
  border: 0;
  padding: 4px 0;
  color: var(--accent);
  font-size: 11px;
}
.demo-preview-link { margin:20px 10px 0; align-self:flex-start; }
.primary,
.secondary {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 10px 15px;
  font-size: 12px;
  min-height: 40px;
}
.primary {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
  font-weight: 650;
}
.secondary {
  background: var(--panel);
  color: var(--text);
}
.secondary:hover { border-color:var(--accent); background:var(--accent-dim); }
.lower-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin-top: 25px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 22px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.alarm-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 15px 0;
  border-top: 1px solid var(--border);
}
.alarm-sign {
  font-size: 18px;
  color: var(--amber);
  background: var(--amber-dim);
  padding: 5px 10px;
  border-radius: 7px;
}
.alarm-item p {
  font-size: 11px;
  color: var(--muted);
  margin: 4px 0;
}
.alarm-item .secondary {
  margin-left: auto;
  padding: 6px 10px;
  font-size: 10px;
}
.empty {
  padding: 35px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 9px;
  color: var(--muted);
}
.weather {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 22px 0;
}
.weather-symbol {
  font-size: 44px;
  color: var(--amber);
}
.weather strong {
  font-size: 32px;
  font-weight: 500;
}
.weather p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.weather-details {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  color: var(--muted);
  font-size: 11px;
}
.chart-wrap {
  overflow: hidden;
}
.chart {
  width: 100%;
  height: 290px;
  display: block;
}
.chart text {
  fill: var(--muted);
  font-size: 11px;
}
.chart .gridline {
  stroke: var(--border);
  stroke-width: 1;
}
.chart .series {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 2.5;
}
.chart .previous {
  fill: none;
  stroke: var(--amber);
  stroke-width: 2;
  stroke-dasharray: 5 5;
}
.chart .area {
  fill: var(--cyan-dim);
}
.legend {
  display: flex;
  gap: 20px;
  font-size: 11px;
  justify-content: center;
  margin: 10px;
}
.legend span:first-child {
  color: var(--cyan);
}
.legend span:last-child {
  color: var(--amber);
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}
.stats > div {
  padding: 15px;
  background: var(--bg);
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px;
}
.stats strong {
  display: block;
  font-size: 21px;
  color: var(--text);
  margin-top: 6px;
}
label {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  gap: 7px;
  align-items: center;
}
label input[type="checkbox"] {
  min-height: auto;
}
.info-box {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 17px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 12px;
}
.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}
.setting-row {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.setting-row p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 12px;
}
footer {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 20px 34px;
  color: var(--muted);
  font-size: 9px;
  border-top: 1px solid var(--border);
  letter-spacing: 0.7px;
}
dialog {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  max-width: 440px;
  width: calc(100% - 30px);
}
dialog::backdrop {
  background: #0009;
}
dialog h2 {
  margin: 10px 0;
}
dialog p {
  font-size: 13px;
  color: var(--muted);
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}
#toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  background: var(--text);
  color: var(--bg);
  border-radius: 8px;
  z-index: 40;
  max-width: 90vw;
  font-size: 12px;
}
#toast:empty {
  display: none;
}
.mobile-label {
  display: none;
}
@media (min-width: 1500px) {
  .device-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 1200px) {
  #sidebar {
    width: 215px;
    padding: 24px 13px;
  }
  .shell {
    margin-left: 215px;
  }
  main {
    padding: 25px 22px;
  }
  .device-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .lower-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .kpis {
    gap: 10px;
  }
  .kpi {
    padding: 15px;
  }
  .kpi-value {
    font-size: 26px;
  }
}
@media (max-width: 800px) {
  #sidebar .brand--stacked .brand-mark { width:104px; height:104px; }
  #sidebar {
    transform: translateX(-100%);
    width: 244px;
    box-shadow: 20px 0 60px #0006;
  }
  #sidebar.open {
    transform: translateX(0);
  }
  .shell {
    margin-left: 0;
  }
  #menu {
    display: block;
  }
  header {
    padding: 0 18px;
    height: 61px;
    gap: 12px;
  }
  .breadcrumb {
    margin-right: auto;
    font-size: 11px;
  }
  .breadcrumb > span,
  .time-zone {
    display: none;
  }
  .header-actions {
    gap: 8px;
  }
  .demo-banner {
    padding: 9px 18px;
    font-size: 9px;
  }
  .demo-banner > span:last-child {
    display: none;
  }
  main {
    padding: 24px 18px;
  }
  .title-row {
    align-items: start;
    gap: 10px;
  }
  h1 {
    font-size: 25px;
  }
  .live {
    font-size: 9px;
    padding: 7px 9px;
  }
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .device-grid {
    gap: 12px;
  }
  .device-head,
  .device-body {
    padding: 14px;
  }
  .device-head {
    flex-wrap: wrap;
  }
  .kpi-value {
    font-size: 28px;
  }
  .toolbar {
    align-items: stretch;
  }
  .filters {
    width: 100%;
  }
  .filters input[type="search"] {
    flex: 1;
    min-width: 120px;
  }
  .filters select {
    flex: 1;
  }
  .panel {
    padding: 18px;
  }
  footer {
    padding: 18px;
    flex-wrap: wrap;
    font-size: 8px;
  }
  footer span:nth-child(2) {
    display: none;
  }
  .chart {
    height: 230px;
  }
}
@media (max-width: 490px) {
  .device-grid {
    grid-template-columns: 1fr;
  }
  .device-head {
    flex-wrap: nowrap;
  }
  .title-row .live {
    display: none;
  }
  .stats {
    gap: 6px;
  }
  .stats > div {
    padding: 11px;
  }
  .stats strong {
    font-size: 17px;
  }
  .alarm-item {
    flex-wrap: wrap;
  }
  .alarm-item .secondary {
    margin-left: 44px;
  }
  .breadcrumb {
    font-size: 10px;
  }
  .chart {
    height: 210px;
  }
  .weather-details {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
