:root {
  color-scheme: dark;
  --bg: #0b1020;
  --panel: rgba(20, 27, 48, 0.78);
  --panel-strong: #141b30;
  --muted: #8997b7;
  --text: #edf2ff;
  --line: rgba(148, 163, 184, 0.18);
  --blue: #63a5ff;
  --blue-strong: #3478f6;
  --green: #48d597;
  --yellow: #f7c86a;
  --red: #ff718b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 10%, rgba(52, 120, 246, 0.32), transparent 32rem),
    radial-gradient(circle at 90% 0%, rgba(72, 213, 151, 0.18), transparent 28rem),
    var(--bg);
}

.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0 48px; }
.hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 12px; }
h1 { margin: 0; font-size: clamp(30px, 5vw, 52px); line-height: 1; }
.subtitle { margin: 14px 0 0; color: var(--muted); font-size: 16px; }
.status-pill { border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--muted); border-radius: 999px; padding: 8px 13px; white-space: nowrap; }
.status-pill.ok { color: var(--green); border-color: rgba(72, 213, 151, .35); }
.status-pill.bad { color: var(--red); border-color: rgba(255, 113, 139, .35); }
.status-pill.warn { color: var(--yellow); border-color: rgba(247, 200, 106, .4); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); backdrop-filter: blur(20px); padding: 22px; }
.span-2 { grid-column: span 2; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.section-title h2 { margin: 0; font-size: 20px; }
.section-title span { color: var(--muted); font-size: 13px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; }

form { display: grid; gap: 14px; }
label { display: grid; gap: 8px; color: var(--muted); font-size: 13px; }
input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(5, 10, 22, .72);
  color: var(--text);
  border-radius: 14px;
  padding: 13px 14px;
  outline: none;
  font-size: 15px;
}
input:focus { border-color: rgba(99, 165, 255, .75); box-shadow: 0 0 0 4px rgba(99, 165, 255, .12); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: end; }
.check-row { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.check-row input { width: 16px; height: 16px; }
.check-row.small { font-size: 12px; }
button { border: 0; border-radius: 14px; padding: 12px 16px; color: var(--text); cursor: pointer; font-weight: 700; transition: transform .15s ease, opacity .15s ease, border-color .15s ease; }
button:hover { transform: translateY(-1px); }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.primary { background: linear-gradient(135deg, var(--blue-strong), #7c5cff); }
.ghost { background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.hint { margin: 14px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.jobs-list { display: grid; gap: 10px; max-height: 304px; overflow: auto; padding-right: 4px; }
.job-item { display: grid; gap: 5px; padding: 13px; border: 1px solid var(--line); background: rgba(255,255,255,.04); border-radius: 16px; cursor: pointer; }
.job-item.active { border-color: rgba(99, 165, 255, .8); background: rgba(99, 165, 255, .1); }
.job-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.job-id { font-weight: 800; }
.badge { border-radius: 999px; padding: 3px 8px; background: rgba(255,255,255,.08); color: var(--muted); font-size: 12px; }
.badge.running { color: var(--blue); }
.badge.awaiting_otp { color: var(--yellow); }
.badge.completed { color: var(--green); }
.badge.failed { color: var(--red); }
.job-sub { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty, .empty-state { color: var(--muted); border: 1px dashed var(--line); border-radius: 16px; padding: 24px; text-align: center; }

.hidden { display: none !important; }
.current-body { display: grid; gap: 18px; }
.progress-line { display: flex; justify-content: space-between; align-items: center; padding: 16px; background: rgba(5,10,22,.48); border: 1px solid var(--line); border-radius: 18px; }
.job-status { text-transform: uppercase; letter-spacing: .08em; color: var(--blue); font-weight: 900; font-size: 12px; }
.job-stage { margin-top: 5px; font-size: 17px; }
.duration { color: var(--muted); font-variant-numeric: tabular-nums; }
.otp-panel { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: center; border: 1px solid rgba(247, 200, 106, .4); background: rgba(247, 200, 106, .1); border-radius: 18px; padding: 16px; }
.otp-panel h3, .details-grid h3, .logs-head h3 { margin: 0 0 8px; }
.otp-panel p { margin: 0; color: var(--muted); line-height: 1.5; }
.otp-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.json-box, .logs-box { margin: 0; border: 1px solid var(--line); background: rgba(2, 6, 16, .72); border-radius: 18px; padding: 14px; overflow: auto; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 12px; line-height: 1.55; }
.json-box { height: 270px; }
.logs-head { display: flex; align-items: center; justify-content: space-between; }
.logs-box { height: 420px; white-space: pre-wrap; }
.log-DEBUG { color: #8fa4cb; }
.log-INFO { color: #dbe7ff; }
.log-WARNING { color: var(--yellow); }
.log-ERROR, .log-CRITICAL { color: var(--red); }
.log-SUCCESS { color: var(--green); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: #17213a; color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 12px 18px; box-shadow: var(--shadow); z-index: 20; }

@media (max-width: 860px) {
  .hero, .section-title, .progress-line { align-items: stretch; flex-direction: column; }
  .grid, .form-row, .details-grid, .otp-panel { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .otp-form { grid-template-columns: 1fr; }
}
