:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef2f6;
  color: #14202b;
  --blue: #005baa;
  --blue-dark: #003f78;
  --yellow: #ffea00;
  --line: #d7dee7;
  --muted: #647184;
  --danger: #b42318;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: linear-gradient(145deg, #edf2f7, #f9fbfd 55%, #e7edf4); }
button, input, textarea { font: inherit; }
.hidden { display: none !important; }
.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0; }
header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(28px, 4vw, 44px); letter-spacing: -0.04em; }
h2 { margin-bottom: 20px; font-size: 19px; }
.eyebrow { margin-bottom: 8px; color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.muted { color: var(--muted); line-height: 1.55; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, .92fr); gap: 20px; }
.panel, .login-card { background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 16px 45px rgba(24,46,72,.09); padding: 26px; }
.login-card { width: min(430px, 100%); margin: 10vh auto 0; }
.brand-mark { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 18px; border-radius: 12px; background: var(--blue); color: white; font-weight: 900; box-shadow: inset 0 -5px 0 var(--yellow); }
.safety { margin-bottom: 20px; padding: 13px 16px; border-left: 5px solid var(--yellow); background: #fffde3; border-radius: 8px; color: #4b4a22; }
form { display: grid; gap: 18px; }
label, legend { color: #344153; font-size: 13px; font-weight: 700; }
input, textarea { width: 100%; margin-top: 8px; padding: 12px 13px; border: 1px solid #cbd4df; border-radius: 9px; outline: none; transition: .15s; }
textarea { min-height: 104px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,91,170,.13); }
fieldset { border: 0; padding: 0; margin: 0; }
legend { margin-bottom: 10px; }
.target-grid { display: grid; gap: 9px; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.target, .check { display: flex; align-items: flex-start; gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.target:has(input:checked) { border-color: var(--blue); background: #f0f7ff; box-shadow: inset 4px 0 0 var(--blue); }
.danger-target:has(input:checked) { border-color: #d92d20; background: #fff5f4; box-shadow: inset 4px 0 0 #d92d20; }
.target input, .check input { width: auto; margin: 3px 0 0; accent-color: var(--blue); }
.target span, .check span { display: grid; gap: 3px; }
small { color: var(--muted); font-weight: 500; line-height: 1.35; }
.optional { color: var(--muted); font-weight: 500; }
.stock-picker { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; }
.stock-picker-heading, .stock-picker-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stock-picker-heading > div { display: grid; gap: 3px; }
.stock-picker-tools input { margin: 0; }
.compact-button { min-height: 44px; padding: 9px 12px; white-space: nowrap; }
.stock-list { display: grid; gap: 7px; max-height: 330px; overflow-y: auto; padding-right: 3px; }
.stock-option { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 54px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: white; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.stock-option:hover { border-color: #9ab8d4; }
.stock-option:has(input:checked) { border-color: var(--blue); background: #eff7ff; }
.stock-option input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
.stock-option-main { display: grid; gap: 3px; min-width: 0; }
.stock-option-main b, .stock-option-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stock-status { padding: 3px 7px; border-radius: 999px; background: #e8f1fb; color: var(--blue-dark); font-size: 10px; font-weight: 800; }
.stock-empty { margin: 0; padding: 18px; text-align: center; color: var(--muted); }
button { border: 0; border-radius: 9px; padding: 12px 16px; background: var(--blue); color: white; font-weight: 800; cursor: pointer; }
button:hover { background: var(--blue-dark); }
button:disabled { opacity: .58; cursor: wait; }
.secondary, .icon-button { background: white; color: var(--blue); border: 1px solid var(--line); }
.icon-button { padding: 6px 11px; font-size: 19px; }
.panel-title { display: flex; justify-content: space-between; align-items: center; }
.jobs { display: grid; gap: 10px; max-height: 630px; overflow: auto; padding-right: 4px; }
.job { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; }
.job-top { display: flex; justify-content: space-between; gap: 12px; }
.job-code { font-weight: 900; }
.badge { padding: 3px 8px; border-radius: 999px; background: #e8edf3; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.badge.success { background: #dcfae6; color: #067647; }
.badge.failed { background: #fee4e2; color: var(--danger); }
.badge.running, .badge.queued { background: #e2f0ff; color: var(--blue); }
.job-meta { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.job details { margin-top: 10px; font-size: 12px; }
.job pre { overflow: auto; padding: 10px; background: #14202b; color: #dce8f4; border-radius: 7px; white-space: pre-wrap; }
.error { min-height: 18px; margin: 0; color: var(--danger); font-size: 13px; }
.error.success { color: #067647; }

@media (max-width: 820px) {
  .shell { width: min(100% - 20px, 620px); padding: 22px 0; }
  .layout { grid-template-columns: 1fr; }
  .action-grid { grid-template-columns: 1fr; }
  .stock-picker-tools { align-items: stretch; flex-direction: column; }
  header { align-items: center; }
}
