body {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  background: #16100f;
  color: #eee2d8;
  margin: 0;
}

h1 { font-weight: 600; font-size: 20px; margin-bottom: 4px; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em; color: #a8968a; margin: 28px 0 12px; }
h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: #a8968a; margin: 16px 0 8px; }

.muted { color: #665048; font-size: 13px; }
.error { color: #e0a458; font-size: 13px; }
code { background: #1c1015; padding: 1px 5px; border-radius: 4px; }
a { color: #e0a458; }

/* ── Login ────────────────────────────────────────────────────────────── */

.login-box {
  max-width: 320px;
  margin: 15vh auto 0;
  background: #241318;
  border-radius: 12px;
  padding: 28px 24px;
}
.login-box h1 { margin-top: 0; }
.login-box label { display: block; font-size: 12px; color: #a8968a; margin: 14px 0 4px; }
.login-box input {
  width: 100%;
  box-sizing: border-box;
  background: #1c1015;
  border: 1px solid #3a2028;
  border-radius: 6px;
  padding: 8px 10px;
  color: #eee2d8;
  font-size: 14px;
}
.login-box button {
  width: 100%;
  margin-top: 18px;
  background: #e0a458;
  border: none;
  border-radius: 6px;
  padding: 9px 0;
  color: #16100f;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.login-box button:disabled { opacity: 0.6; cursor: default; }

/* ── Shell (sidebar + top bar) ────────────────────────────────────────── */

.shell { display: flex; min-height: 100vh; }

#sidebar {
  width: 200px;
  flex: 0 0 auto;
  background: #1c1015;
  border-right: 1px solid #2a1b21;
  transition: width 0.15s ease;
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  box-sizing: border-box;
}
#sidebar.collapsed { width: 56px; }

#sidebar-toggle {
  align-self: flex-end;
  margin: 0 12px 12px;
  background: none;
  border: 1px solid #3a2028;
  color: #a8968a;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  transition: transform 0.15s ease;
}
#sidebar.collapsed #sidebar-toggle { transform: rotate(180deg); align-self: center; margin: 0 0 12px; }

#sidebar ul { list-style: none; margin: 0; padding: 0; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: #a8968a;
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
}
.nav-link:hover { background: #241318; color: #eee2d8; }
.nav-link.active { background: #2a1720; color: #e0a458; }

.nav-mono {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #2a1720;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #e0a458;
}
#sidebar.collapsed .nav-label { display: none; }

.shell-body { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }

.shell-topbar {
  display: flex;
  justify-content: flex-end;
  padding: 12px 24px;
  border-bottom: 1px solid #2a1b21;
}
.shell-topbar button {
  background: none;
  border: 1px solid #3a2028;
  color: #a8968a;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

#view-content { padding: 24px; }

/* ── Toolbar / report (shared by Intake review + Deployments) ───────────── */

.toolbar { display: flex; align-items: baseline; gap: 16px; margin-bottom: 8px; }
.toolbar button {
  background: none;
  border: 1px solid #3a2028;
  color: #a8968a;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}
.section-note { color: #a8968a; font-size: 13px; margin: 0 0 16px; max-width: 760px; }
.back-link { color: #e0a458; font-size: 13px; text-decoration: none; }

.card { background: #241318; border-radius: 12px; padding: 16px 20px; margin-bottom: 22px; }
.card header { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.card h3 { margin: 0; font-size: 19px; font-weight: 600; }
.meta { display: flex; gap: 10px; font-size: 12px; color: #a8968a; flex-wrap: wrap; align-items: center; }
.status { padding: 2px 8px; border-radius: 6px; background: #3a2028; }
.status-ready { background: #1f4d34; }
.status-failed { background: #5a1f1f; }
.promoted { color: #7fbf8a; }
.not-promoted { color: #bf8a7f; }
.id { opacity: 0.6; }

.images { display: flex; gap: 16px; margin: 14px 0; }
.images figure { margin: 0; text-align: center; }
.images img { max-height: 280px; max-width: 220px; border-radius: 6px; background: #000; object-fit: contain; }
.images .missing { width: 140px; height: 200px; display: flex; align-items: center; justify-content: center; color: #665048; border: 1px dashed #443036; border-radius: 6px; }
figcaption { font-size: 11px; color: #a8968a; margin-top: 4px; }

table.attrs { border-collapse: collapse; font-size: 13px; width: 100%; margin-top: 8px; }
table.attrs td { padding: 3px 10px 3px 0; border-bottom: 1px solid #33232a; }
table.attrs tr.flag td { color: #e0a458; }

table.abandoned { border-collapse: collapse; width: 100%; font-size: 13px; }
table.abandoned td { padding: 6px 10px 6px 0; border-bottom: 1px solid #2a1b21; vertical-align: middle; }
table.abandoned td.id { color: #665048; font-size: 11px; }
.thumb { height: 48px; width: 40px; border-radius: 4px; object-fit: cover; display: block; }
.thumb.missing { width: 40px; height: 48px; display: flex; align-items: center; justify-content: center; color: #443036; border: 1px dashed #443036; border-radius: 4px; }

/* ── Deployments ──────────────────────────────────────────────────────── */

.live-row { display: flex; align-items: center; gap: 12px; margin: 10px 0 16px; }
.live-badge { font-size: 14px; }
.live-badge a { font-weight: 600; }

.version-list { list-style: none; margin: 0; padding: 0; }
.version-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #2a1b21;
  font-size: 13px;
}
.version-row .muted { flex: 1 1 auto; }

.promote-btn, .revert-btn {
  background: none;
  border: 1px solid #3a2028;
  color: #e0a458;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 12px;
  cursor: pointer;
}
.promote-btn:disabled, .revert-btn:disabled { opacity: 0.5; cursor: default; }

/* ── Test Harness — picker ───────────────────────────────────────────── */

.harness-split { display: flex; gap: 24px; align-items: flex-start; }
.harness-picker { flex: 1 1 auto; min-width: 0; }
.harness-selection {
  flex: 0 0 280px;
  background: #241318;
  border-radius: 12px;
  padding: 16px 20px;
  position: sticky;
  top: 24px;
}

table.picker-table { border-collapse: collapse; width: 100%; font-size: 13px; }
table.picker-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #a8968a;
  padding: 0 10px 6px 0;
  font-weight: 600;
}
table.picker-table td { padding: 6px 10px 6px 0; border-bottom: 1px solid #2a1b21; vertical-align: middle; }
.pick-cb { width: 15px; height: 15px; }

.pager { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.pager button {
  background: none;
  border: 1px solid #3a2028;
  color: #a8968a;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}
.pager button:disabled { opacity: 0.4; cursor: default; }

.harness-selection h4 { margin-top: 0; }
.harness-selection label { display: block; font-size: 12px; color: #a8968a; margin: 14px 0 4px; }
.harness-selection select {
  width: 100%;
  box-sizing: border-box;
  background: #1c1015;
  border: 1px solid #3a2028;
  border-radius: 6px;
  padding: 6px 8px;
  color: #eee2d8;
  font-size: 13px;
}
.harness-selection #run-test-btn {
  width: 100%;
  margin-top: 18px;
  background: #e0a458;
  border: none;
  border-radius: 6px;
  padding: 8px 0;
  color: #16100f;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.harness-selection #run-test-btn:disabled { opacity: 0.5; cursor: default; }

.selected-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.selected-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid #2a1b21;
  gap: 8px;
}
.remove-btn {
  background: none;
  border: none;
  color: #bf8a7f;
  font-size: 15px;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}

/* ── Test Harness — comparison ────────────────────────────────────────── */

.comparison-row .status-running { background: #4a3a1f; }
.comparison-groups { display: flex; align-items: stretch; gap: 20px; margin-top: 14px; }
.comparison-group { flex: 1 1 0; min-width: 0; }
.comparison-group h4 { margin-top: 0; }
.comparison-arrow { display: flex; align-items: center; justify-content: center; color: #a8968a; font-size: 20px; flex: 0 0 auto; }
.comparison-cols { display: flex; gap: 16px; }
.comparison-cols > div { flex: 1 1 0; min-width: 0; }
.col-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: #a8968a; margin-bottom: 6px; }
.comparison-cols img.rendered { max-width: 100%; max-height: 240px; border-radius: 6px; background: #000; object-fit: contain; }
.comparison-cols .missing { width: 100%; height: 160px; display: flex; align-items: center; justify-content: center; color: #665048; border: 1px dashed #443036; border-radius: 6px; box-sizing: border-box; }
