:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-2: #f9fafc;
  --text: #172033;
  --muted: #6b7280;
  --line: #dfe5ef;
  --accent: #0f766e;
  --accent-2: #2563eb;
  --danger: #b91c1c;
  --ok: #047857;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
button {
  border: 0;
  background: var(--accent);
  color: white;
  border-radius: 6px;
  padding: 0.68rem 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
button.ghost {
  background: #eef2f7;
  color: var(--text);
}
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.7rem 0.8rem;
  font: inherit;
}
.app-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar {
  background: #111827;
  color: #e5e7eb;
  padding: 1rem;
}
.brand {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #14b8a6;
  color: #042f2e;
  font-weight: 900;
  margin-bottom: 1.4rem;
}
.sidebar nav { display: grid; gap: 0.25rem; }
.sidebar a {
  border-radius: 6px;
  padding: 0.75rem 0.85rem;
  color: #cbd5e1;
}
.sidebar a.active, .sidebar a:hover { background: #1f2937; color: white; }
.main { padding: 1.25rem; min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.topbar h1 { margin: 0; font-size: 1.4rem; }
.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
}
.grid { display: grid; gap: 1rem; }
.metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 1rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}
.metric span { color: var(--muted); font-weight: 700; }
.metric strong { display: block; font-size: 2rem; margin-top: 0.45rem; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.section-head h2, .card h2 { margin: 0 0 1rem; font-size: 1.05rem; }
.section-head h2 { margin: 0; }
.search { max-width: 320px; }
.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td {
  text-align: left;
  padding: 0.8rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
th { color: var(--muted); background: var(--panel-2); font-size: 0.78rem; text-transform: uppercase; }
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  background: #e5e7eb;
  color: #374151;
  font-size: 0.78rem;
  font-weight: 800;
}
.pill.connected, .pill.completed { background: #d1fae5; color: var(--ok); }
.pill.failed, .alert.error { background: #fee2e2; color: var(--danger); }
.pill.disabled { background: #f3f4f6; color: #4b5563; }
.alert {
  border-radius: 6px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 1rem;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 700;
}
.login-body, .setup {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.login-panel, .setup-card {
  width: min(920px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2rem;
}
.login-panel {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: center;
}
.login-panel h1 { margin: 0 0 1rem; font-size: 2.4rem; }
.login-panel p { color: var(--muted); line-height: 1.7; }
.login-form { display: grid; gap: 1rem; }
.login-form label { display: grid; gap: 0.4rem; color: var(--muted); font-weight: 700; }
.empty-state { min-height: 320px; display: grid; align-content: center; }
.empty-state p { color: var(--muted); }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics, .two-col, .login-panel { grid-template-columns: 1fr; }
  .section-head, .topbar { align-items: stretch; flex-direction: column; }
  .search { max-width: none; }
}
