:root {
  --bg: #eef3f8;
  --card: #ffffff;
  --line: #d8e2ee;
  --text: #0f1b2d;
  --muted: #5f6f85;
  --brand: #135ecf;
  --brand-dark: #0d49a3;
  --ok: #108a43;
  --fail: #be123c;
  --run: #a16207;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 10% 0%, #dbeafe 0%, transparent 60%), var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.page {
  width: min(1200px, 96vw);
  margin: 20px auto 40px;
}

.hero {
  margin-bottom: 14px;
}

.hero h1 {
  margin: 0 0 4px;
  font-size: clamp(1.4rem, 2vw, 2rem);
}

.hero p {
  margin: 0;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(15, 27, 45, 0.06);
}

.panel.full {
  margin-top: 6px;
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.hint {
  color: var(--muted);
  font-size: 0.88rem;
}

form {
  display: grid;
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid #c5d3e1;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}

input:focus,
select:focus {
  outline: 2px solid #9cc1ff;
  border-color: #7ea8f6;
}

.row.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn {
  border: 1px solid #c8d5e5;
  background: #f7fafc;
  color: var(--text);
  border-radius: 9px;
  padding: 8px 12px;
  cursor: pointer;
}

.btn:hover {
  background: #eef4fb;
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn.primary:hover {
  background: var(--brand-dark);
}

.btn.ghost {
  padding: 6px 10px;
  font-size: 0.86rem;
}

.jobs-list,
.downloads-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
}

.item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px;
  background: #fbfdff;
}

.item-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 4px;
}

.item small {
  color: var(--muted);
}

.badge {
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.76rem;
  border: 1px solid transparent;
}

.badge.running {
  color: #7a5205;
  background: #fef3c7;
  border-color: #f9d88a;
}

.badge.success {
  color: #0b5e2d;
  background: #d1fae5;
  border-color: #9ee8c8;
}

.badge.failed {
  color: #9f1239;
  background: #ffe4e6;
  border-color: #fecdd3;
}

.logs {
  margin: 0;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0b1220;
  color: #dae6ff;
  min-height: 260px;
  max-height: 380px;
  overflow: auto;
  padding: 12px;
  font-size: 0.85rem;
  line-height: 1.4;
}

a.link {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}

a.link:hover {
  text-decoration: underline;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(11, 18, 32, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 999;
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(420px, 96vw);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 16px 40px rgba(11, 18, 32, 0.28);
}

.qr-image {
  width: 100%;
  max-width: 340px;
  margin: 8px auto 0;
  display: block;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}

@media (max-width: 980px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page {
    width: min(1200px, 98vw);
    margin-top: 10px;
  }

  .panel {
    padding: 12px;
  }

  .row.two {
    grid-template-columns: 1fr;
  }

  .logs {
    min-height: 220px;
  }
}
