:root {
  --bg: #0f1115;
  --panel: #171a21;
  --border: #2a2e37;
  --text: #e6e8eb;
  --muted: #8b93a1;
  --accent: #4f8cff;
  --green: #3ecf6e;
  --red: #ff5d5d;
  --yellow: #e8b339;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f6f8;
    --panel: #ffffff;
    --border: #dfe2e7;
    --text: #1a1d23;
    --muted: #5b6472;
    --accent: #2f6fed;
    --green: #1f9d52;
    --red: #d13c3c;
    --yellow: #a97a0e;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.topbar .brand { font-weight: 600; color: var(--text); text-decoration: none; }
.topbar nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 20px;
  font-size: 14px;
}
.topbar nav a:hover { color: var(--accent); }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

h1 { font-size: 22px; margin-bottom: 4px; }
h2 { font-size: 17px; margin-top: 32px; }
p.subtitle { color: var(--muted); margin-top: 0; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 16px;
}

.card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; }

input[type=text], input[type=password], textarea, select {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
}
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

label { display: block; margin: 12px 0 4px; font-size: 13px; color: var(--muted); }

.btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { opacity: 0.9; }
.btn-secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-danger { background: var(--red); }
.btn-small { padding: 4px 10px; font-size: 13px; }

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.progress-label {
  width: 46px;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--muted);
}
.progress-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  width: 0%;
  transition: width 0.3s ease;
}
.progress-fill.success { background: var(--green); }
.progress-fill.failed { background: var(--red); }
.progress-percent {
  width: 38px;
  flex-shrink: 0;
  text-align: right;
  font-size: 13px;
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-running { background: rgba(232,179,57,0.15); color: var(--yellow); }
.badge-success { background: rgba(62,207,110,0.15); color: var(--green); }
.badge-failed { background: rgba(255,93,93,0.15); color: var(--red); }
.badge-none { background: rgba(139,147,161,0.15); color: var(--muted); }

.flash-list { margin-bottom: 16px; }
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 8px; font-size: 14px; }
.flash-success { background: rgba(62,207,110,0.12); color: var(--green); }
.flash-error { background: rgba(255,93,93,0.12); color: var(--red); }

.console {
  background: #05070a;
  color: #d7dde5;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  border-radius: 8px;
  padding: 14px;
  height: 480px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.login-wrap {
  max-width: 340px;
  margin: 80px auto;
}

.muted { color: var(--muted); font-size: 13px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
