:root {
  color-scheme: dark;
  --bg: #0b0d10; --surface: #141820; --surface-2: #181e26; --line: #2a313b; --muted: #8e9ba8; --text: #eef4f6;
  --in: #39d98a; --out: #54b7ff; --cpu: #c7f464; --warn: #f2c94c; --alert: #ff6b6b;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.shell { width: min(1780px, 100%); margin: 0 auto; padding: 28px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.topbar h1 { margin: 0; font-size: 28px; font-weight: 600; }
.eyebrow { margin: 0 0 4px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.dashboard-nav { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 4px; }
.dashboard-nav a { color: var(--muted); text-decoration: none; font-size: 14px; padding: 6px 12px; border-radius: 6px; }
.dashboard-nav a.active { background: var(--surface-2); color: var(--text); }
.sync-state { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.sync-state span { border: 1px solid var(--line); border-radius: 12px; padding: 2px 10px; }
.error-banner { background: #3a1e1e; border: 1px solid var(--alert); color: #ffd0d0; border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }
.machines { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; align-items: start; margin-bottom: 20px; }
.card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.card-head strong { font-size: 15px; font-weight: 600; }
.chip { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 5px; color: #0b0d10; background: var(--in); }
.chip.warn { background: var(--warn); } .chip.alert { background: var(--alert); } .chip.off { background: var(--muted); }
.big { font-size: 26px; font-weight: 600; } .big small { font-size: 13px; font-weight: 400; color: var(--muted); }
.bar { position: relative; height: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; margin: 8px 0 6px; }
.bar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--in); }
.bar .fill.warn { background: var(--warn); } .bar .fill.alert { background: var(--alert); }
.bar .mk { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--muted); }
.sub { font-size: 12px; color: var(--muted); }
.channels { margin-top: 10px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) 44px; gap: 6px; font-size: 12px; align-items: center; }
.cols.head { color: var(--muted); padding: 0 2px 4px; font-size: 11px; }
.cols.row { align-items: start; padding: 4px 2px; border-top: 1px solid var(--line); }
.cols.row span:nth-child(2) { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cols.row span:nth-child(3) { text-align: right; font-variant-numeric: tabular-nums; }
.cols.row span:nth-child(1) { white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
.app { display: flex; justify-content: space-between; margin: 10px 0 4px; padding: 3px 8px; border: 1px solid #3a4452; border-radius: 5px; font-size: 13px; font-weight: 600; }
.app em { font-style: normal; font-weight: 400; color: var(--muted); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: var(--in); }
.dot.s1 { background: var(--warn); } .dot.s2 { background: var(--alert); } .dot.s3 { background: var(--muted); }
.empty { color: var(--muted); font-size: 13px; padding: 12px 2px; }
.reports { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.section-title { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 10px; }
.section-title h2 { margin: 0; font-size: 18px; font-weight: 600; } .unit { color: var(--muted); font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th { color: var(--muted); font-weight: 500; text-align: right; padding: 8px 10px; border-bottom: 1px solid #3a4452; font-size: 12px; }
td { text-align: right; padding: 9px 10px; border-top: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
th.tot, td.tot { border-left: 1px solid #3a4452; font-weight: 600; color: var(--text); }
tr.sum td { border-top: 1px solid #3a4452; font-weight: 600; }
td small { color: var(--muted); font-weight: 400; }
.note { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.stats { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.stats b { color: var(--text); font-weight: 600; }
.chart-wrap { width: 100%; margin: 4px 0 6px; }
#historyChart { width: 100%; height: auto; display: block; }
#historyChart .grid { stroke: var(--line); stroke-width: 1; }
#historyChart .axis { stroke: #3a4452; stroke-width: 1; }
#historyChart .ytick, #historyChart .xtick { fill: var(--muted); font-size: 11px; }
#historyChart .val { fill: var(--text); font-size: 11px; font-variant-numeric: tabular-nums; }
#historyChart .bar-real { fill: var(--out); }
#historyChart .bar-est { fill: var(--out); fill-opacity: .28; stroke: var(--out); stroke-width: 1; stroke-dasharray: 3 3; }
.legend { display: flex; gap: 18px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.legend .sw { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -2px; border-radius: 2px; background: var(--out); }
.legend .sw.est { background: rgba(84, 183, 255, .28); border: 1px dashed var(--out); }
th.left, td.left { text-align: left; }
td.est { color: var(--warn); }
@media (max-width: 640px) { .shell { padding: 16px; } }
.appblock { display: flow-root; }
.appblock.ph { visibility: hidden; }
