:root {
  --bg: #0f1115;
  --panel: #171a21;
  --line: #262b36;
  --fg: #e6e9ef;
  --muted: #8b93a5;
  --accent: #4c8dff;
  --danger: #e5484d;
  --warn: #f5a524;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7f9;
    --panel: #ffffff;
    --line: #e2e5ea;
    --fg: #1a1d23;
    --muted: #667085;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ── Navigation ─────────────────────────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 1.25rem;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.nav .brand { font-weight: 600; text-decoration: none; color: var(--fg); }
.nav .spacer { flex: 1; }
.nav .who { color: var(--muted); }
.nav a { color: var(--accent); text-decoration: none; }
.nav a:hover { text-decoration: underline; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }

/* ── Karten ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}
.card--narrow { max-width: 380px; margin: 4rem auto; }

h1 { font-size: 1.4rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 1rem; }
h3 { font-size: .95rem; margin: 1.75rem 0 .75rem; color: var(--muted); }

.muted { color: var(--muted); }
.error { color: var(--danger); }
.warn  { color: var(--warn); }
.msg {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: .5rem .75rem;
}
.nowrap { white-space: nowrap; }
code { font-size: .85em; color: var(--muted); }

/* ── Tabs ───────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: .25rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.tabs a {
  padding: .45rem .9rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
}
.tabs a.on { color: var(--fg); border-color: var(--accent); background: var(--panel); }

/* ── Formulare ──────────────────────────────────────────────────────────── */
label { display: block; margin-bottom: .9rem; color: var(--muted); font-size: .9rem; }

input[type=text], input[type=password], input:not([type]), select {
  width: 100%;
  margin-top: .3rem;
  padding: .5rem .6rem;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
input[type=checkbox] { width: auto; }

button {
  padding: .5rem .9rem;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 6px;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}
button:hover { filter: brightness(1.1); }
button.danger { background: var(--danger); }

.row {
  display: flex;
  gap: .6rem;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: .7rem 0;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row__label { min-width: 190px; display: flex; flex-direction: column; }
.row__label .muted { font-size: .82rem; }
.row input { flex: 1; min-width: 160px; }

/* ── Tabellen ───────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; font-size: .85rem; }
td form { display: inline-flex; gap: .4rem; align-items: center; }
td.actions { white-space: nowrap; display: flex; gap: .4rem; }
.audit td { font-size: .88rem; }
