/* =========================================================
   Drei R GmbH – Admin-Dashboard
   ========================================================= */

@font-face { font-family: "Jakarta"; src: url("/assets/fonts/jakarta.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Jakarta"; src: url("/assets/fonts/jakarta-italic.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }

:root {
  --bg: #09080a;
  --bg-2: #0f0e0d;
  --karte: #151311;
  --karte-2: #1c1a17;
  --karte-3: #24211d;
  --linie: rgba(246, 240, 225, .08);
  --linie-2: rgba(246, 240, 225, .14);
  --creme: #f6f0e1;
  --text: rgba(246, 240, 225, .86);
  --leise: rgba(246, 240, 225, .55);
  --sehr-leise: rgba(246, 240, 225, .32);
  --gold: #dca800;
  --gold-hell: #f2c94c;
  --gold-text: #f0c234;
  --gold-weich: rgba(220, 168, 0, .12);
  --gruen: #34d399; --gruen-weich: rgba(52, 211, 153, .12);
  --rot: #f87171; --rot-weich: rgba(248, 113, 113, .12);
  --blau: #60a5fa; --blau-weich: rgba(96, 165, 250, .12);
  --lila: #a78bfa; --lila-weich: rgba(167, 139, 250, .12);
  --orange: #fb923c; --orange-weich: rgba(251, 146, 60, .12);
  --r: 18px; --r-k: 12px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --seite: 264px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 14.5px/1.55 "Jakarta", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
img { display: block; max-width: 100%; }
svg { flex-shrink: 0; }
::selection { background: var(--gold); color: var(--bg); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--karte-3); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Ladebildschirm ---------- */
.lade-bildschirm { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 20px; }
.lade-bildschirm img { width: 64px; animation: atmen 1.6s ease-in-out infinite; }
.lade-balken { width: 120px; height: 2px; background: var(--linie); overflow: hidden; border-radius: 2px; }
.lade-balken i { display: block; height: 100%; width: 40%; background: var(--gold); animation: laden 1.1s var(--ease) infinite; }
@keyframes laden { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
@keyframes atmen { 50% { transform: scale(.92); opacity: .7; } }

/* =========================================================
   Login
   ========================================================= */
.login {
  min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 20px;
  position: relative; overflow: hidden; isolation: isolate;
}
.login::before {
  content: ""; position: absolute; inset: -20%; z-index: -2;
  background:
    radial-gradient(circle at 30% 30%, rgba(220, 168, 0, .22), transparent 40%),
    radial-gradient(circle at 75% 70%, rgba(220, 168, 0, .12), transparent 45%);
  animation: login-drift 18s ease-in-out infinite alternate;
}
.login::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(var(--linie) 1px, transparent 1px), linear-gradient(90deg, var(--linie) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 0%, transparent 65%); mask-image: radial-gradient(circle at 50% 50%, #000 0%, transparent 65%);
}
@keyframes login-drift { to { transform: translate(6%, -4%) rotate(8deg); } }
.login-karte {
  width: min(420px, 100%); padding: 40px 34px 34px; border-radius: 28px; text-align: center;
  background: rgba(21, 19, 17, .82); border: 1px solid var(--linie-2);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: 0 40px 120px -40px rgba(220, 168, 0, .45);
  animation: rein .8s var(--ease) both;
}
.login-logo { width: 74px; margin: 0 auto 18px; filter: drop-shadow(0 10px 30px rgba(220, 168, 0, .35)); }
.login h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--creme); }
.login p { margin: 6px 0 26px; color: var(--leise); }
.login form { display: grid; gap: 12px; text-align: left; }
.login .fehler { min-height: 20px; font-size: 13px; color: var(--rot); text-align: center; }
.passwort-feld { position: relative; }
.passwort-feld button { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--leise); padding: 6px; }
.passwort-feld button:hover { color: var(--creme); }
.passwort-feld svg { width: 18px; height: 18px; }
.staerke { height: 4px; border-radius: 4px; background: var(--linie); overflow: hidden; }
.staerke i { display: block; height: 100%; width: 0; transition: width .3s, background .3s; }

/* =========================================================
   Grundlayout
   ========================================================= */
.layout { display: grid; grid-template-columns: var(--seite) 1fr; min-height: 100vh; }
.seitenleiste {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px; padding: 20px 14px;
  background: var(--bg-2); border-right: 1px solid var(--linie);
}
.sl-kopf { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; }
.sl-kopf img { width: 34px; }
.sl-kopf b { display: block; font-size: 16px; font-weight: 700; color: var(--creme); letter-spacing: -.02em; }
.sl-kopf b i { font-style: normal; color: var(--gold); }
.sl-kopf small { font-size: 12px; color: var(--leise); }
.sl-gruppe { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sehr-leise); padding: 16px 12px 6px; }
.sl-link {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
  color: var(--leise); font-weight: 500; transition: background .2s, color .2s;
}
.sl-link svg { width: 18px; height: 18px; }
.sl-link:hover { background: var(--karte); color: var(--creme); }
.sl-link.aktiv { background: var(--gold-weich); color: var(--gold-text); }
.sl-link.aktiv::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.sl-zahl { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--gold); color: var(--bg); }
.sl-fuss { margin-top: auto; padding-top: 16px; display: grid; gap: 4px; border-top: 1px solid var(--linie); }

.haupt { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 14px 28px; background: rgba(9, 8, 10, .82); border-bottom: 1px solid var(--linie);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.topbar h1 { font-size: 18px; font-weight: 700; color: var(--creme); letter-spacing: -.02em; }
.topbar .krumen { font-size: 13px; color: var(--leise); }
.topbar .rechts { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.menue-knopf { display: none; }
.inhalt { padding: 28px; max-width: 1480px; width: 100%; animation: rein .5s var(--ease) both; }
@keyframes rein { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* =========================================================
   Bausteine
   ========================================================= */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  height: 40px; padding: 0 16px; border-radius: 11px; font-weight: 600; font-size: 14px;
  background: var(--karte-2); border: 1px solid var(--linie-2); color: var(--creme);
  transition: background .2s, border-color .2s, transform .2s, opacity .2s;
}
.knopf:hover { background: var(--karte-3); border-color: rgba(246, 240, 225, .22); }
.knopf:active { transform: scale(.98); }
.knopf svg { width: 17px; height: 17px; }
.knopf.gold { background: linear-gradient(135deg, var(--gold), var(--gold-hell)); border-color: transparent; color: #1a1400; box-shadow: 0 10px 26px -12px rgba(220, 168, 0, .7); }
.knopf.gold:hover { filter: brightness(1.06); }
.knopf.rot { background: var(--rot-weich); border-color: rgba(248, 113, 113, .3); color: var(--rot); }
.knopf.rot:hover { background: rgba(248, 113, 113, .2); }
.knopf.gruen { background: var(--gruen-weich); border-color: rgba(52, 211, 153, .3); color: var(--gruen); }
.knopf.geist { background: transparent; border-color: transparent; color: var(--leise); }
.knopf.geist:hover { background: var(--karte); color: var(--creme); }
.knopf.klein { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.knopf.symbol-k { width: 40px; padding: 0; }
.knopf.klein.symbol-k { width: 32px; }
.knopf.gross { height: 50px; padding: 0 22px; font-size: 15px; border-radius: 14px; }
.knopf[disabled] { opacity: .45; pointer-events: none; }
.knopf .dreher { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: drehen .7s linear infinite; }
@keyframes drehen { to { transform: rotate(1turn); } }

.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--r); padding: 22px; }
.karte-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.karte-kopf h2, .karte-kopf h3 { font-size: 16px; font-weight: 700; color: var(--creme); letter-spacing: -.01em; }
.karte-kopf p { font-size: 13px; color: var(--leise); }
.raster { display: grid; gap: 18px; }
.raster-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.raster-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.raster-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.raster-haupt { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
.zeile { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.zeile.ende { justify-content: flex-end; }
.zeile.zwischen { justify-content: space-between; }
.leise { color: var(--leise); }
.klein-text { font-size: 13px; }
.gold-text { color: var(--gold-text); }
.trenner { height: 1px; background: var(--linie); margin: 18px 0; }
.leer { padding: 50px 20px; text-align: center; color: var(--leise); }
.leer svg { width: 42px; height: 42px; color: var(--sehr-leise); margin: 0 auto 12px; }
.leer b { display: block; color: var(--creme); font-size: 16px; margin-bottom: 4px; }

/* Begrüßung */
.begruessung { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.begruessung h2 { font-size: 28px; font-weight: 700; letter-spacing: -.03em; color: var(--creme); }
.begruessung h2 em { font-style: italic; font-weight: 500; color: var(--gold-text); }
.begruessung p { color: var(--leise); }

/* Kennzahlen */
.kpi { position: relative; overflow: hidden; }
.kpi .kpi-kopf { display: flex; align-items: center; justify-content: space-between; color: var(--leise); font-size: 13px; font-weight: 600; }
.kpi .kpi-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--gold-weich); color: var(--gold); }
.kpi .kpi-ico svg { width: 19px; height: 19px; }
.kpi strong { display: block; margin-top: 14px; font-size: 30px; font-weight: 700; letter-spacing: -.03em; color: var(--creme); line-height: 1.1; }
.kpi small { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 12.5px; color: var(--leise); }
.trend-hoch { color: var(--gruen) !important; }
.trend-runter { color: var(--rot) !important; }
.kpi.hervor { background: linear-gradient(140deg, rgba(220, 168, 0, .18), var(--karte) 60%); border-color: rgba(220, 168, 0, .3); }

/* Abzeichen / Status */
.abz {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--karte-3); color: var(--text);
}
.abz::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.abz.ohne-punkt::before { display: none; }
.abz.gold { background: var(--gold-weich); color: var(--gold-text); }
.abz.gruen { background: var(--gruen-weich); color: var(--gruen); }
.abz.rot { background: var(--rot-weich); color: var(--rot); }
.abz.blau { background: var(--blau-weich); color: var(--blau); }
.abz.lila { background: var(--lila-weich); color: var(--lila); }
.abz.orange { background: var(--orange-weich); color: var(--orange); }
.abz.grau { color: var(--leise); }

/* Tabs */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 13px; background: var(--karte); border: 1px solid var(--linie); width: max-content; max-width: 100%; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--leise); white-space: nowrap; transition: all .2s; }
.tab:hover { color: var(--creme); }
.tab.aktiv { background: var(--karte-3); color: var(--creme); box-shadow: 0 1px 0 rgba(255,255,255,.04) inset; }
.tab .zahl { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--karte-2); color: var(--leise); }
.tab.aktiv .zahl { background: var(--gold); color: var(--bg); }

/* Formulare */
.feld { display: grid; gap: 6px; }
.feld > label, .feld-titel { font-size: 12.5px; font-weight: 600; color: var(--leise); }
.feld .hilfe { font-size: 12px; color: var(--sehr-leise); }
.eingabe, .feld input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]), .feld select, .feld textarea {
  width: 100%; height: 42px; padding: 0 13px; border-radius: 11px;
  background: var(--bg-2); border: 1px solid var(--linie-2); color: var(--creme); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.feld textarea, textarea.eingabe { height: auto; min-height: 92px; padding: 11px 13px; resize: vertical; line-height: 1.55; }
.feld select, select.eingabe { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dca800' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
.eingabe:focus, .feld input:focus, .feld select:focus, .feld textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(220, 168, 0, .12); }
.eingabe::placeholder, .feld input::placeholder, .feld textarea::placeholder { color: var(--sehr-leise); }
.feld-raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.feld-raster .breit { grid-column: 1 / -1; }
.mit-einheit { position: relative; }
.mit-einheit span { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--leise); font-size: 13px; pointer-events: none; }
.mit-einheit input { padding-right: 40px !important; }

.schalter { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.schalter input { display: none; }
.schalter i { position: relative; width: 40px; height: 23px; border-radius: 999px; background: var(--karte-3); border: 1px solid var(--linie-2); transition: background .25s; flex-shrink: 0; }
.schalter i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 15px; height: 15px; border-radius: 50%; background: var(--creme); transition: transform .3s var(--ease); }
.schalter input:checked + i { background: var(--gold); border-color: var(--gold); }
.schalter input:checked + i::after { transform: translateX(17px); background: #1a1400; }

/* Regler (Schieberegler) */
.regler-feld { display: grid; gap: 10px; }
.regler-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.regler-wert { font-size: 26px; font-weight: 700; color: var(--creme); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 99px; outline: none; cursor: pointer;
  background: linear-gradient(90deg, var(--gold), var(--gold-hell) var(--p, 0%), var(--karte-3) var(--p, 0%));
}
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--creme); border: 5px solid var(--gold); box-shadow: 0 0 0 5px rgba(220, 168, 0, .18); transition: transform .2s var(--ease); }
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.12); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--creme); border: 5px solid var(--gold); }
.regler-schnell { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-k { height: 28px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; background: var(--karte-2); border: 1px solid var(--linie); color: var(--text); transition: all .2s; }
.chip-k:hover { border-color: rgba(220, 168, 0, .45); }
.chip-k.aktiv { background: var(--gold); color: var(--bg); border-color: var(--gold); }

/* Segment-Wahl (z. B. Einmalig / Monatlich / Raten) */
.segment { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.segment button {
  display: grid; justify-items: center; gap: 4px; padding: 12px 8px; border-radius: 12px; text-align: center;
  background: var(--bg-2); border: 1px solid var(--linie-2); color: var(--leise); font-weight: 600; font-size: 13px;
  transition: all .2s;
}
.segment button svg { width: 20px; height: 20px; }
.segment button:hover { color: var(--creme); border-color: rgba(220, 168, 0, .4); }
.segment button.aktiv { background: var(--gold-weich); border-color: var(--gold); color: var(--gold-text); }

/* Tabellen / Listen */
.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th { text-align: left; font-size: 12px; font-weight: 600; color: var(--sehr-leise); padding: 0 14px 10px; white-space: nowrap; }
.tabelle td { padding: 13px 14px; border-top: 1px solid var(--linie); vertical-align: middle; }
.tabelle tr.klickbar { cursor: pointer; transition: background .15s; }
.tabelle tr.klickbar:hover td { background: rgba(246, 240, 225, .025); }
.tabelle .rechts, .rechts-b { text-align: right; }
.tabelle b { color: var(--creme); font-weight: 600; }
.tabellen-rahmen { overflow-x: auto; margin: 0 -22px -22px; padding: 0 8px 8px; }

.liste-eintrag {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 13px;
  transition: background .15s; cursor: pointer;
}
.liste-eintrag:hover { background: var(--karte-2); }
.liste-eintrag.aktiv { background: var(--gold-weich); }
.avatar { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; background: var(--karte-3); color: var(--gold-text); font-weight: 700; font-size: 15px; }
.avatar.neu { background: var(--gold); color: var(--bg); }
.le-text { flex: 1; min-width: 0; }
.le-text b { display: block; color: var(--creme); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.le-text small { display: block; color: var(--leise); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.punkt-neu { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px var(--gold-weich); flex-shrink: 0; }

/* Detail-Felder */
.detail-liste { display: grid; gap: 2px; }
.detail-liste > div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--linie); }
.detail-liste dt { color: var(--leise); font-size: 13px; }
.detail-liste dd { color: var(--creme); font-weight: 500; overflow-wrap: anywhere; }

/* Toasts */
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: grid; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 420px; padding: 13px 16px; border-radius: 14px;
  background: var(--karte-2); border: 1px solid var(--linie-2); color: var(--creme); box-shadow: 0 20px 50px -20px #000;
  animation: toast-rein .45s var(--ease) both;
}
.toast.weg { animation: toast-raus .3s var(--ease) both; }
.toast svg { width: 18px; height: 18px; }
.toast.ok svg { color: var(--gruen); }
.toast.fehler { border-color: rgba(248, 113, 113, .35); }
.toast.fehler svg { color: var(--rot); }
@keyframes toast-rein { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toast-raus { to { opacity: 0; transform: translateX(30px); } }

/* Modal */
.modal-hg { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(5, 4, 6, .7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: einblenden .25s both; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; border-radius: 22px; background: var(--karte); border: 1px solid var(--linie-2); box-shadow: 0 40px 120px -30px #000; animation: modal-rein .45s var(--ease) both; }
.modal.breit { width: min(980px, 100%); }
.modal.sehr-breit { width: min(1240px, 100%); }
.modal-kopf { display: flex; align-items: center; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--linie); }
.modal-kopf h2 { font-size: 18px; font-weight: 700; color: var(--creme); letter-spacing: -.02em; }
.modal-kopf p { font-size: 13px; color: var(--leise); }
.modal-kopf .x { margin-left: auto; }
.modal-inhalt { padding: 22px; overflow-y: auto; }
.modal-fuss { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--linie); flex-wrap: wrap; }
@keyframes einblenden { from { opacity: 0; } }
@keyframes modal-rein { from { opacity: 0; transform: translateY(24px) scale(.97); } }

/* Seitliches Panel */
.panel-hg { position: fixed; inset: 0; z-index: 150; background: rgba(5, 4, 6, .55); animation: einblenden .25s both; }
.panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 151; width: min(560px, 100%); display: flex; flex-direction: column; background: var(--karte); border-left: 1px solid var(--linie-2); box-shadow: -30px 0 80px -30px #000; animation: panel-rein .45s var(--ease) both; }
@keyframes panel-rein { from { transform: translateX(40px); opacity: 0; } }

/* Hinweisboxen */
.hinweis { display: flex; gap: 12px; padding: 13px 15px; border-radius: 13px; font-size: 13.5px; background: var(--karte-2); border: 1px solid var(--linie); }
.hinweis svg { width: 18px; height: 18px; margin-top: 1px; }
.hinweis.gold { background: var(--gold-weich); border-color: rgba(220, 168, 0, .3); color: #f5dc8f; }
.hinweis.gold svg { color: var(--gold); }
.hinweis.rot { background: var(--rot-weich); border-color: rgba(248, 113, 113, .3); color: #fecaca; }
.hinweis.rot svg { color: var(--rot); }
.hinweis.gruen { background: var(--gruen-weich); border-color: rgba(52, 211, 153, .3); color: #bbf7d0; }
.hinweis.gruen svg { color: var(--gruen); }
.hinweise { display: grid; gap: 8px; }

/* Speicher-Leiste */
.speicher-leiste {
  position: sticky; bottom: 16px; z-index: 15; margin-top: 22px;
  display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 18px; border-radius: 16px;
  background: rgba(28, 26, 23, .92); border: 1px solid var(--linie-2); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 20px 50px -20px #000; transform: translateY(140%); opacity: 0; transition: transform .45s var(--ease), opacity .3s;
}
.speicher-leiste.sichtbar { transform: none; opacity: 1; }
.speicher-leiste .punkt-neu { animation: puls 1.6s infinite; }
@keyframes puls { 50% { box-shadow: 0 0 0 8px rgba(220, 168, 0, 0); } }

/* =========================================================
   Inhalts-Editor (Formulare aus Schema)
   ========================================================= */
.editor-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: start; }
.unternav { position: sticky; top: 84px; display: grid; gap: 2px; }
.unternav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--leise); font-weight: 500; }
.unternav a svg { width: 16px; height: 16px; }
.unternav a:hover { background: var(--karte); color: var(--creme); }
.unternav a.aktiv { background: var(--karte-2); color: var(--creme); box-shadow: inset 2px 0 0 var(--gold); }
.schema { display: grid; gap: 16px; }
.liste-feld { display: grid; gap: 10px; }
.liste-element { border: 1px solid var(--linie); border-radius: 14px; background: var(--bg-2); overflow: hidden; }
.liste-element-kopf { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; }
.liste-element-kopf .nr { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--karte-3); color: var(--gold-text); font-size: 12px; font-weight: 700; }
.liste-element-kopf b { flex: 1; min-width: 0; color: var(--creme); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.liste-element-kopf .chev { width: 16px; height: 16px; color: var(--leise); transition: transform .3s var(--ease); }
.liste-element.offen .chev { transform: rotate(180deg); }
.liste-element-inhalt { display: none; padding: 4px 14px 16px; }
.liste-element.offen .liste-element-inhalt { display: grid; gap: 14px; }
.tags-feld { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; min-height: 42px; border-radius: 11px; background: var(--bg-2); border: 1px solid var(--linie-2); }
.tags-feld:focus-within { border-color: var(--gold); }
.tag-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 10px; border-radius: 8px; background: var(--karte-3); font-size: 13px; color: var(--creme); }
.tag-chip button { color: var(--leise); display: grid; place-items: center; }
.tag-chip button svg { width: 13px; height: 13px; }
.tags-feld input { flex: 1; min-width: 120px; border: 0 !important; background: transparent !important; height: 28px !important; box-shadow: none !important; padding: 0 6px !important; }

/* Bild-Feld */
.bild-feld { display: flex; gap: 14px; align-items: center; padding: 10px; border-radius: 13px; background: var(--bg-2); border: 1px solid var(--linie-2); }
.bild-feld .vorschau { width: 96px; height: 66px; border-radius: 9px; overflow: hidden; background: var(--karte-3) center/cover; flex-shrink: 0; display: grid; place-items: center; color: var(--sehr-leise); }
.bild-feld .vorschau svg { width: 22px; height: 22px; }
.bild-feld .info { flex: 1; min-width: 0; font-size: 12.5px; color: var(--leise); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-wahl { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; max-height: 260px; overflow-y: auto; }
.icon-wahl button { height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--bg-2); border: 1px solid var(--linie); color: var(--text); }
.icon-wahl button:hover, .icon-wahl button.aktiv { border-color: var(--gold); color: var(--gold); background: var(--gold-weich); }
.icon-wahl svg { width: 20px; height: 20px; }
.icon-knopf { display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px; border-radius: 11px; background: var(--bg-2); border: 1px solid var(--linie-2); color: var(--creme); }
.icon-knopf svg { width: 20px; height: 20px; color: var(--gold); }

/* Medien-Raster */
.medien-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.medium { position: relative; border-radius: 14px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--linie); cursor: pointer; transition: border-color .2s, transform .2s; }
.medium:hover { border-color: var(--gold); transform: translateY(-2px); }
.medium img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--karte-3); }
.medium span { display: block; padding: 8px 10px; font-size: 12px; color: var(--leise); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.medium .medium-aktionen { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .2s; }
.medium:hover .medium-aktionen { opacity: 1; }
.ablage {
  display: grid; place-items: center; gap: 8px; padding: 30px; border-radius: 16px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--linie-2); background: var(--bg-2); color: var(--leise); transition: all .2s;
}
.ablage svg { width: 30px; height: 30px; color: var(--gold); }
.ablage:hover, .ablage.drueber { border-color: var(--gold); background: var(--gold-weich); color: var(--creme); }

/* Diagramme */
.diagramm { width: 100%; height: auto; display: block; }
.sl-link { width: 100%; text-align: left; }
.diagramm text { fill: var(--sehr-leise); font-size: 11px; font-family: inherit; }
.balken-liste { display: grid; gap: 10px; }
.balken-zeile { display: grid; grid-template-columns: 140px 1fr 56px; gap: 12px; align-items: center; font-size: 13px; }
.balken-zeile .spur { height: 10px; border-radius: 99px; background: var(--karte-3); overflow: hidden; }
.balken-zeile .spur i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold), var(--gold-hell)); transform-origin: left; animation: wachsen 1s var(--ease) both; }
.balken-zeile b { text-align: right; color: var(--creme); }
.balken-zeile span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes wachsen { from { transform: scaleX(0); } }
.trichter { display: grid; gap: 8px; }
.trichter-stufe { position: relative; display: flex; justify-content: space-between; align-items: center; height: 42px; padding: 0 14px; border-radius: 10px; overflow: hidden; font-size: 13px; }
.trichter-stufe i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, rgba(220, 168, 0, .35), rgba(220, 168, 0, .12)); border-radius: 10px; transform-origin: left; animation: wachsen 1s var(--ease) both; }
.trichter-stufe span, .trichter-stufe b { position: relative; }
.trichter-stufe b { color: var(--creme); }
.donut-legende { display: grid; gap: 10px; }
.donut-legende div { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.donut-legende i { width: 10px; height: 10px; border-radius: 3px; }

/* Rechnungs-Editor */
.rechnung-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); gap: 22px; align-items: start; }
.positionen { display: grid; gap: 10px; }
.position { display: grid; grid-template-columns: 1fr 80px 90px 130px 84px 36px; gap: 8px; align-items: start; }
.position .eingabe { height: 40px; }
.position textarea.eingabe { min-height: 40px; height: 40px; resize: vertical; padding-top: 9px; }
.position-kopf { font-size: 11.5px; font-weight: 600; color: var(--sehr-leise); }
.summen { display: grid; gap: 6px; margin-left: auto; width: min(320px, 100%); }
.summen div { display: flex; justify-content: space-between; font-size: 14px; }
.summen .gesamt { padding-top: 10px; margin-top: 4px; border-top: 1px solid var(--linie-2); font-size: 18px; font-weight: 700; color: var(--creme); }
.plan-tabelle { width: 100%; font-size: 13px; border-collapse: collapse; }
.plan-tabelle td { padding: 7px 0; border-top: 1px solid var(--linie); }
.plan-tabelle td:last-child { text-align: right; font-weight: 600; color: var(--creme); }

/* Papier-Vorschau (A4) */
.papier-rahmen { position: sticky; top: 84px; }
.papier {
  width: 100%; aspect-ratio: 210 / 297; background: #fff; color: #1b1813; border-radius: 6px; overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8); position: relative;
  container-type: inline-size; font-family: Helvetica, Arial, sans-serif;
}
.papier-innen { position: absolute; inset: 0; padding: 7cqw 8cqw 16cqw 9cqw; font-size: 1.75cqw; line-height: 1.45; overflow: hidden; }
.papier .p-logo { display: flex; align-items: center; gap: 1.5cqw; }
.papier .p-logo img { width: 7cqw; }
.papier .p-logo b { font-size: 3cqw; }
.papier .p-logo b i { font-style: normal; color: #b48a00; }
.papier .p-absender { margin-top: 6cqw; font-size: 1.3cqw; color: #777; text-decoration: underline; }
.papier .p-kopf { display: flex; justify-content: space-between; gap: 4cqw; margin-top: 1.5cqw; }
.papier .p-info { text-align: right; font-size: 1.6cqw; }
.papier .p-info b { display: inline-block; min-width: 18cqw; text-align: left; color: #777; font-weight: 400; }
.papier h4 { font-size: 3.4cqw; margin: 6cqw 0 2cqw; }
.papier table { width: 100%; border-collapse: collapse; margin-top: 2cqw; }
.papier th { text-align: left; font-size: 1.45cqw; color: #777; font-weight: 600; border-bottom: .2cqw solid #1b1813; padding: .8cqw .6cqw; }
.papier td { padding: .9cqw .6cqw; border-bottom: .1cqw solid #e5e0d6; vertical-align: top; }
.papier .r { text-align: right; white-space: nowrap; }
.papier .p-summen { margin: 2cqw 0 0 auto; width: 45%; }
.papier .p-summen div { display: flex; justify-content: space-between; padding: .4cqw 0; }
.papier .p-summen .g { font-weight: 700; border-top: .2cqw solid #1b1813; margin-top: .6cqw; padding-top: 1cqw; font-size: 2cqw; }
.papier .p-hinweis { margin-top: 2.2cqw; font-size: 1.45cqw; color: #555; }
.papier .p-fuss { position: absolute; left: 9cqw; right: 8cqw; bottom: 5cqw; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2cqw; padding-top: 1.5cqw; border-top: .1cqw solid #ddd; font-size: 1.2cqw; color: #777; }
.papier .p-wasser { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-24deg); font-size: 12cqw; font-weight: 800; color: rgba(220, 168, 0, .1); pointer-events: none; }
.papier .md h2 { font-size: 2.2cqw; margin: 3cqw 0 1cqw; }
.papier .md h1 { font-size: 3.4cqw; margin: 2cqw 0 2cqw; }
.papier .md p { margin: 0 0 1.4cqw; }

/* Bild-Generator */
.generator { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.generator canvas { width: 100%; height: auto; border-radius: 14px; box-shadow: 0 30px 80px -30px #000; background: var(--karte-3); }
.farb-wahl { display: flex; gap: 8px; flex-wrap: wrap; }
.farb-wahl button { width: 44px; height: 44px; border-radius: 12px; border: 2px solid transparent; transition: transform .2s; }
.farb-wahl button.aktiv { border-color: var(--creme); transform: scale(1.06); }

/* Leistungs-Karten im Admin */
.leistungs-karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.l-karte { border-radius: var(--r); overflow: hidden; background: var(--karte); border: 1px solid var(--linie); display: flex; flex-direction: column; transition: border-color .2s, transform .3s var(--ease); }
.l-karte:hover { border-color: rgba(220, 168, 0, .4); transform: translateY(-3px); }
.l-karte img { width: 100%; aspect-ratio: 16 / 11; object-fit: cover; background: var(--karte-3); }
.l-karte .l-text { padding: 16px; display: grid; gap: 6px; flex: 1; }
.l-karte .l-text b { color: var(--creme); font-size: 15px; }
.l-karte .l-text p { font-size: 13px; color: var(--leise); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.l-karte .l-fuss { display: flex; gap: 6px; padding: 0 16px 16px; }
.l-karte.inaktiv img { filter: grayscale(1) brightness(.5); }
.neu-karte { display: grid; place-items: center; gap: 10px; min-height: 260px; border-radius: var(--r); border: 1.5px dashed var(--linie-2); color: var(--leise); font-weight: 600; transition: all .2s; }
.neu-karte svg { width: 30px; height: 30px; color: var(--gold); }
.neu-karte:hover { border-color: var(--gold); background: var(--gold-weich); color: var(--creme); }

/* Funnel-Editor */
.frage-karte { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: var(--karte); border: 1px solid var(--linie); }
.frage-karte .fk-nr { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--gold-weich); color: var(--gold-text); font-weight: 700; flex-shrink: 0; }
.frage-karte .fk-text { flex: 1; min-width: 0; }
.frage-karte .fk-text b { display: block; color: var(--creme); }
.frage-karte .fk-text b em { font-style: italic; color: var(--gold-text); font-weight: 500; }
.frage-karte .fk-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.frage-fest { opacity: .65; border-style: dashed; }

/* Markdown-Editor */
.md-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.md-werkzeuge { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.md-editor textarea { min-height: 560px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; line-height: 1.65; }
.md-vorschau { padding: 22px 24px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--linie); max-height: 640px; overflow-y: auto; }
.md-vorschau h2, .md-vorschau h3 { color: var(--gold-text); font-size: 15px; margin: 20px 0 6px; }
.md-vorschau h1 { color: var(--creme); font-size: 22px; margin-bottom: 12px; }
.md-vorschau p, .md-vorschau li { color: var(--text); font-size: 13.5px; margin-bottom: 8px; }
.md-vorschau ul { padding-left: 18px; }
.platzhalter-liste { display: flex; flex-wrap: wrap; gap: 6px; }
.platzhalter-liste button { font-family: ui-monospace, Menlo, monospace; font-size: 12px; padding: 4px 8px; border-radius: 7px; background: var(--karte-2); border: 1px solid var(--linie); color: var(--gold-text); }
.platzhalter-liste button:hover { border-color: var(--gold); }

/* Status-Auswahl (Pipeline) */
.pipeline { display: flex; gap: 6px; flex-wrap: wrap; }
.pipeline button { height: 32px; padding: 0 12px; border-radius: 9px; font-size: 12.5px; font-weight: 600; background: var(--bg-2); border: 1px solid var(--linie-2); color: var(--leise); transition: all .2s; }
.pipeline button:hover { color: var(--creme); }
.pipeline button.aktiv { background: var(--gold); border-color: var(--gold); color: var(--bg); }

/* Schnell-Rechnung */
.betrag-anzeige { text-align: center; padding: 10px 0 4px; }
.betrag-anzeige strong { display: block; font-size: 46px; font-weight: 700; letter-spacing: -.04em; color: var(--creme); font-variant-numeric: tabular-nums; line-height: 1.1; }
.betrag-anzeige small { color: var(--leise); }
.zusammenfassung { display: grid; gap: 8px; padding: 16px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--linie); }
.zusammenfassung div { display: flex; justify-content: space-between; font-size: 13.5px; }
.zusammenfassung .g { font-size: 16px; font-weight: 700; color: var(--creme); border-top: 1px solid var(--linie-2); padding-top: 8px; }
.schritte-anzeige { display: grid; gap: 10px; }
.schritt-zeile { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--leise); }
.schritt-zeile i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--linie-2); }
.schritt-zeile i svg { width: 14px; height: 14px; }
.schritt-zeile.laeuft { color: var(--creme); }
.schritt-zeile.laeuft i { border-color: var(--gold); border-right-color: transparent; animation: drehen .8s linear infinite; }
.schritt-zeile.fertig { color: var(--creme); }
.schritt-zeile.fertig i { background: var(--gruen); border-color: var(--gruen); color: var(--bg); }
.schritt-zeile.fehler i { background: var(--rot); border-color: var(--rot); color: var(--bg); }

/* =========================================================
   Responsiv
   ========================================================= */
@media (max-width: 1280px) {
  .raster-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rechnung-layout { grid-template-columns: 1fr; }
  .papier-rahmen { position: static; max-width: 560px; }
}
@media (max-width: 1080px) {
  .raster-haupt, .raster-3 { grid-template-columns: 1fr; }
  .editor-layout { grid-template-columns: 1fr; }
  .unternav { position: static; display: flex; overflow-x: auto; gap: 4px; }
  .unternav a { white-space: nowrap; }
  .md-editor, .generator { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .seitenleiste { position: fixed; z-index: 100; left: 0; width: 280px; transform: translateX(-100%); transition: transform .4s var(--ease); box-shadow: 30px 0 80px -30px #000; }
  .menue-offen .seitenleiste { transform: none; }
  .menue-knopf { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .inhalt { padding: 18px 14px; }
  .raster-2, .raster-4 { grid-template-columns: 1fr; }
  .feld-raster { grid-template-columns: 1fr; }
  .position { grid-template-columns: 1fr 1fr; }
  .position > :first-child { grid-column: 1 / -1; }
  .position-kopf { display: none; }
  .detail-liste > div { grid-template-columns: 1fr; gap: 2px; }
  .topbar .rechts .knopf span.text { display: none; }
}

/* Anfragen: Liste + Detail */
.anfragen-layout { grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); align-items: start; }
@media (max-width: 1180px) { .anfragen-layout { grid-template-columns: 1fr; } }
[hidden] { display: none !important; }
