:root {
  color-scheme: light dark;
  --bg: #0f1115;
  --panel: #171a21;
  --border: #2a2e38;
  --text: #e6e8ee;
  --muted: #9aa2b1;
  --accent: #4f8cff;
  --danger: #e5484d;
  --ok: #3fb950;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
}

header a { color: var(--text); text-decoration: none; font-weight: 600; }
.brand-logo { height: 40px; display: block; }
header nav a { color: var(--muted); margin-left: 16px; font-weight: 400; }
header form { display: inline; margin-left: 16px; }

main { max-width: 960px; margin: 0 auto; padding: 24px; }

h1 { font-size: 20px; }
h2 { font-size: 16px; color: var(--muted); font-weight: 600; }

table { width: 100%; border-collapse: collapse; margin-top: 16px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; }
tr:hover { background: var(--panel); }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
}
.btn.danger { background: var(--danger); }
.btn.secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }

form.inline { display: inline; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-top: 16px;
}

label { display: block; margin: 14px 0 6px; font-weight: 600; font-size: 13px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
textarea { min-height: 90px; font-family: ui-monospace, monospace; }

pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px;
  overflow-x: auto;
  font-size: 13px;
}

.errors { color: var(--danger); margin-top: 12px; }
.errors li { margin-bottom: 4px; }

.muted { color: var(--muted); }
.actions { margin-top: 20px; display: flex; gap: 10px; }

.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-card { width: 320px; }

dl.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-family: ui-monospace, monospace; }

.diff {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 0;
  overflow-x: auto;
  font-family: ui-monospace, monospace;
  font-size: 13px;
}
.diff .line { padding: 1px 14px; white-space: pre; }
.diff .added { background: rgba(63, 185, 80, 0.15); color: var(--ok); }
.diff .removed { background: rgba(229, 72, 77, 0.15); color: var(--danger); }
.diff .unchanged { color: var(--muted); }

.history-entry { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.history-entry .meta { font-size: 13px; }
