
/* ── Design tokens ─────────────────────────────────────────────────────── */
:root {
  --accent: #a823f5;
  --accent-soft: #a123f522;
  --accent-softer: #ba23f514;

  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  /* status colors */
  --ok:   #15803d;
  --warn: #b45309;
  --bad:  #b91c1c;
  --info: #1d4ed8;
  --violet: #7c3aed;

  /* phase dot colors */
  --phase-running:   #16a34a;
  --phase-pending:   #d97706;
  --phase-failed:    #dc2626;
  --phase-completed: #2563eb;
  --phase-succeeded: #2563eb;

  /* density */
  --row-h: 28px;
  --gap: 10px;
  --pad: 12px;
  --pad-tight: 8px;
  --text-sm: 12px;
  --text-md: 13px;
  --text-lg: 15px;
}

/* Light theme */
:root[data-theme="light"] {
  --bg:      #f1f2f4;
  --panel:   #ffffff;
  --panel-2: #fafafa;
  --panel-3: #f4f4f5;
  --line:    #e4e4e7;
  --line-2:  #d4d4d8;
  --line-strong: #a1a1aa;
  --text:    #18181b;
  --text-2:  #3f3f46;
  --muted:   #71717a;
  --muted-2: #a1a1aa;
  --selected-bg: var(--accent-softer);
  --selected-bd: var(--accent-soft);
  --hover-bg: #f4f4f5;

  --window-bg: #d1d3d8;
  --titlebar-bg: #ebecef;
  --titlebar-bd: #c4c5cb;

  --code-bg: #0a0a0c;
  --code-text: #d4d4d8;
}

/* Dark theme */
:root[data-theme="dark"] {
  --bg:      #0e0e10;
  --panel:   #18181b;
  --panel-2: #131316;
  --panel-3: #1f1f23;
  --line:    #27272a;
  --line-2:  #3f3f46;
  --line-strong: #52525b;
  --text:    #f4f4f5;
  --text-2:  #d4d4d8;
  --muted:   #a1a1aa;
  --muted-2: #71717a;
  --selected-bg: var(--accent-soft);
  --selected-bd: var(--accent-soft);
  --hover-bg: #1f1f23;

  --window-bg: #050507;
  --titlebar-bg: #18181b;
  --titlebar-bd: #27272a;

  --code-bg: #050507;
  --code-text: #d4d4d8;

  --ok:     #4ade80;
  --warn:   #fbbf24;
  --bad:    #f87171;
  --info:   #60a5fa;
  --violet: #a78bfa;

  --phase-running:   #4ade80;
  --phase-pending:   #fbbf24;
  --phase-failed:    #f87171;
  --phase-completed: #60a5fa;
}

/* Density variants */
:root[data-density="compact"] {
  --row-h: 24px;
  --gap: 7px;
  --pad: 8px;
  --pad-tight: 6px;
  --text-sm: 11px;
  --text-md: 12px;
  --text-lg: 14px;
}
:root[data-density="comfy"] {
  --row-h: 34px;
  --gap: 14px;
  --pad: 16px;
  --pad-tight: 11px;
  --text-sm: 13px;
  --text-md: 14px;
  --text-lg: 16px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--window-bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: 1.45;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
}
body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 25% 20%, #4e5c91 0%, transparent 55%),
    radial-gradient(circle at 75% 80%, #8a98bd 0%, transparent 55%),
    var(--window-bg);
}
:root[data-theme="light"] body {
  background:
    radial-gradient(circle at 25% 20%, #c3d0eb 0%, transparent 55%),
    radial-gradient(circle at 75% 80%, #dcd1e9 0%, transparent 55%),
    var(--window-bg);
}

button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
code { font-family: var(--font-mono); font-size: 0.92em; }
.mono { font-family: var(--font-mono); font-feature-settings: "ss01"; }
.dot-sep { opacity: 0.4; }

/* ── App container ─────────────────────────────────────────────────────── */
#root { width: 100%; height: 100%; display: flex; justify-content: center; }
.app { width: 100%; max-width: 1440px; }

/* ── Window chrome ─────────────────────────────────────────────────────── */
.window {
  background: var(--bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.18),
    0 30px 60px -20px rgba(0,0,0,0.5),
    0 12px 24px -8px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 48px);
  min-height: 720px;
}
.titlebar {
  height: 38px;
  background: var(--titlebar-bg);
  border-bottom: 1px solid var(--titlebar-bd);
  display: flex;
  align-items: center;
  padding: 0 14px;
  flex-shrink: 0;
  gap: 16px;
}
.tlights { display: flex; gap: 8px; align-items: center; }
.tlight {
  width: 12px; height: 12px; border-radius: 50%;
  box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.2);
}
.tl-r { background: #ff5f57; }
.tl-y { background: #febc2e; }
.tl-g { background: #28c840; }
.title-center {
  flex: 1; text-align: center;
  font-size: 13px;
  color: var(--text-2);
  display: flex; gap: 8px; justify-content: center; align-items: baseline;
}
.title-app { font-weight: 600; color: var(--text); }
.title-sep { opacity: 0.4; }
.title-doc { color: var(--muted); }
.title-cluster {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.cluster-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ok) 22%, transparent);
}

.chrome-body {
  flex: 1; display: flex; flex-direction: column; min-height: 0;
}
.layout { flex: 1; display: flex; min-height: 0; }

/* ── Sidebar ──────────────────────────────────────────────────────────── */
.sidebar {
  width: 224px;
  flex-shrink: 0;
  background: var(--panel-2);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
:root[data-sidebar="icons"] .sidebar { width: 56px; }
:root[data-sidebar="icons"] .nav-label,
:root[data-sidebar="icons"] .nav-section,
:root[data-sidebar="icons"] .brand-text,
:root[data-sidebar="icons"] .conn-meta,
:root[data-sidebar="icons"] .conn-name,
:root[data-sidebar="icons"] .nav-badge { display: none; }
:root[data-sidebar="icons"] .nav-item { justify-content: center; }
:root[data-sidebar="icons"] .sidebar-footer { padding: 10px 6px; }
:root[data-sidebar="icons"] .sidebar-brand { padding: 12px 8px; justify-content: center; }

.sidebar-brand {
  padding: 14px 14px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 7px;
  background: var(--accent-softer);
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  flex-shrink: 0;
}
.brand-title { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; line-height: 1.1; }
.brand-sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; }

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 8px;
}
.nav-group + .nav-group { margin-top: 4px; }
.nav-section {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 10px 14px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  margin: 0 6px;
  height: 28px;
  border-radius: 6px;
  background: transparent;
  border: 0;
  width: calc(100% - 12px);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  transition: background 0.1s, color 0.1s;
}
.nav-item:hover { background: var(--hover-bg); color: var(--text); }
.nav-item.is-active {
  background: var(--selected-bg);
  color: var(--text);
  font-weight: 600;
}
.nav-item.is-active::before {
  content: ""; position: absolute; left: 0; width: 3px; height: 18px;
  background: var(--accent); border-radius: 2px;
}
.nav-item { position: relative; }
.nav-label { flex: 1; }
.nav-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--panel-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 5px;
  height: 16px;
  display: inline-flex; align-items: center;
  color: var(--muted);
}
.nav-item.is-active .nav-badge { color: var(--text); border-color: var(--line-2); }

.sidebar-footer {
  padding: 10px 14px 12px;
  border-top: 1px solid var(--line);
}
.conn-row { display: flex; gap: 8px; align-items: center; font-size: 12px; font-weight: 500; }
.conn-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ok) 22%, transparent);
}
.conn-meta {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  display: flex; gap: 5px; flex-wrap: wrap;
}

/* ── Main / screens ───────────────────────────────────────────────────── */
.main {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  overflow: hidden;
  display: flex;
}
.screen {
  flex: 1;
  display: grid;
  gap: 8px;
  padding: 8px;
  min-width: 0;
  min-height: 0;
}
.screen-submit  { grid-template-columns: 1fr 380px; }
.screen-jobs    { grid-template-columns: 1fr 420px; }
.screen-services{ grid-template-columns: 1fr; grid-template-rows: auto 1fr; padding: 12px 16px; }
.screen-queues  { grid-template-columns: 1fr 360px; }
.screen-nfs     { grid-template-columns: 240px 1fr; }
.screen-datasets{ grid-template-columns: 1fr 480px; }
.screen-diag    { grid-template-columns: 1fr 340px; }
.screen-config  { grid-template-columns: 1fr; padding: 12px 16px; }

.split { min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.split-form { gap: 6px; }

/* ── Panel ────────────────────────────────────────────────────────────── */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex; flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.split > .panel { flex: 1; }
.split > .panel + .panel { flex: 0 0 auto; }

.panel-hd {
  display: flex; align-items: center; gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  flex-shrink: 0;
}
.panel-hd-title {
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: -0.005em;
  display: flex; align-items: center; gap: 8px;
  flex: 1;
  min-width: 0;
}
.hd-strong {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  /* Trunca com ellipsis quando o nome é longo + há muitos botões no header.
     Sem isso, palavras longas quebravam caractere-por-caractere e empurravam
     o layout vertical. Hover mostra o nome completo via title=. */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.panel-hd-actions {
  display: flex; gap: 6px; align-items: center;
  /* Botões nunca shrinkam — eles têm tamanho previsível, o título que se
     vire pra caber. */
  flex-shrink: 0;
}
.panel-bd {
  padding: 12px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.panel-bd.flush { padding: 0; }
.panel-bd.noscroll { overflow: hidden; }
.panel-bd.flush > .table-wrap,
.panel-bd.flush > .table-foot { padding: 0; }
.panel-bd.flush > * { padding-left: 12px; padding-right: 12px; }
.panel-bd.flush > .table-wrap,
.panel-bd.flush > .filter-strip { padding-left: 0; padding-right: 0; }
.panel-bd.flush > .filter-strip { padding: 8px 12px; }
.panel-bd.flush > :first-child { padding-top: 12px; }
.panel-bd.flush > .filter-strip:first-child,
.panel-bd.flush > .table-wrap:first-child { padding-top: 0; }
.panel-bd.flush > :last-child { padding-bottom: 12px; }
.panel-bd.flush > .table-foot:last-child { padding-bottom: 0; padding: 6px 12px; }

.panel-ft {
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}
.hd-stepped { display: flex; gap: 8px; align-items: center; }
.step-num {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}

.hr {
  height: 1px;
  background: var(--line);
  margin: 12px 0;
}
.panel-bd.flush > .hr { margin-left: 12px; margin-right: 12px; }
.sub-hd {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 4px 0 8px;
}

/* ── Phase / Pill ─────────────────────────────────────────────────────── */
.phase {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 500;
  color: var(--text);
}
.phase-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}
.phase-running   .phase-dot { background: var(--phase-running);   box-shadow: 0 0 0 3px color-mix(in oklab, var(--phase-running) 22%, transparent); animation: pulse-dot 2s infinite; }
.phase-pending   .phase-dot { background: var(--phase-pending);   }
.phase-failed    .phase-dot { background: var(--phase-failed);    }
.phase-completed .phase-dot { background: var(--phase-completed); }
.phase-succeeded .phase-dot { background: var(--phase-succeeded); }
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in oklab, var(--phase-running) 22%, transparent); }
  50%      { box-shadow: 0 0 0 4px color-mix(in oklab, var(--phase-running) 8%, transparent); }
}

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 500;
  font-family: var(--font-mono);
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--panel-3);
  color: var(--text-2);
  border: 1px solid var(--line);
  line-height: 1.5;
}
.pill-ok      { background: color-mix(in oklab, var(--ok) 14%, var(--panel)); color: var(--ok); border-color: color-mix(in oklab, var(--ok) 25%, transparent); }
.pill-warn    { background: color-mix(in oklab, var(--warn) 14%, var(--panel)); color: var(--warn); border-color: color-mix(in oklab, var(--warn) 25%, transparent); }
.pill-bad     { background: color-mix(in oklab, var(--bad) 14%, var(--panel)); color: var(--bad); border-color: color-mix(in oklab, var(--bad) 25%, transparent); }
.pill-info    { background: color-mix(in oklab, var(--info) 14%, var(--panel)); color: var(--info); border-color: color-mix(in oklab, var(--info) 25%, transparent); }
.pill-muted   { color: var(--muted); }
.pill-accent  { background: var(--accent-softer); color: var(--accent); border-color: var(--accent-soft); }

/* ── Bar ──────────────────────────────────────────────────────────────── */
.bar-wrap + .bar-wrap { margin-top: 8px; }
.bar-label { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.bar-label > span:first-child { color: var(--text-2); font-weight: 500; }
.bar-sub { font-family: var(--font-mono); font-size: 10.5px; }
.bar {
  height: 6px;
  background: var(--panel-3);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.bar-fill {
  position: absolute; top: 0; bottom: 0; left: 0;
  background: var(--accent);
  border-radius: 3px;
}
.bar-ok     { background: var(--ok); }
.bar-warn   { background: var(--warn); }
.bar-bad    { background: var(--bad); }
.bar-info   { background: var(--info); }
.bar-accent { background: var(--accent); }
.bar-muted  { background: var(--muted-2); }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  padding: 0 10px;
  height: 26px;
  background: var(--panel);
  color: var(--text-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
}
.btn:hover { background: var(--hover-bg); color: var(--text); border-color: var(--line-2); }
.btn-sm { height: 24px; font-size: 11px; padding: 0 8px; gap: 4px; }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: color-mix(in oklab, var(--accent) 80%, black 10%);
}
.btn-primary:hover { background: color-mix(in oklab, var(--accent) 90%, black 10%); color: #fff; }
.btn-danger { background: var(--panel); color: var(--bad); border-color: color-mix(in oklab, var(--bad) 30%, var(--line)); }
.btn-danger:hover { background: color-mix(in oklab, var(--bad) 10%, var(--panel)); color: var(--bad); }
.btn-ok { background: var(--panel); color: var(--ok); border-color: color-mix(in oklab, var(--ok) 30%, var(--line)); }
.btn-ok:hover { background: color-mix(in oklab, var(--ok) 10%, var(--panel)); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--hover-bg); border-color: var(--line); }

.action-bar {
  display: flex; gap: 8px; padding: 10px 0 4px;
  align-items: center;
  border-top: 1px solid var(--line);
  margin-top: 6px;
}
.action-bar-inline {
  border-top: 0;
  margin-top: 8px;
  padding: 0;
}
.bar-trail { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; font-size: 11.5px; color: var(--muted); }

/* ── Fields / Inputs ──────────────────────────────────────────────────── */
.field {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--row-h);
  padding: 4px 0;
}
.row-2 .field { padding: 3px 0; }
.field-label {
  width: 130px;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}
.field-control { flex: 1; min-width: 0; display: flex; gap: 6px; align-items: center; }
.field-mono .input-val { font-family: var(--font-mono); }
.field-hint { font-size: 11px; color: var(--muted); font-style: italic; }

.input {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  flex: 1;
  min-width: 0;
  font-size: 12px;
}
.input-mono .input-val,
.input-mono { font-family: var(--font-mono); }
.input-val { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.is-placeholder { color: var(--muted-2); font-style: normal; }
.input-combo { padding-right: 28px; position: relative; cursor: pointer; background: var(--panel-2); }
.input-combo svg { position: absolute; right: 8px; }
.input-ghost { background: transparent; border: 0; }

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 24px;
  row-gap: 2px;
  align-items: start;
}
.dual-input { display: flex; gap: 4px; align-items: center; flex: 1; min-width: 0; }
.dual-input .input { flex: 1; }
.dual-sep { color: var(--muted-2); font-family: var(--font-mono); font-size: 11px; padding: 0 2px; }
.textarea {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 6px 8px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--text-2);
  min-height: 64px;
  width: 100%;
}
.textarea.mono { font-family: var(--font-mono); }
.check-row { padding: 6px 0; }
.check {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text);
}
.check-box {
  width: 14px; height: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel-2);
}
.check-on .check-box { background: var(--accent); border-color: var(--accent); color: #fff; }
.check-lbl { color: var(--text-2); }
.toggle-row { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; }

.hint {
  display: inline-flex; align-items: flex-start; gap: 6px;
  font-size: 11.5px;
  color: var(--text-2);
  padding: 6px 9px;
  border-radius: 5px;
  background: var(--panel-3);
  border: 1px solid var(--line);
  margin-top: 6px;
}
.hint code { background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; font-size: 10.5px; }
.hint-info { background: color-mix(in oklab, var(--info) 8%, var(--panel-2)); border-color: color-mix(in oklab, var(--info) 25%, transparent); color: var(--info); }
.hint-info code { color: var(--text); }
.hint-ok { background: color-mix(in oklab, var(--ok) 8%, var(--panel-2)); border-color: color-mix(in oklab, var(--ok) 25%, transparent); color: var(--ok); }
.hint-block { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; padding: 10px 12px; }

/* ── Data table ───────────────────────────────────────────────────────── */
.table-wrap {
  overflow: auto;
  min-height: 0;
  flex: 1;
}
.dtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.dtable th {
  text-align: left;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  position: sticky; top: 0; z-index: 1;
  white-space: nowrap;
}
.dtable th.th-num { text-align: right; }
.dtable th.th-name { padding-left: 16px; }
.dtable td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  vertical-align: middle;
  white-space: nowrap;
}
.dtable td.td-name {
  display: flex; align-items: center; gap: 8px;
  padding-left: 16px;
  color: var(--text);
  font-weight: 500;
  font-family: var(--font-mono);
}
.dtable td.td-num { text-align: right; font-variant-numeric: tabular-nums; }
.dtable td.td-dim { color: var(--muted); }
.dtable tr:hover td { background: var(--hover-bg); }
.dtable tr.is-selected td {
  background: var(--selected-bg);
  color: var(--text);
}
.dtable tr.is-selected td.td-name { color: var(--text); }
.job-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
  margin-right: 2px;
}
.job-dot[data-phase="running"]   { background: var(--phase-running); }
.job-dot[data-phase="pending"]   { background: var(--phase-pending); }
.job-dot[data-phase="failed"]    { background: var(--phase-failed); }
.job-dot[data-phase="completed"] { background: var(--phase-completed); }

.table-foot {
  display: flex; justify-content: space-between;
  padding: 6px 16px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: var(--panel-2);
  font-family: var(--font-mono);
  flex-shrink: 0;
}

/* ── Filter strip ─────────────────────────────────────────────────────── */
.filter-strip {
  display: flex; gap: 5px; align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  background: var(--panel-2);
}
.filter-label { color: var(--muted); font-size: 11px; margin-right: 2px; }
.filter-trail { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.chip {
  display: inline-flex; gap: 5px; align-items: center;
  height: 22px;
  padding: 0 8px;
  font-size: 11px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--font-mono);
}
.chip:hover { background: var(--hover-bg); }
.chip.chip-on {
  background: var(--panel-3);
  color: var(--text);
  border-color: var(--line-2);
}
.chip-run.chip-on { color: var(--phase-running); border-color: color-mix(in oklab, var(--phase-running) 30%, transparent); background: color-mix(in oklab, var(--phase-running) 10%, var(--panel-2)); }
.chip-pend.chip-on { color: var(--phase-pending); border-color: color-mix(in oklab, var(--phase-pending) 30%, transparent); background: color-mix(in oklab, var(--phase-pending) 10%, var(--panel-2)); }
.chip-n { font-size: 10px; opacity: 0.7; }

.search-input {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px;
  padding: 0 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 11.5px;
  min-width: 180px;
  color: var(--muted);
}
.kbd {
  font-family: var(--font-mono);
  font-size: 9.5px;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  background: var(--panel);
  margin-left: auto;
}

/* ── Key/value list ───────────────────────────────────────────────────── */
.kv {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 6px 14px;
  font-size: 12px;
  padding: 12px;
}
.kv-label { color: var(--muted); font-size: 11.5px; }
.kv-val { color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.kv-val.mono { font-family: var(--font-mono); font-size: 11.5px; }

/* ── Metrics ──────────────────────────────────────────────────────────── */
.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 12px;
}
.metric { font-size: 11.5px; }
.metric-hd { display: flex; gap: 6px; align-items: center; color: var(--muted); margin-bottom: 5px; }
.metric-val { font-family: var(--font-mono); font-size: 11px; color: var(--text-2); margin-top: 3px; text-align: right; }

/* ── Logs ─────────────────────────────────────────────────────────────── */
.logs-hd {
  display: flex; justify-content: space-between;
  padding: 0 12px 8px;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 600;
}
.log-tail {
  margin: 0 12px 12px;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--code-text);
  max-height: 200px;
  overflow: auto;
}
.log-line { display: flex; gap: 10px; }
.log-time { color: #6b7280; flex-shrink: 0; }
.log-body { color: #c7d2cf; }
.log-line:last-child .log-body { color: #f5a623; }

/* ── YAML preview ─────────────────────────────────────────────────────── */
.estimate-title {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.estimate { padding: 12px; }
.yaml-box { padding: 0 12px 12px; }
.yaml-hd {
  display: flex; gap: 6px; align-items: center;
  font-size: 11.5px;
  color: var(--text-2);
  margin-bottom: 6px;
}
.yaml-meta { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }
.yaml-pre {
  background: var(--code-bg);
  color: var(--code-text);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.55;
  padding: 10px 12px;
  margin: 0;
  border-radius: 5px;
  border: 1px solid var(--line);
  max-height: 360px;
  overflow: auto;
  white-space: pre;
}

/* ── Services ─────────────────────────────────────────────────────────── */
.services-bar { display: flex; align-items: baseline; gap: 12px; padding: 4px 4px 8px; }
.services-bar-left { display: flex; align-items: baseline; gap: 12px; }
.services-bar-right { margin-left: auto; display: flex; gap: 6px; }
.screen-h { font-size: 16px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.td-dim { color: var(--muted); font-size: 12px; }

.service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
  min-height: 0;
  overflow: auto;
}

.svc-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
}
.svc-hd { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.svc-title { display: flex; gap: 10px; align-items: center; }
.svc-preset-mark {
  width: 36px; height: 36px;
  border-radius: 7px;
  background: var(--accent-softer);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  border: 1px solid var(--accent-soft);
}
.svc-preset-mark[data-preset="tensorboard"] { background: color-mix(in oklab, var(--info) 12%, var(--panel)); color: var(--info); border-color: color-mix(in oklab, var(--info) 25%, transparent); }
.svc-preset-mark[data-preset="vllm"] { background: color-mix(in oklab, var(--violet) 12%, var(--panel)); color: var(--violet); border-color: color-mix(in oklab, var(--violet) 25%, transparent); }
.svc-preset-mark[data-preset="openvscode-server"] { background: color-mix(in oklab, var(--ok) 12%, var(--panel)); color: var(--ok); border-color: color-mix(in oklab, var(--ok) 25%, transparent); }
.svc-name { font-weight: 600; font-size: 14px; }
.svc-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

.svc-row {
  display: grid;
  grid-template-columns: 1.2fr 0.7fr 0.7fr 0.7fr 1.4fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--panel-2);
}
.svc-mini { padding: 8px 10px; border-right: 1px solid var(--line); }
.svc-mini:last-child { border-right: 0; }
.mini-k { font-size: 9.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.mini-v { font-size: 13px; font-weight: 500; margin-top: 1px; }
.mini-v.mono { font-family: var(--font-mono); font-size: 12px; }
.mini-bar { height: 3px; background: var(--panel-3); border-radius: 2px; overflow: hidden; margin-top: 5px; }
.mini-fill { height: 100%; }

.svc-section-hd { font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.svc-nfs-row { font-size: 11.5px; color: var(--text-2); padding: 2px 0; border-bottom: 1px dashed var(--line); }
.svc-nfs-row:last-child { border-bottom: 0; }

.svc-ports { display: flex; flex-direction: column; gap: 6px; }
.port-row {
  display: flex; gap: 8px; align-items: center;
  padding: 6px 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 11.5px;
}
.port-label { font-weight: 600; font-size: 11px; color: var(--text); background: var(--panel-3); padding: 1px 6px; border-radius: 3px; }
.port-arrow { font-size: 11.5px; color: var(--text-2); }
.port-state { margin-left: auto; font-size: 11px; font-family: var(--font-mono); }
.port-on { color: var(--ok); }
.port-off { color: var(--muted); }

.svc-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 6px; border-top: 1px solid var(--line); }
.svc-foot-actions { display: flex; gap: 5px; }

/* ── Queues ───────────────────────────────────────────────────────────── */
.queue-jobs { display: flex; flex-direction: column; gap: 4px; }
.qj-row { display: flex; gap: 8px; align-items: center; font-size: 12px; padding: 3px 0; }
.qj-name { font-size: 11.5px; color: var(--text-2); flex: 1; }

.spark-grid {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 3px;
  align-items: end;
  height: 96px;
  padding: 4px 0 0;
}
.spark-bar { height: 100%; display: flex; flex-direction: column; align-items: stretch; gap: 2px; }
.spark-bar:nth-child(n+13):nth-child(-n+16) .spark-fill { background: var(--accent); }
.spark-fill {
  flex: 0 0 auto;
  margin-top: auto;
  background: color-mix(in oklab, var(--accent) 55%, transparent);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
}
.spark-axis { font-family: var(--font-mono); font-size: 9px; color: var(--muted); text-align: center; height: 12px; }

/* ── NFS ──────────────────────────────────────────────────────────────── */
.tree { font-size: 12px; }
.tree-item {
  display: flex; gap: 6px; align-items: center;
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--text-2);
  cursor: pointer;
}
.tree-item:hover { background: var(--hover-bg); }
.tree-item.is-active { background: var(--selected-bg); color: var(--text); }
.tree-item.is-root { font-weight: 600; color: var(--text); }
.tree-meta { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--muted-2); }

.nfs-quota { padding: 4px 0; }
.quota-row { display: flex; justify-content: space-between; font-size: 11.5px; margin-bottom: 6px; }
.quota-k { color: var(--muted); }
.quota-v { color: var(--text); }

.breadcrumb { display: flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 12px; }
.crumb { color: var(--text-2); }
.crumb:last-child { color: var(--accent); font-weight: 500; }

.nfs-table tbody tr { cursor: pointer; }
.dir-name { color: var(--text); }
.row-actions { display: inline-flex; gap: 4px; }

/* ── Diagnostics ──────────────────────────────────────────────────────── */
.node-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.node-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: var(--panel-2);
}
.node-hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.node-name { font-size: 12px; font-weight: 600; }
.node-taint { font-size: 10.5px; color: var(--warn); margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }

.term {
  background: var(--code-bg);
  color: var(--code-text);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.65;
  padding: 14px 16px;
  border-radius: 0;
  height: 100%;
  overflow: auto;
}
.term-h { color: var(--accent); font-weight: 600; margin-top: 10px; margin-bottom: 2px; }
.term-h:first-child { margin-top: 0; }
.term-dim { color: #6b7280; }
.term-ok { color: #4ade80; }
.term-warn { color: #fbbf24; }
.term-violet { color: #a78bfa; }
.term-cursor { margin-top: 12px; color: #d4d4d8; }
.term-blink { animation: blink 1s infinite step-end; }
@keyframes blink { 50% { opacity: 0; } }

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.stat {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--panel-2);
}
.stat-k { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.stat-v { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; margin: 2px 0; font-family: var(--font-sans); }
.stat-unit { font-size: 14px; color: var(--muted); margin-left: 2px; font-weight: 500; }
.stat-sub { font-size: 11px; color: var(--muted); font-family: var(--font-mono); }
.stat-ok { color: var(--ok); }

.dual-bar { display: flex; flex-direction: column; gap: 8px; }
.dual-bar-row { display: flex; gap: 8px; align-items: center; font-size: 11.5px; }
.dual-bar-lbl { width: 40px; color: var(--muted); font-size: 11px; }
.dual-bar-pct { color: var(--text-2); font-size: 11px; width: 56px; text-align: right; }
.dual-bar-row .bar { flex: 1; }
.dual-bar-legend { display: flex; gap: 14px; font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.legend-sq { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.legend-mine { background: var(--accent); }
.legend-other { background: var(--muted-2); }
.legend-free { background: var(--panel-3); border: 1px solid var(--line); }

/* ── Config ───────────────────────────────────────────────────────────── */
.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-content: start;
}
.ctx-list { display: flex; flex-direction: column; gap: 4px; }
.ctx-row {
  display: flex; gap: 10px; align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
}
.ctx-row.is-active { background: var(--selected-bg); border-color: var(--accent-soft); }
.ctx-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted-2);
  flex-shrink: 0;
}
.ctx-dot[data-on="1"] { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ok) 22%, transparent); }
.ctx-text { flex: 1; min-width: 0; }
.ctx-name { font-weight: 600; font-size: 12.5px; }
.ctx-server { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.ctx-meta { display: flex; gap: 8px; align-items: center; }

.info-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 16px;
  font-size: 12px;
}
.info-k { color: var(--muted); font-size: 11.5px; }
.info-v { color: var(--text); }
.info-v.mono { font-family: var(--font-mono); font-size: 11.5px; }

/* ── Status bar ───────────────────────────────────────────────────────── */
.statusbar {
  height: 26px;
  background: var(--titlebar-bg);
  border-top: 1px solid var(--titlebar-bd);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 10px;
  font-size: 11px;
  color: var(--text-2);
  flex-shrink: 0;
  font-family: var(--font-mono);
}
.sb-cell { display: inline-flex; gap: 5px; align-items: center; padding: 0 4px; }
.sb-cell-strong { font-weight: 600; color: var(--ok); }
.sb-cell-dim { color: var(--muted); }
.sb-spacer { flex: 1; }
.sb-spacer-sm { width: 14px; border-left: 1px solid var(--line); height: 14px; margin: 0 4px; }
.sb-cell b { color: var(--text); font-weight: 500; }

