:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-alt: #273449;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: #334155;
  --accent: #38bdf8;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --info: #818cf8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "DejaVu Sans", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
}

.site-header h1 { margin: 0; font-size: 1.25rem; }
.site-header h1 a { color: var(--text); }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

.site-footer {
  padding: 1rem 1.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

.status-line h2 { margin-top: 0; }

.health {
  font-weight: bold;
  padding: 0.15rem 0.6rem;
  border-radius: 4px;
}
.health-healthy { color: var(--ok); }
.health-degraded { color: var(--bad); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 2rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card-value { font-size: 1.8rem; font-weight: bold; }
.card-label { color: var(--muted); font-size: 0.85rem; }

table.data {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.9rem;
}

table.data th, table.data td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  overflow-wrap: anywhere;
}

table.data thead th {
  background: var(--panel-alt);
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

table.meta th { width: 12rem; color: var(--muted); }

.status {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
  text-transform: uppercase;
}
.status-running { background: rgba(56, 189, 248, 0.15); color: var(--accent); }
.status-waiting { background: rgba(129, 140, 248, 0.15); color: var(--info); }
.status-waiting_approval { background: rgba(129, 140, 248, 0.15); color: var(--info); }
.status-prepared { background: rgba(148, 163, 184, 0.15); color: var(--muted); }
.status-completed { background: rgba(52, 211, 153, 0.15); color: var(--ok); }
.status-failed { background: rgba(248, 113, 113, 0.15); color: var(--bad); }
.status-stalled { background: rgba(251, 191, 36, 0.15); color: var(--warn); }

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

.empty {
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-width: 360px;
}

.admin-form label {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.admin-form input {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  padding: 0.5rem;
  font-size: 1rem;
}

.admin-form button {
  margin-top: 1rem;
  background: var(--accent);
  border: none;
  border-radius: 4px;
  color: var(--bg);
  padding: 0.6rem;
  font-weight: bold;
  cursor: pointer;
}

section { margin-bottom: 2rem; }
section h3 { border-bottom: 1px solid var(--border); padding-bottom: 0.4rem; }