:root {
  --gruen: #1b7d12;
  --gruen-dunkel: #145f0e;
  --gruen-hell: #e9f5e7;
  --blau: #1450b4;
  --blau-hell: #e8effa;
  --gelb: #f0b92d;
  --gelb-hell: #fdf5de;
  --rot: #b3261e;
  --rot-hell: #fbeae8;
  --text: #1c2420;
  --leise: #5d6a63;
  --linie: #dfe5e0;
  --grund: #f5f7f5;
  --flaeche: #fff;
  --radius: 8px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--grund);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; font-size: 15px; line-height: 1.45; }
h1 { font-size: 1.55rem; margin: 0 0 .25rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
p { margin: 0 0 .75rem; }
.untertitel { color: var(--leise); margin-bottom: 1.25rem; }

header {
  display: flex; align-items: center; gap: 1.5rem; padding: .6rem 1.5rem;
  background: var(--flaeche); border-bottom: 1px solid var(--linie); position: sticky; top: 0; z-index: 5;
}
.kopf-logo { height: 38px; display: block; }
nav { display: flex; gap: .25rem; flex: 1; flex-wrap: wrap; }
nav button {
  border: 0; background: none; padding: .45rem .85rem; border-radius: var(--radius);
  font: inherit; font-weight: 600; color: var(--leise); cursor: pointer;
}
nav button:hover { background: var(--grund); color: var(--text); }
nav button.aktiv { background: var(--gruen-hell); color: var(--gruen-dunkel); }
.kopf-konto { display: flex; align-items: center; gap: .75rem; color: var(--leise); }

main { flex: 1; width: 100%; max-width: 1400px; margin: 0 auto; padding: 1.5rem; animation: fadeSlideIn .22s ease-out; }
footer { display: flex; align-items: center; justify-content: center; gap: .5rem; padding: 1rem; color: var(--leise); font-size: .8rem; }
footer img { height: 20px; display: block; }

.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1rem; }
.zeile { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.zeile.zwischen { justify-content: space-between; }
.raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .85rem; }
.spalten { display: grid; grid-template-columns: 280px 1fr; gap: 1rem; align-items: start; }

label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; font-weight: 600; color: var(--leise); }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--flaeche); padding: .45rem .6rem;
  border: 1px solid var(--linie); border-radius: 6px; width: 100%;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--blau); outline-offset: 1px;
}
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid var(--gruen);
  background: var(--gruen); color: #fff; padding: .5rem 1rem; border-radius: 6px; font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color .15s ease;
}
.knopf:hover { background: var(--gruen-dunkel); }
.knopf:disabled { opacity: .5; cursor: not-allowed; }
.knopf.leise { background: var(--flaeche); color: var(--text); border-color: var(--linie); }
.knopf.leise:hover { background: var(--grund); }
.knopf.klein { padding: .25rem .6rem; font-size: .85rem; }

.anmeldung { flex: 1; display: grid; place-items: center; }
.anmelde-karte { width: min(380px, 100%); background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px; padding: 2rem; display: grid; gap: 1rem; }
.anmelde-karte img { width: 200px; justify-self: center; }
.anmelde-karte h1 { text-align: center; font-size: 1.2rem; }
.fehlertext { color: var(--rot); font-size: .9rem; min-height: 1.3em; margin: 0; }
.honig { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.ablage {
  display: block; border: 2px dashed var(--linie); border-radius: 10px; background: var(--flaeche); padding: 2.25rem 1rem;
  text-align: center; cursor: pointer; transition: border-color .15s ease, background-color .15s ease; color: var(--leise); font-weight: 400; font-size: 1rem;
}
.ablage strong { color: var(--text); display: block; font-size: 1.1rem; margin-bottom: .2rem; }
.ablage:hover, .ablage.ueber { border-color: var(--gruen); background: var(--gruen-hell); }
.ablage input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.tabelle-rahmen { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th { text-align: left; color: var(--leise); font-size: .78rem; font-weight: 700; padding: .45rem .55rem; border-bottom: 2px solid var(--linie); white-space: nowrap; }
td { padding: .4rem .55rem; border-bottom: 1px solid var(--linie); vertical-align: top; }
td.zahl, th.zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot td { font-weight: 700; border-top: 2px solid var(--linie); border-bottom: 0; }
td input, td select { padding: .25rem .4rem; font-size: .85rem; min-width: 110px; }
td input[type="date"] { min-width: 130px; }
td input.breit { min-width: 190px; }

.marke { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.marke.neu { background: var(--gruen-hell); color: var(--gruen-dunkel); }
.marke.konflikt { background: var(--gelb-hell); color: #7a5a00; }
.marke.duplikat { background: var(--blau-hell); color: var(--blau); }
.marke.fehler { background: var(--rot-hell); color: var(--rot); }
.hinweise { margin: .3rem 0 0; padding-left: 1.1rem; font-size: .82rem; }
.hinweise.fehler { color: var(--rot); }
.hinweise.warnung { color: #7a5a00; }
.fehlt { color: var(--rot); font-size: .8rem; font-weight: 600; }

.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.kachel { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: .75rem 1rem; }
.kachel span { display: block; color: var(--leise); font-size: .8rem; }
.kachel strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.kundenliste { display: grid; gap: .15rem; max-height: 65vh; overflow-y: auto; }
.kundenliste button { text-align: left; border: 0; background: none; font: inherit; padding: .45rem .6rem; border-radius: 6px; cursor: pointer; }
.kundenliste button:hover { background: var(--grund); }
.kundenliste button.aktiv { background: var(--gruen-hell); color: var(--gruen-dunkel); font-weight: 600; }
.leer { color: var(--leise); text-align: center; padding: 2rem 1rem; }
.geheim { font-family: ui-monospace, monospace; background: var(--gelb-hell); padding: .6rem .8rem; border-radius: 6px; user-select: all; word-break: break-all; }

#meldung {
  position: fixed; right: 1.25rem; bottom: 1.25rem; max-width: 420px; background: var(--text); color: #fff;
  padding: .7rem 1rem; border-radius: var(--radius); z-index: 20; animation: fadeSlideIn .2s ease-out;
}
#meldung.fehler { background: var(--rot); }

@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 800px) {
  header { flex-wrap: wrap; gap: .5rem; padding: .5rem .75rem; }
  nav { order: 3; flex-basis: 100%; }
  .kopf-konto { margin-left: auto; }
  main { padding: 1rem .75rem; }
  .spalten { grid-template-columns: 1fr; }
}
