:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #202124;
  background: #f5f7f8;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #f5f7f8; }
button, input, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }

.topbar {
  height: 64px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid #dfe3e6;
}
.brand { display: flex; align-items: center; gap: 12px; font-size: 17px; }
.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #d92d20;
  font-weight: 800;
  border-radius: 6px;
}
.brand-mark.small { width: 34px; height: 34px; font-size: 13px; }

.workspace { max-width: 1180px; margin: 0 auto; padding: 28px 24px 48px; }
.query-band, .jobs-band { background: #fff; border: 1px solid #dfe3e6; }
.query-band { padding: 24px; }
.jobs-band { margin-top: 20px; }
.executor-note { margin: 18px 0 0; padding: 10px 12px; border-left: 3px solid #1677ff; background: #f3f8ff; color: #374151; font-size: 13px; }
#queueState.offline { color: #b42318; background: #fee4e2; }
.jobs-band .section-heading { padding: 18px 20px; border-bottom: 1px solid #e5e7eb; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
h1, h2 { margin: 0; letter-spacing: 0; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }

.segmented { display: inline-flex; margin: 22px 0; border: 1px solid #cfd5d9; border-radius: 6px; overflow: hidden; }
.segmented button { min-width: 120px; padding: 9px 18px; border: 0; border-right: 1px solid #cfd5d9; background: #fff; color: #4b5563; }
.segmented button:last-child { border-right: 0; }
.segmented button.active { background: #202124; color: #fff; }

label { display: grid; gap: 7px; color: #4b5563; font-size: 13px; font-weight: 600; }
input, textarea { width: 100%; border: 1px solid #cfd5d9; border-radius: 5px; padding: 10px 12px; background: #fff; color: #111827; outline: none; }
input:focus, textarea:focus { border-color: #d92d20; box-shadow: 0 0 0 3px rgba(217,45,32,.12); }
textarea { resize: vertical; min-height: 150px; }
.credential-grid, .date-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.mode-fields { margin-top: 18px; }
.hidden { display: none; }
.file-field { margin-top: 14px; max-width: 420px; }
.form-actions { min-height: 48px; margin-top: 22px; display: flex; justify-content: flex-end; align-items: center; gap: 16px; }
.primary-button { min-width: 120px; border: 0; border-radius: 5px; padding: 11px 20px; background: #d92d20; color: #fff; font-weight: 700; }
.primary-button:hover { background: #b42318; }
.text-button { border: 0; background: transparent; color: #475467; padding: 7px 9px; }
.text-button:hover { color: #d92d20; }
.form-error, .error-text { color: #b42318; }
.form-error { margin: 0; font-size: 13px; }
.status-pill, .job-status { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 9px; border-radius: 999px; background: #eef2f4; color: #475467; font-size: 12px; }
.job-status.completed { background: #e8f5ee; color: #067647; }
.job-status.failed { background: #fee4e2; color: #b42318; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid #e5e7eb; white-space: nowrap; }
th { background: #f8fafb; color: #475467; font-weight: 700; }
td { color: #344054; }
.empty-row { text-align: center; color: #98a2b3; padding: 36px; }
.download-link { color: #b42318; font-weight: 700; text-decoration: none; }

.login-page { min-height: 100vh; display: grid; place-items: center; background: #eef1f2; }
.login-shell { width: min(430px, calc(100vw - 32px)); }
.login-panel { padding: 34px; background: #fff; border: 1px solid #dfe3e6; box-shadow: 0 16px 40px rgba(31,41,55,.08); }
.login-panel .brand-mark { margin-bottom: 24px; }
.login-panel h1 { margin-bottom: 28px; font-size: 26px; }
.login-panel form { display: grid; gap: 18px; }
.login-panel .primary-button { width: 100%; margin-top: 4px; }

@media (max-width: 700px) {
  .topbar { padding: 0 16px; }
  .workspace { padding: 16px 12px 32px; }
  .query-band { padding: 18px 14px; }
  .credential-grid, .date-grid { grid-template-columns: 1fr; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; min-width: 0; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .primary-button { width: 100%; }
}
