/* nixin-view's page: one table of machines, a detail pane, a terminal overlay. */
:root {
  --bg: #fbfaf7; --panel: #ffffff; --line: #e4e1da; --text: #22211f; --dim: #77736b;
  --ok: #2f7d4f; --warn: #a36a00; --bad: #b3261e; --accent: #3558b8; --sel: #eef1fb;
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15161a; --panel: #1c1d22; --line: #2c2e35; --text: #e6e4df; --dim: #8d8a83;
    --ok: #5cc28a; --warn: #e0a640; --bad: #f07167; --accent: #8aa4f0; --sel: #232838;
  }
}
:root[data-theme="dark"] {
  --bg: #15161a; --panel: #1c1d22; --line: #2c2e35; --text: #e6e4df; --dim: #8d8a83;
  --ok: #5cc28a; --warn: #e0a640; --bad: #f07167; --accent: #8aa4f0; --sel: #232838;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, sans-serif; }
header { display: flex; gap: 12px; align-items: baseline; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.grow { flex: 1; }
.dim { color: var(--dim); }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }
button { font: inherit; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; cursor: pointer; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }
input { font: inherit; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); }
code, pre { font-family: var(--mono); font-size: 12.5px; }
pre { background: var(--panel); border: 1px solid var(--line); padding: 8px; white-space: pre-wrap; word-break: break-all; border-radius: 6px; }
.panel { max-width: 640px; margin: 32px auto; padding: 0 16px; }
#fleet { display: grid; grid-template-columns: minmax(0, 1fr) 420px; min-height: calc(100vh - 45px); }
#list { overflow: auto; }
#detail { border-left: 1px solid var(--line); padding: 12px 16px; overflow: auto; background: var(--panel); }
@media (max-width: 900px) { #fleet { grid-template-columns: 1fr; } #detail { border-left: 0; border-top: 1px solid var(--line); } }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th { text-align: left; font-weight: 500; color: var(--dim); padding: 6px 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); }
td { padding: 5px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr.row { cursor: pointer; }
tr.row:hover td { background: var(--sel); }
tr.row.sel td { background: var(--sel); }
tr.row.stale td { opacity: .55; }
td.name .indent { display: inline-block; width: 18px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--dim); }
.dot.up { background: var(--ok); } .dot.down { background: var(--bad); } .dot.silent { background: var(--warn); }
.dot.off { background: var(--dim); opacity: .6; }
h3.section { margin: 18px 0 6px; font-size: 14px; font-weight: 600; color: var(--dim); }
.bar-cell { width: 150px; }
.gauge { display: grid; grid-template-columns: 60px auto; gap: 8px; align-items: center; }
.gauge .dim { font-size: 12px; }
.meter { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); }
.meter.hot > i { background: var(--warn); } .meter.full > i { background: var(--bad); }
.badge { font-size: 12px; padding: 1px 6px; border-radius: 10px; border: 1px solid var(--line); margin-left: 4px; }
.badge.bad { border-color: var(--bad); } .badge.warn { border-color: var(--warn); } .badge.ok { border-color: var(--ok); }
#detail h2 { margin: 0 0 4px; font-size: 18px; }
#detail h3 { margin: 16px 0 6px; font-size: 13px; color: var(--dim); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
#detail dl { display: grid; grid-template-columns: 110px 1fr; gap: 2px 10px; margin: 0; }
#detail dt { color: var(--dim); } #detail dd { margin: 0; word-break: break-all; }
#detail .actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
#detail ul { list-style: none; padding: 0; margin: 0; }
#detail li { padding: 2px 0; }
svg.spark { width: 100%; height: 44px; display: block; }
svg.spark path { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.spark-label { display: flex; justify-content: space-between; color: var(--dim); font-size: 12px; }
dialog { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); max-width: 680px; width: calc(100% - 32px); }
dialog::backdrop { background: rgb(0 0 0 / .4); }
menu { display: flex; justify-content: flex-end; gap: 8px; padding: 0; }
#term { position: fixed; inset: 0; background: #0d0e11; display: flex; flex-direction: column; z-index: 10; }
#term .bar { display: flex; gap: 12px; align-items: center; padding: 8px 12px; color: #e6e4df; border-bottom: 1px solid #2c2e35; }
#term .bar .dim { color: #8d8a83; }
#term-screen { flex: 1; padding: 6px; min-height: 0; }
td.name .fold { display: inline-block; width: 16px; color: var(--dim); user-select: none; }
td.name .fold[data-fold] { cursor: pointer; }
td.name .fold[data-fold]:hover { color: var(--accent); }
