/* Aussehen wie die Content-Hub-Übersicht (content-hub/scripts/uebersicht.mjs):
   gleiche Farbwerte, Seitenleiste, Fenster mit Kopfleiste, Karten, Pills. */
:root {
  color-scheme: light;
  --bg: #f4f4f6; --flaeche: #ffffff; --sidebar: #fafafa; --hover: #f1f1f3; --aktiv: #e9e9ec;
  --zeile-hover: #fbfbfc; --kopf-bg: #fafafb;
  --rand: #ebebee; --rand-stark: #dcdce0;
  --text: #18181b; --text-2: #52525b; --gedaempft: #8a8a93;
  --primaer: #111113; --primaer-hover: #2a2a2e; --primaer-text: #ffffff;
  --akzent: #e60023; --akzent-hover: #c4001e;
  --gruen: #15803d; --gruen-bg: #e9f7ee;
  --gelb: #a16207; --gelb-bg: #fdf5dc;
  --rot: #b91c1c; --rot-bg: #fdecec;
  --blau: #2f5f9e; --blau-bg: #eaf1fb;
  --lila: #6d4bc3; --lila-bg: #f1ecfc;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0e0e10; --flaeche: #17171a; --sidebar: #131315; --hover: #222226; --aktiv: #2a2a2f;
    --zeile-hover: #1c1c20; --kopf-bg: #1b1b1f;
    --rand: #29292e; --rand-stark: #3a3a41;
    --text: #ededef; --text-2: #b4b4bb; --gedaempft: #85858e;
    --primaer: #ededef; --primaer-hover: #d4d4d8; --primaer-text: #111113;
    --gruen: #6fc394; --gruen-bg: #1a2e23;
    --gelb: #dcaa54; --gelb-bg: #2f2610;
    --rot: #e8877c; --rot-bg: #36201d;
    --blau: #8db2dd; --blau-bg: #1a2839;
    --lila: #b9a0f0; --lila-bg: #282040;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 15px; line-height: 1.45; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--hover); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Rahmen ------------------------------------------------------------------- */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: var(--sidebar); border-right: 1px solid var(--rand);
  padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
}
.marke { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; text-decoration: none; }
.marke-logo { width: 28px; height: 28px; flex: none; display: block; }
.marke b { font-size: 15.5px; font-weight: 600; display: block; }
.marke span { font-size: 12.5px; color: var(--gedaempft); }
.btn.neu { justify-content: center; margin: 0 4px; }
.nav-gruppe { margin-top: 18px; }
.nav-label { font-size: 12.5px; font-weight: 500; color: var(--gedaempft); padding: 0 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border-radius: 8px;
  text-decoration: none; color: var(--text-2);
}
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--aktiv); color: var(--text); font-weight: 600; }
.badge { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--gedaempft); font-variant-numeric: tabular-nums; }
.badge.warm { color: var(--primaer-text); background: var(--primaer); border-radius: 999px; padding: 1px 7px; }
.sidebar-fuss { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--rand); }
.stand-zeile { padding: 4px 10px; font-size: 13.5px; }
.stand-zeile b { font-weight: 500; }
.stand-zeile small { display: block; font-size: 12.5px; color: var(--gedaempft); padding-left: 14px; }
.punkt { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; flex: none; }
.punkt.ok { background: #22c55e; } .punkt.warn { background: #eab308; } .punkt.neutral { background: var(--rand-stark); }

.haupt { padding: 16px 20px 24px; min-width: 0; }
.fenster { background: var(--flaeche); border: 1px solid var(--rand); border-radius: 16px; min-height: calc(100vh - 80px); }
.kopfleiste {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 24px; min-height: 58px;
  border-bottom: 1px solid var(--rand); position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--flaeche) 92%, transparent); backdrop-filter: blur(8px);
  border-radius: 16px 16px 0 0;
}
.kopfleiste h1 { font-size: 16.5px; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 8px; }
.kopfleiste .rechts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.kopfleiste .rechts form { margin: 0; }
.inhalt { padding: 22px 24px 32px; }
.fuss { color: var(--gedaempft); font-size: 13px; padding: 14px 8px 0; }
.fuss a { color: var(--gedaempft); }

/* Bausteine ---------------------------------------------------------------- */
h2 { font-size: 15.5px; font-weight: 600; margin: 0; }
h3 { font-size: 14.5px; font-weight: 600; margin: 18px 0 8px; }
.muted, .gedaempft { color: var(--gedaempft); }
.small { font-size: 13.5px; }
.error { color: var(--rot); }
.nowrap { white-space: nowrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--rand-stark); background: var(--flaeche);
  border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: 14px; font-weight: 500; white-space: nowrap;
  text-decoration: none; color: var(--text);
}
.btn .ico { width: 16px; height: 16px; }
.btn:hover { background: var(--hover); }
.btn.primaer { background: var(--primaer); border-color: var(--primaer); color: var(--primaer-text); }
.btn.primaer:hover { background: var(--primaer-hover); }
.btn.akzent { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.btn.akzent:hover { background: var(--akzent-hover); }
.btn.gefahr { color: var(--rot); }
.btn.leise { border-color: transparent; background: none; color: var(--text-2); }
.btn.leise:hover { background: var(--hover); color: var(--text); }
.btn.klein { padding: 4px 9px; font-size: 13.5px; }
fieldset:disabled .btn { opacity: .45; cursor: not-allowed; }

.pill {
  display: inline-flex; align-items: center; font-size: 13px; font-weight: 500; line-height: 1.15;
  padding: 4px 8px; border-radius: 6px; background: var(--hover); color: var(--text-2); white-space: nowrap;
}
.pill.gruen { background: var(--gruen-bg); color: var(--gruen); }
.pill.gelb { background: var(--gelb-bg); color: var(--gelb); }
.pill.rot { background: var(--rot-bg); color: var(--rot); }
.pill.blau { background: var(--blau-bg); color: var(--blau); }
.pill.lila { background: var(--lila-bg); color: var(--lila); }
.pill.klein { font-size: 12px; padding: 2px 6px; }

.hinweis { padding: 10px 14px; border-radius: 10px; margin: 0 0 14px; font-size: 14.5px; background: var(--hover); color: var(--text-2); }
.hinweis.ok { background: var(--gruen-bg); color: var(--gruen); }
.hinweis.fehler { background: var(--rot-bg); color: var(--rot); }
.hinweis.warn { background: var(--gelb-bg); color: var(--gelb); }
.hinweis-leiste { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hinweis-leiste span { margin-right: auto; }
.hinweis-leiste select { width: auto; }

.karte { border: 1px solid var(--rand); border-radius: var(--radius); background: var(--flaeche); margin: 0 0 16px; min-width: 0; }
.karte-kopf { display: flex; align-items: center; gap: 10px; padding: 14px 16px 0; flex-wrap: wrap; }
.karte-kopf .rechts { margin-left: auto; display: flex; gap: 8px; }
.karte-kopf form { margin: 0; }
.karte-inhalt { padding: 10px 16px 16px; }
.karte-inhalt > p:first-child { margin-top: 0; }

.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { border: 1px solid var(--rand); border-radius: var(--radius); padding: 12px 16px; min-width: 0; text-decoration: none; display: block; }
a.kpi:hover { background: var(--zeile-hover); }
.kpi small { display: block; font-size: 13px; color: var(--text-2); }
.kpi b { display: block; font-size: 24px; font-weight: 650; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi b.text { font-size: 17px; padding-top: 6px; }

.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--rand); margin-bottom: 14px; overflow-x: auto; }
.tabs a { padding: 9px 0 10px; color: var(--text-2); white-space: nowrap; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a span { color: var(--gedaempft); margin-left: 4px; font-variant-numeric: tabular-nums; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--text); border-color: var(--primaer); font-weight: 600; }

.liste { border: 1px solid var(--rand); border-radius: var(--radius); overflow-x: auto; }
.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th { text-align: left; font-size: 13px; font-weight: 500; color: var(--gedaempft); padding: 10px 12px; border-bottom: 1px solid var(--rand); white-space: nowrap; }
.tabelle td { padding: 10px 12px; border-top: 1px solid var(--rand); vertical-align: middle; }
.tabelle tr:first-child td { border-top: 0; }
.tabelle tbody tr:hover td { background: var(--zeile-hover); }
.tabelle .titel { font-weight: 550; display: block; text-decoration: none; }
.tabelle a.titel:hover { text-decoration: underline; }
.tabelle .unter { display: block; font-size: 13px; color: var(--gedaempft); }
.tabelle .rechts { text-align: right; }
.tabelle.log td { font-size: 13.5px; }
.tabelle.log .fehler td:nth-child(2) { color: var(--rot); font-weight: 500; }
.tabelle.log .ok td:nth-child(2) { color: var(--gruen); font-weight: 500; }
.thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; display: block; background: var(--hover); }
.bulk { margin: 12px 0 0; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; color: var(--text-2); font-size: 14px; }
.leer { color: var(--gedaempft); margin: 8px 0; }

/* Formulare ---------------------------------------------------------------- */
input[type=text], input[type=url], input[type=search], input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; padding: 7px 10px; border: 1px solid var(--rand-stark); border-radius: 8px; background: var(--flaeche); font-size: 14.5px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--blau) 40%, transparent); outline-offset: 0; border-color: var(--blau); }
textarea { resize: vertical; line-height: 1.5; }
.filter { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 16px; }
.filter input, .filter select { width: auto; flex: 1 1 220px; }
.filter select { flex: 0 1 240px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0 0; }
.inline-form input { width: auto; flex: 1 1 200px; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; border: 0; padding: 0; margin: 0; min-width: 0; }
.grid-form label, .feld { display: flex; flex-direction: column; gap: 5px; font-weight: 500; font-size: 13.5px; color: var(--text-2); }
.grid-form .wide { grid-column: 1 / -1; }
.grid-form .check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; color: var(--text); font-size: 14px; }
.grid-form .check input { width: auto; margin: 0; }
.hint { font-weight: 400; color: var(--gedaempft); font-size: 12.5px; }
.label-zeile { display: flex; justify-content: space-between; gap: 8px; }
.count { font-weight: 400; color: var(--gedaempft); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.buttons { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }

/* Artikel ------------------------------------------------------------------ */
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.article-card { border: 1px solid var(--rand); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; background: var(--flaeche); }
.article-card:hover { border-color: var(--rand-stark); }
.article-card img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; background: var(--hover); display: block; }
.article-body { padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.article-body h3 { margin: 0; font-size: 14.5px; line-height: 1.35; }
.article-body .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; align-items: center; }
.article-body .meta .btn { margin-left: auto; }

/* Pin-Editor --------------------------------------------------------------- */
.pin-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.pin-preview { border: 1px solid var(--rand); border-radius: 18px; padding: 10px; position: sticky; top: 78px; background: var(--flaeche); }
.pin-preview img { width: 100%; border-radius: 12px; display: block; margin-bottom: 10px; background: var(--hover); min-height: 140px; object-fit: cover; }
.pin-preview strong { display: block; font-size: 15px; line-height: 1.3; padding: 0 4px; }
.pin-preview p { color: var(--text-2); padding: 0 4px; margin: 6px 0 4px; }
.vorschau-label { font-size: 12.5px; color: var(--gedaempft); margin: 0 0 8px 4px; }
.image-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.pick { position: relative; cursor: pointer; display: block !important; }
.pick input { position: absolute; opacity: 0; }
.pick img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 2px solid var(--rand); display: block; background: var(--hover); }
.pick:hover img { border-color: var(--rand-stark); }
.pick input:checked + img { border-color: var(--akzent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--akzent) 30%, transparent); }
.pick input:focus-visible + img { outline: 2px solid var(--blau); outline-offset: 2px; }
.boards { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; list-style: none; }

/* Öffentliche Seiten ------------------------------------------------------- */
.oeffentlich .kopf { max-width: 860px; margin: 0 auto; padding: 22px 20px 14px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.oeffentlich .kopf .marke { padding: 0; }
.oeffentlich .kopf nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.oeffentlich .kopf nav a { text-decoration: none; color: var(--text-2); padding: 6px 10px; border-radius: 8px; font-size: 14px; }
.oeffentlich .kopf nav a:hover { background: var(--hover); color: var(--text); }
.oeffentlich .fenster { max-width: 860px; margin: 0 auto; min-height: 0; }
.oeffentlich .fuss { max-width: 860px; margin: 0 auto; padding: 16px 20px 30px; }
.prose { padding: 28px 36px 36px; line-height: 1.65; }
.prose h1 { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; margin: 0 0 12px; }
.prose h2 { font-size: 17px; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--text-2); }
.prose strong { color: var(--text); }
.prose a { color: var(--blau); }
.prose .lead { font-size: 17px; color: var(--text); }
.prose li { margin: 5px 0; }
hr { border: 0; border-top: 1px solid var(--rand); margin: 32px 0; }

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pin-layout { grid-template-columns: minmax(0, 1fr) 240px; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--rand); }
  .sidebar-fuss { display: none; }
  .haupt { padding: 8px; }
  .inhalt, .kopfleiste { padding-left: 16px; padding-right: 16px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-form, .pin-layout { grid-template-columns: 1fr; }
  .pin-preview { position: static; }
  .tabelle .opt { display: none; }
  .prose { padding: 20px 18px 26px; }
}
