:root {
  color-scheme: dark;
  --bg: #0b1017;
  --panel: rgba(21, 29, 41, 0.92);
  --line: #283548;
  --text: #edf3fb;
  --muted: #91a0b5;
  --accent: #48d7a1;
  --accent-dark: #173d33;
  --danger: #ff7d7d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 14px/1.6 "Segoe UI", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 15% 0%, rgba(33, 116, 94, 0.24), transparent 34rem),
    radial-gradient(circle at 90% 15%, rgba(41, 79, 126, 0.22), transparent 30rem),
    var(--bg);
}

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

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0 80px;
}

.auth-page { display: grid; place-items: center; }
.auth-shell { width: min(440px, calc(100% - 28px)); padding: 40px 0; }
.auth-card, .panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(16px);
}
.auth-card { padding: 34px; }
.auth-card h1 { margin-bottom: 8px; font-size: 34px; }
.auth-form { display: grid; gap: 16px; margin-top: 26px; }

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

h1, h2, p { margin-top: 0; }
h1 {
  margin-bottom: 10px;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}
h2 { margin-bottom: 5px; font-size: 20px; }
.subtitle, .panel-heading p { margin-bottom: 0; color: var(--muted); }

.account-card {
  display: grid;
  min-width: 220px;
  padding: 16px 18px;
  border: 1px solid #285944;
  border-radius: 16px;
  background: rgba(18, 50, 40, 0.6);
}
.account-card span { color: var(--muted); font-size: 12px; }
.account-card strong { color: var(--accent); }
.link-button {
  margin-top: 6px;
  padding: 0;
  min-height: auto;
  border: 0;
  background: transparent;
  color: #b8d6cb;
  text-align: left;
}

.panel { margin-top: 18px; padding: 24px; }
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent-dark);
  color: var(--accent);
  white-space: nowrap;
}
.status-pill.error { background: rgba(120, 35, 35, 0.45); color: var(--danger); }
.status-pill.muted { background: #1b2634; color: var(--muted); }

form { display: grid; gap: 16px; }
label { display: grid; gap: 7px; color: #c6d2e2; }
label > span { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; }
textarea, input, select {
  width: 100%;
  border: 1px solid #35445a;
  border-radius: 12px;
  outline: none;
  background: #0e151f;
  color: var(--text);
}
textarea { min-height: 150px; padding: 14px; resize: vertical; }
input, select { height: 44px; padding: 0 12px; }
textarea:focus, input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(72, 215, 161, 0.12);
}

.grid { display: grid; grid-template-columns: 170px 140px minmax(260px, 1fr); gap: 12px; }
.check { display: flex; align-items: center; gap: 10px; color: #b7c5d7; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.actions { display: flex; align-items: center; gap: 14px; }

button {
  min-height: 42px;
  padding: 0 20px;
  border: 0;
  border-radius: 11px;
  background: var(--accent);
  color: #072018;
  font-weight: 750;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }
button:disabled { cursor: not-allowed; opacity: 0.55; }
button.ghost { border: 1px solid #35445a; background: transparent; color: #c5d2e3; }
button.danger { border: 1px solid #663a3a; background: transparent; color: var(--danger); }
.form-message { margin: 0; color: var(--muted); }
.form-message.error { color: var(--danger); }

.jobs { display: grid; gap: 12px; }
.empty {
  padding: 34px;
  border: 1px dashed #334155;
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}
.job {
  display: grid;
  gap: 12px;
  padding: 17px;
  border: 1px solid #2b394c;
  border-radius: 15px;
  background: #101823;
}
.job-top, .job-actions, .job-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.job-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { padding: 3px 9px; border-radius: 999px; background: #26364b; color: #c9d7e8; font-size: 12px; }
.badge.running { background: #173d33; color: var(--accent); }
.badge.completed { background: #1b3c2a; color: #8ee5ad; }
.badge.failed { background: #4a2528; color: var(--danger); }
.badge.cancelled { background: #44391f; color: #f3c96b; }
.progress { height: 7px; overflow: hidden; border-radius: 999px; background: #202c3c; }
.progress > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #35b98a, #62e8b7);
  transition: width 220ms ease;
}
.job-meta { color: var(--muted); font-size: 12px; }
.job-message { color: #d7e0ec; overflow-wrap: anywhere; }
.footer-note { margin-top: 20px; color: #718096; font-size: 12px; text-align: center; }

@media (max-width: 760px) {
  .shell { width: min(100% - 20px, 1180px); padding-top: 24px; }
  .hero, .panel-heading, .job-top { align-items: flex-start; flex-direction: column; }
  .grid { grid-template-columns: 1fr; }
  .account-card { min-width: auto; width: 100%; }
  .panel { padding: 17px; }
}
