:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --text: #1d2330;
  --muted: #5d6675;
  --line: #dde1e7;
  --ok: #1f7a3d;
  --ok-bg: #e3f4e8;
  --bad: #b3261e;
  --bad-bg: #fbe5e3;
  --wait: #7a5a00;
  --wait-bg: #fff3cd;
  --accent: #1d4ed8;
  --danger: #b3261e;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--panel); color: var(--text); padding: 12px 24px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo { height: 20px; width: auto; display: block; }
.title { color: var(--muted); font-size: 14px; padding-left: 14px; border-left: 1px solid var(--line); }
.version { color: var(--muted); font-size: 13px; }
.nav { display: flex; gap: 18px; flex: 1; margin-left: 32px; }
.nav a { color: var(--text); text-decoration: none; font-size: 14px; }
.nav a:hover { color: var(--accent); }
.who { display: flex; align-items: center; gap: 12px; font-size: 14px; white-space: nowrap; }
.content { max-width: 960px; margin: 32px auto; padding: 0 16px; }
h1 { font-size: 24px; margin: 0 0 20px; }
table.status {
  width: 100%; border-collapse: collapse; background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
table.status th, table.status td {
  text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top;
}
table.status tr:last-child th, table.status tr:last-child td { border-bottom: 0; }
table.status th { width: 230px; font-weight: 600; }
table.status td:nth-child(2) { width: 160px; }
.pill { display: inline-block; white-space: nowrap; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.pill.ok { color: var(--ok); background: var(--ok-bg); }
.pill.bad { color: var(--bad); background: var(--bad-bg); }
.pill.wait { color: var(--wait); background: var(--wait-bg); }
.note { color: var(--muted); margin-top: 16px; }
h2 { font-size: 17px; margin: 24px 0 8px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 28px; max-width: 640px; margin: 0 auto;
}
.card.narrow { max-width: 400px; }
.heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.heading h1 { margin: 0; }
form label { display: block; margin: 0 0 14px; font-weight: 600; font-size: 14px; }
form label input, form label select, form label textarea { display: block; width: 100%; margin-top: 4px; font-weight: 400; }
input, select {
  font: inherit; padding: 8px 10px; border: 1px solid #b9c0cb; border-radius: 6px; background: #fff;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row label { flex: 1; min-width: 200px; }
button, .button {
  font: inherit; font-size: 14px; display: inline-block; padding: 8px 16px; border-radius: 6px;
  border: 1px solid #b9c0cb; background: #fff; color: var(--text); cursor: pointer; text-decoration: none;
}
button:hover, .button:hover { border-color: var(--accent); }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.primary:hover { background: #1e40af; }
button.small { padding: 4px 10px; font-size: 13px; }
button.danger { color: var(--danger); }
button.link { border: 0; background: none; color: var(--accent); padding: 0; }
form.inline { display: inline; }
.spaced { margin-top: 20px; }
.card.wide { max-width: none; }
h2.first { margin-top: 0; }
.crumbs { margin: 0 0 4px; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.search { display: flex; gap: 8px; margin-bottom: 16px; }
.search input { flex: 1; }
textarea { font: inherit; width: 100%; padding: 8px 10px; border: 1px solid #b9c0cb; border-radius: 6px; margin-top: 4px; font-weight: 400; display: block; }
.mono, code.big { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
code.big { font-size: 20px; background: none; padding: 0; }
.pre { white-space: pre-wrap; }
.warning { color: var(--wait); background: var(--wait-bg); padding: 10px 12px; border-radius: 6px; }
.hint { display: block; font-weight: 400; font-size: 13px; color: var(--muted); margin-top: 4px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin: 0 0 16px; }
legend { font-weight: 600; font-size: 14px; padding: 0 6px; }
label.check { display: block; font-weight: 400; margin: 4px 0; }
.choices { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 12px; }
label.choice { font-weight: 400; margin: 0; white-space: nowrap; }
label.check input, label.choice input { display: inline-block; width: auto; margin: 0 6px 0 0; vertical-align: middle; }
.row label.narrow-field { flex: 0 0 140px; min-width: 120px; }
label.half { max-width: 320px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filters input[name="q"] { flex: 1; min-width: 220px; }
.inline-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; font-size: 14px; margin: 0; }
.badge { background: var(--bad); color: #fff !important; border-radius: 999px; padding: 0 8px; font-size: 12px; font-weight: 700; line-height: 20px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); margin-right: 6px; }
.alerts { border-color: #f1c0bc; margin-bottom: 28px; }
.error-text { color: var(--bad); }
.pager { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.banner { padding: 10px 24px; font-size: 14px; }
.banner.bad { background: var(--bad-bg); color: var(--bad); }
.banner.wait { background: var(--wait-bg); color: var(--wait); }
.banner a { color: inherit; font-weight: 600; }
.error { color: var(--bad); background: var(--bad-bg); padding: 10px 12px; border-radius: 6px; }
.notice { color: var(--ok); background: var(--ok-bg); padding: 10px 12px; border-radius: 6px; }
.qr { width: 220px; margin: 8px 0; }
.qr svg { width: 100%; height: auto; display: block; }
code { background: #eef0f3; padding: 2px 6px; border-radius: 4px; font-size: 13px; word-break: break-all; }
.link-box { display: block; padding: 10px 12px; user-select: all; }
table.list {
  width: 100%; border-collapse: collapse; background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
table.list th, table.list td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { font-size: 13px; color: var(--muted); font-weight: 600; background: #fafbfc; }
table.list td.actions { white-space: nowrap; text-align: right; }
table.list td.actions form { margin-left: 4px; }

@media (max-width: 800px) {
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .nav { margin-left: 0; order: 3; flex-basis: 100%; }
  .title { display: none; }
  table.list { display: block; overflow-x: auto; }
}
@media (max-width: 640px) {
  table.status th, table.status td { display: block; width: auto !important; border: 0; padding: 6px 16px; }
  table.status tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
}
