:root {
  color-scheme: light dark;
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1c1f24;
  --muted: #5b6270;
  --accent: #2557d6;
  --error: #b42318;
  --border: #d6d9df;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121418;
    --card: #1c1f26;
    --text: #e8eaee;
    --muted: #9aa1ad;
    --accent: #7aa2ff;
    --error: #ff8a80;
    --border: #343944;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.card {
  width: 100%;
  max-width: 400px;
  padding: 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

h1 { margin: 0 0 24px; font-size: 1.5rem; }

label { display: block; margin-bottom: 16px; font-weight: 500; }

input:not([type]), input[type="email"], input[type="password"], input[type="text"] {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
}

label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }

button, a.button {
  display: block;
  box-sizing: border-box;
  width: 100%;
  text-align: center;
  text-decoration: none;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button.danger { background: #b42318; }

button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--border); margin-top: 8px; }

.error { color: var(--error); margin: 0 0 16px; }

.muted { color: var(--muted); }

.card:has(table) { max-width: 960px; }

.admin-nav { display: flex; gap: 16px; margin-bottom: 16px; }

a { color: var(--accent); }

table { width: 100%; border-collapse: collapse; margin: 16px 0; }

th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }

td form { margin: 0; }

td button { width: auto; margin: 0; padding: 4px 12px; }

.badge { margin-left: 8px; padding: 0 6px; border: 1px solid var(--border); border-radius: 4px; font-size: 0.8rem; color: var(--muted); }

code { word-break: break-all; }

h2 { font-size: 1.15rem; margin: 24px 0 8px; }

@media (max-width: 600px) {
  table, thead, tbody, tr, th, td { display: block; }
  thead { display: none; }
  tr { border-bottom: 1px solid var(--border); padding: 8px 0; }
  td { border: 0; padding: 2px 0; }
  td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
}
