/* UONO Cloud — styles. Design system shared with the Hexitronics IoT demo dashboards.
   Dark by default, light via the header toggle. Number font self-hosted (Barlow, SIL OFL). */

@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("../fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("../fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("../fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 500; font-display: swap; src: url("../fonts/barlow-semi-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 600; font-display: swap; src: url("../fonts/barlow-semi-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 700; font-display: swap; src: url("../fonts/barlow-semi-condensed-latin-600-normal.woff2") format("woff2"); }

:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg: #070d18; --bg-2: #0b1424;
  --card: #0f1a2c; --card2: #13213a; --line: #1d2c46; --line2: #2a3d5e;
  --ink: #e9eef7; --ink2: #a9b5c9; --ink3: #71809a;
  --brand: #3d8bff; --brand2: #2a6fe0; --brandSoft: #13284a;
  --good: #2fc672; --goodSoft: #0f2e20; --warn: #f2a51a; --warnSoft: #33260b; --crit: #ff5a5a; --critSoft: #3a1416; --info: #4a9af0; --infoSoft: #12253f;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #2f9a2f; --s7: #9085e9; --s8: #e66767;
  --grid: #1a2840;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  --hero1: #0a1f45; --hero2: #0f3b86;
  --inp: #0b1424;
  /* names used by older scripts (chart.js) */
  --panel: var(--card); --panel-2: var(--card2); --line-2: var(--line2); --ink-2: var(--ink2); --ink-3: var(--ink3);
  --teal: var(--brand); --blue: var(--info); --ok: var(--good); --alarm: var(--crit); --fault: var(--warn); --off: #5d6c86; --on-accent: #fff;
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2f8; --bg-2: #e4eaf4;
  --card: #ffffff; --card2: #f6f8fc; --line: #dde3ee; --line2: #c9d2e2;
  --ink: #0d1726; --ink2: #46536a; --ink3: #7a879c;
  --brand: #1663d6; --brand2: #0e4aa8; --brandSoft: #e3edfd;
  --good: #12a150; --goodSoft: #e2f6ea; --warn: #d98a00; --warnSoft: #fdf1d8; --crit: #dc3434; --critSoft: #fde4e4; --info: #2a78d6; --infoSoft: #e3eefb;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --grid: #e6ebf3;
  --shadow: 0 1px 2px rgba(15,30,60,.06), 0 4px 14px rgba(15,30,60,.06);
  --hero1: #0b3d91; --hero2: #1663d6;
  --inp: #ffffff;
  --off: #9aa6b8;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink);
  font: 400 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "tnum" 1;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 700; letter-spacing: -.1px; margin: 0; line-height: 1.15; }
h1 { font-size: 28px; letter-spacing: -.3px; }
h2 { font-size: 15px; }
h3 { font-size: 16px; }
p { margin: 0 0 12px; }
code { font: 500 .88em ui-monospace, "Cascadia Mono", Consolas, monospace; background: var(--card2); padding: 1px 6px; border-radius: 5px; }
.num { font-family: "Barlow Semi Condensed", "Barlow", Inter, system-ui, sans-serif; font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.muted { color: var(--ink3); }
.small { font-size: 12.5px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.right { text-align: right; }
.inline { display: inline; }
.ic { width: 1em; height: 1em; display: inline-block; vertical-align: -.15em; flex: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.spacer, .sp { flex: 1; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; height: 58px; display: flex; align-items: center; gap: 18px; padding: 0 max(16px, calc((100vw - 1360px) / 2 + 16px));
  background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); min-width: 0; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 34px; height: 34px; flex: none; }
.brand-text b { display: block; font-size: 16px; line-height: 1.1; letter-spacing: .2px; }
.brand-text small { display: block; font-size: 11px; color: var(--ink3); line-height: 1.1; letter-spacing: .4px; text-transform: uppercase; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--ink2); padding: 0 12px; height: 34px; display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; font-weight: 600; font-size: 13px; border: 1px solid transparent; }
.nav a:hover { color: var(--ink); background: var(--card2); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--brand); background: var(--brandSoft); border-color: var(--brand); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.clock { font-size: 13px; color: var(--ink2); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); animation: pulse 1.8s infinite; flex: none; }
.live-dot.off { background: var(--off); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.who { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.who-name { font-weight: 600; font-size: 13px; }
.who-role { font-size: 11.5px; color: var(--ink3); }
.icon-btn { background: var(--card); border: 1px solid var(--line); color: var(--ink2); width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { color: var(--ink); background: var(--card2); border-color: var(--line2); }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: 1360px; margin: 0 auto; padding: 22px 16px 56px; flex: 1; }
.wrap.narrow { max-width: 780px; }
.site-foot { display: flex; justify-content: center; gap: 8px 24px; flex-wrap: wrap; padding: 22px 16px 34px; color: var(--ink3); font-size: 12px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: 6px 0 0; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink3); margin-bottom: 14px; }
.crumbs a { color: var(--ink2); }
.block { margin-top: 26px; }
.block-head, .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h2 { font-size: 13px; font-weight: 700; letter-spacing: .3px; color: var(--ink2); text-transform: uppercase; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-top: 22px; box-shadow: var(--shadow); min-width: 0; }
.panel.pad { margin-top: 18px; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 16px; align-items: start; }
.two-col > .panel { margin-top: 22px; }
.empty { color: var(--ink3); padding: 14px 0; margin: 0; }
li.empty { list-style: none; }

/* section title like the demo */
.section-t { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; font-size: 15px; font-weight: 800; letter-spacing: .2px; flex-wrap: wrap; }
.section-t .ic { color: var(--brand); font-size: 18px; }
.section-t small { font-weight: 500; color: var(--ink3); font-size: 12.5px; }

/* ---------- buttons, forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 600; font-size: 13px; line-height: 1.2; font-family: inherit; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--line2); background: var(--card2); text-decoration: none; }
.btn .ic { font-size: 15px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand2); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--crit); border-color: var(--crit); color: #fff; }
.btn.danger-ghost { background: transparent; color: var(--crit); border-color: color-mix(in srgb, var(--crit) 45%, var(--line)); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn.light { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.3); color: #fff; }
.btn.light:hover { background: rgba(255,255,255,.2); }
.btn[disabled] { opacity: .55; cursor: default; }
input, select, textarea {
  width: 100%; padding: 8px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--inp); color: var(--ink);
  font: inherit; font-size: 14px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brandSoft); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--brand); }
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink2); margin: 14px 0 5px; }
label.check, .checks label, .radios label { display: flex; gap: 10px; align-items: center; color: var(--ink); margin: 8px 0; font-size: 14px; font-weight: 500; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 8px 16px 10px; margin: 18px 0 0; }
legend { padding: 0 6px; color: var(--ink2); font-size: 12.5px; font-weight: 700; }
.hint { color: var(--ink3); font-size: 12.5px; margin: 6px 0 0; line-height: 1.5; }
.form-actions { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; }
.form.pad { padding: 8px 22px 22px; }
.mono-in { font: 500 13px ui-monospace, Consolas, monospace; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline-form input { flex: 1 1 260px; width: auto; }
.danger-zone { border-color: color-mix(in srgb, var(--crit) 40%, var(--line)); }
.search input { width: 300px; max-width: 100%; height: 40px; border-radius: 11px; }

.notice { padding: 11px 14px; border-radius: 12px; margin: 0 0 16px; border: 1px solid; }
.notice.bad { background: var(--critSoft); border-color: color-mix(in srgb, var(--crit) 50%, var(--line)); }
.notice.good { background: var(--goodSoft); border-color: color-mix(in srgb, var(--good) 50%, var(--line)); }
.banner { margin: 16px 0 0; padding: 11px 16px; border-radius: 12px; background: var(--warnSoft); border: 1px solid color-mix(in srgb, var(--warn) 50%, var(--line)); display: flex; gap: 10px; align-items: center; }
.banner .ic { color: var(--warn); font-size: 18px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.panel .table-wrap { border: 0; background: none; box-shadow: none; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; color: var(--ink3); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--card2); }
.tbl .num, .tbl td.n, .tbl th.n { text-align: right; }
.tbl td.w { color: var(--warn); font-weight: 700; } .tbl td.c { color: var(--crit); font-weight: 700; }
.tbl.compact td, .tbl.compact th { padding: 7px 10px; }
.tbl tr.dim td { opacity: .55; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--card2); border: 1px solid var(--line); color: var(--ink2); }
.tag.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 7px 18px; margin: 10px 0 6px; font-size: 13px; }
.kv dt { color: var(--ink3); } .kv dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.kv.r dd { text-align: right; }
.status-line { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; }
.scrollx { overflow-x: auto; }

/* ---------- status glyph (kept: admin + events use it) ---------- */
.hex { --c: var(--off); flex: none; width: 22px; height: 24px; background: var(--c); display: inline-block; vertical-align: middle;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.hex.sm { width: 14px; height: 16px; }
.hex[data-state="online"], .hex[data-state="ok"] { --c: var(--good); }
.hex[data-state="alarm"] { --c: var(--crit); }
.hex[data-state="fault"] { --c: var(--warn); }
.hex[data-state="offline"], .hex[data-state="blocked"], .hex[data-state="unknown"] { --c: var(--off); }
.hex[data-state="info"] { --c: var(--info); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; border: 0; }
.badge .ic { font-size: 12px; }
.badge.alarm, .b-crit { background: var(--critSoft); color: var(--crit); }
.badge.fault, .badge.warn, .b-warn { background: var(--warnSoft); color: var(--warn); }
.badge.ok, .b-good { background: var(--goodSoft); color: var(--good); }
.b-info { background: var(--infoSoft); color: var(--info); }
.b-off { background: var(--card2); color: var(--ink3); }

/* ---------- hero (device + fleet pages) ---------- */
.hero-band { background: linear-gradient(120deg, var(--hero1), var(--hero2)); color: #fff; position: relative; overflow: hidden; }
.hero-band:after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(800px 300px at 85% -10%, rgba(255,255,255,.14), transparent 60%), repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 1px, transparent 1px 48px), repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 48px); }
.hero-band .in { position: relative; z-index: 1; max-width: 1360px; margin: 0 auto; padding: 20px 16px 22px; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; }
.hero-band a { color: #fff; }
.hero-band .crumbs { color: rgba(255,255,255,.7); margin-bottom: 10px; }
.hero-band .crumbs a { color: rgba(255,255,255,.85); }
.series { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); padding: 4px 10px; border-radius: 6px; }
.hero-band h1 { margin: 10px 0 4px; font-size: clamp(24px, 3.4vw, 34px); line-height: 1.12; }
.hero-band .tagl { font-size: 15px; opacity: .92; margin: 0; }
.hero-band .meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 12.5px; opacity: .92; }
.hero-band .meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-band .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.hero-side { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.statusbig { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22); border-radius: 16px; padding: 14px 18px; min-width: 260px; max-width: 380px; }
.statusbig .ring { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; background: #fff; flex: none; color: #12a150; }
.statusbig b { display: block; font-size: 20px; letter-spacing: .5px; }
.statusbig small { opacity: .85; font-size: 12px; display: block; }
.statusbig.warn { background: rgba(242,165,26,.28); border-color: rgba(255,215,140,.6); } .statusbig.warn .ring { color: #d98a00; animation: blink 1.2s infinite; }
.statusbig.crit { background: rgba(220,52,52,.35); border-color: rgba(255,160,160,.6); } .statusbig.crit .ring { color: #dc3434; animation: blink .7s infinite; }
.statusbig.off { background: rgba(0,0,0,.18); } .statusbig.off .ring { color: #7a879c; }
@keyframes blink { 50% { transform: scale(.9); opacity: .7; } }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.hero-stats div { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: 14px; padding: 12px 14px; min-width: 110px; }
.hero-stats b { display: block; font-size: 26px; line-height: 1.1; }
.hero-stats span { font-size: 12px; opacity: .85; }
@media (max-width: 860px) { .hero-band .in { grid-template-columns: 1fr; } .statusbig { min-width: 0; max-width: none; } .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.has-hero > .topbar { border-bottom-color: transparent; }

/* ---------- sign in ---------- */
body.auth { background: var(--bg); }
.auth-wrap { flex: 1; display: grid; grid-template-columns: 1.2fr 1fr; min-height: calc(100vh - 58px); }
.auth-side { background: linear-gradient(125deg, var(--hero1), var(--hero2)); color: #fff; position: relative; overflow: hidden; padding: 56px 48px; display: flex; flex-direction: column; justify-content: center; }
.auth-side:after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(700px 320px at 90% 0, rgba(255,255,255,.16), transparent 60%), repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 1px, transparent 1px 48px), repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 48px); }
.auth-side > * { position: relative; z-index: 1; }
.auth-side .series { align-self: flex-start; }
.auth-side h2 { font-size: clamp(28px, 3.6vw, 42px); line-height: 1.08; margin: 14px 0 10px; letter-spacing: -.5px; }
.auth-side p { font-size: 15px; opacity: .88; max-width: 520px; }
.auth-feat { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; max-width: 520px; }
.auth-feat div { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: 14px; padding: 12px 14px; font-size: 13px; display: flex; gap: 10px; align-items: center; }
.auth-feat .ic { font-size: 20px; }
.auth-main { display: grid; place-items: center; padding: 30px 16px; }
.auth-card { width: min(400px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 30px 28px 28px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 26px; margin: 12px 0 4px; }
.auth-mark .logo { width: 48px; height: 48px; }
.auth-card .btn.block { margin-top: 22px; height: 42px; font-size: 14px; }
@media (max-width: 860px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { padding: 30px 20px; } .auth-feat { display: none; } }

/* ---------- fleet ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 999px; background: var(--card2); border: 1px solid var(--line); color: var(--ink2); font-weight: 600; font-size: 12.5px; line-height: 1; font-family: inherit; cursor: pointer; white-space: nowrap; }
.chip b { font: 700 14px/1 "Barlow Semi Condensed", sans-serif; color: var(--ink); }
.chip:hover { border-color: var(--brand); }
.chip[aria-pressed="true"] { background: var(--brandSoft); border-color: var(--brand); color: var(--brand); }
.chip .hex { width: 10px; height: 11px; }
.fleet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.dev-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; position: relative; overflow: hidden; }
.dev-card:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--brand); }
.dev-card[data-state="alarm"] { border-color: var(--crit); box-shadow: 0 0 0 1px var(--crit), var(--shadow); }
.dev-card[data-state="fault"] { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn), var(--shadow); }
.dc-top { display: flex; gap: 12px; align-items: center; }
.dc-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 22px; color: #fff; flex: none; background: linear-gradient(135deg, var(--s1), var(--brand2)); }
.dev-card[data-state="offline"] .dc-ic { background: var(--off); }
.dc-name { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.dc-name b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-name span { color: var(--ink3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-state { flex: none; }
.dc-vals { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dc-vals li { display: flex; flex-direction: column; gap: 2px; padding: 9px 11px; border-radius: 10px; background: var(--card2); border: 1px solid var(--line); min-width: 0; }
.dc-vals span { color: var(--ink3); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-vals b { font: 700 22px/1.1 "Barlow Semi Condensed", sans-serif; white-space: nowrap; }
.dc-vals i { font-style: normal; font-weight: 600; color: var(--ink3); margin-left: 3px; font-size: .62em; }
.dc-vals li.alarm { border-color: var(--crit); } .dc-vals li.alarm b { color: var(--crit); }
.dc-vals li.fault b { color: var(--warn); }
.dc-foot { display: flex; align-items: center; gap: 8px; color: var(--ink3); font-size: 12px; margin-top: auto; flex-wrap: wrap; }
.dc-go { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--brand); font-size: 13px; margin-left: auto; }
.sig { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.sig i { width: 3px; background: var(--line2); display: block; border-radius: 1px; }
.sig i.on { background: var(--good); }
.fleet-empty { grid-column: 1 / -1; padding: 40px 24px; text-align: center; background: var(--card); border: 1px dashed var(--line2); border-radius: 14px; }
.fleet-empty h3 { margin-bottom: 8px; }

/* ---------- device page: grid + cards ---------- */
.grid { display: grid; gap: 14px; }
.row2 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.row2e { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1000px) { .row2, .row2e { grid-template-columns: minmax(0, 1fr); } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); min-width: 0; position: relative; }
.card .hd { display: flex; align-items: center; gap: 10px; padding: 14px 16px 6px; flex-wrap: wrap; }
.card .hd h3 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .3px; color: var(--ink2); text-transform: uppercase; }
.card .hd h3 .muted { text-transform: none; }
.card .bd { padding: 6px 16px 16px; }
.mt { margin-top: 14px; }

/* tiles */
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.tiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .tiles.four { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); } }
@media (max-width: 520px) { .tiles, .tiles.four { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .tile { padding: 12px !important; } .tile .v { font-size: 26px !important; } .tile .tl { font-size: 11px !important; } .tile .foot { flex-wrap: wrap; } }
.tile { padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.tile .tl { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--ink2); text-transform: uppercase; letter-spacing: .4px; min-width: 0; }
.tile .tl > span:not(.unit) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .tl .ic { font-size: 17px; color: var(--brand); }
.tile .tl .unit { margin-left: auto; font-weight: 600; color: var(--ink3); text-transform: none; letter-spacing: 0; white-space: nowrap; }
.tile .v { font-size: 34px; font-weight: 700; line-height: 1.05; }
.tile .foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink3); min-height: 20px; }
.tile .foot .dl { margin-left: auto; white-space: nowrap; }
.tile svg.spark { width: 100%; height: 34px; display: block; }
.tile.warn { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn), var(--shadow); }
.tile.crit { border-color: var(--crit); box-shadow: 0 0 0 1px var(--crit), var(--shadow); animation: critglow 1.2s infinite; }
.tile.na .v { color: var(--ink3); }
@keyframes critglow { 50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--crit) 35%, transparent), var(--shadow); } }
.gauge { display: block; width: 100%; max-width: 190px; margin: -2px auto -8px; }

/* svg charts */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .gl { stroke: var(--grid); stroke-width: 1; }
.chart .ax { fill: var(--ink3); font-size: 11px; }
.chart .thr { stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .cross { stroke: var(--ink3); stroke-width: 1; stroke-dasharray: 3 3; }
.cempty { display: grid; place-items: center; color: var(--ink3); font-size: 13px; text-align: center; border: 1px dashed var(--line2); border-radius: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink2); margin-bottom: 4px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.tip { position: absolute; pointer-events: none; background: var(--card); border: 1px solid var(--line2); box-shadow: var(--shadow); border-radius: 10px; padding: 8px 10px; font-size: 12px; min-width: 120px; z-index: 5; opacity: 0; transition: opacity .12s; white-space: nowrap; }
.tip.show { opacity: 1; }
.tip .tt { color: var(--ink3); font-size: 11px; margin-bottom: 4px; }
.tip .tr { display: flex; align-items: center; gap: 8px; }
.tip .tr i { width: 10px; height: 3px; border-radius: 2px; }
.tip .tr b { margin-left: auto; padding-left: 12px; }
.stats { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 12px; color: var(--ink3); padding-top: 6px; }
.stats b { color: var(--ink); font-weight: 700; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 5px 10px; color: var(--ink2); font-weight: 600; font-size: 12px; font-family: inherit; cursor: pointer; }
.seg button:hover { color: var(--ink); background: var(--card2); }
.seg button.on { background: var(--brand); color: #fff; }

/* insights */
.ins { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.insc { display: flex; gap: 12px; padding: 14px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); }
.insc .ii { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; flex: none; background: var(--brandSoft); color: var(--brand); }
.insc.warn .ii { background: var(--warnSoft); color: var(--warn); } .insc.good .ii { background: var(--goodSoft); color: var(--good); } .insc.crit .ii { background: var(--critSoft); color: var(--crit); }
.insc p { margin: 0; font-size: 13.5px; }
.insc p b { font-weight: 800; }
.insc small { display: block; color: var(--ink3); font-size: 11.5px; margin-top: 3px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
.mini { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink3); font-weight: 500; }
.mini input { width: 84px; height: 28px; padding: 0 8px; border-radius: 8px; }

/* alerts / events */
.alerts { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow: auto; }
.alerts.tall { max-height: none; }
.alerts li { display: flex; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.alerts li:last-child { border-bottom: 0; }
.alerts li .ai { font-size: 18px; margin-top: 1px; flex: none; }
.alerts li.crit .ai { color: var(--crit); } .alerts li.warn .ai { color: var(--warn); } .alerts li.good .ai { color: var(--good); } .alerts li.info .ai { color: var(--info); }
.alerts li b { display: block; font-size: 13px; }
.alerts li span { font-size: 12px; color: var(--ink2); }
.alerts li span a { color: var(--ink2); }
.alerts li time { margin-left: auto; font-size: 11.5px; color: var(--ink3); white-space: nowrap; padding-left: 8px; text-align: right; }
.alerts li.empty { color: var(--ink3); }
.events { list-style: none; margin: 0; padding: 0; }
.events li:not(.empty) { display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.events li:last-child { border-bottom: 0; }
.events .hex { width: 14px; height: 16px; margin-top: 4px; }
.events .msg small { display: block; color: var(--ink3); font-size: 12px; }
.events time { color: var(--ink3); font-size: 12px; white-space: nowrap; }

/* phases, donut, bars */
.ph { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.ph i { width: 10px; height: 10px; border-radius: 3px; }
.bar { height: 6px; border-radius: 3px; background: var(--grid); overflow: hidden; min-width: 60px; }
.bar i { display: block; height: 100%; border-radius: 3px; }
.donut { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut svg { width: 150px; height: 150px; flex: none; }
.donut .lg { flex: 1; min-width: 150px; display: grid; gap: 8px; font-size: 13px; }
.donut .lg div { display: flex; align-items: center; gap: 8px; }
.donut .lg b { margin-left: auto; }

/* digital inputs */
.dis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.dic { padding: 12px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); }
.dic small { display: block; font-size: 11px; font-weight: 700; color: var(--ink3); text-transform: uppercase; letter-spacing: .5px; }
.dic.crit { border-color: var(--crit); }
.state-v { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 800; letter-spacing: .5px; margin-top: 4px; }
.state-v .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--ink3); }
.state-v.good .dot { background: var(--good); animation: pulse 1.8s infinite; }
.state-v.crit { color: var(--crit); } .state-v.crit .dot { background: var(--crit); }

/* device + pipeline */
.dev { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 18px; align-items: start; }
@media (max-width: 700px) { .dev { grid-template-columns: 1fr; } }
.arch { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; font-weight: 600; color: var(--ink2); margin-top: 14px; }
.arch span { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 8px; background: var(--card2); border: 1px solid var(--line); }
.arch .ar { color: var(--ink3); background: none; border: 0; padding: 0; }
.mirror-fig { margin: 0; }
.mirror-fig figcaption { color: var(--ink3); font-size: 12px; margin-top: 10px; text-align: center; }
.mirror { background: #06090b; padding: 12px; border-radius: 12px; border: 1px solid #2a3b45; box-shadow: inset 0 0 0 2px #121c22, 0 10px 30px rgba(0,0,0,.28); }
.mirror svg { display: block; width: 100%; height: auto; border-radius: 3px; background: #000; }
.mirror.off svg { filter: grayscale(1) brightness(.55); }

/* generic channel charts (canvas TrendChart) */
.charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 430px), 1fr)); gap: 14px; }
.chart-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 10px; min-width: 0; box-shadow: var(--shadow); }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.chart-head b { font-size: 13px; font-weight: 700; letter-spacing: .3px; color: var(--ink2); text-transform: uppercase; }
.chart-head b .muted { text-transform: none; }
.chart-stats { color: var(--ink3); font-size: 12px; }
.chart-stats span { color: var(--ink); font-weight: 700; }
.chart-host { position: relative; height: 180px; margin-top: 8px; }
.chart-host canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.chart-tip { position: absolute; pointer-events: none; z-index: 3; background: var(--card); border: 1px solid var(--line2); border-radius: 10px; padding: 7px 10px; font-size: 12px; line-height: 1.4; white-space: nowrap; box-shadow: var(--shadow); }
.chart-tip b { font-family: "Barlow Semi Condensed", sans-serif; font-size: 16px; }
.chart-tip .a { color: var(--crit); } .chart-tip .f { color: var(--warn); }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink3); }

.cfg h4 { margin: 18px 0 8px; font-size: 13px; color: var(--ink2); }
.cfg h4:first-child { margin-top: 0; }

/* ---------- voice: hero buttons, spoken caption, tour spotlight ---------- */
.btn.white { background: #fff; border-color: #fff; color: #0b3d91; }
.btn.white:hover { background: #e9f1ff; }
.btn.light.on { background: rgba(255,255,255,.24); border-color: #fff; }
.vcap { visibility: hidden; opacity: 0; position: fixed; left: 50%; bottom: 18px; transform: translate(-50%, 140%); z-index: 60; max-width: min(720px, calc(100vw - 24px)); background: rgba(8,16,32,.94); color: #fff; border-radius: 14px; padding: 12px 16px 12px 14px; display: flex; gap: 12px; align-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.35); transition: transform .35s, opacity .35s, visibility .35s; border: 1px solid rgba(255,255,255,.12); }
.vcap.show { transform: translate(-50%, 0); visibility: visible; opacity: 1; }
.vcap .wv { display: flex; gap: 3px; align-items: center; height: 22px; flex: none; }
.vcap .wv i { width: 3px; background: #4ea1ff; border-radius: 2px; animation: wv 1s ease-in-out infinite; }
.vcap .wv i:nth-child(2) { animation-delay: .15s; } .vcap .wv i:nth-child(3) { animation-delay: .3s; } .vcap .wv i:nth-child(4) { animation-delay: .45s; }
@keyframes wv { 0%, 100% { height: 5px; } 50% { height: 20px; } }
.vcap p { margin: 0; font-size: 14px; line-height: 1.4; }
.vcap button { background: rgba(255,255,255,.12); border: 0; border-radius: 8px; width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer; color: #fff; flex: none; }
.spot { outline: 3px solid var(--brand); outline-offset: 3px; transition: outline-color .3s; }
@media (max-width: 560px) { .acts .btn .lbl { display: none; } }

/* ---------- dialogs and toast ---------- */
dialog.dlg { width: min(460px, calc(100vw - 32px)); background: var(--card); color: var(--ink); border: 1px solid var(--line2); border-radius: 16px; padding: 22px 24px; box-shadow: 0 20px 50px rgba(0,0,0,.4); }
dialog.dlg::backdrop { background: rgba(2, 8, 20, .62); }
dialog.dlg h3 { margin-bottom: 10px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.radios { margin-top: 16px; }
.toast { position: fixed; top: 70px; right: 14px; z-index: 70; background: var(--card); border: 1px solid var(--line2); border-left: 4px solid var(--good); padding: 10px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.3); max-width: min(92vw, 420px); font-weight: 600; }
.toast.bad { border-left-color: var(--crit); }

@media (max-width: 760px) {
  .topbar { gap: 10px; }
  .who, .clock, .brand-text small { display: none; }
  .nav a { padding: 0 9px; }
  h1 { font-size: 24px; }
  .wrap { padding: 16px 16px 50px; }
  .tile .v { font-size: 30px; }
}
@media (max-width: 560px) { .nav a .lbl { display: none; } .nav a { padding: 0 10px; } .nav a .ic { font-size: 16px; } }
@media (max-width: 480px) { .brand-text { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *:before, *:after { animation: none !important; transition: none !important; } }

/* ---------- login: demos for visitors without an account ---------- */
.auth-demo { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.auth-demo p { margin: 0 0 4px; font-size: 13.5px; color: var(--ink2); line-height: 1.5; }
.auth-demo .btn.block { margin: 12px 0 10px; height: 40px; font-size: 14px; }
.auth-demo .small a { font-weight: 600; }
