:root {
  --bg: #0f1115;
  --panel: #181b22;
  --panel-2: #20242e;
  --border: #2c313d;
  --text: #e6e8ee;
  --muted: #9aa1b0;
  --accent: #5b9dff;
  --green: #3fb950;
  --amber: #d29922;
  --red: #f85149;
}

* { box-sizing: border-box; }

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  padding: 0.75rem 1.5rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; color: var(--text); }
.brand span { color: var(--accent); margin-left: 0.25rem; }
/* Cleanup R8: the ten nav links wrap below ~1050px instead of forcing the
   whole page to scroll sideways (the admin's only page-level overflow). */
.topbar nav { display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; }
.topbar nav a { color: var(--muted); }

.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }

h1 { font-size: 1.4rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 0.75rem; }
h3 { font-size: 0.95rem; margin: 1rem 0 0.5rem; }
h4 { font-size: 0.82rem; margin: 1rem 0 0.25rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.04em; }
.config-key { color: var(--muted); font-size: 0.8rem; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }

.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 1rem 0; }
.row-actions { display: flex; gap: 0.5rem; }
.inline-form { display: flex; gap: 0.5rem; align-items: center; }
.inline-form input[type=text] { flex: 1; }
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.35rem 0.8rem;
  margin: 0.25rem 0 0.9rem;
}
.checkbox-grid label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  color: var(--text);
  font-weight: 500;
}
