:root {
  --bg: #f3f5f7;
  --panel: #ffffff;
  --ink: #17212b;
  --muted: #5b6875;
  --line: #d5dce3;
  --accent: #0b6e69;
  --accent-ink: #ffffff;
  --error: #b3261e;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11171c;
    --panel: #1a222a;
    --ink: #e8edf1;
    --muted: #93a1ae;
    --line: #2d3945;
    --accent: #4fc3bb;
    --accent-ink: #0b1a19;
    --error: #ff8a80;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  padding: 1.5rem;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
}

main {
  width: 100%;
  max-width: 24rem;
  padding: 2rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
}

h1 {
  margin: 0 0 1.25rem;
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1rem; }

.muted { color: var(--muted); }

a { color: var(--accent); }

label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

input,
textarea {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.6rem 0.7rem;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0.375rem;
}

textarea { resize: vertical; }

input:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button {
  width: 100%;
  padding: 0.65rem 1rem;
  font: inherit;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  border: 0;
  border-radius: 0.375rem;
  cursor: pointer;
}

button:disabled { opacity: 0.6; cursor: wait; }

button.secondary {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
}

.back-button {
  display: block;
  width: 100%;
  margin: 0 0 1.25rem;
  padding: 0.65rem 1rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 0.375rem;
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

.back-button:hover { border-color: var(--accent); }

.site-footer {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1rem;
  padding: 0.75rem 1rem 0;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.site-footer p { margin: 0; }
.site-footer a { color: inherit; }

.error {
  min-height: 1.5rem;
  margin: 0.75rem 0 0;
  color: var(--error);
  font-size: 0.9rem;
}

.links { margin: 1.25rem 0 0; font-size: 0.9rem; }

.liste { display: grid; gap: 0.75rem; margin: 0 0 1.25rem; }

.eintrag {
  display: block;
  padding: 0.9rem 1rem;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 0.375rem;
}

.eintrag:hover { border-color: var(--accent); }
.eintrag[hidden] { display: none; }
.eintrag strong { display: block; }
.eintrag span { color: var(--muted); font-size: 0.9rem; }

.admin-page { max-width: 48rem; }

.user-table {
  width: 100%;
  margin-top: 1rem;
  border-collapse: collapse;
  table-layout: fixed;
}

.user-table th,
.user-table td {
  padding: 0.65rem 0.5rem;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.user-table .user-name { width: 38%; overflow-wrap: anywhere; }
.user-table .user-role { width: 18%; }
.user-table .user-action-heading { width: 44%; text-align: right; }

.user-table .user-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.user-actions button {
  width: auto;
  padding: 0.45rem 0.65rem;
  white-space: nowrap;
}

@media (max-width: 36rem) {
  .admin-page { padding: 1.25rem; }
  .user-table .user-name { width: 34%; }
  .user-table .user-role { width: 22%; }
  .user-table .user-action-heading { width: 44%; }
  .user-table .user-actions { flex-direction: column; align-items: stretch; }
}

