/* komfortzonen — Geschäftsübersicht. Design-System wie im Angebots-Tool. */

@font-face { font-family: 'Prompt'; src: url('/fonts/Prompt-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Prompt'; src: url('/fonts/Prompt-Light.woff2') format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Montserrat'; src: url('/fonts/Montserrat-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Montserrat'; src: url('/fonts/Montserrat-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --text: #281101;
  --leise: rgba(40, 17, 1, 0.6);
  --bg: #F5EFFB;
  --karte: #fff;
  --lila: #9f00ff;
  --lila-hell: rgba(159, 0, 255, 0.12);
  --gelb: #fcea21;
  --dunkel: #3C1A60;
  --linie: rgba(40, 17, 1, 0.12);
  --linie-stark: rgba(40, 17, 1, 0.25);
  --gut: #0a7d33;
  --gut-hell: #dff5e6;
  --warn: #b3261e;
  --warn-hell: #fde7e5;
  --plan-hell: #efe6fb;
  --offen-hell: #fff6c2;
  --radius: 0.5rem;
  --schrift: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --kopfschrift: 'Prompt', var(--schrift);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--schrift); font-size: 15px; line-height: 1.45; color: var(--text); background: var(--bg); }
a { color: var(--dunkel); text-decoration-color: var(--linie-stark); text-underline-offset: 2px; }
a:hover { color: var(--lila); }
h1, h2, h3 { font-family: var(--kopfschrift); font-weight: 700; line-height: 1.2; margin: 0; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.05rem; margin-bottom: 0.75rem; }
h2 .leise, h3 .leise { font-family: var(--schrift); font-weight: 400; font-size: 0.85rem; }
h3 { font-size: 0.95rem; margin: 1.1rem 0 0.4rem; }
p { margin: 0 0 0.75rem; }
:focus-visible { outline: 2px solid var(--lila); outline-offset: 2px; }

/* Kopf */
.kopf { display: flex; align-items: center; gap: 1.5rem; padding: 0.7rem 1.25rem; background: var(--dunkel); color: #fff; flex-wrap: wrap; }
.kopf a { color: #fff; text-decoration: none; }
.marke { font-family: var(--kopfschrift); font-weight: 700; font-size: 1.15rem; }
.kopf nav { display: flex; gap: 0.25rem; flex-wrap: wrap; flex: 1; }
.kopf nav a { padding: 0.35rem 0.7rem; border-radius: 2rem; opacity: 0.85; }
.kopf nav a:hover { opacity: 1; background: rgba(255, 255, 255, 0.12); }
.kopf nav a.aktiv { background: var(--gelb); color: var(--text); opacity: 1; font-weight: 700; }
.wer { font-size: 0.85rem; opacity: 0.85; white-space: nowrap; }
.wer a { text-decoration: underline; }

main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
main.breit { max-width: 1400px; }

.titelzeile { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.aktionen { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.pfadzeile { font-size: 0.85rem; margin-bottom: 0.4rem; }
.leise { color: var(--leise); }
.klein { font-size: 0.82rem; }
.stark { font-weight: 700; }
.warn { color: var(--warn); }
.gut { color: var(--gut); }
.nowrap { white-space: nowrap; }
.rechts { text-align: right; }
.kurz { max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.85rem; }
.leer { padding: 2.5rem 1rem; text-align: center; color: var(--leise); background: var(--karte); border-radius: var(--radius); }

.karte { background: var(--karte); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1rem; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); }
details.karte > summary { cursor: pointer; font-weight: 700; }
details.karte[open] > summary { margin-bottom: 1rem; }

.hinweis { padding: 0.65rem 0.9rem; border-radius: var(--radius); background: var(--offen-hell); margin-bottom: 1rem; }
.hinweis.ok { background: var(--gut-hell); color: #064d1f; }
.hinweis.fehler { background: var(--warn-hell); color: #7a1a14; }

/* Knöpfe */
.btn { display: inline-block; font: inherit; font-weight: 700; padding: 0.5rem 0.95rem; border-radius: 2rem; border: 2px solid var(--lila); background: var(--lila); color: #fff; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--dunkel); border-color: var(--dunkel); color: #fff; }
.btn.zweit { background: transparent; color: var(--dunkel); border-color: var(--linie-stark); }
.btn.zweit:hover { border-color: var(--dunkel); background: var(--lila-hell); color: var(--dunkel); }
.btn.klein { padding: 0.2rem 0.65rem; font-size: 0.82rem; }
button.link { font: inherit; background: none; border: none; padding: 0; color: var(--dunkel); text-decoration: underline; text-decoration-color: var(--linie-stark); cursor: pointer; }
button.link.warn { color: var(--warn); }

/* Chips */
.chips { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.titelzeile .chips, .aktionen .chips { margin-bottom: 0; }
.chip { padding: 0.25rem 0.7rem; border-radius: 2rem; background: var(--karte); border: 1px solid var(--linie); text-decoration: none; font-size: 0.88rem; white-space: nowrap; }
.chip span { color: var(--leise); margin-left: 0.2rem; }
.chip.aktiv { background: var(--dunkel); color: #fff; border-color: var(--dunkel); }
.chip.aktiv span { color: rgba(255, 255, 255, 0.75); }

/* Formulare */
input[type="text"], input[type="search"], input[type="password"], input[type="month"], select, textarea {
  font: inherit; color: inherit; padding: 0.45rem 0.6rem; border: 1px solid var(--linie-stark); border-radius: 0.35rem; background: #fff; max-width: 100%;
}
textarea { width: 100%; resize: vertical; }
label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.82rem; font-weight: 700; }
label .leise { font-weight: 400; }
label input, label select, label textarea { font-weight: 400; font-size: 0.95rem; }
.raster { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem 1rem; }
.raster.eng { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.breit2 { grid-column: span 2; }
.breit3 { grid-column: 1 / -1; }
.formular-fuss { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; }
.formular details { margin-top: 1rem; }
.formular details summary { cursor: pointer; font-weight: 700; margin-bottom: 0.75rem; }
form.inline { display: inline-flex; gap: 0.4rem; align-items: center; }
.filter { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1rem; }
.filter .suche { flex: 1; min-width: 180px; }
fieldset.prozente { border: 1px solid var(--linie); border-radius: var(--radius); margin: 1rem 0 0.5rem; padding: 0.75rem 1rem 1rem; display: flex; gap: 0.9rem; flex-wrap: wrap; }
fieldset.prozente legend { font-weight: 700; font-size: 0.82rem; padding: 0 0.4rem; }
fieldset.prozente input.prozent { width: 5.5rem; text-align: right; }
.schnell button { margin-right: 0.7rem; }
input.betrag { width: 7.5rem; text-align: right; }

/* Tabellen */
.tabelle-rahmen { overflow-x: auto; background: var(--karte); border-radius: var(--radius); }
.karte .tabelle-rahmen { border-radius: 0; }
table { border-collapse: collapse; width: 100%; }
table.liste th, table.liste td { text-align: left; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--linie); vertical-align: top; }
table.liste thead th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--leise); white-space: nowrap; }
table.liste.kompakt th, table.liste.kompakt td { padding: 0.35rem 0.6rem; }
table.liste tbody tr:last-child td { border-bottom: none; }
table.liste tfoot td { font-weight: 700; border-top: 2px solid var(--linie-stark); border-bottom: none; color: var(--leise); font-size: 0.85rem; }
table.liste .zahl, th.zahl { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
a.haupt { font-weight: 700; }
tr.ueberfaellig td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
tr.blass td { color: var(--leise); opacity: 0.6; }
tr.summenzeile td { font-weight: 700; border-top: 2px solid var(--linie-stark); }
.zwei-spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }

/* Status-Marken */
select.status, .marke-status { font-size: 0.82rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 2rem; border: 1px solid transparent; background: var(--plan-hell); color: var(--dunkel); white-space: nowrap; }
.s-neu { background: var(--offen-hell); color: #5c4a00; }
.s-gespraech { background: var(--plan-hell); color: var(--dunkel); }
.s-angebot { background: #dbe9ff; color: #0b3a82; }
.s-gewonnen { background: var(--gut-hell); color: #064d1f; }
.s-verloren, .s-abgesagt { background: #eee; color: #555; }
.s-vergeben { background: #e3f1f1; color: #0d4a4a; }
.marke-status.z-geplant { background: var(--plan-hell); color: var(--dunkel); }
.marke-status.z-abgerechnet { background: #dbe9ff; color: #0b3a82; }
.marke-status.z-bezahlt { background: var(--gut-hell); color: #064d1f; }
.marke-status.z-offen { background: var(--offen-hell); color: #5c4a00; }

/* Übersicht */
.personen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.person .gross { font-family: var(--kopfschrift); font-weight: 700; font-size: 1.7rem; margin-bottom: 0.5rem; }
.person .gross .leise { font-family: var(--schrift); font-weight: 400; font-size: 0.85rem; }
.balken { height: 0.6rem; background: var(--bg); border-radius: 1rem; overflow: hidden; display: flex; margin-bottom: 0.75rem; }
.balken .ist { background: var(--lila); }
.balken .plan { background: repeating-linear-gradient(135deg, #cfa3f5, #cfa3f5 4px, #e6cdfa 4px, #e6cdfa 8px); }
.person dl { margin: 0; }
.person dl div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.15rem 0; font-size: 0.9rem; }
.person dt { color: var(--leise); }
.person dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; align-items: start; }
.kacheln .karte { margin-bottom: 0; }
ul.schlicht { list-style: none; margin: 0; padding: 0; }
ul.schlicht li { padding: 0.4rem 0; border-bottom: 1px solid var(--linie); }
ul.schlicht li:last-child { border-bottom: none; }

/* Raster: Monate nebeneinander */
table.raster-tabelle { font-variant-numeric: tabular-nums; font-size: 0.85rem; }
table.raster-tabelle th, table.raster-tabelle td { padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--linie); text-align: right; white-space: nowrap; }
table.raster-tabelle thead th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--leise); }
table.raster-tabelle thead th.aktuell a { background: var(--gelb); padding: 0.1rem 0.4rem; border-radius: 1rem; color: var(--text); }
table.raster-tabelle th:first-child { text-align: left; font-weight: 700; position: sticky; left: 0; background: var(--karte); max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
table.raster-tabelle tbody th a { text-decoration: none; font-weight: 400; }
table.raster-tabelle td b { display: block; }
table.raster-tabelle td i { display: block; font-style: normal; color: var(--leise); }
table.raster-tabelle td i::before { content: '+ '; opacity: 0.6; }
table.raster-tabelle td.summe { border-left: 2px solid var(--linie-stark); }
table.raster-tabelle tfoot td, table.raster-tabelle tfoot th { border-top: 2px solid var(--linie-stark); }
table.raster-tabelle tr.offen th, table.raster-tabelle tr.person-zeile th, table.raster-tabelle tr.person-zeile td { font-weight: 400; color: var(--leise); border-top: none; }
table.planung td a { text-decoration: none; display: block; padding: 0.15rem 0.35rem; border-radius: 0.3rem; }
table.planung td.z-ist a { background: var(--lila); color: #fff; }
table.planung td.z-plan a { background: var(--plan-hell); }
table.planung td.z-gemischt a { background: linear-gradient(90deg, var(--lila) 50%, var(--plan-hell) 50%); color: var(--text); text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
table.planung td.z-offen a { box-shadow: inset 0 0 0 2px #d9b800; }
.legende { display: inline-block; width: 0.9rem; height: 0.9rem; border-radius: 0.2rem; vertical-align: -0.12rem; margin-left: 0.6rem; }
.legende.z-ist { background: var(--lila); margin-left: 0; }
.legende.z-plan { background: var(--plan-hell); border: 1px solid var(--linie); }
.legende.z-gemischt { background: linear-gradient(90deg, var(--lila) 50%, var(--plan-hell) 50%); }
.legende.z-offen { box-shadow: inset 0 0 0 2px #d9b800; }

/* Projekt */
.eckdaten { display: flex; gap: 0.4rem 0.5rem; flex-wrap: wrap; font-size: 0.88rem; }
.eckdaten span { background: var(--karte); border: 1px solid var(--linie); padding: 0.15rem 0.6rem; border-radius: 2rem; }
.zahlenreihe { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 1rem 0; }
.zahlenreihe div { background: var(--karte); border-radius: var(--radius); padding: 0.6rem 1rem; display: flex; flex-direction: column; min-width: 8rem; }
.zahlenreihe span { font-size: 0.78rem; }
.zahlenreihe b { font-family: var(--kopfschrift); font-size: 1.2rem; }
.anteil-zeile { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
select.marke-status { font: inherit; font-size: 0.85rem; font-weight: 700; padding: 0.35rem 0.5rem; border-radius: 2rem; }

/* Login */
body.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--dunkel); padding: 1rem; }
.login-box { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 0.9rem; padding: 2rem; }
.login-box h1 { color: var(--lila); }
.login-box p { margin: -0.6rem 0 0.4rem; }

@media (max-width: 800px) {
  .raster { grid-template-columns: 1fr; }
  .breit2 { grid-column: auto; }
  .personen, .zwei-spalten { grid-template-columns: 1fr; }
  main { padding: 1rem 0.75rem 3rem; }
  .kopf { gap: 0.6rem; padding: 0.6rem 0.75rem; }
  .kurz { max-width: 26ch; }
  h1 { font-size: 1.4rem; }
}

/* Nachbesserungen nach dem ersten Blick */
[hidden] { display: none !important; }
.karte { overflow-x: auto; }
.anteil-zeile { flex-wrap: nowrap; }
.anteil-zeile input[type="month"] { width: 10.5rem; }
.anteil-zeile select[name="person"] { width: 9rem; }
.anteil-zeile input.betrag { width: 6.5rem; }
.anteil-zeile input[name="rechnung"] { width: 7.5rem; }
table.anteile td { vertical-align: middle; }
table.raster-tabelle { font-size: 0.8rem; }
table.raster-tabelle th, table.raster-tabelle td { padding: 0.4rem 0.35rem; }
table.raster-tabelle th:first-child { max-width: 220px; }
table.planung td a { padding: 0.15rem 0.25rem; }
@media (max-width: 800px) {
  .anteil-zeile { flex-wrap: wrap; }
  table.liste th, table.liste td { padding: 0.45rem 0.5rem; }
}

/* Übersicht: wofür jede Person geplant ist */
.klein-titel { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--leise, #777); margin: 1rem 0 0.25rem; }
.planliste li { display: flex; gap: 0.5rem; align-items: baseline; font-size: 0.9rem; }
.planliste li a { flex: 1; min-width: 0; }
.planliste li b { white-space: nowrap; }

/* Diagramme: feste Farbe je Person (geprüft auf Unterscheidbarkeit, auch bei Farbfehlsichtigkeit) */
.p-valentin { background: #9f00ff; } .p-joerg { background: #eb6834; } .p-dirk { background: #1baf7a; } .p-offen { background: #b9b2c2; }
.balkenbild { margin: 0.25rem 0 1.25rem; }
.balkenzeile { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.balkenjahr { width: 2.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.balkenspur { flex: 1; display: flex; align-items: center; gap: 2px; min-width: 0; }
.balkenspur .seg { height: 1.1rem; flex: none; }
.balkenspur .seg:last-of-type { border-radius: 0 4px 4px 0; }
.balkenspur .seg:hover, .anteilspur .seg:hover { filter: brightness(0.88); }
.balkenwert { margin-left: 0.5rem; font-size: 0.85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.diagramm-legende { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: 0.8rem; color: var(--leise); margin: 0.75rem 0 0; }
.diagramm-legende i { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 2px; margin-right: 0.35rem; }
.anteilliste li { display: block; }
.anteilliste .zeile { display: flex; gap: 0.5rem; align-items: baseline; font-size: 0.9rem; }
.anteilliste .zeile a, .anteilliste .zeile > .leise:first-child { flex: 1; min-width: 0; }
.anteilliste .zeile b { white-space: nowrap; min-width: 4.5rem; text-align: right; }
.anteilspur { display: block; height: 0.35rem; background: var(--bg); border-radius: 4px; margin-top: 0.25rem; overflow: hidden; }
.anteilspur .seg { display: block; height: 100%; border-radius: 0 4px 4px 0; }

/* Schätzung und Mite */
.marke-quelle { font-size: 0.75rem; color: var(--leise); border: 1px solid var(--linie); border-radius: 1rem; padding: 0.1rem 0.5rem; white-space: nowrap; }
label.haken { display: flex; flex-direction: row; align-items: center; gap: 0.5rem; font-weight: 400; }
label.haken input { width: auto; }
.mite-auswahl { border: 1px solid var(--linie); border-radius: 0.5rem; padding: 0.5rem 0.75rem; max-height: 16rem; overflow-y: auto; margin-top: 0.5rem; }
.mite-auswahl legend { font-size: 0.8rem; color: var(--leise); padding: 0 0.25rem; }

/* Einblicke: Verläufe über die Jahre */
.filterleiste { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 0.6rem 1.75rem; align-items: center; padding: 0.7rem 1.25rem; overflow: visible; box-shadow: 0 2px 8px rgba(40, 17, 1, 0.1); }
.filtergruppe { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.filtergruppe .klein-titel { margin: 0; }
.filtergruppe .chips { margin: 0; }
.filterhinweis { margin-left: auto; }
button.chip { font: inherit; font-size: 0.88rem; color: inherit; cursor: pointer; }
button.chip:hover { border-color: var(--dunkel); }
.chip.schalter { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; }
.chip.schalter i { width: 0.75rem; height: 0.75rem; border-radius: 50%; flex: none; }
.chip.schalter[aria-pressed="false"] { font-weight: 400; color: var(--leise); background: transparent; border-style: dashed; text-decoration: line-through; }
.chip.schalter[aria-pressed="false"] i { background: transparent !important; box-shadow: inset 0 0 0 2px var(--linie-stark); }
.kennkacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kennkachel { display: flex; flex-direction: column; gap: 0.15rem; margin: 0; text-decoration: none; color: var(--text); border: 1px solid transparent; }
.kennkachel:hover { border-color: var(--lila); color: var(--text); }
.kennkachel .kopfzeile { display: flex; align-items: center; gap: 0.45rem; font-weight: 700; font-size: 0.9rem; }
.kennkachel .kopfzeile i { width: 0.75rem; height: 0.75rem; border-radius: 50%; }
.kennkachel > b { font-family: var(--kopfschrift); font-size: 1.5rem; line-height: 1.2; }
.kennkachel > span.warn, .kennkachel > span.gut { font-size: 0.85rem; font-weight: 700; }
.bild { position: relative; }
.bild svg { display: block; touch-action: pan-y; }
.bild .gitter { stroke: var(--linie); stroke-width: 1; }
.bild .grund { stroke: var(--linie-stark); stroke-width: 1; }
.bild .achse { font-size: 11px; fill: rgba(40, 17, 1, 0.6); font-variant-numeric: tabular-nums; }
.bild .achse.jahr { font-size: 12px; font-weight: 700; fill: var(--text); }
.bild .endmarke { font-size: 12px; font-weight: 700; fill: var(--text); }
.bild .kurve { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bild .kurve.geplant { stroke-dasharray: 5 5; }
.bild .faden { stroke: var(--linie-stark); stroke-width: 1; }
.bild .spalte { fill: rgba(40, 17, 1, 0.05); }
.bild .ziellinie { stroke: var(--text); stroke-opacity: 0.55; stroke-width: 1.5; stroke-dasharray: 2 3; }
.bild .zielmarke { fill: var(--text); }
.tipp { position: absolute; top: 6px; pointer-events: none; background: #fff; border: 1px solid var(--linie-stark); border-radius: 0.4rem; box-shadow: 0 4px 14px rgba(40, 17, 1, 0.15); padding: 0.5rem 0.7rem; font-size: 0.82rem; min-width: 11rem; max-width: 19rem; z-index: 3; }
.tipp strong { display: block; margin-bottom: 0.25rem; }
.tipp .tz { display: flex; align-items: baseline; gap: 0.4rem; flex-wrap: wrap; padding: 0.08rem 0; }
.tipp .tz i { width: 0.65rem; height: 0.65rem; border-radius: 50%; flex: none; align-self: center; }
.tipp .tz span { flex: 1; }
.tipp .tz b { font-weight: 400; font-variant-numeric: tabular-nums; }
.tipp .tz.stark span, .tipp .tz.stark b { font-weight: 700; }
.tipp .tz em { flex-basis: 100%; font-style: normal; color: var(--leise); text-align: right; font-size: 0.75rem; margin-top: -0.15rem; }
.tipp .tz.summe { border-top: 1px solid var(--linie); margin-top: 0.25rem; padding-top: 0.25rem; }
.tipp small { display: block; color: var(--leise); margin-top: 0.3rem; }
.diagramm-legende svg { vertical-align: middle; margin-right: 0.3rem; }
table.waerme td a { text-decoration: none; color: var(--text); display: block; }
table.waerme td a:hover { text-decoration: underline; }
table.waerme td.geplant a { font-style: italic; color: var(--leise); }
table.waerme td { border-right: 2px solid var(--karte); }
.kundenspur { display: flex; gap: 2px; height: 0.5rem; margin-top: 0.3rem; }
.kundenspur .seg { height: 100%; min-width: 2px; }
.kundenspur .seg:last-child { border-radius: 0 4px 4px 0; }
.einsichten li { padding: 0.55rem 0; }
@media (max-width: 800px) {
  .filterleiste { position: static; }
  .filterhinweis { margin-left: 0; }
}

/* Angebote aus dem Angebots-Tool */
.marke-status.g-entwurf { background: #eee; color: #555; }
.marke-status.g-versendet { background: #dbe9ff; color: #0b3a82; }
.marke-status.g-angenommen { background: var(--gut-hell); color: #064d1f; }
.marke-status.g-abgelehnt, .marke-status.g-abgelaufen { background: var(--warn-hell); color: #7a1a14; }
select.schmal { max-width: 13rem; }
table.angebotsliste td:nth-child(2) { max-width: 19rem; }

/* Topf: Ausgaben unter aufklappbaren Überschriften */
.topf-filter { margin: 1.25rem 0 0.75rem; }
.mit-komma + .mit-komma::before { content: ", "; }
.gruppen { border-top: 1px solid var(--linie); }
.gruppe-kopf, .gruppe-fuss, details.gruppe > summary { display: grid; grid-template-columns: minmax(0, 1fr) 7.5rem 7.5rem; gap: 0.75rem; align-items: baseline; padding: 0.5rem 0.25rem; }
.gruppe-kopf { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--leise); font-weight: 700; }
.gruppe-kopf .zahl, .gruppe-fuss .zahl, details.gruppe > summary .zahl { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
details.gruppe { border-top: 1px solid var(--linie); }
details.gruppe > summary { cursor: pointer; list-style: none; }
details.gruppe > summary::-webkit-details-marker { display: none; }
details.gruppe > summary:hover { background: var(--lila-hell); }
details.gruppe .g-name { font-weight: 700; }
details.gruppe .g-name .leise { font-weight: 400; font-size: 0.85rem; }
details.gruppe .g-name::before { content: "▸"; display: inline-block; width: 1.1rem; color: var(--leise); }
details.gruppe[open] .g-name::before { content: "▾"; }
details.gruppe > .tabelle-rahmen { margin: 0 0 0.6rem 1.35rem; border-left: 2px solid var(--linie); }
details.gruppe tr.gerade td { background: var(--offen-hell); }
.gruppe-fuss { border-top: 2px solid var(--linie-stark); font-weight: 700; color: var(--leise); font-size: 0.85rem; }
@media (max-width: 640px) {
  .gruppe-kopf, .gruppe-fuss, details.gruppe > summary { grid-template-columns: minmax(0, 1fr) 5.5rem 5.5rem; gap: 0.4rem; }
}
table.liste .plan-spalte { color: var(--leise); font-style: italic; }
table.liste th.plan-spalte { font-style: normal; border-left: 1px solid var(--linie); }
table.liste td.plan-spalte:nth-last-child(2) { border-left: 1px solid var(--linie); }
table.liste .plan-spalte.warn { color: var(--warn); }
input.muster { width: 7.5rem; }
details.lex-offen { margin-top: 0.75rem; }
details.lex-offen > summary { cursor: pointer; font-weight: 700; margin-bottom: 0.5rem; }
.marke-status.z-ausgefallen { background: #eee; color: #555; text-decoration: line-through; }
.ausfall { color: var(--leise); text-decoration: line-through; font-weight: 400; }
th .ausfall { text-decoration: none; }
details.ausfall-liste { margin-top: 1rem; }

/* ---- Kontaktpflege ---- */
input[type="date"], input[type="file"] { font: inherit; color: inherit; padding: 0.4rem 0.6rem; border: 1px solid var(--linie-stark); border-radius: 0.35rem; background: #fff; max-width: 100%; }
.zahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.zahlen .karte { margin: 0; padding: 0.8rem 1rem; }
.zahlen strong { display: block; font-family: var(--kopfschrift); font-size: 1.6rem; line-height: 1.1; }
.abz { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 2rem; background: var(--plan-hell); color: var(--dunkel); white-space: nowrap; vertical-align: middle; }
.abz.kunde { background: var(--gelb); color: var(--text); }
.abz.anlass { background: var(--gut-hell); color: #064d1f; }
.abz.kontakt { background: #dbe9ff; color: #0b3a82; }
.abz.grau { background: var(--bg); color: var(--leise); }
.personkopf h1 { margin-bottom: 0.2rem; }
.personkopf .station { font-size: 1.05rem; margin-bottom: 0.3rem; }
.profilzeile { color: var(--leise); font-size: 0.9rem; max-width: 70ch; }
.warum { list-style: none; margin: 0; padding: 0; }
.warum li { padding: 0.3rem 0; border-bottom: 1px solid var(--linie); }
.warum li:last-child { border-bottom: none; }
.leiste { list-style: none; margin: 0; padding: 0 0 0 1.1rem; border-left: 2px solid var(--linie-stark); }
.leiste li { position: relative; padding: 0 0 1rem 0.4rem; }
.leiste li:last-child { padding-bottom: 0; }
.leiste li::before { content: ''; position: absolute; left: -1.56rem; top: 0.3rem; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--lila); border: 2px solid var(--karte); }
.leiste li.anlass::before { background: var(--gut); }
.leiste li.kontakt::before { background: #0b3a82; }
.leiste li.vernetzt::before { background: var(--linie-stark); }
.leiste .wann { font-size: 0.8rem; color: var(--leise); }
.leiste .was { font-weight: 700; }
.person-raster { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem; align-items: start; }
.stapel-formular { display: flex; flex-direction: column; gap: 0.7rem; }
.zeile { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: flex-end; }
.zeile label { flex: 1; min-width: 120px; }
td .profilzeile { font-size: 0.8rem; max-width: 60ch; }
@media (max-width: 800px) {
  .person-raster { grid-template-columns: 1fr; }
  table.liste .weg-schmal { display: none; }
}

/* ---- Anmeldung und Sicherheit ---- */
.kopf .wer button.abmelden { color: #fff; text-decoration: underline; }
.login-box.weit { max-width: 460px; }
.login-box .qr { align-self: center; background: #fff; padding: 0.5rem; border-radius: var(--radius); border: 1px solid var(--linie); }
.login-box .qr svg { display: block; width: 220px; height: 220px; }
.login-box ol { margin: 0; padding-left: 1.2rem; }
.login-box ol li { margin-bottom: 0.4rem; }
.geheim { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.95rem; letter-spacing: 0.04em; word-break: break-all; user-select: all; }
input.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.4rem; letter-spacing: 0.25em; text-align: center; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem 1rem; list-style: none; margin: 0; padding: 0.8rem 1rem; background: var(--bg); border-radius: var(--radius); }
.codes li { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.05rem; user-select: all; }
tr.auffaellig td { color: var(--warn); }
.ampel { display: flex; flex-direction: column; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.ampel li::before { content: '✓ '; color: var(--gut); font-weight: 700; }
.ampel li.fehlt::before { content: '! '; color: var(--warn); }

/* ---- Eingang: eine Karte, vier Richtungen ---- */
.stapel { max-width: 560px; margin: 0 auto; }
.wischkarte { position: relative; touch-action: pan-y; user-select: none; -webkit-user-select: none; transition: transform 0.18s ease, opacity 0.18s ease; padding: 1.4rem 1.4rem 1.1rem; box-shadow: 0 6px 24px rgba(60, 26, 96, 0.14); }
.wischkarte.zieht { transition: none; }
.wischkarte .kartenname { font-size: 1.45rem; margin-bottom: 0.3rem; }
.wischkarte .station { font-size: 1.05rem; margin-bottom: 0.35rem; }
.wischkarte h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--leise); margin: 1.1rem 0 0.45rem; }
.wischkarte .kartenfuss { display: flex; justify-content: space-between; align-items: center; margin: 1.1rem 0 0; }
.wisch-marke { position: absolute; top: 0.9rem; right: 1rem; font-weight: 700; font-size: 0.9rem; padding: 0.2rem 0.7rem; border-radius: 2rem; opacity: 0; pointer-events: none; }
.wisch-marke.auftraggeber { background: var(--gut-hell); color: #064d1f; }
.wisch-marke.wichtig { background: var(--gelb); color: var(--text); }
.wisch-marke.netzwerk { background: var(--plan-hell); color: var(--dunkel); }
.wisch-marke.verwerfen { background: var(--warn-hell); color: #7a1a14; }
.wahl { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin: 0.25rem 0 0.75rem; }
.wahl .btn { white-space: normal; text-align: center; padding: 0.7rem 0.5rem; }
.wahl-verwerfen { background: #fff; color: var(--warn); border-color: var(--warn); }
.wahl-netzwerk { background: #fff; color: var(--dunkel); border-color: var(--linie-stark); }
.wahl-wichtig { background: var(--gelb); color: var(--text); border-color: var(--gelb); }
.wahl-auftraggeber { background: var(--gut); border-color: var(--gut); }
.mitte { text-align: center; }
.eingang-hinweis { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; background: var(--dunkel); color: #fff; }
.eingang-hinweis strong { font-family: var(--kopfschrift); font-size: 1.3rem; }
.eingang-hinweis .btn { background: var(--gelb); border-color: var(--gelb); color: var(--text); }

.nachfuellen { margin: 1.5rem 0 0; }
.nachfuellen p { margin: .5rem 0 0; }

/* Verlauf: Brett mit Spalten */
.brett { display: grid; grid-template-columns: repeat(5, minmax(210px, 1fr)); gap: 0.75rem; overflow-x: auto; padding-bottom: 0.5rem; align-items: start; }
.spalte { background: rgba(255, 255, 255, 0.55); border-radius: var(--radius); padding: 0.75rem; min-height: 8rem; border: 2px solid transparent; }
.spalte.ziel { border-color: var(--lila); background: var(--lila-hell); }
.spalte h2 { margin-bottom: 0.1rem; }
.spaltenhilfe { margin-bottom: 0.6rem; }
.spalte[data-stufe="ruht"] { opacity: 0.8; }
.brettkarte { background: var(--karte); border-radius: var(--radius); padding: 0.65rem 0.75rem; margin-bottom: 0.6rem; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); cursor: grab; }
.brettkarte.zieht { opacity: 0.4; }
.brettkarte .haupt { font-weight: 700; }
.brettkarte > div { margin-top: 0.25rem; overflow-wrap: anywhere; }
.brettknoepfe { display: flex; gap: 0.35rem; align-items: flex-start; flex-wrap: wrap; margin-top: 0.5rem !important; }
.brettknoepfe details { flex: 0 1 auto; }
.brettknoepfe form.inline:last-child { margin-left: auto; }
.brettknoepfe .btn.klein { padding: 0.2rem 0.5rem; }
.brettknoepfe summary { list-style: none; display: inline-block; cursor: pointer; }
.brettknoepfe summary::-webkit-details-marker { display: none; }
.brettknoepfe details[open] { flex-basis: 100%; order: 3; }
.brettknoepfe details form { margin-top: 0.5rem; }
.spalte-leer { margin: 0; }
.zeile-knopf { display: flex; gap: 0.5rem; align-items: center; }
.zeile-knopf select { flex: 1; }
.leiste details.aendern { margin-top: 0.2rem; }
.leiste details.aendern summary { cursor: pointer; color: var(--leise); display: inline-block; }
.leiste details.aendern form { margin-top: 0.5rem; padding: 0.6rem 0.75rem; background: var(--bg); border-radius: var(--radius); font-weight: 400; }
@media (max-width: 800px) {
  .brett { grid-template-columns: repeat(5, 78vw); scroll-snap-type: x mandatory; }
  .spalte { scroll-snap-align: start; }
}
