:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --text: #e2e8f0;
  --accent: #38bdf8;
  --muted: #94a3b8;
  --border: #334155;
  --danger: #f87171;
  --success: #4ade80;
  --warning: #facc15;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Segoe UI, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
h1, h2, h3 { margin-top: 0; }
.subtitle, .hint, .empty { color: var(--muted); }
.hidden { display: none !important; }
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
}
.project-bar {
  max-width: 1200px;
  margin: 1rem auto;
  display: flex;
  gap: 1rem;
  align-items: end;
}
.project-bar label { flex: 1; }
.tabs {
  max-width: 1200px;
  margin: 1rem auto 0;
  display: flex;
  gap: .5rem;
}
.tabs button {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.tabs button.active {
  background: var(--accent);
  color: #0f172a;
  border-color: var(--accent);
}
.tab {
  display: none;
  max-width: 1200px;
  margin: 1rem auto;
}
.tab.active { display: block; }
button {
  background: var(--accent);
  color: #0f172a;
  border: none;
  padding: .55rem .9rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}
button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
button.danger {
  background: var(--danger);
}
button:disabled {
  cursor: not-allowed;
  opacity: .55;
}
input, select, textarea {
  width: 100%;
  margin-top: .25rem;
  padding: .55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0b1220;
  color: var(--text);
}
textarea { min-height: 90px; resize: vertical; }
label { display: block; }
.grid {
  display: grid;
  gap: .75rem;
}
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr);
  gap: 1rem;
}
.split.wide-left {
  grid-template-columns: minmax(320px, 1fr) minmax(0, 2.4fr);
}
.stack {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.actions, .toolbar, .filters {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}
.toolbar { justify-content: space-between; }
.filters {
  margin: .75rem 0;
}
.filters input, .filters select {
  width: auto;
  min-width: 160px;
}
.message {
  max-width: 1200px;
  margin: .75rem auto;
  padding: .75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0b1220;
}
.message.error { border-color: var(--danger); color: var(--danger); }
.message.success { border-color: var(--success); color: var(--success); }
.card-list {
  padding: 0;
  margin: .75rem 0 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.card-list li, .run-item, .step-row {
  padding: .75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0b1220;
}
.card-list li { cursor: pointer; }
.card-list li:hover, .tree button:hover { border-color: var(--accent); }
.tree {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  margin-bottom: 1rem;
}
.tree button {
  text-align: left;
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
  font-weight: 500;
}
.tree button.active {
  border-color: var(--accent);
  color: var(--accent);
}
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  border-bottom: 1px solid var(--border);
  padding: .6rem;
  text-align: left;
}
tbody tr { cursor: pointer; }
tbody tr:hover { background: #0b1220; }
.detail {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.pill-list {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}
.pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .25rem .6rem;
  color: var(--muted);
}
.pill.current {
  color: #0f172a;
  background: var(--accent);
  border-color: var(--accent);
}
pre {
  background: #0b1220;
  padding: .75rem;
  border-radius: 8px;
  overflow: auto;
}
.status-Passed, .status-passed { color: var(--success); }
.status-Failed, .status-failed { color: var(--danger); }
.status-Blocked, .status-blocked { color: var(--warning); }
.status-Retest, .status-retest { color: var(--accent); }
.status-Untested, .status-untested, .status-Skipped, .status-skipped { color: var(--muted); }

@media (max-width: 850px) {
  .grid.two, .grid.three, .split, .split.wide-left {
    grid-template-columns: 1fr;
  }
  .project-bar {
    flex-direction: column;
    align-items: stretch;
  }
}
