:root {
  --gruen: #0a6e3c;
  --gruen-dunkel: #07522d;
  --gruen-hell: #e6f3ec;
  --rot: #b42318;
  --rot-hell: #fdecea;
  --gelb: #8a5a00;
  --gelb-hell: #fff4d6;
  --blau: #1d4ed8;
  --text: #1c2421;
  --grau: #5d6b65;
  --linie: #dfe6e2;
  --flaeche: #f5f7f6;
  --weiss: #fff;
  --radius: 10px;
  --schatten: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text); background: var(--flaeche);
}
a { color: var(--gruen); }
h1 { font-size: 1.5rem; margin: .4rem 0 1rem; line-height: 1.25; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
p { margin: 0 0 .75rem; }
small, .klein { font-size: .85rem; color: var(--grau); }

/* Kopf und Navigation */
.kopf {
  position: sticky; top: 0; z-index: 10; background: var(--gruen); color: #fff;
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .55rem 1rem;
  padding-top: max(.55rem, env(safe-area-inset-top));
}
.marke { color: #fff; text-decoration: none; font-weight: 700; display: flex; align-items: center; gap: .55rem; margin-right: auto; }
.kreuz { width: 22px; height: 22px; border-radius: 5px; background: #fff; position: relative; flex: none; }
.kreuz::before, .kreuz::after { content: ""; position: absolute; background: var(--gruen); }
.kreuz::before { left: 9px; top: 4px; width: 4px; height: 14px; }
.kreuz::after { left: 4px; top: 9px; width: 14px; height: 4px; }
.menue-knopf {
  display: none; background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.35);
  border-radius: 8px; padding: .35rem .8rem; font: inherit; cursor: pointer;
}
.nav { display: flex; flex-wrap: wrap; gap: .15rem; }
.nav a { color: #fff; text-decoration: none; padding: .4rem .65rem; border-radius: 8px; white-space: nowrap; }
.nav a:hover, .nav a.aktiv { background: rgba(255,255,255,.18); }
.nav .zahl { background: #fff; color: var(--rot); border-radius: 999px; font-size: .75rem; font-weight: 700; padding: 0 .4rem; margin-left: .2rem; }
@media (max-width: 900px) {
  .menue-knopf { display: inline-block; }
  .nav { display: none; width: 100%; flex-direction: column; padding-bottom: .4rem; }
  body.nav-offen .nav { display: flex; }
  .nav a { padding: .65rem .5rem; }
}

.inhalt { max-width: 1050px; margin: 0 auto; padding: 1rem; padding-bottom: 3rem; }
.inhalt.breit { max-width: 1400px; }
.fuss { text-align: center; color: var(--grau); font-size: .8rem; padding: 1rem 1rem 2rem; }

/* Karten und Raster */
.karte { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem; box-shadow: var(--schatten); }
.karte > h2:first-child { margin-top: 0; }
.raster { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.raster .karte { margin-bottom: 0; }
.zeile { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.zeile.zwischen { justify-content: space-between; }
.leer { color: var(--grau); font-style: italic; }
.kennzahl { font-size: 2rem; font-weight: 700; line-height: 1.1; }

/* Meldungen und Hinweise */
.meldung, .hinweis { display: block; border-radius: var(--radius); padding: .7rem .9rem; margin-bottom: .75rem; border: 1px solid; text-decoration: none; }
.meldung.ok { background: var(--gruen-hell); border-color: #b5dcc6; color: var(--gruen-dunkel); }
.meldung.fehler, .hinweis.rot { background: var(--rot-hell); border-color: #f4c2bd; color: var(--rot); }
.meldung.info { background: #eaf1fe; border-color: #c5d6fb; color: var(--blau); }
.hinweis.gelb, .meldung.warnung { background: var(--gelb-hell); border-color: #f1d999; color: var(--gelb); }
.hinweis:hover { filter: brightness(.98); }
ul.fehlerliste { margin: .3rem 0 0; padding-left: 1.2rem; }

/* Formulare */
label { display: block; font-weight: 600; margin: .6rem 0 .25rem; font-size: .95rem; }
label.inline { display: inline-flex; align-items: center; gap: .45rem; font-weight: 400; margin: .3rem 1rem .3rem 0; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number],
input[type=search], input[type=tel], select, textarea {
  width: 100%; font: inherit; padding: .55rem .65rem; border: 1px solid #c5d0ca; border-radius: 8px; background: #fff; color: var(--text);
  min-height: 44px;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus, .knopf:focus-visible, button:focus-visible { outline: 3px solid #8cc9a8; outline-offset: 1px; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--gruen); }
.felder { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.felder .voll { grid-column: 1 / -1; }
.hilfe { font-size: .85rem; color: var(--grau); margin-top: .2rem; }
.pflicht::after { content: " *"; color: var(--rot); }
fieldset { border: 1px solid var(--linie); border-radius: var(--radius); padding: .5rem 1rem 1rem; margin: 1rem 0; }
legend { font-weight: 700; padding: 0 .3rem; }

.knopf, button.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 600;
  background: var(--gruen); color: #fff; border: 1px solid var(--gruen); border-radius: 8px; padding: .55rem 1rem;
  min-height: 44px; text-decoration: none; cursor: pointer;
}
.knopf:hover { background: var(--gruen-dunkel); }
.knopf.zweit { background: #fff; color: var(--gruen); }
.knopf.zweit:hover { background: var(--gruen-hell); }
.knopf.rot { background: var(--rot); border-color: var(--rot); }
.knopf.klein { min-height: 34px; padding: .3rem .7rem; font-size: .9rem; }
.knopf[disabled] { opacity: .5; cursor: not-allowed; }
.aktionen { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }

/* Tabellen */
.tabelle-huelle { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--linie); vertical-align: top; }
th { font-size: .82rem; text-transform: uppercase; letter-spacing: .02em; color: var(--grau); font-weight: 700; }
tr:hover td { background: #fafcfb; }
td.zahl, th.zahl { text-align: right; white-space: nowrap; }
@media (max-width: 700px) {
  table.stapeln thead { display: none; }
  table.stapeln tr { display: block; border: 1px solid var(--linie); border-radius: var(--radius); margin-bottom: .6rem; background: #fff; }
  table.stapeln td { display: flex; gap: .75rem; justify-content: space-between; border: 0; border-bottom: 1px solid #eef2f0; text-align: right; }
  table.stapeln td:last-child { border-bottom: 0; }
  table.stapeln td::before { content: attr(data-label); font-weight: 600; color: var(--grau); text-align: left; }
  table.stapeln td.zahl { text-align: right; }
}

/* Etiketten */
.etikett { display: inline-block; font-size: .78rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; background: #eef2f0; color: var(--grau); white-space: nowrap; }
.etikett.geplant { background: #eaf1fe; color: var(--blau); }
.etikett.durchgefuehrt, .etikett.offen { background: var(--gelb-hell); color: var(--gelb); }
.etikett.abgerechnet, .etikett.bezahlt, .etikett.ok { background: var(--gruen-hell); color: var(--gruen-dunkel); }
.etikett.abgesagt, .etikett.storniert, .etikett.abgelaufen { background: var(--rot-hell); color: var(--rot); }
.etikett.bald, .etikett.fehlt { background: var(--gelb-hell); color: var(--gelb); }

/* Checkliste */
.checkliste { list-style: none; padding: 0; margin: 0; }
.checkliste li { display: flex; gap: .75rem; align-items: flex-start; padding: .7rem 0; border-bottom: 1px solid var(--linie); }
.checkliste li:last-child { border-bottom: 0; }
.checkliste .text { flex: 1; }
.checkliste .ueberfaellig { color: var(--rot); font-weight: 600; }

/* Kunden-Vorschläge */
.vorschlag-huelle { position: relative; }
.vorschlaege { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--linie); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); margin-top: 2px; max-height: 280px; overflow: auto; }
.vorschlaege button { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid #eef2f0; padding: .6rem .75rem; font: inherit; cursor: pointer; }
.vorschlaege button:hover, .vorschlaege button:focus { background: var(--gruen-hell); }
.gewaehlt { background: var(--gruen-hell); border: 1px solid #b5dcc6; border-radius: 8px; padding: .6rem .75rem; margin-top: .5rem; }
.wahl { display: block; border: 1px solid var(--linie); border-radius: 8px; padding: .6rem .75rem; margin: .4rem 0; font-weight: 400; cursor: pointer; }
.wahl:has(input:checked) { border-color: var(--gruen); background: var(--gruen-hell); }

/* Unterschrift */
.unterschrift-feld { border: 2px dashed #9fb4a9; border-radius: var(--radius); background: #fff; touch-action: none; width: 100%; height: 220px; display: block; }
.tn-wahl { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tn-wahl a { display: block; padding: .8rem; border: 1px solid var(--linie); border-radius: var(--radius); background: #fff; text-decoration: none; color: var(--text); }
.tn-wahl a.erledigt { background: var(--gruen-hell); border-color: #b5dcc6; }

/* Anmeldung */
.anmeldung { max-width: 420px; margin: 8vh auto 0; }
.anmeldung .marke-gross { display: flex; align-items: center; gap: .7rem; font-size: 1.35rem; font-weight: 700; margin-bottom: 1rem; color: var(--gruen); }
.anmeldung .kreuz { width: 36px; height: 36px; background: var(--gruen); border-radius: 8px; }
.anmeldung .kreuz::before { background: #fff; left: 15px; top: 7px; width: 6px; height: 22px; }
.anmeldung .kreuz::after { background: #fff; left: 7px; top: 15px; width: 22px; height: 6px; }

@media print {
  .kopf, .fuss, .aktionen, .hinweis, .meldung, .nicht-drucken, form button { display: none !important; }
  body { background: #fff; }
  .karte { box-shadow: none; border: 0; padding: 0; }
}

.qr-feld{display:flex;justify-content:center;margin:.5rem 0}
.qr-feld svg{width:min(320px,80vw);height:auto;background:#fff;padding:6px;border-radius:8px}
