:root {
  --bg: #0f1419;
  --panel: #1a2332;
  --text: #e7ecf3;
  --muted: #8b98a8;
  --accent: #3d8bfd;
  --danger: #f87171;
  --ok: #4ade80;
  --warn: #fbbf24;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 900px; margin: 0 auto; padding: 0 1rem; }

.top {
  background: var(--panel);
  border-bottom: 1px solid #2a3545;
  padding: 0.75rem 0;
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.brand { font-weight: 700; font-size: 1.1rem; color: var(--text); }
nav a { margin-left: 1rem; }

main { padding: 1.5rem 0 3rem; }
h1 { font-size: 1.5rem; margin-top: 0; }
h2 { font-size: 1.1rem; margin-top: 0; }
.lead { color: var(--muted); }
.muted { color: var(--muted); font-size: 0.95rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.card {
  background: var(--panel);
  border: 1px solid #2a3545;
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.card.link { display: block; color: inherit; transition: border-color 0.15s; }
.card.link:hover { border-color: var(--accent); text-decoration: none; }

label { display: block; margin-top: 0.75rem; font-size: 0.85rem; color: var(--muted); }
input, select, button {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  border: 1px solid #3d4a5c;
  background: #0f1419;
  color: var(--text);
}
button, .button {
  width: auto;
  margin-top: 1rem;
  background: var(--accent);
  border: none;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  padding: 0.55rem 1rem;
}
.button.secondary {
  background: transparent;
  border: 1px solid #3d4a5c;
  color: var(--text);
  display: inline-block;
}
.row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.hint { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 0.2rem; }

.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td { text-align: left; padding: 0.5rem 0.4rem; border-bottom: 1px solid #2a3545; }
.table code { font-size: 0.9em; }

.actions { white-space: nowrap; }
form.inline { display: inline; margin: 0; }
button.link {
  background: none; border: none; color: var(--accent);
  padding: 0; margin: 0; width: auto; font: inherit; cursor: pointer;
}
button.link.danger { color: var(--danger); }

.flash { list-style: none; padding: 0; margin: 0 0 1rem; }
.flash li { padding: 0.6rem 0.75rem; border-radius: 6px; margin-bottom: 0.5rem; }
.flash .success { background: #14532d; color: #bbf7d0; }
.flash .error { background: #7f1d1d; color: #fecaca; }
.flash .warning { background: #713f12; color: #fde68a; }
.flash .info { background: #1e3a5f; color: #bfdbfe; }

.summary { display: grid; grid-template-columns: 180px 1fr; gap: 0.35rem 1rem; margin-top: 1rem; }
.summary dt { color: var(--muted); margin: 0; }
.summary dd { margin: 0; }

.foot { padding: 1rem 0 2rem; color: var(--muted); font-size: 0.85rem; }
.foot code { font-size: 0.85em; word-break: break-all; }

.small { font-size: 0.88rem; }
.nowrap { white-space: nowrap; }
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}
.filter-row { min-width: 140px; flex: 1; }
.filter-row label { margin-top: 0; }
.filter-row.actions-inline { flex: 2; display: flex; gap: 0.5rem; align-items: flex-end; }
.filter-row.actions-inline button,
.filter-row.actions-inline .button { margin-top: 1.4rem; }
.table-wrap { overflow-x: auto; }
.table.dense th, .table.dense td { padding: 0.35rem 0.3rem; font-size: 0.9rem; }
tr.row-err td { background: #2a1515; }
tr.err-detail td { font-size: 0.85rem; color: var(--danger); background: #1f1212; }
tr.warn-detail td { font-size: 0.85rem; color: var(--warn); background: #1a1810; }

.ping-ok { color: var(--ok); font-weight: 600; }
.ping-fail { color: var(--danger); font-weight: 600; }
pre.ping-out {
  margin: 0.75rem 0 0;
  padding: 0.75rem;
  background: #0d1117;
  border: 1px solid #2a3545;
  border-radius: 6px;
  font-size: 0.8rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
