:root {
  color-scheme: light;
  --canvas: #ecefeb;
  --surface: #ffffff;
  --surface-soft: #f6f7f5;
  --graphite: #171b18;
  --graphite-2: #222824;
  --ink: #17201a;
  --muted: #5f6b63;
  --faint: #8a948d;
  --line: #d7ddd7;
  --line-strong: #bfc8c0;
  --accent: #ef5a24;
  --accent-dark: #c94317;
  --accent-soft: #fff0e9;
  --success: #14744a;
  --success-soft: #e5f4eb;
  --warning: #95600e;
  --warning-soft: #fff2d9;
  --danger: #b92f31;
  --danger-soft: #fbe8e8;
  --info: #246a83;
  --info-soft: #e7f2f5;
  --focus: #176fc1;
  --sidebar-width: 248px;
  --radius: 12px;
  font-family: "Avenir Next", "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); font-size: 14px; line-height: 1.45; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 30%, transparent); outline-offset: 2px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
h1, h2, h3, p { text-wrap: pretty; }

.workspace { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; z-index: 20; height: 100vh; padding: 24px 16px 18px; display: flex; flex-direction: column; color: #f6f8f6; background: var(--graphite); }
.brand-lockup, .login-brand { display: flex; align-items: center; gap: 12px; }
.brand-lockup { padding: 0 8px 28px; }
.brand-lockup strong, .login-brand strong { display: block; letter-spacing: .16em; font-size: 15px; }
.brand-lockup small { display: block; margin-top: 3px; color: #aeb8b0; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.brand-symbol { position: relative; width: 38px; height: 38px; border: 1px solid #4c574f; background: #0f1210; }
.brand-symbol::before { content: ""; position: absolute; left: 9px; right: 9px; bottom: 8px; height: 13px; border: 2px solid #f7f8f6; border-top: 0; }
.brand-symbol::after { content: ""; position: absolute; top: 8px; left: 7px; right: 7px; height: 2px; background: var(--accent); }
.brand-symbol i { position: absolute; right: 5px; bottom: 11px; width: 7px; height: 7px; border: 2px solid #f7f8f6; border-left: 0; }
.sidebar nav { display: grid; gap: 5px; }
.nav-item { position: relative; min-height: 48px; width: 100%; padding: 0 10px; display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 9px; border: 0; border-radius: 8px; background: transparent; color: #aeb8b0; text-align: left; }
.nav-item:hover { background: #252c27; color: #fff; }
.nav-item.active { background: #f4f6f3; color: #18201a; font-weight: 700; }
.nav-glyph { width: 22px; height: 22px; display: grid; place-content: center; border: 1px solid currentColor; border-radius: 5px; font: 12px ui-monospace, monospace; }
.nav-item kbd { color: inherit; border: 0; background: none; opacity: .56; font: 10px ui-monospace, monospace; }
.nav-item b { position: absolute; right: 34px; min-width: 20px; padding: 2px 6px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 10px; text-align: center; }
.sidebar-fleet { margin: 28px 8px 0; padding-top: 18px; border-top: 1px solid #343c36; }
.sidebar-fleet > span { display: block; margin-bottom: 10px; color: #89938c; font-size: 10px; }
.mini-station { padding: 9px 0; display: grid; grid-template-columns: auto 1fr; gap: 9px; align-items: start; }
.mini-station i { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--danger); }
.mini-station i.live { background: #52c487; box-shadow: 0 0 0 3px #244431; }
.mini-station strong, .mini-station small { display: block; }
.mini-station strong { font-size: 11px; color: #e8ece8; }
.mini-station small { margin-top: 2px; color: #8f9991; font-size: 9px; }
.sidebar-foot { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid #343c36; display: flex; align-items: center; gap: 10px; }
.sidebar-foot strong, .sidebar-foot small { display: block; }
.sidebar-foot strong { font-size: 11px; }
.sidebar-foot small { margin-top: 2px; color: #8f9991; font-size: 9px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #52c487; box-shadow: 0 0 0 4px #244431; }

main { min-width: 0; padding: 0 30px 52px; }
.topbar { min-height: 92px; display: flex; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); }
.breadcrumb { margin-bottom: 4px; color: var(--faint); font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
.breadcrumb span { color: var(--accent-dark); }
.topbar h1 { margin: 0; font-size: 22px; line-height: 1.1; letter-spacing: -.02em; }
.topbar p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.sync-state { min-width: 142px; display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.sync-state > i { width: 8px; height: 8px; border-radius: 50%; background: #37a86c; box-shadow: 0 0 0 4px #d7eade; }
.sync-state span, .sync-state b, .sync-state small { display: block; }
.sync-state b { color: var(--success); font: 9px ui-monospace, monospace; letter-spacing: .12em; }
.sync-state small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.icon-button, .secondary-button, .primary-button, .text-button { min-height: 44px; border-radius: 8px; transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease; }
.icon-button { padding: 0 13px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.secondary-button { padding: 0 15px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.primary-button { padding: 0 17px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font-weight: 700; }
.icon-button:hover, .secondary-button:hover { background: var(--surface-soft); border-color: #98a59b; }
.primary-button:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.primary-button.compact { align-self: end; }
.text-button { padding: 0 3px; border: 0; background: transparent; color: var(--accent-dark); font-weight: 700; }
#menu-button { display: none; }

.view { display: none; padding-top: 24px; }
.view.active { display: block; }
.error-banner { margin-top: 16px; padding: 12px 14px; border: 1px solid #df9fa0; border-radius: 8px; background: var(--danger-soft); color: #792427; }
.surface { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.section-head { min-height: 70px; padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.section-head.flat { padding-inline: 0; border: 0; }
.section-head h2 { margin: 0; font-size: 15px; letter-spacing: -.01em; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.section-stat { color: var(--muted); font-size: 11px; }

.overview-ribbon { min-height: 76px; padding: 0 20px; display: flex; align-items: center; gap: 18px; color: #edf2ee; background: var(--graphite-2); border-radius: var(--radius); overflow: hidden; }
.overview-ribbon .ribbon-title { min-width: 240px; }
.overview-ribbon .ribbon-title strong { display: block; font-size: 17px; }
.overview-ribbon .ribbon-title span { display: block; margin-top: 3px; color: #aeb8b0; font-size: 10px; }
.ribbon-signal { display: flex; align-items: center; gap: 8px; color: #dfe5e0; font-size: 11px; }
.ribbon-signal i { width: 7px; height: 7px; border-radius: 50%; background: #58c98b; }
.ribbon-signal.warn i { background: #f4b44a; }
.ribbon-signal.danger i { background: #e65858; }
.ribbon-rule { align-self: stretch; width: 1px; background: #3c453f; }
.metric-ledger { margin-top: 14px; display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.metric { min-height: 108px; padding: 17px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric span { color: var(--muted); font-size: 11px; }
.metric strong { display: block; margin-top: 8px; font-size: 25px; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.metric small { display: block; margin-top: 7px; color: var(--faint); font-size: 10px; }
.metric.attention strong { color: var(--danger); }
.overview-layout { margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(310px, .72fr); gap: 14px; }
.trend-surface, .attention-surface { min-height: 340px; }
.fleet-surface, .category-surface { min-height: 290px; }
.orders-surface, .alerts-surface { min-height: 330px; }
.segmented { padding: 3px; display: flex; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.segmented button { min-height: 31px; padding: 0 12px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 11px; }
.segmented button.active { color: var(--ink); background: var(--surface); box-shadow: 0 1px 4px rgba(24, 33, 27, .1); }
.chart-area { height: 262px; padding: 18px; display: flex; flex-direction: column; }
.chart-area svg, .telemetry-chart svg { width: 100%; height: 210px; overflow: visible; }
.chart-grid { stroke: #e5e9e5; stroke-width: 1; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.chart-fill { fill: color-mix(in srgb, var(--accent) 10%, transparent); }
.chart-dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-labels { padding-top: 8px; display: flex; justify-content: space-between; color: var(--faint); font: 9px ui-monospace, monospace; }
.status-breakdown { padding: 22px 18px; }
.donut-row { display: flex; align-items: center; gap: 24px; }
.donut { position: relative; width: 128px; aspect-ratio: 1; border-radius: 50%; }
.donut::after { content: ""; position: absolute; inset: 25px; border-radius: 50%; background: var(--surface); }
.donut-center { position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; text-align: center; }
.donut-center strong { font-size: 22px; }
.donut-center span { color: var(--muted); font-size: 9px; }
.legend { flex: 1; display: grid; gap: 10px; }
.legend-row { display: grid; grid-template-columns: 9px 1fr auto; gap: 9px; align-items: center; font-size: 11px; }
.legend-row i { width: 7px; height: 7px; border-radius: 50%; }
.legend-row span { color: var(--muted); }
.station-list { padding: 6px 18px; }
.station-row { min-height: 64px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; border-bottom: 1px solid var(--line); }
.station-row:last-child { border-bottom: 0; }
.station-row strong, .station-row small { display: block; }
.station-row strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.station-row small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.health { display: flex; align-items: center; gap: 7px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }
.status-dot.online { background: var(--success); }
.category-list { padding: 10px 18px; }
.category-row { min-height: 43px; display: grid; grid-template-columns: minmax(86px, 1fr) 2fr auto; gap: 11px; align-items: center; }
.category-row span, .category-row b { font-size: 11px; }
.bar-track { height: 6px; border-radius: 99px; background: #e9ede9; overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--accent); }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { height: 43px; padding: 0 14px; color: var(--muted); background: var(--surface-soft); text-align: left; font-size: 10px; font-weight: 650; }
td { height: 52px; padding: 0 14px; border-top: 1px solid var(--line); font-size: 11px; }
tbody tr:hover { background: #f9faf8; }
.order-link { padding: 0; border: 0; background: transparent; color: var(--ink); font-weight: 750; }
.status-chip { min-height: 24px; padding: 0 8px; display: inline-flex; align-items: center; border-radius: 99px; color: var(--info); background: var(--info-soft); font-size: 9px; font-weight: 750; }
.status-chip.ready, .status-chip.acked, .status-chip.online, .status-chip.running, .status-chip.live, .status-chip.healthy { color: var(--success); background: var(--success-soft); }
.status-chip.failed, .status-chip.critical, .status-chip.offline, .status-chip.stale { color: var(--danger); background: var(--danger-soft); }
.status-chip.pending, .status-chip.retrying, .status-chip.high, .status-chip.warning { color: var(--warning); background: var(--warning-soft); }
.alert-list { padding: 6px 18px; }
.alert-item { min-height: 62px; padding: 12px 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; border-bottom: 1px solid var(--line); }
.alert-item:last-child { border: 0; }
.severity-mark { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--warning); }
.severity-mark.critical, .severity-mark.high { background: var(--danger); }
.alert-item strong, .alert-item small { display: block; }
.alert-item strong { font-size: 11px; }
.alert-item small { margin-top: 3px; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty-state { min-height: 170px; display: grid; place-content: center; text-align: center; color: var(--muted); }
.empty-state strong { color: var(--ink); }

.toolbar { margin-bottom: 14px; display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.toolbar label, .device-toolbar label { min-width: 170px; display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.toolbar .search-field { min-width: 280px; flex: 1; }
input, select { min-height: 44px; width: 100%; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); }
.table-surface { min-height: 550px; }

.device-toolbar { min-height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.device-toolbar h2 { margin: 0; font-size: 17px; }
.device-toolbar p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.device-toolbar label { min-width: 260px; }
.device-summary { display: grid; grid-template-columns: repeat(6, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.device-kpi { min-height: 80px; padding: 14px 16px; border-right: 1px solid var(--line); }
.device-kpi:last-child { border: 0; }
.device-kpi span { display: block; color: var(--muted); font-size: 9px; }
.device-kpi strong { display: block; margin-top: 6px; font-size: 19px; }
.station-banner { margin-top: 12px; min-height: 96px; padding: 17px 20px; display: grid; grid-template-columns: minmax(220px, 1.2fr) repeat(4, minmax(110px, .55fr)); gap: 18px; align-items: center; color: #eaf0eb; background: var(--graphite-2); border-radius: var(--radius); }
.station-identity h2 { margin: 0; font-size: 17px; }
.station-identity p { margin: 4px 0 0; color: #aab4ac; font-size: 10px; }
.station-signal { padding-left: 16px; border-left: 1px solid #3b443e; }
.station-signal span, .station-signal strong { display: block; }
.station-signal span { color: #9fa9a1; font-size: 9px; }
.station-signal strong { margin-top: 5px; color: #fff; font-size: 13px; }
.edge-cloud-layout { margin-top: 12px; display: grid; grid-template-columns: minmax(360px, .8fr) minmax(0, 1.4fr); gap: 12px; }
.station-operations { padding: 8px 17px 16px; display: grid; grid-template-columns: repeat(4, 1fr); }
.station-operation { min-height: 65px; padding: 12px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.station-operation:nth-child(4n) { border-right: 0; }
.station-operation:nth-last-child(-n+4) { border-bottom: 0; }
.station-operation span, .station-operation strong { display: block; }
.station-operation span { color: var(--muted); font-size: 9px; }
.station-operation strong { margin-top: 6px; font-size: 15px; }
.auth-proof { display: inline-flex !important; align-items: center; gap: 7px; color: #8fe0b5; font-size: 11px; }
.auth-proof i { width: 7px; height: 7px; border-radius: 50%; background: #52c487; box-shadow: 0 0 0 3px rgba(82, 196, 135, .18); }
.station-forecast { padding: 8px 17px 16px; }
.forecast-line { min-height: 47px; display: grid; grid-template-columns: minmax(110px, 1fr) minmax(100px, 1.2fr) auto; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); }
.forecast-line:last-child { border: 0; }
.forecast-line strong, .forecast-line small { display: block; }
.forecast-line strong { font-size: 10px; }
.forecast-line small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.forecast-line b { font-size: 10px; }
.machine-section { margin-top: 10px; }
.legend-inline { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; }
.legend-inline i { width: 7px; height: 7px; margin-left: 7px; border-radius: 50%; background: var(--line-strong); }
.legend-inline .ok { background: var(--success); }
.legend-inline .warn { background: var(--warning); }
.legend-inline .off { background: var(--danger); }
.machine-flow { position: relative; display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.machine-flow::before { content: ""; position: absolute; left: 6%; right: 6%; top: 31px; height: 1px; background: var(--line-strong); }
.machine-node { position: relative; z-index: 1; min-height: 112px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-align: left; }
.machine-node:hover, .machine-node.active { border-color: var(--accent); }
.machine-node.active { background: var(--accent-soft); }
.machine-node .node-top { display: flex; align-items: center; justify-content: space-between; }
.machine-node .device-code { width: 38px; height: 38px; display: grid; place-content: center; border-radius: 8px; color: #eaf0eb; background: var(--graphite); font: 10px ui-monospace, monospace; }
.machine-node .node-state { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.machine-node.warning .node-state { background: var(--warning); box-shadow: 0 0 0 4px var(--warning-soft); }
.machine-node.offline .node-state { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.machine-node strong, .machine-node small { display: block; }
.machine-node strong { margin-top: 11px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.machine-node small { margin-top: 3px; color: var(--muted); font: 9px ui-monospace, monospace; }
.device-workbench { margin-top: 12px; display: grid; grid-template-columns: 270px minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.device-list { border-right: 1px solid var(--line); background: var(--surface-soft); }
.device-list-head { min-height: 52px; padding: 0 15px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.device-list-head strong { font-size: 11px; }
.device-list-head span { color: var(--muted); font-size: 9px; }
.device-list button { width: 100%; min-height: 59px; padding: 9px 14px; display: grid; grid-template-columns: 1fr auto; align-items: center; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); background: transparent; text-align: left; }
.device-list button:hover, .device-list button.active { background: var(--surface); }
.device-list button.active { box-shadow: inset 3px 0 0 var(--accent); }
.device-list strong, .device-list small { display: block; }
.device-list strong { font-size: 10px; }
.device-list small { margin-top: 3px; color: var(--muted); font: 9px ui-monospace, monospace; }
.device-detail { min-height: 355px; padding: 20px; }
.device-detail-head { display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.device-detail-head h2 { margin: 0; font-size: 18px; }
.device-detail-head p { margin: 5px 0 0; color: var(--muted); font: 10px ui-monospace, monospace; }
.metric-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.device-metric { min-height: 75px; padding: 13px 12px; border-right: 1px solid var(--line); }
.device-metric:last-child { border: 0; }
.device-metric span, .device-metric strong { display: block; }
.device-metric span { color: var(--muted); font-size: 9px; }
.device-metric strong { margin-top: 7px; font-size: 17px; font-variant-numeric: tabular-nums; }
.device-containers { margin-top: 18px; }
.device-containers h3 { margin: 0 0 10px; font-size: 11px; }
.container-mini-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.container-mini { padding: 10px; background: var(--surface-soft); border-radius: 8px; }
.container-mini header { display: flex; justify-content: space-between; gap: 10px; font-size: 10px; }
.container-mini header span { color: var(--muted); }
.fill-track { height: 5px; margin-top: 8px; border-radius: 99px; background: #dfe5df; overflow: hidden; }
.fill-track i { display: block; height: 100%; border-radius: inherit; background: var(--success); }
.fill-track i.low { background: var(--warning); }
.fill-track i.critical { background: var(--danger); }
.inventory-surface { margin-top: 14px; }
.inventory-board { padding: 14px 18px 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 1px; background: var(--line); }
.inventory-item { min-height: 91px; padding: 12px; display: grid; grid-template-columns: 32px 1fr; gap: 11px; background: var(--surface); }
.tank { position: relative; align-self: stretch; min-height: 58px; border: 1px solid var(--line-strong); border-radius: 6px 6px 9px 9px; overflow: hidden; background: #eef1ee; }
.tank i { position: absolute; left: 0; right: 0; bottom: 0; background: #58a878; }
.tank i.low { background: #d79b38; }
.tank i.critical { background: #cf4a4b; }
.inventory-copy strong, .inventory-copy small { display: block; }
.inventory-copy strong { font-size: 10px; }
.inventory-copy small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.inventory-copy b { display: block; margin-top: 8px; font-size: 12px; }
.telemetry-layout { margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(310px, .75fr); gap: 14px; }
.telemetry-chart { min-height: 265px; padding: 18px; }
.telemetry-legend { display: flex; gap: 14px; margin-bottom: 10px; color: var(--muted); font-size: 9px; }
.telemetry-legend i { display: inline-block; width: 13px; height: 2px; margin-right: 5px; vertical-align: middle; background: var(--accent); }
.telemetry-legend i.secondary { background: var(--info); }
.gateway-panel { padding: 12px 18px 20px; }
.gateway-row { min-height: 46px; display: grid; grid-template-columns: minmax(110px, 1fr) 2fr auto; gap: 10px; align-items: center; border-bottom: 1px solid var(--line); }
.gateway-row:last-child { border: 0; }
.gateway-row span { color: var(--muted); font-size: 10px; }
.gateway-row b { font-size: 11px; }

.alert-intro { min-height: 96px; margin-bottom: 14px; padding: 16px 20px; display: flex; align-items: center; gap: 24px; color: #eef2ef; background: var(--graphite-2); border-radius: var(--radius); }
.alert-intro > div { min-width: 115px; }
.alert-intro strong, .alert-intro span { display: block; }
.alert-intro strong { color: #ff8060; font-size: 28px; }
.alert-intro span { color: #aeb8b0; font-size: 10px; }
.alert-intro p { max-width: 72ch; margin: 0; color: #c7cec8; font-size: 11px; }
.alert-center { display: grid; gap: 8px; }
.alert-card { min-height: 102px; padding: 15px 17px; display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 16px; align-items: start; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.alert-card h2 { margin: 0; font-size: 13px; }
.alert-card p { max-width: 76ch; margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.alert-meta { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 11px; color: var(--faint); font: 9px ui-monospace, monospace; }
.alert-actions { display: flex; gap: 8px; }

.detail-drawer { position: fixed; z-index: 50; inset: 0 0 0 auto; width: min(600px, 94vw); overflow: auto; background: var(--surface); transform: translateX(100%); transition: transform 220ms cubic-bezier(.22,1,.36,1); box-shadow: -8px 0 20px rgba(18, 25, 20, .16); }
.detail-drawer.open { transform: translateX(0); }
.drawer-backdrop { position: fixed; z-index: 40; inset: 0; background: rgba(12, 16, 13, .35); }
.drawer-head { position: sticky; top: 0; z-index: 1; min-height: 82px; padding: 15px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: var(--surface); }
.drawer-head p, .drawer-head h2 { margin: 0; }
.drawer-head p { color: var(--muted); font-size: 10px; }
.drawer-head h2 { margin-top: 3px; font-size: 18px; }
.drawer-body { padding: 20px; }
.detail-section { padding: 17px 0; border-bottom: 1px solid var(--line); }
.detail-section:first-child { padding-top: 0; }
.detail-section h3 { margin: 0 0 11px; font-size: 12px; }
.fact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.fact { padding: 11px; border-radius: 8px; background: var(--surface-soft); }
.fact span, .fact strong { display: block; }
.fact span { color: var(--muted); font-size: 9px; }
.fact strong { margin-top: 4px; font-size: 11px; overflow-wrap: anywhere; }
.timeline-item { position: relative; padding: 0 0 16px 19px; }
.timeline-item::before { content: ""; position: absolute; left: 4px; top: 7px; bottom: -4px; width: 1px; background: var(--line-strong); }
.timeline-item:last-child::before { display: none; }
.timeline-item::after { content: ""; position: absolute; left: 0; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.timeline-item strong { display: block; font-size: 11px; }
.timeline-item span { color: var(--muted); font-size: 9px; }

.analytics-sync-note { min-height: 52px; margin-bottom: 12px; padding: 0 16px; display: flex; align-items: center; gap: 10px; border: 1px solid #c9ddd1; border-radius: 9px; color: var(--success); background: var(--success-soft); }
.analytics-sync-note strong, .analytics-sync-note span { display: block; }
.analytics-sync-note strong { font-size: 10px; }
.analytics-sync-note span { color: var(--muted); font-size: 9px; }
.cloud-finance-layout { margin-top: 12px; display: grid; grid-template-columns: 1.45fr .75fr; gap: 12px; }
.cloud-finance-layout > .surface { min-height: 330px; }
.cloud-finance-chart { height: 270px; padding: 15px 18px; }
.cloud-finance-chart svg { width: 100%; height: 215px; overflow: visible; }
.cloud-finance-chart line { stroke: #e4e9e5; stroke-width: 1; }
.cloud-finance-chart polyline { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.cloud-finance-chart polyline.cost { stroke: var(--info); stroke-width: 2; }
.cloud-finance-chart footer { display: flex; justify-content: space-between; color: var(--faint); font: 8px ui-monospace, monospace; }
.cloud-chart-legend { display: flex; gap: 14px; color: var(--muted); font-size: 8px; }
.cloud-chart-legend i { display: inline-block; width: 13px; height: 3px; margin-right: 4px; background: var(--accent); }
.cloud-chart-legend span:last-child i { background: var(--info); }
.cloud-breakdown, .cloud-ranks { padding: 10px 17px; }
.cloud-rank { min-height: 43px; display: grid; grid-template-columns: 24px minmax(78px, 1fr) minmax(50px, 1.2fr) auto; align-items: center; gap: 9px; }
.cloud-rank > b { color: var(--faint); font: 8px ui-monospace, monospace; }
.cloud-rank > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.cloud-rank > div { height: 5px; overflow: hidden; border-radius: 99px; background: #e7ece8; }
.cloud-rank > div i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.cloud-rank > strong { font-size: 9px; }

.login-shell { min-height: 100vh; padding: 22px; display: grid; grid-template-columns: minmax(520px, 1.12fr) minmax(420px, .88fr); background: #0f1511; }
.login-story { position: relative; min-height: calc(100vh - 44px); padding: 40px 46px 34px; display: grid; grid-template-rows: auto auto 1fr auto; overflow: hidden; color: #f4f6f4; border: 1px solid #38423a; border-radius: 16px 0 0 16px; background-color: #19211b; background-image: linear-gradient(#242d26 1px, transparent 1px), linear-gradient(90deg, #242d26 1px, transparent 1px); background-size: 52px 52px; }
.login-story::before { content: ''; position: absolute; inset: 0; background: rgba(25,33,27,.86); pointer-events: none; }
.login-story > * { position: relative; z-index: 1; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand strong, .login-brand small { display: block; }
.login-brand small { margin-top: 2px; color: #7f8c82; font: 8px ui-monospace, monospace; letter-spacing: .18em; }
.login-brand .brand-symbol { background: #121713; }
.command-intro { margin-top: clamp(60px, 10vh, 118px); }
.login-kicker { margin: 0; color: #ed6a3c; font: 800 9px ui-monospace, monospace; letter-spacing: .16em; }
.command-intro h1 { margin: 14px 0 18px; max-width: 600px; font-size: clamp(42px, 5vw, 72px); line-height: .98; letter-spacing: -.055em; }
.command-intro > p:last-child { max-width: 480px; margin: 0; color: #a8b2aa; font-size: 13px; line-height: 1.8; }
.fleet-console { align-self: end; max-width: 720px; margin: 36px 0 28px; padding: 18px; border: 1px solid #38433a; border-radius: 10px; background: rgba(15,20,16,.72); }
.cloud-core { display: flex; align-items: center; gap: 10px; }
.cloud-core > i { width: 10px; height: 10px; border-radius: 50%; background: #48c67b; box-shadow: 0 0 0 5px rgba(72,198,123,.12); }
.cloud-core span, .cloud-core b, .cloud-core small { display: block; }
.cloud-core b { font: 9px ui-monospace, monospace; letter-spacing: .12em; }
.cloud-core small { margin-top: 3px; color: #718077; font: 8px ui-monospace, monospace; }
.cloud-core em { margin-left: auto; color: #75d69e; font: normal 8px ui-monospace, monospace; }
.fleet-rule { height: 24px; margin-left: 5px; border-left: 1px solid #4b5850; }
.fleet-nodes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.fleet-nodes span { min-width: 0; padding: 10px; border: 1px solid #354038; border-radius: 7px; background: #202922; }
.fleet-nodes i { display: block; width: 6px; height: 6px; margin-bottom: 9px; border-radius: 50%; background: #4cc27e; }
.fleet-nodes b, .fleet-nodes small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fleet-nodes b { color: #ec7449; font: 8px ui-monospace, monospace; }
.fleet-nodes small { margin-top: 3px; color: #a8b1aa; font-size: 8px; }
.login-trust { padding-top: 17px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #3c463f; font: 8px ui-monospace, monospace; }
.login-trust span { color: #a9b4ac; }
.login-trust i { display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: #4ed087; }
.login-trust b { color: #6f7d73; letter-spacing: .08em; }
.login-panel { align-self: stretch; width: 100%; padding: clamp(42px, 8vh, 92px) clamp(38px, 6vw, 86px); display: flex; flex-direction: column; justify-content: center; border-radius: 0 16px 16px 0; background: #f7f8f6; box-shadow: 0 30px 80px rgba(0,0,0,.22); }
.mobile-login-brand { display: none; }
.login-panel-head { margin-bottom: auto; padding-bottom: 24px; display: flex; justify-content: space-between; border-bottom: 1px solid #dce1dc; color: var(--faint); font: 8px ui-monospace, monospace; letter-spacing: .12em; }
.login-panel-head b { color: var(--success); font-weight: 600; }
.login-panel-head i { display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--success); }
.login-panel > .login-kicker { margin-top: clamp(36px, 7vh, 72px); }
.login-panel h2 { margin: 10px 0 8px; font-size: 32px; letter-spacing: -.04em; }
.login-copy { margin: 0 0 30px; color: var(--muted); font-size: 12px; }
.login-panel label { display: block; margin: 17px 0 7px; color: #323b34; font-size: 10px; font-weight: 700; }
.login-panel input { width: 100%; height: 50px; padding: 0 14px; color: var(--ink); border: 1px solid #cbd2cc; border-radius: 8px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
.login-panel input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(222,80,40,.1); }
.identity-field { display: grid; grid-template-columns: 48px 1fr; }
.identity-field > span { display: grid; place-content: center; color: #68736a; border: 1px solid #cbd2cc; border-right: 0; border-radius: 8px 0 0 8px; background: #edf0ed; font: 9px ui-monospace, monospace; }
.identity-field input { border-radius: 0 8px 8px 0; color: #354038; background: #f9faf9; }
.password-field { position: relative; }
.password-field input { padding-right: 64px; }
.password-field button { position: absolute; right: 7px; top: 7px; height: 36px; padding: 0 10px; color: var(--muted); border: 0; background: transparent; font-size: 10px; }
.login-panel .login-submit { width: 100%; height: 50px; margin-top: 8px; padding-inline: 18px; display: flex; align-items: center; justify-content: space-between; border-radius: 8px; }
.login-security { margin-top: auto; padding-top: 30px; display: flex; align-items: center; gap: 10px; color: var(--faint); }
.login-security > i { width: 28px; height: 28px; border: 1px solid #cbd3cc; border-radius: 50%; background: #edf1ee; }
.login-security span, .login-security b, .login-security small { display: block; }
.login-security b { color: #4f5b52; font-size: 9px; }
.login-security small { margin-top: 2px; font: 7px ui-monospace, monospace; letter-spacing: .04em; }
.form-error { min-height: 22px; margin: 6px 0 0; color: var(--danger); font-size: 10px; }
.skeleton-block:empty { min-height: 90px; background: linear-gradient(90deg, #e7ebe7 25%, #f5f7f5 45%, #e7ebe7 65%); background-size: 220% 100%; animation: skeleton 1.3s linear infinite; }
@keyframes skeleton { to { background-position: -220% 0; } }

@media (max-width: 1180px) {
  .metric-ledger { grid-template-columns: repeat(3, 1fr); }
  .metric:nth-child(3n) { border-right: 0; }
  .metric:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .device-summary { grid-template-columns: repeat(3, 1fr); }
  .device-kpi:nth-child(3) { border-right: 0; }
  .device-kpi:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .station-banner { grid-template-columns: 1fr repeat(2, minmax(120px, .5fr)); }
  .station-signal:nth-last-child(-n+2) { display: none; }
}

@media (max-width: 820px) {
  .login-shell { display: grid; grid-template-columns: 1fr; padding: 0; background: #f7f8f6; }
  .login-story { display: none; }
  .login-panel { min-height: 100vh; width: min(460px, 100%); margin: auto; padding: 32px 26px; border: 0; border-radius: 0; box-shadow: none; }
  .mobile-login-brand { display: flex; }
  .login-panel-head { margin: 26px 0 0; }
  .login-panel > .login-kicker { margin-top: auto; }
  .login-security { margin-top: auto; }
}
@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; width: var(--sidebar-width); transform: translateX(-100%); transition: transform 200ms ease; }
  .sidebar.open { transform: translateX(0); }
  main { padding-inline: 18px; }
  #menu-button { display: inline-flex; align-items: center; }
  .sync-state { display: none; }
  .overview-layout, .telemetry-layout, .edge-cloud-layout, .cloud-finance-layout { grid-template-columns: 1fr; }
  .device-workbench { grid-template-columns: 220px minmax(0, 1fr); }
}
@media (max-width: 620px) {
  main { padding-inline: 12px; }
  .topbar { min-height: 78px; }
  .topbar-actions .secondary-button { display: none; }
  .breadcrumb, .topbar p { display: none; }
  .overview-ribbon { min-height: 92px; flex-wrap: wrap; align-content: center; gap: 7px 15px; }
  .overview-ribbon .ribbon-title { width: 100%; }
  .ribbon-rule { display: none; }
  .metric-ledger { grid-template-columns: repeat(2, 1fr); }
  .metric { min-height: 94px; padding: 14px; border-bottom: 1px solid var(--line); }
  .metric:nth-child(3n) { border-right: 1px solid var(--line); }
  .metric:nth-child(2n) { border-right: 0; }
  .metric strong { font-size: 21px; }
  .toolbar, .device-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar label, .toolbar .search-field, .device-toolbar label { min-width: 100%; }
  .device-summary { grid-template-columns: repeat(2, 1fr); }
  .device-kpi, .device-kpi:nth-child(3) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .device-kpi:nth-child(2n) { border-right: 0; }
  .station-banner { grid-template-columns: 1fr 1fr; }
  .station-identity { grid-column: 1 / -1; }
  .station-signal { padding-left: 0; border: 0; }
  .station-operations { grid-template-columns: repeat(2, 1fr); }
  .station-operation, .station-operation:nth-child(4n) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .station-operation:nth-child(2n) { border-right: 0; }
  .station-operation:nth-last-child(-n+2) { border-bottom: 0; }
  .device-workbench { grid-template-columns: 1fr; }
  .device-list { max-height: 250px; overflow: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .device-detail { padding: 16px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .device-metric:nth-child(2n) { border-right: 0; }
  .inventory-board { grid-template-columns: 1fr 1fr; padding: 1px; }
  .inventory-item { min-height: 86px; padding: 10px; }
  .alert-card { grid-template-columns: 1fr; gap: 9px; }
  .alert-actions { justify-content: flex-start; }
  .alert-intro { align-items: flex-start; }
  .fact-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
