/* Suche und Verwaltung (Paket E). Ergänzt basis.css um eigene Klassen, überschreibt keine Basis-Klassen.
   Handy zuerst (390 px), Tipp-Ziele ≥ 56 px (var(--tipp)). */

.unsichtbar {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Suchfeld ---------- */
.suche-form { margin-bottom: var(--abstand); }
.suche-eingabe { position: relative; }
.suche-input {
  -webkit-appearance: none;
  appearance: none;
  padding-right: calc(var(--tipp) + 4px);
}
.suche-input::-webkit-search-cancel-button,
.suche-input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.suche-leeren {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--tipp);
  height: 100%;
  min-height: var(--tipp);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 22px;
  cursor: pointer;
  touch-action: manipulation;
}
.suche-leeren:focus-visible { outline: 3px solid var(--akzent); outline-offset: -3px; }
.suche-hinweis { margin: 6px 0 0; }
.suche-hinweis:empty { display: none; }
.suche-filter { margin-top: var(--abstand-klein); }
.filter-chip { gap: 12px; }
.filter-x { font-size: 16px; }

/* ---------- Kopf einer Ansicht ---------- */
.zurueck {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tipp);
  margin: -8px 0 4px;
  padding-right: 16px;
  color: var(--akzent);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  touch-action: manipulation;
}
.zurueck-pfeil { font-size: 30px; line-height: 1; margin-top: -4px; }
.liste-kopf { margin-bottom: var(--abstand); }
.liste-titel { margin-bottom: 4px; overflow-wrap: anywhere; }
.liste-code { color: var(--akzent); margin-right: 12px; }
.liste-name { letter-spacing: 0.02em; }
.liste-anzahl { margin: 0; color: var(--text-2); font-size: 15px; }

/* ---------- Kostenstellen-Kacheln ---------- */
.kacheln {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--abstand-klein);
}
.kachel {
  display: flex;
  flex-direction: column;
  min-height: 136px;
  padding: 14px 14px 12px;
  background: var(--flaeche);
  border: 2px solid var(--linie);
  color: var(--text);
  text-decoration: none;
  touch-action: manipulation;
}
.kachel:hover, .kachel:focus-visible { border-color: var(--akzent); outline: none; }
.kachel:active { background: var(--flaeche-2); border-color: var(--akzent); }
.kachel-code {
  color: var(--akzent);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}
.kachel-name { margin-top: 6px; font-weight: 500; line-height: 1.25; overflow-wrap: anywhere; }
.kachel-info {
  display: flex;
  flex-direction: column;
  margin-top: auto;
  padding-top: 10px;
  color: var(--text-2);
  font-size: 13px;
}
.kachel-anzahl { color: var(--text); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }

.kst-sprung { margin-bottom: var(--abstand); }
.kst-chip { text-decoration: none; }

/* ---------- Trefferliste ---------- */
.treffer-liste { display: grid; gap: var(--abstand-klein); margin: 0; padding: 0; list-style: none; }
.suche-inhalt[aria-busy="true"] > .treffer-liste,
.suche-inhalt[aria-busy="true"] > .kacheln { opacity: 0.5; transition: opacity 0.15s; }
.treffer { background: var(--flaeche); border: 2px solid var(--linie); }
.treffer-pdf {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 12px 12px 12px 14px;
  color: var(--text);
  text-decoration: none;
  touch-action: manipulation;
}
.treffer-pdf:active { background: var(--flaeche-2); }
.treffer-pdf:focus-visible, .treffer-details:focus-visible, .zurueck:focus-visible, .detail-link:focus-visible {
  outline: 3px solid var(--akzent);
  outline-offset: -3px;
}
.treffer-text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; gap: 2px; }
.treffer-oben { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.treffer-kst {
  padding: 1px 8px;
  background: var(--akzent);
  color: var(--akzent-text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.treffer-art { color: var(--text-2); font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.treffer-lieferant { margin-top: 4px; font-size: 20px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.treffer-meta { font-weight: 500; overflow-wrap: anywhere; }
.treffer-ort, .treffer-notiz { color: var(--text-2); font-size: 14px; overflow-wrap: anywhere; }
.treffer-notiz { font-style: italic; }
.treffer-oeffnen {
  display: flex;
  flex: 0 0 64px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  align-self: center;
  min-height: 72px;
  background: var(--akzent);
  color: var(--akzent-text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.treffer-oeffnen::before {
  content: "";
  width: 20px;
  height: 24px;
  margin-bottom: 5px;
  background: currentColor;
  clip-path: polygon(0 0, 66% 0, 100% 28%, 100% 100%, 0 100%);
}
.treffer-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--tipp);
  padding: 0 14px;
  border-top: 1px solid var(--linie);
  color: var(--akzent);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  touch-action: manipulation;
}
.treffer-details::after { content: "›"; font-size: 28px; line-height: 1; }
.treffer-details:active { background: var(--flaeche-2); }
/* Details | Herunterladen nebeneinander */
.treffer-aktionen { display: flex; }
.treffer-aktionen .treffer-details { flex: 1 1 auto; }
.treffer-laden {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tipp);
  padding: 0 14px;
  border-top: 1px solid var(--linie);
  border-left: 1px solid var(--linie);
  color: var(--akzent);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  touch-action: manipulation;
}
.treffer-laden::after { content: "↓"; font-size: 20px; line-height: 1; }
.treffer-laden:active { background: var(--flaeche-2); }
.treffer-laden:focus-visible { outline: 3px solid var(--akzent); outline-offset: -3px; }
.alle-laden { width: 100%; margin-bottom: var(--abstand); }
.alle-laden-hinweis { margin: 0 0 var(--abstand); }
.detail-laden { margin-bottom: var(--abstand); }
.mehr { width: 100%; margin-top: var(--abstand); }
.mehr-fehler { margin: 8px 0 0; }

/* ---------- Meldungen, Laden ---------- */
.meldung { padding: var(--abstand); background: var(--flaeche); border-left: 6px solid var(--akzent); }
.meldung-fehler { border-left-color: var(--fehler); }
.meldung-titel {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.meldung-text { margin: 0; color: var(--text-2); }
.meldung-knoepfe { display: grid; gap: var(--abstand-klein); margin-top: var(--abstand); }

.laden { display: flex; flex-direction: column; gap: 12px; padding: 24px 0; color: var(--text-2); }
.laden-balken {
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--linie) 0 35%, var(--akzent) 35% 65%, var(--linie) 65% 100%);
  background-size: 200% 100%;
  animation: laden-lauf 1.1s linear infinite;
}
@keyframes laden-lauf { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .laden-balken { animation: none; } }

/* ---------- Details eines Belegs ---------- */
.detail-pdf { margin-bottom: var(--abstand); }
.detail-felder { margin: 0 0 24px; border-top: 1px solid var(--linie); }
.detail-feld {
  display: grid;
  grid-template-columns: minmax(104px, 34%) 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--linie);
}
.detail-feld dt {
  padding-top: 3px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.detail-feld dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.detail-link { display: flex; align-items: center; min-height: var(--tipp); margin: -12px 0; font-weight: 700; text-decoration: none; }
.detail-titel {
  margin: 0 0 var(--abstand-klein);
  color: var(--akzent);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.positionen { display: grid; gap: var(--abstand-klein); margin: 0; padding: 0; list-style: none; }
.position {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-left: 4px solid var(--akzent);
}
.position-kopf { color: var(--text-2); font-size: 13px; letter-spacing: 0.04em; overflow-wrap: anywhere; }
.position-text { font-weight: 500; overflow-wrap: anywhere; }
.position-menge { color: var(--akzent); font-weight: 700; }

/* ---------- Verwaltung ---------- */
.reiter { display: grid; grid-template-columns: 1fr 1fr; gap: var(--abstand-klein); margin: var(--abstand) 0; }
.reiter-knopf { justify-content: center; font-size: 16px; }
.verwaltung-status:empty { display: none; }
.verwaltung-status { margin-bottom: var(--abstand); }
.erklaerung { margin: 0 0 var(--abstand); color: var(--text-2); font-size: 15px; }
.erklaerung strong { color: var(--text); }
.neu-knopf { width: 100%; margin-bottom: var(--abstand); }
.neu-platz:empty { display: none; }
.neu-platz { margin-bottom: var(--abstand); }
.stamm-liste { display: grid; gap: var(--abstand-klein); margin: 0; padding: 0; list-style: none; }
.stamm-eintrag { padding: 14px; background: var(--flaeche); border: 2px solid var(--linie); }
.stamm-eintrag.inaktiv { border-style: dashed; }
.stamm-eintrag.inaktiv .stamm-kopf, .stamm-eintrag.inaktiv .stamm-zeile { opacity: 0.6; }
.stamm-neu { border-color: var(--akzent); }
.stamm-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.stamm-code { color: var(--akzent); font-size: 28px; font-weight: 700; line-height: 1.1; overflow-wrap: anywhere; }
.stamm-name { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.stamm-name-gross { font-size: 22px; }
.stamm-marken { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.stamm-marke {
  padding: 2px 8px;
  border: 1px solid var(--linie);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.stamm-marke-eigen { border-color: var(--akzent); color: var(--akzent); }
.stamm-zeile { margin: 6px 0 0; color: var(--text-2); font-size: 14px; overflow-wrap: anywhere; }
.stamm-aktionen, .stamm-knoepfe { display: grid; grid-template-columns: 1fr 1fr; gap: var(--abstand-klein); margin-top: 12px; }
.knopf-schmal { padding: 0 8px; font-size: 15px; letter-spacing: 0.06em; }
.stamm-leer { padding: 8px 0; }

.stamm-form-titel {
  margin: 0 0 var(--abstand);
  color: var(--akzent);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.input-mehrzeilig { min-height: 112px; resize: vertical; line-height: 1.4; }
.input-gesperrt { color: var(--text-2); border-style: dashed; }
.feld-hilfe { display: block; margin-top: 6px; color: var(--text-2); font-size: 13px; line-height: 1.35; }
.feld-schalter { margin-bottom: var(--abstand); }
.schalter { display: flex; align-items: center; gap: 14px; min-height: var(--tipp); font-weight: 500; cursor: pointer; }
.schalter input { flex: none; width: 26px; height: 26px; margin: 0; accent-color: var(--akzent); }
.stamm-fehler { margin: 0 0 var(--abstand-klein); }
.knopf-loeschen { grid-column: 1 / -1; background: transparent; border-color: var(--fehler); color: var(--fehler); }
.knopf-loeschen.bestaetigen { background: var(--fehler); border-color: var(--fehler); color: var(--akzent-text); }
.stamm-hinweis { margin: 0 0 var(--abstand-klein); padding: 12px 14px; background: var(--flaeche-2); border-left: 6px solid var(--fehler); }
.stamm-hinweis-titel { display: block; margin-bottom: 4px; }
.stamm-hinweis .btn { width: 100%; margin-top: 12px; }

@media (min-width: 700px) {
  .kachel-code { font-size: 40px; }
}
