:root {
  color-scheme: light dark;
  --bg: #09111f;
  --bg-soft: #0f172a;
  --card: rgba(15, 23, 42, 0.9);
  --card-edge: rgba(148, 163, 184, 0.18);
  --text: #e5eefc;
  --muted: #9fb1ca;
  --primary: #38bdf8;
  --primary-strong: #0ea5e9;
  --danger: #fb7185;
  --success: #22c55e;
  --warning: #f59e0b;
  --idle: #64748b;
  --input: rgba(15, 23, 42, 0.72);
  --shadow: 0 20px 40px rgba(2, 8, 23, 0.35);
  font-family: "SF Pro Text", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.18), transparent 30%),
    linear-gradient(180deg, #020617 0%, #0f172a 100%);
  color: var(--text);
}

.shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.shell-login {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  padding: 18px;
}

.login-card {
  width: min(100%, 420px);
}

.hero {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  line-height: 1.05;
}

h2 {
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.muted,
.meta-line {
  color: var(--muted);
}

.stack-md > * + * {
  margin-top: 14px;
}

.stack-lg > * + * {
  margin-top: 18px;
}

.grid-two {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 0.92rem;
  font-weight: 600;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--text);
  background: var(--input);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(56, 189, 248, 0.75);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
}

textarea {
  resize: vertical;
  min-height: 180px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 0;
  border-radius: 16px;
  padding: 0 18px;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease, background 120ms ease;
}

.button:active {
  transform: scale(0.98);
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.button-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: #04111d;
  font-weight: 700;
}

.button-secondary {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text);
}

.button-block {
  width: 100%;
}

.button-small {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 12px;
}

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

.status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-idle {
  background: rgba(100, 116, 139, 0.18);
  color: #cbd5e1;
}

.status-running {
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
}

.status-completed {
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
}

.status-error,
.status-timeout {
  background: rgba(251, 113, 133, 0.18);
  color: #fecdd3;
}

.status-info {
  background: rgba(56, 189, 248, 0.16);
  color: #bae6fd;
}

.status-warn {
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
}

.output-panel {
  margin: 12px 0 0;
  padding: 16px;
  min-height: 260px;
  max-height: 58vh;
  overflow: auto;
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #d7e3f4;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-item {
  padding: 14px;
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.42);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.history-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.history-title {
  font-weight: 700;
}

.history-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.history-summary {
  margin-top: 10px;
  color: #d7e3f4;
  white-space: pre-wrap;
}

.alert {
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 0.92rem;
}

.alert-error {
  background: rgba(251, 113, 133, 0.14);
  color: #fecdd3;
  border: 1px solid rgba(251, 113, 133, 0.2);
}

@media (min-width: 720px) {
  .shell-dashboard {
    padding-top: 36px;
  }

  .grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
