:root {
  color-scheme: light;
  --ink: #20242c;
  --muted: #69717d;
  --line: #d9dee7;
  --panel: #ffffff;
  --page: #f4f6f8;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --warn: #b45309;
  --danger: #b91c1c;
  --ok: #15803d;
}

* {
  box-sizing: border-box;
}

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

.sidebar {
  min-height: 100vh;
  padding: 20px;
  background: #ffffff;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--accent);
  border-radius: 8px;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  margin-top: 2px;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-link {
  color: var(--ink);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}

.nav-link.active {
  color: var(--accent-strong);
  background: #e6f4f1;
  font-weight: 700;
}

.api-box {
  display: grid;
  gap: 8px;
  margin-top: 28px;
  color: var(--muted);
  font-size: 12px;
}

.shell {
  min-width: 0;
  padding: 24px;
}

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

h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

p {
  margin: 6px 0 0;
  color: var(--muted);
}

input,
button {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

input {
  min-width: 0;
  padding: 0 10px;
  background: #ffffff;
}

button {
  padding: 0 14px;
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
  cursor: pointer;
  font-weight: 700;
}

button.secondary {
  color: var(--accent-strong);
  background: #e6f4f1;
  border-color: #b8dfd7;
}

button.danger {
  background: var(--danger);
  border-color: var(--danger);
}

.icon-button {
  width: 40px;
  padding: 0;
  font-size: 20px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(120px, 1.1fr) minmax(120px, 1.1fr) minmax(100px, 0.8fr) 110px auto;
  gap: 10px;
  margin-bottom: 14px;
}

.table-wrap {
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
  vertical-align: middle;
}

th {
  color: var(--muted);
  background: #f9fafb;
  font-weight: 700;
}

tr:last-child td {
  border-bottom: 0;
}

.actions {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.badge.finished,
.badge.active {
  background: #dcfce7;
  color: var(--ok);
}

.badge.running,
.badge.queued {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge.failed {
  background: #fee2e2;
  color: var(--danger);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.card {
  min-height: 180px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  letter-spacing: 0;
}

.card p {
  font-size: 14px;
  line-height: 1.5;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 360px;
  padding: 12px 14px;
  color: #ffffff;
  background: #20242c;
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}

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

  .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .toolbar {
    grid-template-columns: 1fr;
  }
}
