/* GOcontroll Cloud dashboard — GENERATED by cloud-deployer. Static; brand token
   comes from /app-config.json (styling.brand) applied to --brand at runtime.
   Tokens mirror GOcontroll-Architecture/styling. Theme-aware (light default +
   prefers-color-scheme dark). Do not hand-edit. */

:root {
  --brand: #e94e25;
  --brand-light: #fdf2ef;
  --brand-dim: rgba(233, 78, 37, .12);
  --black: #1a1a1a;
  --bg: #f5f5f5;
  --panel: #fff;
  --white: #fff;
  --muted: #6b7280;
  --border: #e2e2e2;
  --border2: #d0d0d0;
  --danger: #dc2626;
  --warn: #d97706;
  --info: #2563eb;
  --ok: #16a34a;
  --radius: 6px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  --topbar-h: 52px;
  --sidebar-w: 288px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand-light: rgba(233, 78, 37, .16);
    --black: #ececec;
    --bg: #131313;
    --panel: #1c1c1c;
    --white: #1c1c1c;
    --muted: #9aa0aa;
    --border: #2c2c2c;
    --border2: #3a3a3a;
  }
}

* { box-sizing: border-box; }
/* The `hidden` attribute must beat author `display` rules (e.g. .empty-state uses
   flex, which would otherwise override the UA [hidden]{display:none}). */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  color: var(--black);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
.spacer { flex: 1 1 auto; }

/* ---- top bar ---- */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--panel);
  border-bottom: 3px solid var(--brand);
  position: sticky;
  top: 0;
  z-index: 10;
}
.logo { height: 26px; width: auto; }
.app-title { font-size: 15px; font-weight: 600; letter-spacing: .01em; }
.conn { font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.conn.ok::before { content: "● "; color: var(--ok); }
.conn.err::before { content: "● "; color: var(--danger); }

/* ---- shell layout ---- */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: calc(100vh - var(--topbar-h));
}
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.side-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 14px 16px 8px;
}
.side-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.side-count { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.search {
  margin: 0 12px 10px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  color: var(--black);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
}
.search:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-dim); }
.device-list { overflow-y: auto; padding: 0 8px 12px; }

.device {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 11px;
  margin: 2px 0;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.device:hover { background: var(--bg); }
.device.sel { background: var(--brand-light); border-color: var(--brand); }
.device .dev-id { font-weight: 600; font-size: 13px; word-break: break-all; }
.device .dev-fields { margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.device .dev-f { font-size: 11.5px; color: var(--muted); }
.device .dev-f b { color: var(--black); font-weight: 600; }

/* ---- content ---- */
.content { overflow-y: auto; min-height: 0; padding: 16px; }
.empty-state {
  display: flex; align-items: center; justify-content: center;
  height: 60vh; color: var(--muted); font-size: 14px;
}
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.tab {
  padding: 7px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); color: var(--muted); cursor: pointer; font: inherit; font-size: 13px; font-weight: 600;
}
.tab:hover { border-color: var(--border2); }
.tab.sel { background: var(--brand); border-color: var(--brand); color: #fff; }

.tab-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.time-sel { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.time-sel .time-badge {
  padding: 4px 10px; background: var(--brand-dim); color: var(--brand);
  border-radius: 100px; font-weight: 600; font-size: 12px;
}
.btn {
  padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); color: var(--black); cursor: pointer; font: inherit; font-size: 13px;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }

/* ---- widget grid (12-col, mirrors the configurator layout) ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 92px;
  gap: 12px;
}
.widget {
  grid-column: span 4;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.w-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 8px; }
.w-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.dash-w-empty { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; justify-content: center; flex: 1; text-align: center; }

/* gauge */
.gauge-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; }
.gauge-svg { width: 100%; max-width: 190px; height: auto; }
.gauge-val { font-size: 26px; font-weight: 700; font-family: var(--mono); margin-top: -6px; }
.gauge-range { margin-top: 2px; }

/* timeseries / sparkline */
.spark-wrap { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.spark-svg { flex: 1; width: 100%; min-height: 0; }
.spark-foot { margin-top: 6px; display: flex; justify-content: space-between; }
.spark-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 4px; }
.spark-legend span { font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.spark-legend i { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }

/* table */
.dash-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dash-table th { text-align: left; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; font-size: 10.5px; padding: 4px 8px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--panel); }
.dash-table td { padding: 4px 8px; border-bottom: 1px solid var(--border); font-family: var(--mono); }
.dash-table td.muted { color: var(--muted); }
.table-scroll { overflow: auto; flex: 1; min-height: 0; }

/* text */
.text-val { font-size: 30px; font-weight: 700; font-family: var(--mono); display: flex; align-items: center; justify-content: center; flex: 1; word-break: break-all; text-align: center; }

/* boolean */
.bool-wrap { display: flex; align-items: center; justify-content: center; flex: 1; }
.bool-pill { padding: 8px 20px; border-radius: 100px; font-weight: 700; font-size: 15px; }
.bool-pill.on { background: rgba(22, 163, 74, .12); color: var(--ok); }
.bool-pill.off { background: rgba(107, 114, 128, .14); color: var(--muted); }

/* map */
.map-wrap { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.map-canvas { flex: 1; min-height: 120px; border-radius: 4px; overflow: hidden; background: var(--bg); }
.map-foot { margin-top: 6px; }

.small { font-size: 11.5px; }
.muted { color: var(--muted); }

/* ---- responsive: collapse the grid + sidebar on narrow screens ---- */
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; height: auto; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--border); max-height: 40vh; }
  .grid { grid-template-columns: repeat(4, 1fr); }
  .widget { grid-column: span 4 !important; }
}
