/* ---------- Farben und Maße ---------- */
:root {
  --akzent: #c5855b;
  --akzent-dunkel: #a3613a;
  --akzent-tief: #8f5330;
  --ink: #2a2420;
  --text: #564b43;
  --leise: #776b61;
  --linie: #e7e1da;
  --grund: #fdfcfa;
  --flaeche: #f5f2ee;
  --warm: #f6ead9;
  --karte: #ffffff;
  --radius: 12px;
  --maxw: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }

/* Auch in der Demo klebt die Kopfleiste oben. */
html { scroll-padding-top: 76px; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--flaeche);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 0.5rem; }
h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
h2 { font-size: 1.05rem; }
p { margin: 0 0 0.8rem; }
a { color: inherit; text-decoration: none; }

:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
  background: var(--akzent); color: #fff; font-weight: 600; z-index: 100;
}
.skip-link:focus {
  position: fixed; top: 0; left: 1rem; width: auto; height: auto; clip: auto;
  padding: 0.7rem 1.2rem; border-radius: 0 0 var(--radius) var(--radius);
}

/* ---------- Kopf ---------- */
.kopf { background: var(--karte); border-bottom: 1px solid var(--linie); position: sticky; top: 0; z-index: 40; }
.kopf-innen {
  max-width: var(--maxw); margin-inline: auto; padding: 0 1.5rem;
  display: flex; align-items: center; gap: 1.5rem; min-height: 60px; flex-wrap: wrap;
}
.marke { display: inline-flex; align-items: baseline; gap: 0.45rem; }
.marke-name { font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); }
.marke-zusatz { font-size: 0.78rem; color: var(--akzent-tief); font-weight: 600; }

.hauptnavi { display: flex; gap: 0.3rem; margin-right: auto; flex-wrap: wrap; }
.hauptnavi a {
  padding: 0.45rem 0.85rem; border-radius: 999px; font-size: 0.94rem; font-weight: 500;
  color: var(--text); transition: background 0.15s ease, color 0.15s ease;
}
.hauptnavi a:hover { background: rgba(197, 133, 91, 0.16); color: var(--ink); }
.hauptnavi a[aria-current="page"] { background: var(--ink); color: #fff; }

.kopf-rechts { display: flex; align-items: center; gap: 0.6rem; }
.thema {
  background: none; border: 0; cursor: pointer; color: var(--text);
  width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
}
.thema:hover { background: rgba(197, 133, 91, 0.16); color: var(--ink); }
.thema .sonne { display: none; }
html[data-theme="dark"] .thema .mond { display: none; }
html[data-theme="dark"] .thema .sonne { display: inline; }
.ruecksetzen { margin: 0; }

.fahne {
  background: var(--warm); color: var(--ink); margin: 0;
  padding: 0.6rem 1.5rem; font-size: 0.88rem; text-align: center;
  border-bottom: 1px solid var(--linie);
}
.fahne a { color: var(--akzent-tief); font-weight: 600; text-decoration: underline; }

/* ---------- Grundgerüst ---------- */
.inhalt { max-width: var(--maxw); margin-inline: auto; padding: 1.8rem 1.5rem 3rem; }
.unterzeile { color: var(--leise); margin-top: -0.3rem; margin-bottom: 1.2rem; }
/* Kurzer Hinweis, was auf dieser Seite möglich ist */
.tipp {
  background: var(--warm); border-radius: var(--radius);
  padding: 0.75rem 1rem; margin-bottom: 1.6rem;
  font-size: 0.92rem; color: var(--ink); max-width: 860px;
}
.tipp strong { font-weight: 600; }
.meldung {
  background: rgba(197, 133, 91, 0.18); border: 1px solid rgba(197, 133, 91, 0.4);
  border-radius: var(--radius); padding: 0.7rem 1rem; color: var(--ink); font-weight: 500;
}
.leer { color: var(--leise); font-style: normal; }
.zurueck { margin-bottom: 0.6rem; }
.zurueck a { color: var(--akzent-tief); font-weight: 600; }
.zurueck a:hover { text-decoration: underline; }
.abstand { margin-top: 1.6rem; }

/* ---------- Knöpfe ---------- */
.knopf {
  display: inline-block; padding: 0.55rem 1.1rem; border-radius: 999px;
  font: inherit; font-size: 0.92rem; font-weight: 600; cursor: pointer;
  background: var(--ink); color: #fff; border: 1px solid var(--ink);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.knopf:hover { background: #3c322a; border-color: #3c322a; }
.knopf-leise {
  background: transparent; color: var(--ink); border-color: var(--linie);
}
.knopf-leise:hover { background: rgba(197, 133, 91, 0.16); border-color: var(--akzent); }
.knopf-leise.ist-aktiv { background: var(--akzent-dunkel); border-color: var(--akzent-dunkel); color: #fff; }
.knopf-warnung { background: transparent; color: #8c3a2e; border-color: #d8b3ac; }
.knopf-warnung:hover { background: #f6e6e2; border-color: #c08c82; }
.ausgang { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.8rem; }

/* ---------- Kennzahlen ---------- */
.kennzahlen {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
  gap: 1rem; margin-bottom: 1.4rem;
}
.kennzahl {
  background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.15rem;
}
.kennzahl-wert { font-size: 1.5rem; font-weight: 700; color: var(--akzent-tief); line-height: 1.2; }
.kennzahl-text { font-size: 0.86rem; color: var(--leise); }

/* ---------- Begrüßung, Personenwechsel, nächste Schritte ---------- */
.wechsel { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; color: var(--leise); font-size: 0.9rem; }
.wer {
  padding: 0.22rem 0.7rem; border-radius: 999px; border: 1px solid var(--linie);
  color: var(--ink); font-weight: 500; background: var(--karte);
}
a.wer:hover { border-color: var(--akzent); background: rgba(197, 133, 91, 0.16); }
.wer.ist-ich { background: var(--ink); color: #fff; border-color: var(--ink); }

.todo { border-color: var(--akzent); }
.schritte { list-style: none; margin: 0; padding: 0; counter-reset: schritt; }
.schritte li {
  display: flex; gap: 1rem; align-items: baseline; justify-content: space-between;
  padding: 0.6rem 0; border-top: 1px solid var(--linie);
}
.schritte li:first-child { border-top: 0; }
.schritte li::before {
  counter-increment: schritt; content: counter(schritt) ".";
  color: var(--akzent-tief); font-weight: 700; flex: none; min-width: 1.2rem;
}
.schritt-ziel { flex: 1; display: flex; flex-direction: column; }
.schritt-name { font-weight: 600; color: var(--ink); }
.schritt-ziel:hover .schritt-name { color: var(--akzent-tief); text-decoration: underline; }
.schritt-grund { color: var(--text); font-size: 0.89rem; }
.schritt-rechts { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.schritt-frist { font-weight: 600; font-size: 0.9rem; color: var(--ink); white-space: nowrap; }
.frist-rot { color: #8c3a2e; }
.schritt-zahlen { color: var(--leise); font-size: 0.83rem; white-space: nowrap; }
.bereich { font-size: 1.3rem; margin-top: 2.4rem; }

/* ---------- Karten und Raster ---------- */
.raster-zwei { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 1rem; margin-bottom: 1rem; }
.raster-drei { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 1rem; margin-bottom: 1rem; }
.karte {
  background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 1.2rem 1.3rem; margin-bottom: 1rem;
}
.raster-zwei .karte, .raster-drei .karte { margin-bottom: 0; }
.karte-hinweis { color: var(--leise); font-size: 0.85rem; margin: -0.35rem 0 0.9rem; }

/* ---------- Diagramme ---------- */
.diagramm { width: 100%; height: auto; display: block; }
.diagramm .raster { stroke: var(--linie); stroke-width: 1; }
.diagramm .achse { fill: var(--leise); font-size: 13px; font-family: inherit; }
.diagramm .wert { fill: var(--text); font-size: 12px; font-weight: 600; font-family: inherit; }
.ring-block { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.diagramm-ring { width: 190px; flex: none; }
.ring-grund { stroke: var(--flaeche); }
.ring-zahl { fill: var(--ink); font-size: 14px; font-weight: 700; font-family: inherit; }
.ring-text { fill: var(--leise); font-size: 12px; font-family: inherit; }
.legende { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 160px; }
.legende li { display: flex; align-items: center; gap: 0.5rem; padding: 0.22rem 0; font-size: 0.9rem; }
.punkt { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.legende-name { flex: 1; }
.legende-wert { color: var(--leise); font-variant-numeric: tabular-nums; }

/* ---------- Übersichtsbild auf der Ausbauseite ---------- */
.baukasten .spalten-titel { fill: var(--akzent-tief); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; font-family: inherit; }
.baukasten .feld-da { fill: rgba(197, 133, 91, 0.22); stroke: var(--akzent-dunkel); stroke-width: 1.5; }
.baukasten .feld-offen { fill: transparent; stroke: var(--leise); stroke-width: 1.5; stroke-dasharray: 6 5; }
.baukasten .feld-text { fill: var(--ink); font-size: 14.5px; font-family: inherit; }
.legende-bild { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin: 0.9rem 0 0; color: var(--leise); font-size: 0.88rem; }
.probe { width: 22px; height: 14px; border-radius: 4px; display: inline-block; }
.probe-da { background: rgba(197, 133, 91, 0.22); border: 1.5px solid var(--akzent-dunkel); }
.probe-offen { border: 1.5px dashed var(--leise); margin-left: 1rem; }

/* ---------- Top-5-Listen ---------- */
.topliste { list-style: none; margin: 0; padding: 0; }
.topliste li {
  display: grid; grid-template-columns: 1fr 90px auto; align-items: center;
  gap: 0.7rem; padding: 0.42rem 0; border-top: 1px solid var(--linie); font-size: 0.92rem;
}
.topliste li:first-child { border-top: 0; }
.top-balken { background: var(--flaeche); border-radius: 999px; height: 7px; overflow: hidden; }
.top-balken span { display: block; height: 100%; background: var(--akzent); border-radius: 999px; }
.top-wert { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.topliste-breit li { grid-template-columns: 1fr auto; }
.topliste-breit .top-name { display: flex; flex-direction: column; }
.topliste-breit a.top-name:hover { color: var(--akzent-tief); text-decoration: underline; }
.top-zusatz { color: var(--leise); font-size: 0.83rem; }

/* ---------- Filter und Formulare ---------- */
.filter, .formular {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
  gap: 0.8rem 1rem; align-items: end;
  background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; margin-bottom: 1.2rem;
}
.formular { background: transparent; border: 0; padding: 0; margin-bottom: 0; }
.feld { margin: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.feld-weit { grid-column: span 2; }
.feld-voll { grid-column: 1 / -1; }
.feld label { font-size: 0.84rem; font-weight: 600; color: var(--ink); }
.feld input[type="text"], .feld input[type="search"], .feld input[type="number"],
.feld input[type="date"], .feld select, .feld textarea {
  font: inherit; font-size: 0.94rem; color: var(--text);
  padding: 0.5rem 0.65rem; border: 1px solid var(--linie); border-radius: 8px;
  background: var(--grund); width: 100%;
}
.feld textarea { resize: vertical; }
.schalter { font-weight: 500; display: flex; align-items: center; gap: 0.45rem; margin-right: 0.6rem; }
.feld-knoepfe { flex-direction: row; gap: 0.6rem; align-items: center; flex-wrap: wrap; }

/* ---------- Tabelle ---------- */
.tabelle-rahmen {
  background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius);
  overflow-x: auto;
}
.tabelle { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.tabelle th, .tabelle td { padding: 0.62rem 0.9rem; text-align: left; vertical-align: top; }
.tabelle thead th {
  background: var(--flaeche); color: var(--ink); font-size: 0.82rem;
  text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap;
  border-bottom: 1px solid var(--linie);
}
.tabelle thead a { display: inline-block; }
.tabelle thead a:hover { color: var(--akzent-tief); text-decoration: underline; }
.tabelle tbody tr { border-top: 1px solid var(--linie); }
.tabelle tbody tr:first-child { border-top: 0; }
.tabelle .rechts { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.zeilen-link { font-weight: 600; color: var(--ink); }
.zeilen-link:hover { color: var(--akzent-tief); text-decoration: underline; }
.zeile-zusatz { display: block; color: var(--leise); font-size: 0.83rem; }

.marke-phase {
  display: inline-block; padding: 0.12rem 0.55rem; border-radius: 999px;
  font-size: 0.8rem; font-weight: 600; white-space: nowrap;
  background: var(--flaeche); color: var(--ink); border: 1px solid var(--linie);
}
.phase-kontakt { background: #eee8e0; }
.phase-gespraech { background: #f1e2cf; }
.phase-angebot { background: #e8dcc2; }
.phase-verhandlung { background: #e0d3b4; }
.phase-gewonnen { background: #dbe6d4; border-color: #bfd0b4; }
.phase-verloren { background: #eddcd8; border-color: #dcc0b9; }

.blaettern { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; color: var(--leise); font-size: 0.9rem; }

/* ---------- Kanban ---------- */
.board {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 1rem; align-items: start;
}
.spalte { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 1rem; }
.spalte-kopf { margin-bottom: 0.8rem; }
.spalte-kopf h2 { margin: 0; }
.spalte-zahl { color: var(--leise); font-size: 0.84rem; margin: 0; }
.ablage { min-height: 48px; }
.board-karte {
  border: 1px solid var(--linie); border-radius: 10px; padding: 0.7rem 0.8rem;
  margin-bottom: 0.7rem; background: var(--grund);
  cursor: grab; touch-action: manipulation;
}
.board-karte a { -webkit-user-drag: none; }
/* Die Karte hängt während des Ziehens am Zeiger, die Lücke bleibt als Umriss stehen. */
.board-karte.wird-gezogen {
  position: fixed; z-index: 90; margin: 0; pointer-events: none;
  cursor: grabbing; transform: rotate(1.5deg);
  box-shadow: 0 16px 34px -14px rgba(42, 36, 32, 0.55);
}
.platzhalter {
  border: 2px dashed var(--akzent); border-radius: 10px;
  background: rgba(197, 133, 91, 0.1); margin-bottom: 0.7rem;
}
.spalte.ist-ziel { outline: 2px solid var(--akzent); outline-offset: 2px; }
body.zieht-gerade { user-select: none; cursor: grabbing; }
.board-titel { font-weight: 600; color: var(--ink); display: block; }
.board-titel:hover { color: var(--akzent-tief); text-decoration: underline; }
.board-vorhaben { margin: 0.1rem 0 0.4rem; font-size: 0.86rem; color: var(--text); }
.board-zahlen { display: flex; justify-content: space-between; gap: 0.5rem; margin: 0; font-size: 0.84rem; color: var(--leise); }
.board-betrag { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.board-frist { margin: 0.15rem 0 0.55rem; font-size: 0.8rem; color: var(--leise); }
.board-knoepfe { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.board-knoepfe form { margin: 0; }
.schieber {
  font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer;
  padding: 0.25rem 0.6rem; border-radius: 999px;
  border: 1px solid var(--linie); background: var(--karte); color: var(--ink);
  min-width: 34px;
}
.schieber:hover { border-color: var(--akzent); background: rgba(197, 133, 91, 0.16); }
.schieber-gewonnen { margin-left: auto; }
.abschluss { margin-left: auto; }
.schieber-verloren { color: #8c3a2e; }
html[data-theme="dark"] .schieber-verloren { color: #e8a79b; }
.mehr { display: inline-block; margin-top: 0.3rem; color: var(--akzent-tief); font-weight: 600; font-size: 0.88rem; }
.mehr:hover { text-decoration: underline; }

/* ---------- Vorgang ---------- */
.daten { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; margin: 0; font-size: 0.93rem; }
.daten dt { color: var(--leise); }
.daten dd { margin: 0; color: var(--ink); }
.phasen-knoepfe { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.phasen-knoepfe form { margin: 0; }
.notiz { color: var(--text); margin: 0; }
.loeschen { margin-top: 1.2rem; }

/* ---------- Fuß ---------- */
.fuss { background: var(--ink); color: #c9bcab; margin-top: 2rem; }
.fuss-innen {
  max-width: var(--maxw); margin-inline: auto; padding: 1.4rem 1.5rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: 0.88rem;
}
.fuss-links { display: flex; gap: 1.2rem; }
.fuss-links a { color: #ece2d6; }
.fuss-links a:hover { color: var(--akzent); }

/* ---------- Dunkelmodus ---------- */
html[data-theme="dark"] {
  --akzent: #d49a6f;
  --akzent-dunkel: #c5855b;
  --akzent-tief: #e0a87e;
  --ink: #f2ebe2;
  --text: #cdbfb0;
  --leise: #9c8d7d;
  --linie: #38302a;
  --grund: #1b1613;
  --flaeche: #16120f;
  --warm: #241d18;
  --karte: #221b16;
}
html[data-theme="dark"] .hauptnavi a[aria-current="page"] { background: var(--akzent); color: #1b1613; }
html[data-theme="dark"] .knopf { background: var(--akzent); border-color: var(--akzent); color: #1b1613; }
html[data-theme="dark"] .knopf:hover { background: #e0a87e; border-color: #e0a87e; }
html[data-theme="dark"] .knopf-leise { background: transparent; color: var(--ink); border-color: var(--linie); }
html[data-theme="dark"] .knopf-leise.ist-aktiv { background: var(--akzent); border-color: var(--akzent); color: #1b1613; }
html[data-theme="dark"] .knopf-warnung { color: #e8a79b; border-color: #5c3a34; }
html[data-theme="dark"] .knopf-warnung:hover { background: #3a2622; border-color: #7a4c44; }
html[data-theme="dark"] .fuss { background: #100d0b; }
html[data-theme="dark"] .marke-phase { background: #2e2620; color: var(--ink); border-color: #3f352d; }
html[data-theme="dark"] .phase-gespraech { background: #38291c; }
html[data-theme="dark"] .phase-angebot { background: #3d2f1d; }
html[data-theme="dark"] .phase-verhandlung { background: #43351f; }
html[data-theme="dark"] .phase-gewonnen { background: #27331f; border-color: #3c4a33; }
html[data-theme="dark"] .phase-verloren { background: #3a231f; border-color: #55332c; }
html[data-theme="dark"] .ring-grund { stroke: #2e2620; }
html[data-theme="dark"] .wer.ist-ich { background: var(--akzent); color: #1b1613; border-color: var(--akzent); }
html[data-theme="dark"] .frist-rot { color: #e8a79b; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media (max-width: 720px) {
  .kopf-innen { padding-block: 0.6rem; }
  .hauptnavi { order: 3; width: 100%; margin-right: 0; }
  .feld-weit { grid-column: span 1; }
  .daten { grid-template-columns: 1fr; gap: 0 0; }
  .daten dd { margin-bottom: 0.5rem; }
}
