* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  background: #f5f6f8;
  color: #1a1a1a;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: #430e69;
  color: white;
}
header h1 { margin: 0; font-size: 1.2rem; }
main { max-width: 960px; margin: 1.5rem auto; padding: 0 1rem; }
.panel {
  background: white;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.panel h2 { margin-top: 0; font-size: 1rem; color: #430e69; }

/* Job cards — one selectable card per fixed backfill, showing its locked SOQL. */
.job-cards { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; }
.job-card {
  flex: 1 1 320px;
  text-align: left;
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.job-card:hover { border-color: #7a4aa5; }
.job-card.selected { border-color: #430e69; background: #f7f3fb; }
.job-card h3 { margin: 0 0 0.35rem; font-size: 0.95rem; color: #430e69; }
.job-card p { margin: 0 0 0.6rem; }
.soql-label { margin-bottom: 0.25rem; }
.soql {
  margin: 0;
  background: #10121a;
  color: #d3f7d3;
  padding: 0.6rem;
  border-radius: 6px;
  font-size: 0.72rem;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

#run-form { display: flex; flex-wrap: wrap; gap: 1rem; }
#run-form label { display: flex; flex-direction: column; font-size: 0.85rem; gap: 0.25rem; flex: 1 1 220px; }
#run-form label.full { flex: 1 1 100%; }
#run-form label.checkbox { flex-direction: row; align-items: center; flex: 1 1 100%; gap: 0.5rem; }
#run-form div.full { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 1rem; }
#run-form div.full label { display: flex; flex-direction: column; font-size: 0.85rem; gap: 0.25rem; flex: 1 1 220px; }
#run-form input[type=text], #run-form input[type=number], #run-form input[type=password], #run-form select {
  padding: 0.4rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
}
#run-button { margin-top: 1rem; }
.button-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.button {
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 6px;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  color: #1a1a1a;
}
.button:hover { background: #f0f0f0; }
.button.primary { background: #430e69; color: white; border-color: #430e69; }
.button.primary:hover { background: #5a1a8a; }
/* Verify: secondary action — brand-purple outline so it reads as a real button
   without competing with the primary Run action. */
.button.secondary { border-color: #430e69; color: #430e69; font-weight: 600; }
.button.secondary:hover { background: #f7f3fb; }
.button:disabled { opacity: 0.5; cursor: not-allowed; }

#run-status { margin-bottom: 0.5rem; font-size: 0.9rem; }
#progress-wrap { margin-bottom: 0.75rem; }
#progress-bar {
  height: 14px;
  background: #e6e2ec;
  border-radius: 7px;
  overflow: hidden;
}
#progress-fill {
  height: 100%;
  width: 0%;
  background: #430e69;
  transition: width 0.3s ease;
}
#progress-fill.indeterminate {
  background: linear-gradient(90deg, #430e69 25%, #7a4aa5 50%, #430e69 75%);
  background-size: 200% 100%;
  animation: indeterminate 1.2s linear infinite;
}
@keyframes indeterminate {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
#progress-stats { margin-top: 0.35rem; }

#log-pane {
  background: #10121a;
  color: #d3f7d3;
  padding: 1rem;
  border-radius: 6px;
  max-height: 420px;
  overflow-y: auto;
  font-size: 0.8rem;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.hint { font-size: 0.75rem; color: #666; font-weight: normal; }
.hidden { display: none !important; }

.verify-results { margin: 0.75rem 0; display: flex; flex-direction: column; gap: 0.3rem; }
.verify-heading { font-weight: 600; font-size: 0.9rem; }
.verify-row {
  font-size: 0.8rem;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  border-left: 4px solid transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.verify-pass { color: #16601b; }
.verify-fail { color: #9a1616; }
.verify-row.verify-pass { background: #eaf6ea; border-left-color: #2e7d32; }
.verify-row.verify-fail { background: #fbeaea; border-left-color: #c62828; }
.dialog {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
}
.dialog-box { background: white; border-radius: 8px; padding: 1.5rem; max-width: 400px; }
.dialog-box input { width: 100%; padding: 0.4rem; margin: 0.75rem 0; border: 1px solid #ccc; border-radius: 4px; }
