:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1c1f24;
  --muted: #5f6672;
  --line: #e1e4e9;
  --accent: #b3121a;
  --accent-dark: #8e0e14;
  --accent-soft: #fbeaea;
  --ok: #1d6b3a;
  --ok-soft: #e6f4ea;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --card: #1f2226;
    --text: #e8eaed;
    --muted: #a0a6b0;
    --line: #33373d;
    --accent: #e0464c;
    --accent-dark: #c4343a;
    --accent-soft: #3a1f21;
    --ok: #7bd39a;
    --ok-soft: #1c3226;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
main { flex: 1; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; margin: 0; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.pad { padding: 20px; margin: 20px 0; }
.n { font-size: .8em; font-weight: 500; color: var(--muted); }

/* Kopf */
.top { background: var(--accent); color: #fff; padding: 36px 0 28px; border-bottom: 4px solid var(--accent-dark); }
.top.slim { padding: 20px 0; }
.top h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.eyebrow { margin: 0 0 4px; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; opacity: .85; }
.search { margin-top: 20px; }
.search input {
  width: 100%; max-width: 480px; padding: 11px 14px; border-radius: 8px;
  border: 0; font: inherit; background: #fff; color: #1c1f24;
}
.bar { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; }
.top .btn { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.35); color: #fff; }
.top .btn:hover { background: rgba(255,255,255,.24); }

/* Kategorien */
.cats { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 4px; }
.cats a {
  text-decoration: none; color: var(--text); background: var(--card);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px; font-size: .9rem;
}
.cats a:hover { border-color: var(--accent); color: var(--accent); }

.group { margin: 28px 0; scroll-margin-top: 12px; }
.group h2 { font-size: 1.15rem; margin-bottom: 12px; }
.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.link {
  display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; height: 100%;
  text-decoration: none; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.link:hover, .link:focus-visible { border-color: var(--accent); box-shadow: 0 2px 10px rgba(0,0,0,.06); outline: none; }
.badge {
  flex: none; width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 1.1rem;
}
.txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.t { font-weight: 600; }
.d { color: var(--muted); font-size: .92rem; }
.h { color: var(--muted); font-size: .8rem; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ext { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-top: 2px; }
.link:hover .ext { stroke: var(--accent); }
.empty { padding: 28px; margin: 28px 0; text-align: center; }
.noresult { text-align: center; margin: 32px 0; }

/* Formulare */
.fields { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 14px; }
.fields .wide { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 5px; font-size: .9rem; font-weight: 600; }
.opt { font-weight: 400; color: var(--muted); }
input[type=text], input:not([type]), input[type=password], input[type=search] {
  font: inherit; font-weight: 400; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--bg); color: var(--text); width: 100%;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
label.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer; text-decoration: none;
  padding: 8px 14px; border-radius: 7px; border: 1px solid var(--line); background: var(--card); color: var(--text);
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.small { padding: 5px 10px; font-size: .85rem; }
.btn.danger { color: var(--accent); }
.btn.danger:hover { border-color: var(--accent); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
form { margin: 0; }

.msg { padding: 10px 14px; border-radius: 8px; margin: 20px 0 0; }
.msg.ok { background: var(--ok-soft); color: var(--ok); }
.msg.err { background: var(--accent-soft); color: var(--accent); }

/* Verwaltungsliste */
.admin h2 { font-size: 1.15rem; }
.admin h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 20px 0 6px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.list li.current { background: var(--accent-soft); margin: 0 -10px; padding: 10px; border-radius: 6px; }
.info { display: flex; flex-direction: column; min-width: 0; flex: 1 1 300px; }
.info a { font-size: .85rem; overflow-wrap: anywhere; }
.info .muted { font-size: .88rem; }

/* Anmeldung */
.login { flex: 0 0 auto; display: block; width: calc(100% - 32px); max-width: 380px; margin: 12vh auto 40px; padding: 28px; }
.center .foot { margin-top: auto; }
.login h1 { font-size: 1.35rem; }
.login form { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 18px; }
.login .msg { margin-top: 14px; }
.back { margin: 18px 0 0; font-size: .9rem; }

/* Fuß */
.foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 18px 0; font-size: .85rem; color: var(--muted); }
.foot-in { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.foot nav { display: flex; gap: 16px; flex-wrap: wrap; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--accent); }

@media (max-width: 560px) {
  .top { padding: 26px 0 22px; }
  .grid { grid-template-columns: 1fr; }
}
