:root {
  color-scheme: dark;
  --bg: #0e141b;
  --panel: #18212c;
  --panel-2: #101821;
  --line: #2a394a;
  --text: #e8edf4;
  --muted: #93a4b8;
  --accent: #67c3d0;
  --accent-dark: #46a8b7;
  --danger: #ff7b7b;
  --danger-bg: #351c22;
  --ok: #78d69f;
  --warn: #e5c76b;
  --input: #0c131d;
}
* { 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;
  font-size: 15px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: #111a24;
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 18px; color: var(--text); }
.topbar nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.topbar form { margin: 0; }
button, .button {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 6px;
  padding: 9px 13px;
  font: inherit;
  cursor: pointer;
  display: inline-block;
}
button:hover, .button:hover { border-color: var(--accent); text-decoration: none; }
.primary { background: var(--accent); border-color: var(--accent); color: #071217; font-weight: 650; }
.primary:hover { background: var(--accent-dark); color: #071217; }
.danger { border-color: #78414b; color: var(--danger); background: var(--danger-bg); }
.page { max-width: 1180px; margin: 0 auto; padding: 32px 24px 48px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: 28px; margin-bottom: 6px; }
h2 { font-size: 18px; }
p, .help { color: var(--muted); }
.panel, .auth-panel, .table-wrap, .metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}
.panel, .auth-panel { padding: 22px; margin-bottom: 18px; }
.auth-panel { max-width: 420px; margin: 56px auto; }
.form { display: grid; gap: 10px; }
.form input, .form select, .form textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  background: var(--input);
  color: var(--text);
}
.form input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  justify-self: start;
}
.help { margin: -4px 0 6px; font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 13px; font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.empty { color: var(--muted); text-align: center; }
.status { display: inline-flex; min-height: 26px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; }
.status.documented { color: var(--ok); border-color: #35694b; }
.status.failed, .status.revoked { color: var(--danger); border-color: #78414b; }
.status.claimed, .status.issued, .status.received { color: var(--warn); border-color: #776333; }
.command { white-space: pre-wrap; overflow-wrap: anywhere; background: #070d13; color: #eff5f7; padding: 16px; border-radius: 6px; border: 1px solid var(--line); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric { padding: 16px; }
.metric span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.metric strong { display: block; overflow-wrap: anywhere; }
.events { padding-left: 20px; }
.events li { margin-bottom: 10px; }
.events time { color: var(--muted); margin-right: 8px; }
.error { color: var(--danger); }
.messages { margin-bottom: 18px; }
.message { padding: 10px 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); }
.message.success { border-color: #35694b; color: var(--ok); }
.message.error { border-color: #78414b; color: var(--danger); }
.facts { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
code { overflow-wrap: anywhere; color: #c6d5e6; }
@media (max-width: 760px) {
  .topbar, .section-title { align-items: stretch; flex-direction: column; }
  .topbar { height: auto; padding: 14px 18px; }
  .topbar nav { width: 100%; justify-content: space-between; }
  .grid, .facts { grid-template-columns: 1fr; }
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.panel-head h2 { margin-bottom: 0; }
.icon-button {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}
.icon-button.copied {
  border-color: var(--ok);
  color: var(--ok);
}
.compact {
  padding: 6px 10px;
  min-height: 30px;
}
td form { margin: 0; }
