:root {
  color-scheme: light;
  --bg: #f7f9fc;
  --panel: #ffffff;
  --text: #23344e;
  --muted: #667085;
  --line: #d8dee8;
  --brand: #3b5682;
  --brand-light: #4c6fa8;
  --accent: #f05f28;
  --accent-light: #f88f22;
  --accent-soft: #fef5eb;
  --success: #15803d;
  --warning: #b45309;
  --danger: #b42318;
  --shadow: 0 10px 24px rgb(35 52 78 / 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family:
    Comfortaa, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0 14px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

button:hover {
  border-color: var(--accent-light);
  background: var(--accent-light);
  box-shadow: 0 8px 18px rgb(240 95 40 / 0.18);
}

button:disabled {
  border-color: var(--line);
  background: #eef2f7;
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
}

.shell {
  width: min(1240px, calc(100vw - 32px));
  margin: 24px auto;
}

.topbar,
.sectionHeader,
.actions,
.topActions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar {
  border-radius: 8px;
  background: linear-gradient(90deg, var(--brand), var(--brand-light));
  color: white;
  padding: 18px;
  box-shadow: var(--shadow);
}

.topbar p {
  color: rgb(255 255 255 / 0.82);
}

.topActions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
}

h2 {
  font-size: 17px;
  font-weight: 700;
}

p,
label,
#status {
  color: var(--muted);
}

.panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: white;
  color: var(--text);
}

input:focus,
select:focus {
  border-color: var(--brand-light);
  outline: 3px solid rgb(76 111 168 / 0.16);
}

.wide {
  grid-column: span 2;
}

.actions {
  align-self: end;
}

.connectBox {
  display: flex;
  align-items: end;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.5fr);
  gap: 18px;
}

.runs {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.run {
  width: 100%;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
  color: var(--text);
  padding: 11px;
  text-align: left;
}

.run:hover,
.run.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: none;
}

.runTitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.run strong,
.run span {
  display: block;
}

.run span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.runError {
  color: var(--danger) !important;
}

.badge,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge {
  margin-top: 0 !important;
}

.pill-muted,
.badge-queued,
.badge-retrying {
  border: 1px solid #c9d5e8;
  background: #eff4fb;
  color: var(--brand);
}

.pill-success,
.badge-succeeded {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: var(--success);
}

.pill-warning,
.badge-running {
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: var(--warning);
}

.badge-failed,
.badge-cancelled {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: var(--danger);
}

.summaryText,
.statusText {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status-success {
  color: var(--success);
}

.status-error {
  color: var(--danger);
}

.status-muted {
  color: var(--muted);
}

.emptyState {
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.detail {
  min-height: 460px;
  overflow: auto;
  margin: 14px 0 0;
  border: 1px solid #1f2d43;
  border-radius: 6px;
  background: #23344e;
  color: #f7f9fc;
  padding: 14px;
  white-space: pre-wrap;
}

@media (max-width: 860px) {
  .grid,
  .layout {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topActions {
    justify-content: flex-start;
  }
}
