* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0b1020;
  color: #e6edf3;
}
.layout {
  max-width: 1560px;
  margin: 0 auto;
  padding: 20px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.topbar h1 {
  margin: 0 0 6px;
  font-size: 28px;
}
.topbar p {
  margin: 0;
  color: #94a3b8;
}
button {
  border: 0;
  border-radius: 10px;
  background: #2563eb;
  color: white;
  padding: 10px 14px;
  cursor: pointer;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.card,
.panel {
  background: #131a2b;
  border: 1px solid #243047;
  border-radius: 16px;
  padding: 16px;
}
.card .label,
.hint,
.panel-title span,
label {
  color: #94a3b8;
}
.card .value {
  margin-top: 10px;
  font-size: 30px;
  font-weight: 700;
}
.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.panel-title h2 {
  margin: 0;
  font-size: 18px;
}
.filters,
.form-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.grid-main {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
.grid-top {
  align-items: start;
}
.span-2 { min-width: 0; }
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field.grow { grid-column: span 2; }
.field.inline-end {
  justify-content: end;
}
.checkbox-field {
  grid-column: span 2;
  justify-content: end;
}
input, select, textarea, pre {
  width: 100%;
  border: 1px solid #334155;
  background: #0f172a;
  color: #e6edf3;
  border-radius: 10px;
  padding: 10px 12px;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  padding: 10px 8px;
  border-bottom: 1px solid #223047;
  text-align: left;
  vertical-align: top;
}
tbody tr {
  cursor: pointer;
}
tbody tr:hover {
  background: rgba(37, 99, 235, 0.08);
}
.status-pill {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.status-active, .status-finished, .status-success {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}
.status-error, .status-failed, .status-invalidated {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}
.status-queued, .status-running, .status-auth_fail, .status-transient_fail {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
}
.result-box,
.detail-box {
  min-height: 180px;
  white-space: pre-wrap;
  line-height: 1.5;
}
.detail-box.muted {
  color: #94a3b8;
}
.actions,
.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.runs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.run-item {
  border: 1px solid #243047;
  border-radius: 12px;
  padding: 12px;
  background: #0f172a;
  line-height: 1.5;
}
.run-item:hover {
  background: #111d33;
}
.plan-panel {
  padding-bottom: 12px;
}
.compact-form-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.compact-form-grid .field {
  gap: 6px;
}
.compact-form-grid label {
  font-size: 12px;
}
.compact-form-grid input,
.compact-form-grid select {
  min-height: 38px;
  padding: 8px 10px;
}
.compact-checkbox-field {
  grid-column: span 1;
  justify-content: end;
}
.compact-checkbox-field label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding-top: 18px;
}
.compact-checkbox-field input {
  width: auto;
  min-height: auto;
  padding: 0;
}
.compact-actions {
  margin: 10px 0 8px;
}
.compact-actions button {
  padding: 8px 12px;
}
.compact-result {
  min-height: 96px;
  max-height: 132px;
  overflow: auto;
  font-size: 13px;
}
.runs-panel {
  display: flex;
  flex-direction: column;
}
.compact-runs-list {
  max-height: 260px;
  overflow: auto;
}
.runs-panel .run-item {
  padding: 10px;
  font-size: 13px;
}
.slim-filters {
  margin-top: 14px;
}
@media (max-width: 1280px) {
  .compact-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .compact-checkbox-field {
    grid-column: span 3;
    justify-content: start;
  }
  .compact-checkbox-field label {
    padding-top: 0;
  }
}
@media (max-width: 1100px) {
  .grid-main,
  .filters,
  .form-grid,
  .compact-form-grid {
    grid-template-columns: 1fr;
  }
  .field.grow,
  .checkbox-field,
  .compact-checkbox-field {
    grid-column: span 1;
  }
}
