:root {
  --bg:          #0f1117;
  --bg2:         #161b22;
  --bg3:         #1c2128;
  --border:      #30363d;
  --text:        #e6edf3;
  --text-muted:  #7d8590;
  --accent:      #388bfd;
  --accent-dim:  #1f3a6e;
  --green:       #3fb950;
  --red:         #f85149;
  --orange:      #d29922;
  --yellow:      #e3b341;
  --purple:      #bc8cff;
  --sidebar-w:   220px;
  --header-h:    56px;
  --radius:      8px;
  --font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:        'JetBrains Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; overflow: hidden; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ── Layout ────────────────────────────────────────────────── */

.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ───────────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}

.sidebar-logo-img {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: cover;
  object-position: center 25%;
  border-radius: 50%;
  border: 2px solid var(--border);
}

.sidebar-logo-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  letter-spacing: 0.3px;
}

.sidebar-version {
  margin-top: auto;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.version-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.version-grid {
  display: grid;
  grid-template-columns: repeat(7, auto);
  grid-template-rows: auto auto;
  column-gap: 1px;
  row-gap: 4px;
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.version-seg {
  cursor: pointer;
  color: var(--accent);
  text-align: center;
  border-radius: 3px;
  padding: 2px 3px;
  transition: background 0.12s, color 0.12s;
  user-select: none;
}

.version-seg:hover {
  background: var(--accent-dim);
  color: #fff;
}

.version-seg:active {
  background: var(--accent);
  color: #fff;
}

.version-dot {
  color: var(--text-muted);
  font-weight: 400;
  padding: 0 1px;
  align-self: baseline;
}

.version-sublabel {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 400;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.m3s-build-info {
  margin-top: 8px;
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-list {
  list-style: none;
  padding: 8px 0;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  margin: 1px 8px;
  transition: background 0.12s, color 0.12s;
  user-select: none;
}

.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active { background: var(--accent-dim); color: var(--accent); }

/* ── Sidebar nav group (expandable) ─────────────────────────── */

.nav-group { margin: 1px 0; }

.nav-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  user-select: none;
  transition: color 0.12s;
  border-radius: 6px;
  margin: 1px 8px;
}
.nav-group-header:hover { color: var(--text); background: var(--bg3); }
.nav-group-header svg { width: 16px; height: 16px; flex-shrink: 0; }

.nav-group-chevron {
  margin-left: auto;
  transition: transform 0.18s ease;
  opacity: 0.6;
}
.nav-group.open .nav-group-chevron { transform: rotate(90deg); }

.nav-group-items {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.2s ease;
}
.nav-group.open .nav-group-items { max-height: 400px; }

.nav-child {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px 7px 36px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  margin: 1px 8px;
  transition: background 0.12s, color 0.12s;
  user-select: none;
}
.nav-child svg { width: 14px; height: 14px; flex-shrink: 0; }
.nav-child:hover { background: var(--bg3); color: var(--text); }
.nav-child.active { background: var(--accent-dim); color: var(--accent); }

/* ── Main content ───────────────────────────────────────────── */

.main {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tab-pane {
  display: none;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.tab-pane.active { display: flex; }

/* ── Page header ────────────────────────────────────────────── */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.page-header h1 {
  font-size: 18px;
  font-weight: 600;
}

.page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.lt-run-row {
  display: flex;
  align-items: center;
  margin-top: 16px;
}
.lt-run-row #orch-stop-btn {
  margin-left: auto;
}
.lt-live-stop-row {
  display: flex;
  justify-content: flex-end;
  padding: 16px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}

/* ── Buttons ────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
  font-family: var(--font);
}

.btn:hover { background: var(--bg2); border-color: #6e7681; }
.btn:active { opacity: 0.8; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: #58a6ff; border-color: #58a6ff; }

.btn-danger {
  background: transparent;
  border-color: var(--red);
  color: var(--red);
}
.btn-danger:hover { background: rgba(248,81,73,0.12); }

.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ── Config sub-tabs ──────────────────────────────────────────── */
.cfg-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.cfg-tab-btn:hover { color: var(--text); }
.cfg-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.cfg-panel { display: block; }
.cfg-panel.hidden { display: none; }

/* Toggle switch */
.cfg-toggle { position:relative; display:inline-flex; align-items:center; cursor:pointer; }
.cfg-toggle input { opacity:0; width:0; height:0; position:absolute; }
.cfg-toggle-track {
  width:40px; height:22px; background:var(--border); border-radius:11px;
  transition:background .2s; flex-shrink:0;
}
.cfg-toggle-track::after {
  content:''; position:absolute; top:3px; left:3px;
  width:16px; height:16px; border-radius:50%; background:#fff;
  transition:transform .2s; box-shadow:0 1px 3px rgba(0,0,0,.3);
}
.cfg-toggle input:checked + .cfg-toggle-track { background:var(--accent); }
.cfg-toggle input:checked + .cfg-toggle-track::after { transform:translateX(18px); }

/* ── Scrollable body ────────────────────────────────────────── */

.scroll-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

/* ── Config ─────────────────────────────────────────────────── */

.config-yaml {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  white-space: pre;
  overflow-x: auto;
  line-height: 1.6;
  color: #c9d1d9;
}

.config-editor {
  width: 100%;
  height: 100%;
  min-height: 400px;
  font-family: var(--mono);
  font-size: 13px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  color: var(--text);
  resize: vertical;
  outline: none;
  line-height: 1.6;
}
.config-editor:focus { border-color: var(--accent); }

.edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* ── Tables ─────────────────────────────────────────────────── */

.table-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px 24px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
tbody tr:hover { background: var(--bg3); }
tbody tr:last-child { border-bottom: none; }

tbody td {
  padding: 10px 12px;
  font-size: 13px;
  vertical-align: top;
}

/* ── Badges ─────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.badge-running    { background: rgba(56,139,253,0.15);  color: var(--accent); }
.badge-passed     { background: rgba(63,185,80,0.15);   color: var(--green); }
.badge-success    { background: rgba(63,185,80,0.15);   color: var(--green); }
.badge-failed     { background: rgba(248,81,73,0.15);   color: var(--red); }
.badge-error      { background: rgba(210,153,34,0.15);  color: var(--orange); }
.badge-skipped    { background: rgba(125,133,144,0.15); color: var(--text-muted); }
.badge-cancelled  { background: rgba(125,133,144,0.15); color: var(--text-muted); }

.badge-low      { background: rgba(63,185,80,0.12);  color: var(--green); }
.badge-medium   { background: rgba(227,179,65,0.15); color: var(--yellow); }
.badge-high     { background: rgba(210,153,34,0.18); color: var(--orange); }
.badge-critical { background: rgba(248,81,73,0.15);  color: var(--red); }

.badge-manual { background: rgba(56,139,253,0.12); color: var(--accent); }
.badge-agent  { background: rgba(188,140,255,0.15); color: var(--purple); }
.badge-auto   { background: rgba(125,133,144,0.15); color: var(--text-muted); }

/* Test kind badges — colour-coded by category of test (functional/ML/skill).
 * Functional uses the neutral muted style; ML and Skill get distinct hues
 * so a glance at the table immediately distinguishes them. See
 * docs/agent/ML_TESTING.md + SKILLS_TESTING.md in healthcare-hub for the
 * conceptual distinction. */
.badge-kind-functional  { background: rgba(125,133,144,0.15); color: var(--text-muted); }
.badge-kind-regression  { background: rgba(217,119,6,0.15);   color: #d97706; }
.badge-kind-ml          { background: rgba(188,140,255,0.18); color: var(--purple); }
.badge-kind-skill       { background: rgba(56,139,253,0.18);  color: var(--accent); }

/* Quality metric pill rendered in the Quality column — smaller than a
 * status badge, no uppercase, fits multiple side-by-side (Skill rows
 * show both Activation and Composition rates). */
.quality-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  margin-right: 4px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.quality-ml    { background: rgba(188,140,255,0.12); color: var(--purple); }
.quality-skill { background: rgba(56,139,253,0.12);  color: var(--accent); }

/* Test kind filter chip row — sits above the stats strip on the
 * Test Results page. Reuses the existing .filter-btn pill styling
 * from the Conversations tab. */
.test-kind-filter {
  display: flex;
  gap: 6px;
  padding: 10px 24px 0;
  flex-shrink: 0;
}

/* ── Test stats strip ───────────────────────────────────────── */

.stats-strip {
  display: flex;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.stat-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 18px;
  min-width: 100px;
  text-align: center;
}
.stat-card .stat-val {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}
.stat-card .stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.stat-passed .stat-val { color: var(--green); }
.stat-failed .stat-val { color: var(--red); }
.stat-running .stat-val { color: var(--accent); }
.stat-total .stat-val { color: var(--text); }
.stat-archived .stat-val { color: var(--text-muted); }
.stat-archived { opacity: 0.7; transition: opacity .15s, border-color .15s; }
.stat-archived:hover { opacity: 1; border-color: var(--text-muted); }
.stat-archived.active { opacity: 1; border-color: var(--text-muted); background: var(--bg2); }

/* ── Test case expand ───────────────────────────────────────── */

.results-panel {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 8px;
}

.test-case {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.test-case:last-child { border-bottom: none; }
.test-case-name { flex: 1; color: var(--text); font-family: var(--mono); font-size: 12px; }
.test-case-dur  { color: var(--text-muted); font-size: 11px; min-width: 60px; text-align: right; }
.test-case-err  { color: var(--red); font-size: 12px; margin-top: 2px; }

/* ── Conversations ──────────────────────────────────────────── */

.conv-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.conv-sidebar {
  width: 280px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.conv-filter {
  display: flex;
  gap: 4px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.filter-btn {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.12s;
  font-family: var(--font);
}
.filter-btn:hover { border-color: #6e7681; color: var(--text); }
.filter-btn.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

.conv-list {
  flex: 1;
  overflow-y: auto;
}

.conv-list-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.conv-list-item:hover { background: var(--bg3); }
.conv-list-item.active { background: var(--accent-dim); }

.conv-item-type {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.conv-item-type.claude { color: var(--accent); }
.conv-item-type.agent  { color: var(--purple); }

.conv-item-title {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conv-item-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.conv-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.conv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.conv-title {
  font-size: 15px;
  font-weight: 600;
}

.conv-header-actions { display: flex; gap: 8px; }

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
}

.message.role-user      { align-self: flex-end; align-items: flex-end; }
.message.role-assistant { align-self: flex-start; align-items: flex-start; }
.message.role-system    { align-self: center; align-items: center; max-width: 100%; }
.message.role-tool      { align-self: flex-start; align-items: flex-start; }

.message-role {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.message-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.role-user      .message-bubble { background: var(--accent-dim); border: 1px solid var(--accent); color: var(--text); }
.role-assistant .message-bubble { background: var(--bg3); border: 1px solid var(--border); color: var(--text); }
.role-system    .message-bubble { background: rgba(227,179,65,0.08); border: 1px solid rgba(227,179,65,0.3); color: var(--yellow); font-size: 12px; text-align: center; }
.role-tool      .message-bubble { background: var(--bg3); border: 1px solid var(--border); color: var(--text-muted); font-family: var(--mono); font-size: 12px; }
.role-summary   .message-bubble {
  background: rgba(188,140,255,0.07);
  border: 1px dashed rgba(188,140,255,0.35);
  color: var(--text-muted);
  font-size: 12px;
  font-family: var(--mono);
  white-space: pre-wrap;
}

.message-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
}

.replay-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}

.replay-progress {
  font-size: 12px;
  color: var(--text-muted);
}

.replay-bar select {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-family: var(--font);
}

/* ── Empty states ───────────────────────────────────────────── */

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 8px;
}

.empty-state svg { opacity: 0.3; }
.empty-state p { font-size: 14px; }

/* ── Search bar ─────────────────────────────────────────────── */

.search-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 6px 12px;
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  width: 220px;
  transition: border-color 0.12s;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-muted); }

/* ── Modal ──────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}
.modal-overlay.hidden { display: none; }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 680px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 { font-size: 16px; font-weight: 600; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.modal-close:hover { color: var(--text); }

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

/* ── Forms ──────────────────────────────────────────────────── */

label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-row {
  display: flex;
  gap: 12px;
}
.form-row label { flex: 1; }

input[type="text"],
input[type="search"],
select,
textarea {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 7px 12px;
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.12s;
  width: 100%;
}

input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

select option { background: var(--bg2); }

/* ── Scrollbars ─────────────────────────────────────────────── */

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #484f58; }

/* ── Notification toast ─────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 13px;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: slideIn 0.2s ease;
  max-width: 360px;
}
.toast.success { border-color: var(--green); }
.toast.error   { border-color: var(--red); }

@keyframes slideIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── Misc utilities ─────────────────────────────────────────── */

.hidden { display: none !important; }

.text-muted { color: var(--text-muted); }
.text-mono  { font-family: var(--mono); font-size: 12px; }

.auto-refresh-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}
.auto-refresh-label input { cursor: pointer; }

.pulse {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 1.5s ease infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.kb-slug { font-family: var(--mono); font-size: 12px; color: var(--text-muted); }

/* ── Environment tabs ───────────────────────────────────────── */

.env-tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  padding: 0 20px;
  background: var(--bg2);
}

.env-tab-btn {
  display: flex;
  align-items: center;
  padding: 10px 18px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  transition: color 0.12s, border-color 0.12s;
  margin-bottom: -1px;
  white-space: nowrap;
}
.env-tab-btn:hover { color: var(--text); }
.env-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.env-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.badge-Ready    { background: rgba(63,185,80,0.15);  color: var(--green); }
.badge-NotReady { background: rgba(248,81,73,0.15);  color: var(--red); }
.badge-Running  { background: rgba(56,139,253,0.15); color: var(--accent); }
.badge-Succeeded{ background: rgba(63,185,80,0.12);  color: var(--green); }
.badge-Pending  { background: rgba(227,179,65,0.15); color: var(--yellow); }
.badge-Failed   { background: rgba(248,81,73,0.15);  color: var(--red); }

/* ── Pod Connect button ───────────────────────────────────────────────────── */
.pod-connect-btn { white-space: nowrap; }

/* ── Pod terminal modal ───────────────────────────────────────────────────── */
.pod-terminal-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.pod-terminal-box {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 900px;
  max-width: 95vw;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}

.pod-terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: #161b22;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--text-muted);
}

.pod-shell-select {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 12px;
}

#pod-terminal-container {
  padding: 8px;
  height: 480px;
}

/* ── Test Orchestration controls ─────────────────────────────────────────── */
.orch-controls {
  display: flex;
  gap: 24px;
  align-items: flex-end;
}

.orch-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.orch-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.orch-select {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  padding: 7px 32px 7px 12px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237d8590' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  min-width: 160px;
  transition: border-color 0.12s;
}
.orch-select:focus { outline: none; border-color: var(--accent); }
.orch-select:hover { border-color: #6e7681; }
.orch-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  padding: 7px 12px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.12s;
}
.orch-input:focus { outline: none; border-color: var(--accent); }
.orch-input::placeholder { color: var(--text-muted); }

/* ── Orchestration uninstall output ─────────────────────────────────────── */
.orch-output {
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.orch-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.orch-output pre {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  padding: 12px 16px;
  background: #0d1117;
  color: #c9d1d9;
  max-height: 60vh;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.th-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.th-sortable:hover { color: var(--text); }
.th-sort-active { color: var(--text); }
.sort-arrow { font-size: 10px; margin-left: 3px; opacity: 0.7; }

/* ── Test Runner toolbar & pagination ── */
.tr-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  flex-wrap: wrap;
}
.tr-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  margin-top: 4px;
}
.select-sm {
  font-size: 12px;
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
}
tr.tr-row-archived td { opacity: 0.45; }
tr.tr-row-selected td { background: rgba(99,102,241,.08); }

/* Clickable stat cards for status filtering */
.stat-card { cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.stat-card:hover { box-shadow: 0 0 0 2px var(--border); }
.stat-card-active { box-shadow: 0 0 0 2px var(--primary) !important; }
.stat-card-active .stat-label { color: var(--primary); }

/* ── Live Log Panel ─────────────────────────────────────────────────────── */
.log-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  background: #0d1117;
  border-top: 1px solid #30363d;
  font-family: 'SF Mono', 'Fira Mono', monospace;
  font-size: 11px;
  transition: height .2s ease;
}
.log-panel.collapsed { height: 28px; }
.log-panel.expanded  { height: 220px; }
.log-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 28px;
  padding: 0 12px;
  cursor: pointer;
  user-select: none;
  color: #8b949e;
}
.log-panel-header:hover { color: #e6edf3; }
.log-panel-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.log-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3d444d;
  transition: background .3s;
}
.log-indicator.active { background: #3fb950; box-shadow: 0 0 4px #3fb950; }
.log-indicator.error  { background: #f85149; }
.log-panel-controls { display: flex; align-items: center; gap: 8px; }
.log-btn {
  background: none;
  border: none;
  color: #8b949e;
  cursor: pointer;
  font-size: 13px;
  padding: 0 4px;
  line-height: 1;
}
.log-btn:hover { color: #e6edf3; }
.log-chevron { font-size: 9px; }
.log-panel-body {
  display: none;
  height: calc(220px - 28px);
  overflow: hidden;
}
.log-panel.expanded .log-panel-body { display: block; }
.log-output {
  margin: 0;
  padding: 6px 12px;
  height: 100%;
  overflow-y: auto;
  color: #e6edf3;
  line-height: 1.5;
}
/* ── Formatted log lines ─────────────────────────────────────────────────── */
.ll { display: flex; gap: 8px; align-items: baseline; padding: 1px 0; }
.ll-time   { color: #484f58; flex-shrink: 0; }
.ll-level  { flex-shrink: 0; width: 38px; font-weight: 600; letter-spacing: .03em; }
.ll-msg    { color: #e6edf3; flex: 1; min-width: 0; word-break: break-word; }
.ll-extras { color: #8b949e; word-break: break-all; }
.ll-key    { color: #58a6ff; }
.ll-val    { color: #a8c3e8; }
.ll-raw    { color: #8b949e; font-style: italic; word-break: break-all; }
.ll-info  .ll-level { color: #8b949e; }
.ll-debug .ll-level { color: #484f58; }
.ll-warn  .ll-level { color: #d29922; }
.ll-error .ll-level { color: #f85149; }
.ll-error .ll-msg   { color: #ffa198; }
.ll-warn  .ll-msg   { color: #e3b341; }
/* push main content up so it isn't hidden behind the panel */
.app-shell { padding-bottom: 28px; }
body.log-open .app-shell { padding-bottom: 220px; }

/* ── Load / Stress test form ─────────────────────────────────────────────── */
.loadtest-form {
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  background: var(--bg2);
}
.loadtest-form.hidden { display: none; }

.loadtest-apps {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.loadtest-apps legend {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 6px;
}
.loadtest-apps label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  margin-right: 20px;
  cursor: pointer;
  user-select: none;
}
.loadtest-apps input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.loadtest-concurrency {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.lt-stress-note {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 10px 12px;
  margin: 0 0 12px;
  line-height: 1.6;
}
.lt-stress-note strong { color: var(--text); }
.loadtest-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.loadtest-slider-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  min-width: 80px;
}
.loadtest-slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
}
.loadtest-slider-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 36px;
  text-align: right;
}

.loadtest-totals {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.loadtest-totals #loadtest-total {
  font-weight: 700;
  color: var(--text);
}
.loadtest-totals.over-cap #loadtest-total {
  color: var(--red);
}

/* ── Test Setup fieldset ──────────────────────────────────────────────────── */
/* ── Test Configuration panel (AWS-inspired) ─────────────────────────────── */
.ltcfg-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 16px 0 14px;
  overflow: hidden;
}
.ltcfg-header {
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .01em;
}
.ltcfg-section {
  padding: 0;
  border-bottom: 1px solid var(--border);
}
.ltcfg-section--last { border-bottom: none; }
.ltcfg-section-title {
  padding: 8px 16px 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--bg2) 60%, var(--bg3));
  border-bottom: 1px solid var(--border);
}
.ltcfg-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0;
  padding: 12px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 40%, transparent);
  align-items: start;
}
.ltcfg-row:last-child { border-bottom: none; }
.ltcfg-label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 16px;
}
.ltcfg-label-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.ltcfg-label-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}
.ltcfg-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 1px;
}
.ltcfg-control--inline {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ltcfg-checkbox {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.ltcfg-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  margin-right: 16px;
}
.ltcfg-pool-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.ltcfg-pool-block:last-of-type { border-bottom: none; }
.ltcfg-pool-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.ltcfg-pool-desc {
  font-size: 11px;
  color: var(--text-muted);
}
.ltcfg-pool-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.ltcfg-pool-field {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: default;
}
.ltcfg-pool-field-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.ltcfg-pool-autoscale {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  margin-left: 4px;
}
.ltcfg-seed-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.ltcfg-inline-label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* shared input/select/unit styles kept for reuse */
.lt-setup-input {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-size: 13px;
  padding: 4px 8px;
}
.lt-setup-input--sm { width: 64px; text-align: center; }
.ltcfg-think-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ltcfg-think-app-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  min-width: 70px;
}
.lt-setup-select {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-size: 13px;
  padding: 4px 8px;
}
.lt-setup-unit {
  font-size: 12px;
  color: var(--text-muted);
}
.lt-seed-btn {
  font-size: 12px;
  padding: 4px 10px;
  flex-shrink: 0;
}
.lt-seed-status {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Load test live dashboard ─────────────────────────────────────────────── */
.loadtest-dashboard {
  margin-top: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  background: var(--bg2);
}
.loadtest-dashboard.hidden { display: none; }

.loadtest-status-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
}
.lt-est-time {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}
.loadtest-status-bar #orch-stop-btn {
  margin-left: auto;
}
.loadtest-status-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.loadtest-status-pill.provisioning { background: var(--bg3); color: var(--text-muted); }
.loadtest-status-pill.running      { background: #1a3a1a; color: #56d364; }
.loadtest-status-pill.ramping      { background: #1a2a3a; color: var(--accent); }
.loadtest-status-pill.complete     { background: #1a3a1a; color: #56d364; }
.loadtest-status-pill.failed       { background: #3a1a1a; color: var(--red); }
.loadtest-status-pill.timed_out    { background: #2a2a1a; color: #d3c056; }
.loadtest-status-pill.holding      { background: #1a2a3a; color: #56b3d3; }

.loadtest-chart-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.loadtest-chart {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 8px;
  background: var(--bg3);
  min-width: 0;
  overflow: hidden;
}
.loadtest-chart h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 6px;
}
.loadtest-chart canvas {
  width: 100% !important;
  height: 160px !important;
  display: block;
}
.loadtest-chart-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 5px;
}
.loadtest-app-section {
  margin-top: 10px;
}
.loadtest-app-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 0 0 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 5px;
}
.loadtest-charts-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.loadtest-ramp-badge {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--bg3);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 2px 8px;
}
.loadtest-ramp-badge.hidden { display: none; }
.loadtest-results {
  margin-top: 20px;
}
.loadtest-results-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.loadtest-results-toggle .lt-tab-btn {
  opacity: 0.6;
}
.loadtest-results-toggle .lt-tab-btn.active {
  opacity: 1;
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.loadtest-results-text {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 20px;
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
}
.loadtest-results-text h1,
.loadtest-results-text h2,
.loadtest-results-text h3 {
  color: var(--text);
  margin: 14px 0 6px;
}
.loadtest-results-text table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  margin: 8px 0;
}
.loadtest-results-text th,
.loadtest-results-text td {
  border: 1px solid var(--border);
  padding: 4px 10px;
  text-align: left;
}
.loadtest-results-text th {
  background: var(--bg3);
  font-weight: 700;
}
.loadtest-results-graphs.hidden,
.loadtest-results-text.hidden,
.loadtest-results-summary.hidden { display: none; }

.loadtest-results-summary {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px 24px;
}
.lt-summary-para {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text);
  margin: 0 0 16px;
  max-width: 72ch;
}
.lt-summary-para:last-child { margin-bottom: 0; }
/* ── Environment build-out checklist ─────────────────────────────────────── */
.lt-provision-panel {
  margin: 12px 0 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg2);
}
.lt-provision-header {
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 10px;
  background: var(--bg3);
}
.lt-provision-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.lt-provision-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}
.lt-provision-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.lt-provision-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}
.lt-provision-step:last-child { border-bottom: none; }
.lt-provision-step[data-status="running"] { background: rgba(56, 139, 253, 0.05); }
.lt-provision-step[data-status="done"]    { background: rgba(86, 211, 100, 0.04); }
.lt-provision-step[data-status="error"]   { background: rgba(248, 81, 73, 0.06); }
.lt-step-icon {
  width: 18px;
  min-width: 18px;
  height: 18px;
  margin-top: 1px;
  font-size: 14px;
  line-height: 18px;
  text-align: center;
  color: var(--text-muted);
}
.lt-step-icon--running { color: var(--accent); }
.lt-step-icon--done    { color: #56d364; }
.lt-step-icon--error   { color: var(--red); }
.lt-step-body {
  flex: 1;
  min-width: 0;
}
.lt-step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.lt-step-detail {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lt-step-bar-wrap { width: 100%; }
.lt-step-bar-track {
  height: 4px;
  background: var(--bg3);
  border-radius: 2px;
  overflow: hidden;
}
.lt-step-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.5s ease;
}
.lt-step-bar-fill.lt-step-bar-error { background: var(--red); }
.lt-step-bar-fill.lt-step-bar-drain { background: var(--yellow); }
@keyframes lt-step-pulse {
  0%   { opacity: 1; }
  50%  { opacity: 0.4; }
  100% { opacity: 1; }
}
.lt-step-bar-fill.lt-step-bar-pulse {
  animation: lt-step-pulse 1.4s ease-in-out infinite;
}
/* Spinner for running step icon */
.lt-step-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: lt-spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes lt-spin {
  to { transform: rotate(360deg); }
}

.lt-progress-section {
  margin: 12px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lt-progress-row {
  display: grid;
  grid-template-columns: 60px 1fr 110px;
  align-items: center;
  gap: 10px;
}
.lt-progress-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.lt-progress-track {
  height: 8px;
  background: var(--bg3);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.lt-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.lt-ramp-fill {
  background: #56d364;
}
.lt-progress-text {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.lt-nodeinfo-row {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.lt-nodeinfo-chip {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
}

/* ── Load test: historical runs ─────────────────────────────────────────── */
/* Loadtest inner tabs (Live / History) */
.lt-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.lt-tab-item {
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.lt-tab-item.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.lt-tab-panel { display: none; }
.lt-tab-panel.active { display: block; }

/* Chart y-axis labels */
.loadtest-chart {
  position: relative;
}

.loadtest-history {
  margin-top: 0;
}
.lt-history-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 .75rem;
}
.lt-history-empty,
.lt-history-loading {
  color: var(--text-muted);
  font-size: 13px;
}
.lt-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.lt-history-table th {
  text-align: left;
  padding: .4rem .6rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.lt-history-table td {
  padding: .45rem .6rem;
  border-bottom: 1px solid rgba(255,255,255,.05);
  vertical-align: middle;
}
.lt-history-row:hover td {
  background: rgba(255,255,255,.03);
}
/* history detail view */
.lt-hist-topbar,
.lt-hist-botbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.lt-hist-botbar {
  border-bottom: none;
  border-top: 1px solid var(--border);
  margin-top: 16px;
  margin-bottom: 0;
  padding-top: 12px;
}
.lt-hist-run-id {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.lt-hist-meta {
  color: var(--text-muted);
  font-size: 12px;
}
.lt-hist-view-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.lt-hv-pane {
  min-height: 60px;
}
.lt-hist-graph-section {
  margin-bottom: 24px;
}
.lt-hist-chart-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 8px;
}
.lt-hist-chart-row .loadtest-chart {
  height: 120px;
}

.lt-history-report {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--bg2);
  border-radius: 6px;
  border: 1px solid var(--border);
}
.lt-history-report-body {
  font-size: 13px;
  line-height: 1.6;
}
.lt-history-report-body pre {
  background: var(--bg3);
  padding: .75rem 1rem;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 12px;
}
.lt-history-report-body table {
  width: 100%;
  border-collapse: collapse;
  margin: .5rem 0;
}
.lt-history-report-body td,
.lt-history-report-body th {
  padding: .3rem .6rem;
  border: 1px solid var(--border);
  font-size: 12px;
}
.lt-history-report-body th {
  background: var(--bg3);
  font-weight: 600;
}

/* ── Q14: Run comparison ─────────────────────────────────────────────────── */

.lt-compare-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 10px;
}
.lt-compare-table td,
.lt-compare-table th {
  padding: 3px 8px;
  border: 1px solid var(--border);
}
.lt-compare-table th { background: var(--bg3); font-weight: 600; }
.lt-compare-table tr:hover td { background: var(--bg3); }
.lt-delta-good { color: var(--green, #4caf50); font-weight: 600; }
.lt-delta-bad  { color: var(--red,   #f44336); font-weight: 600; }

/* ── Cluster Dashboard ───────────────────────────────────────────────────── */

.dash-error   { color: var(--red); font-size: 13px; }
.dash-empty   { color: var(--text-muted); font-size: 13px; margin: 12px 0; }
.dash-note    { font-size: 12px; font-weight: 400; color: var(--text-muted); }
.dash-pill    { background: var(--bg3); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; font-size: 11px; font-weight: 600; }

.dash-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 28px 0 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

/* Summary cards */
.dash-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 8px;
}
@media (max-width: 900px) { .dash-cards { grid-template-columns: repeat(2, 1fr); } }
.dash-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 18px;
}
.dash-card-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
}
.dash-card-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 4px;
}
.dash-card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Active load test cards */
.dash-lt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 4px;
}
.dash-lt-card {
  background: var(--bg2);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 12px 14px;
}
.dash-lt-app {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.dash-lt-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 2px 0;
}
.dash-lt-key  { color: var(--text-muted); }
.dash-lt-val  { font-weight: 600; color: var(--text); }

/* Node cards */
.dash-nodes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 4px;
}
.dash-node-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
}
.dash-node-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.dash-node-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  word-break: break-all;
}
.dash-node-badge {
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  padding: 2px 7px;
}
.dash-node-badge.ready    { background: #1a3a1a; color: #56d364; }
.dash-node-badge.notready { background: #3a1a1a; color: var(--red); }
.dash-node-role {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg3);
  border-radius: 4px;
  padding: 2px 6px;
}
.dash-node-cap {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.dash-node-net {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  font-family: monospace;
}
.dash-node-stat-row {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 5px;
  font-family: monospace;
}
.dash-load-val {
  color: var(--text-primary);
  font-weight: 600;
}
.dash-load-label {
  color: var(--text-muted);
  font-size: 10px;
  margin-right: 6px;
}

/* CPU / memory bars */
.dash-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
}
.dash-bar-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  width: 52px;
  flex-shrink: 0;
}
.dash-bar-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg3);
  border-radius: 4px;
  overflow: hidden;
}
.dash-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}
.dash-bar-text {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Namespace tabs */
.dash-ns-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.dash-ns-tab {
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dash-ns-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.dash-ns-panel { display: none; }
.dash-ns-panel.active { display: block; }

/* Status dot */
.dash-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dash-dot.green  { background: #56d364; }
.dash-dot.yellow { background: #e3b341; }
.dash-dot.red    { background: var(--red); }

/* Pods table */
.dash-pods-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dash-pods-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
.dash-pods-table th[data-col] {
  cursor: pointer;
  user-select: none;
}
.dash-pods-table th[data-col]:hover { color: var(--text); }
.dash-pods-table th[data-col]::after { content: ''; margin-left: 4px; opacity: 0.3; }
.dash-pods-table th.sort-asc[data-col]::after  { content: '▲'; opacity: 1; color: var(--text); }
.dash-pods-table th.sort-desc[data-col]::after { content: '▼'; opacity: 1; color: var(--text); }
.dash-pods-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.dash-pods-table tr:last-child td { border-bottom: none; }
.dash-pod-name {
  font-family: monospace;
  font-size: 12px;
  word-break: break-all;
  max-width: 280px;
}
.dash-pod-node { font-family: monospace; font-size: 12px; color: var(--text-muted); }
.dash-pod-age  { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

.dash-pod-status {
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  padding: 2px 7px;
  display: inline-block;
}
.dash-pod-status.running   { background: #1a3a1a; color: #56d364; }
.dash-pod-status.pending   { background: #2a2a1a; color: #e3b341; }
.dash-pod-status.failed,
.dash-pod-status.unknown   { background: #3a1a1a; color: var(--red); }

/* ── Dashboard — DB Stats box ───────────────────────────────────────────── */
.db-stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.db-stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  min-width: 180px;
  flex: 1 1 180px;
  max-width: 240px;
}
.db-stat-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.db-stat-badge {
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  padding: 2px 7px;
  display: inline-block;
}
.db-stat-badge.mariadb   { background: #1a2e3a; color: #38bdf8; }
.db-stat-badge.redis     { background: #3a1a1a; color: #f87171; }
.db-stat-badge.pgbouncer { background: #1e2a1a; color: #86efac; }
.db-stat-label { font-size: 11px; color: var(--text-muted); }
.db-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.db-stat-row:last-child { border-bottom: none; }
.db-stat-row span:first-child { color: var(--text-muted); }
.db-stat-row span:last-child  { font-family: monospace; font-size: 11px; }

/* ── Dashboard — Environment grid ──────────────────────────────────────── */
.dash-env-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 0 24px 24px;
}
.dash-env-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.dash-env-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}
.dash-env-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.dash-env-counts {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}
.dash-env-scroll { max-height: 320px; overflow-y: auto; }
.dash-env-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.dash-env-table th {
  padding: 5px 12px;
  text-align: left;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 11px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--bg2);
}
.dash-env-table th[data-col] {
  cursor: pointer;
  user-select: none;
}
.dash-env-table th[data-col]:hover { color: var(--text); }
.dash-env-table th[data-col]::after { content: ''; margin-left: 4px; opacity: 0.3; }
.dash-env-table th.sort-asc[data-col]::after  { content: '▲'; opacity: 1; color: var(--text); }
.dash-env-table th.sort-desc[data-col]::after { content: '▼'; opacity: 1; color: var(--text); }
.dash-env-table td {
  padding: 4px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  vertical-align: middle;
}
.dash-env-table tr:last-child td { border-bottom: none; }
.dash-env-pod-name {
  font-family: monospace;
  font-size: 11px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-env-node {
  font-family: monospace;
  font-size: 11px;
  color: var(--text-muted);
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Inline cluster mini-panel (inside load test Live tab) ─────────────── */
.lt-cluster-panel {
  margin: 16px 0 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg2);
  overflow: hidden;
}
.lt-cluster-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.lt-cluster-header .lt-cluster-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}
.lt-cluster-header .lt-cluster-badge .dash-dot { flex-shrink: 0; }
.lt-cluster-node-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0;
}
.lt-cluster-node {
  padding: 10px 14px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.lt-cluster-node:last-child { border-right: none; }
.lt-cluster-node-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lt-cluster-bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.lt-cluster-bar-label {
  font-size: 10px;
  color: var(--text-muted);
  width: 28px;
  flex-shrink: 0;
}
.lt-cluster-bar-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
}
.lt-cluster-bar-track {
  flex: 1;
  height: 6px;
  background: var(--bg3);
  border-radius: 3px;
  overflow: hidden;
}
.lt-cluster-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.lt-cluster-bar-text {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 80px;
}
.lt-cluster-pods-row {
  padding: 8px 14px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 16px;
}
.lt-cluster-pods-row span { color: var(--text); font-weight: 600; }

/* ── Test Cases tab ──────────────────────────────────────────────────────── */
.tc-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.tc-panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
  display: flex;
  align-items: center;
  gap: 14px;
}
.tc-panel-title { font-size: 13px; font-weight: 600; color: var(--text); }
.tc-panel-sub   { font-size: 12px; color: var(--text-muted); }
.tc-suites-list { padding: 4px 16px; }
.tc-suite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.tc-suite-row:last-child { border-bottom: none; }
.tc-suite-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex: 1;
  font-size: 13px;
}
.tc-suite-name  { color: var(--text); }
.tc-suite-count {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg3);
  border-radius: 10px;
  padding: 1px 7px;
}
.tc-suite-delete {
  font-size: 16px;
  line-height: 1;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 7px;
  border-radius: 4px;
  opacity: 0.55;
}
.tc-suite-delete:hover { opacity: 1; background: var(--bg3); color: var(--red); }
.tc-cases-grid {
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
}
.tc-category { min-width: 140px; flex: 1; }
.tc-category-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.tc-case-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 0;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
.tc-case-row.tc-case-disabled { opacity: 0.45; cursor: not-allowed; }
.tc-save-bar {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.tc-save-status { font-size: 12px; color: var(--text-muted); }

/* ── Orch suite chips ─────────────────────────────────────────────────────── */
.orch-suite-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 36px;
  align-items: center;
}
.orch-suite-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.orch-suite-chip:hover { border-color: #6e7681; }
.orch-suite-chip.active {
  border-color: var(--accent);
  background: rgba(88, 166, 255, 0.12);
}
.orch-suite-chip-count {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg2);
  border-radius: 10px;
  padding: 0 6px;
  line-height: 18px;
}

/* ── Test Results tab ─────────────────────────────────────────────────────── */
.tr2-type-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  background: var(--bg3);
  color: var(--text-muted);
}
.tr2-type-functional { background: rgba(79,142,247,.15); color: #4f8ef7; }
.tr2-type-regression  { background: rgba(79,142,247,.15); color: #4f8ef7; }
.tr2-type-smoke       { background: rgba(46,199,120,.15); color: #2ec778; }
.tr2-type-pentest     { background: rgba(224,88,88,.15);  color: #e05858; }
.tr2-type-load        { background: rgba(155,89,182,.15); color: #9b59b6; }
.tr2-type-stress      { background: rgba(247,164,79,.15); color: #f7a44f; }

.tr2-summary-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.tr2-stat {
  font-size: 13px;
  color: var(--text-muted);
}
.tr2-stat-pass { color: var(--green); font-weight: 600; }
.tr2-stat-fail { color: var(--red);   font-weight: 600; }
.tr2-stat-skip { color: var(--text-muted); }

.tr2-fail-section {
  background: rgba(224,88,88,.07);
  border: 1px solid rgba(224,88,88,.25);
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.tr2-fail-header { font-size: 13px; font-weight: 600; color: var(--red); margin-bottom: 8px; }
.tr2-fail-item   { margin-bottom: 10px; }
.tr2-fail-name   { font-size: 13px; font-weight: 500; color: var(--text); }
.tr2-fail-err    { font-family: var(--font-mono, monospace); font-size: 11px; color: var(--red); margin-top: 3px; white-space: pre-wrap; }
.tr2-fail-fix    { font-size: 12px; color: var(--text-muted); margin-top: 4px; background: var(--bg3); padding: 6px 8px; border-radius: 4px; }

.tr2-warn-box {
  background: rgba(247,164,79,.10);
  border: 1px solid rgba(247,164,79,.35);
  border-radius: 6px;
  padding: 14px 16px;
  margin: 12px 0;
  font-size: 13px;
  color: var(--text);
}
.tr2-warn-title { font-weight: 600; color: #f7a44f; margin-bottom: 8px; }
.tr2-rec-table  { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12px; }
.tr2-rec-table th, .tr2-rec-table td { padding: 4px 8px; border: 1px solid var(--border); }
.tr2-rec-table th { background: var(--bg3); font-weight: 600; }

.tr2-report { margin-top: 16px; }
.tr2-report-body { background: var(--surface-raised, var(--bg3)); padding: 14px; border-radius: 6px; font-size: 13px; line-height: 1.6; overflow-x: auto; }
.tr2-report-body pre { background: var(--bg2); padding: 8px; border-radius: 4px; overflow-x: auto; }

/* ── Test results detail view ───────────────────────────────── */
.tr2-detail-view-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.tr2-detail-view-header .tr2-detail-breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  flex: 1;
}
.tr2-detail-view-header .tr2-detail-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

/* ── Drain lock overlay (End Session decommissioning) ─────────────────────── */
#lt-drain-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#lt-drain-overlay.lt-drain-visible {
  opacity: 1;
  pointer-events: all;
}
.lt-drain-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px 40px;
  min-width: 360px;
  max-width: 480px;
  text-align: center;
}
.lt-drain-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.lt-drain-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.lt-drain-track {
  width: 100%;
  height: 10px;
  background: var(--bg3);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 10px;
}
.lt-drain-fill {
  height: 100%;
  background: var(--yellow);
  border-radius: 5px;
  transition: width 0.6s ease;
}
.lt-drain-pct {
  font-size: 13px;
  font-weight: 600;
  color: var(--yellow);
}

/* ── KB hint cards in Test Results detail view ─────────────────────────── */
.tr2-kb-hints {
  margin-top: 10px;
}
.tr2-kb-hint-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.tr2-kb-hint-entry {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: 4px;
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 12px;
}
.tr2-kb-hint-slug {
  font-family: monospace;
  font-size: 11px;
  color: var(--blue);
  margin-right: 8px;
  white-space: nowrap;
}
.tr2-kb-hint-title {
  color: var(--text);
  font-weight: 600;
}
.tr2-kb-hint-symptom {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.5;
}
.tr2-kb-hint-details {
  margin-top: 6px;
}
.tr2-kb-hint-details summary {
  font-size: 11px;
  color: var(--blue);
  cursor: pointer;
}
.tr2-kb-hint-resolution {
  margin-top: 4px;
  color: var(--text);
  font-size: 11px;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* ── Pod optimizer panel ─────────────────────────────────────────────────── */
#opt-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 20px;
}
.opt-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.opt-title { font-weight: 600; font-size: 14px; }
.opt-stat  { font-size: 12px; color: var(--text-muted); }
.opt-nodes {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.opt-node-card {
  flex: 1 1 200px;
  max-width: 280px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
}
.opt-node-name {
  font-family: monospace;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}
.opt-bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.opt-bar-label { font-size: 10px; color: var(--text-muted); width: 28px; flex-shrink: 0; }
.opt-bar-track {
  flex: 1;
  height: 6px;
  background: var(--bg2);
  border-radius: 3px;
  overflow: hidden;
}
.opt-bar-fill  { height: 100%; border-radius: 3px; transition: width .3s; }
.opt-bar-val   { font-size: 10px; color: var(--text-muted); width: 28px; text-align: right; }
.opt-pod-list  { margin-top: 8px; border-top: 1px solid var(--border); padding-top: 6px; }
.opt-pod-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 0;
  font-size: 11px;
}
.opt-pod-row.opt-pod-moved { background: rgba(56,189,248,.05); border-radius: 3px; }
.opt-env-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.opt-pod-name {
  flex: 1;
  font-family: monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.opt-pod-mem   { font-family: monospace; color: var(--text-muted); flex-shrink: 0; }
.opt-moved-tag { color: #38bdf8; font-size: 10px; margin-left: 2px; }
.opt-anchor-tag { color: var(--text-muted); font-size: 10px; }
.opt-moves-section { margin-top: 4px; }
.opt-moves-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 8px;
}
.opt-moves-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.opt-moves-table th {
  text-align: left;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
}
.opt-moves-table td { padding: 5px 8px; border-bottom: 1px solid rgba(255,255,255,.03); }
.opt-moves-table tr:last-child td { border-bottom: none; }
.opt-move-pod { font-family: monospace; font-size: 11px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-env-badge {
  font-size: 10px; font-weight: 600; border-radius: 3px;
  padding: 1px 5px; display: inline-block;
}
.opt-node-chip {
  font-family: monospace; font-size: 11px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 6px;
}
.opt-node-chip.target { border-color: #38bdf8; color: #38bdf8; }
