:root {
  --bg: #10100e;
  --bg-soft: #171714;
  --panel: #1c1c18;
  --panel-2: #232320;
  --line: #33332c;
  --text: #e8e5dc;
  --muted: #9a968a;
  --accent: #d4a24c;
  --accent-soft: rgba(212, 162, 76, 0.14);
  --info: #5aa9dd;
  --ok: #6fbf73;
  --err: #e0605d;
  --radius: 10px;
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 500px at 15% -10%, rgba(212, 162, 76, 0.07), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.6 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

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

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ───────────── Kopfzeile ───────────── */

header.top {
  border-bottom: 1px solid var(--line);
  background: rgba(16, 16, 14, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.top-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 60px;
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

nav.main { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
nav.main a {
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
}
nav.main a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
nav.main a.active { color: var(--accent); background: var(--accent-soft); }

.top form.quick { display: flex; }
.top form.quick input {
  width: 190px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 7px 11px;
  border-radius: 7px;
  font-size: 14px;
}
.top form.quick input:focus { outline: none; border-color: var(--accent); }

/* ───────────── Bausteine ───────────── */

main { padding: 30px 0 70px; }

h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 19px; margin: 34px 0 14px; }
h3 { font-size: 16px; margin: 0 0 8px; }
.sub { color: var(--muted); margin: 0 0 26px; font-size: 14px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: block;
  color: inherit;
  transition: border-color .15s, transform .15s;
}
a.card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.card h3 { color: var(--text); }
.card p { color: var(--muted); font-size: 13.5px; margin: 6px 0 0; }

.meta { color: var(--muted); font-size: 12.5px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.meta .sep { opacity: .4; }

.stat { text-align: center; padding: 18px 12px; }
.stat .num { font-size: 27px; font-weight: 700; color: var(--accent); line-height: 1.2; }
.stat .lbl { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; }

/* ───────────── Badges & Tags ───────────── */

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.badge.accent { background: var(--accent-soft); border-color: rgba(212,162,76,.4); color: var(--accent); }
.badge.draft { background: rgba(224,96,93,.12); border-color: rgba(224,96,93,.4); color: var(--err); }
.badge.ok { background: rgba(111,191,115,.12); border-color: rgba(111,191,115,.35); color: var(--ok); }
.badge.tier { font-family: var(--mono); font-weight: 700; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag {
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
}
a.tag:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

/* ───────────── Formulare ───────────── */

label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--text); }
label .hint { font-weight: 400; color: var(--muted); font-size: 12px; }

input[type=text], input[type=password], input[type=url], input[type=search],
input[type=file], select, textarea {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 9px 11px;
  border-radius: 7px;
  font-family: inherit;
  font-size: 14px;
}
textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
textarea.md { font-family: var(--mono); font-size: 13.5px; min-height: 260px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }

.field { margin-bottom: 16px; }
.row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin: 0 0 18px;
  background: var(--panel);
}
legend { padding: 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 700; }

.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }
.check label { margin: 0; }

/* ───────────── Buttons ───────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1a1408; }
.btn.primary:hover { filter: brightness(1.08); color: #1a1408; }
.btn.danger { color: var(--err); border-color: rgba(224,96,93,.4); }
.btn.danger:hover { background: rgba(224,96,93,.12); border-color: var(--err); color: var(--err); }
.btn.small { padding: 5px 11px; font-size: 12.5px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ───────────── Meldungen ───────────── */

.flash {
  padding: 11px 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  border: 1px solid;
}
.flash.ok { background: rgba(111,191,115,.1); border-color: rgba(111,191,115,.35); color: var(--ok); }
.flash.error { background: rgba(224,96,93,.1); border-color: rgba(224,96,93,.35); color: var(--err); }
.flash.info { background: rgba(90,169,221,.1); border-color: rgba(90,169,221,.35); color: var(--info); }

/* ───────────── Tabellen ───────────── */

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--panel-2); }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }

/* ───────────── Detailansicht ───────────── */

.detail-head { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 26px; }
.detail-head .thumb {
  width: 260px; border-radius: var(--radius); border: 1px solid var(--line);
  object-fit: cover; max-height: 190px;
}
.detail-head .head-text { flex: 1; min-width: 260px; }

.specs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-bottom: 26px; }
.spec {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 15px;
}
.spec .k { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 3px; }
.spec .v { font-size: 14px; white-space: pre-wrap; }

.prose { line-height: 1.75; }
.prose h1, .prose h2, .prose h3 { margin: 26px 0 10px; }
.prose h2 { font-size: 18px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.prose code {
  background: var(--panel-2); padding: 2px 6px; border-radius: 4px;
  font-family: var(--mono); font-size: 13px; color: var(--accent);
}
.prose pre {
  background: var(--bg-soft); border: 1px solid var(--line); padding: 14px;
  border-radius: 8px; overflow-x: auto;
}
.prose pre code { background: none; padding: 0; color: var(--text); }
.prose blockquote {
  border-left: 3px solid var(--accent); margin: 16px 0; padding: 4px 0 4px 16px; color: var(--muted);
}
.prose img { max-width: 100%; border-radius: 8px; }
.prose table { margin: 16px 0; }
.prose ul, .prose ol { padding-left: 22px; }

.video { aspect-ratio: 16/9; width: 100%; border: 1px solid var(--line); border-radius: var(--radius); margin: 24px 0; }

/* ───────────── Filterleiste ───────────── */

.filters {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; margin-bottom: 22px;
}
.filters .field { margin: 0; min-width: 150px; flex: 1; }

/* ───────────── Login ───────────── */

.login-wrap { max-width: 380px; margin: 90px auto; }

/* ───────────── Fußzeile ───────────── */

footer.bottom {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  padding: 20px 0;
}
footer.bottom .wrap { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty p { margin: 8px 0 18px; }

.mono { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.muted { color: var(--muted); }
.mt { margin-top: 22px; }

@media (max-width: 640px) {
  .top-inner { height: auto; padding: 10px 0; }
  .top form.quick input { width: 140px; }
  .detail-head .thumb { width: 100%; max-height: 220px; }
}

/* ───────────── Bildergalerie ───────────── */

.galerie {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  margin-bottom: 26px;
}
.galerie figure { margin: 0; }
.galerie img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: block;
  transition: border-color .15s, transform .15s;
}
.galerie a:hover img { border-color: var(--accent); transform: translateY(-2px); }
.galerie figcaption {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 6px;
  line-height: 1.45;
}

/* Galerie im Bearbeiten-Formular */
.galerie-raster {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}
.galerie-raster:empty { display: none; }
.galerie-raster.neu { margin-top: 12px; }
.galerie-bild {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  margin: 0;
}
.galerie-bild img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.galerie-bild figcaption {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 6px;
  word-break: break-all;
}
.galerie-bild .bu { margin-top: 8px; font-size: 12.5px; padding: 5px 8px; }
.galerie-bild .behalten {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
}
.galerie-bild .behalten input { width: auto; }

.cover-preview {
  max-width: 260px;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: block;
  margin-top: 10px;
}

.trenner {
  border: none;
  border-top: 1px solid var(--line);
  margin: 22px 0 18px;
}
