:root {
  color-scheme: dark;
  --bg: #0e0f12;
  --panel: #15171c;
  --panel-2: #1c1f26;
  --border: #2a2e38;
  --fg: #e8eaf0;
  --muted: #8a90a0;
  --accent: #6aa1ff;
  --green: #4ade80;
  --red: #f87171;
  --yellow: #fbbf24;
  --blue: #60a5fa;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
header h1 { margin: 0; font-size: 18px; font-weight: 600; }
header .actions button {
  margin-left: 8px;
}

button {
  background: var(--panel-2);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font: inherit;
}
button:hover { background: var(--border); }
button.primary { background: var(--accent); border-color: var(--accent); color: #0e0f12; }

nav#tabs {
  display: flex;
  gap: 4px;
  padding: 8px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
nav#tabs button {
  background: transparent;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  color: var(--muted);
}
nav#tabs button.active {
  background: var(--panel-2);
  color: var(--fg);
}

main { padding: 16px 24px; }

#filters {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
#filters input, #filters select {
  background: var(--panel);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font: inherit;
}
#filters input { flex: 1; max-width: 360px; }

table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
tbody td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
tbody tr:hover { background: var(--panel); }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot.queued { background: var(--muted); }
.dot.running { background: var(--yellow); animation: pulse 1.4s infinite; }
.dot.success { background: var(--green); }
.dot.failed { background: var(--red); }
.dot.cancelled { background: var(--muted); opacity: 0.5; }

@keyframes pulse { 50% { opacity: 0.4; } }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
}
.badge.release { color: var(--blue); border-color: var(--blue); }
.badge.agent { color: var(--green); border-color: var(--green); }
.badge.adhoc { color: var(--yellow); border-color: var(--yellow); }

.sha { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }

.dl { display: inline-block; margin-right: 6px; }

dialog {
  background: var(--panel);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-width: 600px;
  padding: 20px;
}
dialog::backdrop { background: rgba(0,0,0,0.6); }
dialog h2 { margin-top: 0; }
dialog label { display: block; margin: 12px 0; }
dialog label input, dialog label select, dialog label textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  background: var(--panel-2);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font: inherit;
}
dialog fieldset {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  margin: 12px 0;
}
dialog fieldset label { display: block; margin: 4px 0; }
dialog menu {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0;
  margin: 16px 0 0;
}

#log-modal {
  width: 90vw;
  max-width: 1200px;
  height: 80vh;
  flex-direction: column;
}
#log-modal[open] { display: flex; }
#log-modal header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border: none;
  padding: 0 0 12px;
}
#log-output {
  flex: 1;
  overflow: auto;
  background: #08090b;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  margin: 0;
  font: 12px ui-monospace, monospace;
  white-space: pre-wrap;
}
