:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #66747f;
  --line: #dce3e8;
  --surface: #ffffff;
  --page: #f4f6f5;
  --sidebar: #111820;
  --sidebar-soft: #202a34;
  --accent: #8d1f2d;
  --accent-hover: #741826;
  --green: #1f7a5a;
  --blue: #2850b8;
  --warn: #ad6800;
  --bad: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.sidebar {
  background: var(--sidebar);
  color: #f8fafc;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  padding: 8px 10px;
  font-size: 17px;
  font-weight: 750;
  text-decoration: none;
}

nav {
  display: grid;
  gap: 3px;
}

nav a,
.logout,
.button,
button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 10px 12px;
  text-align: left;
  text-decoration: none;
  font: inherit;
}

nav a {
  color: #d8dee8;
}

nav a.active,
nav a:hover {
  background: var(--sidebar-soft);
  color: #ffffff;
}

.logout,
.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: var(--accent);
  color: #ffffff;
}

.button.secondary {
  background: var(--green);
}

.button.danger,
button.danger {
  background: var(--bad);
}

.button.compact,
button.compact {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
}

button:hover,
.button:hover {
  background: var(--accent-hover);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.logout {
  width: 100%;
  margin-top: auto;
}

main {
  min-width: 0;
  padding: 28px;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

h2 {
  margin: 22px 0 10px;
  font-size: 17px;
}

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

.panel,
.card,
.login-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel {
  padding: 20px;
  min-height: 420px;
  box-shadow: 0 10px 30px rgba(17, 24, 32, 0.05);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.card {
  padding: 14px;
}

.metric {
  margin-top: 4px;
  font-size: 26px;
  font-weight: 760;
  line-height: 1.1;
}

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

.notice {
  color: var(--green);
}

.error {
  color: var(--bad);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.action-band,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.form-band {
  align-items: stretch;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  font: inherit;
  background: #ffffff;
}

textarea {
  min-height: 140px;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  background: #eef4ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.status.completed {
  background: #eaf7f0;
  color: var(--green);
}

.status.failed {
  background: #fff0f0;
  color: var(--bad);
}

.status.running {
  background: #fff7e6;
  color: var(--warn);
}

.status.canceled,
.status.cancel_requested {
  background: #f1f4f6;
  color: var(--muted);
}

.progress-wrap {
  min-width: 220px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 13px;
}

.progress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f4;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 180ms ease;
}

.progress-counts {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.login-page {
  display: grid;
  place-items: center;
  grid-template-columns: 1fr;
  padding: 20px;
}

.login-box {
  width: min(430px, 100%);
  padding: 28px;
  box-shadow: 0 20px 50px rgba(17, 24, 32, 0.08);
}

@media (max-width: 860px) {
  body {
    display: block;
  }

  .sidebar {
    position: static;
  }

  main {
    padding: 18px;
  }

  .topbar {
    display: block;
  }
}
