/* Auslagen: Handy zuerst. Farben wie die Messe-Kontakte: Lila #8764B8 (Leiste),
   Blau #24398B, Orange #EF8F18. Gruen fuer erledigt, Rot nur fuer Stornieren. */
:root {
  --lila: #8764B8; --navy: #24398B; --orange: #EF8F18;
  --text: #1F2937; --sek: #6B7280; --rand: #D9DCE3; --grund: #F4F5F8; --flaeche: #fff;
  --gefahr: #B42318; --gefahr-hell: #FEF3F2; --info-hell: #EEF1F9;
  --ok: #17796B; --ok-hell: #ECFDF3; --warn: #B45309; --fokus: #6B4A9E;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--grund); color: var(--text);
  font: 17px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; }
[hidden] { display: none !important; }
a { color: var(--navy); }

.leiste { background: var(--lila); color: #fff; display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px 12px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); position: sticky; top: 0; z-index: 10; }
.leiste-marke { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 600; font-size: 1.05rem; }
.leiste-marke img { height: 28px; }
.leiste nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; align-items: center; }
.leiste nav a, .leiste nav button { color: #fff; text-decoration: none; padding: 8px 10px; border-radius: 8px;
  font: inherit; font-size: .92rem; background: none; border: 0; cursor: pointer; min-height: 40px; display: inline-flex; align-items: center; }
.leiste nav a.aktiv { background: rgba(255,255,255,.22); }
.leiste nav form { margin: 0; }
.sprache { display: flex; gap: 2px; margin-left: auto; }
.leiste nav + .sprache, .sprache + nav { margin-left: 0; }
.sprache button { font: inherit; font-size: .78rem; font-weight: 600; color: #fff; background: none;
  border: 1px solid rgba(255,255,255,.55); border-radius: 6px; min-width: 36px; min-height: 32px; cursor: pointer; }
.sprache button.aktiv { background: #fff; color: var(--lila); border-color: #fff; }

main { max-width: 760px; margin: 0 auto; padding: 12px 12px 48px; }
.karte { background: var(--flaeche); border: 1px solid var(--rand); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.karte.schmal { max-width: 440px; margin: 24px auto; }
h1 { font-size: 1.3rem; color: var(--navy); margin: 0 0 10px; }
h2 { font-size: 1rem; color: var(--navy); margin: 18px 0 8px; }
.karte h2:first-child { margin-top: 0; }
.sek { color: var(--sek); font-size: .85rem; margin: 6px 0; }
label, .feld { display: block; font-size: .9rem; color: var(--sek); margin: 8px 0; }
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: #fff;
  border: 2px solid var(--rand); border-radius: 10px; padding: 10px 12px; min-height: 48px; margin-top: 4px; }
input[type=checkbox] { width: 24px; height: 24px; min-height: 0; margin: 0 10px 0 0; accent-color: var(--lila); }
input:focus, select:focus, textarea:focus { border-color: var(--lila); outline: none; }
textarea { resize: vertical; line-height: 1.5; }
.feld.fehler input, .feld.fehler textarea { border-color: var(--gefahr); }
.feldfehler { display: block; color: var(--gefahr); font-size: .85rem; margin-top: 4px; }
.feld.haken { display: flex; align-items: center; min-height: 48px; margin-top: 30px; color: var(--text); }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.zwei > .feld { margin-top: 8px; }

.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px;
  padding: 0 16px; border-radius: 10px; border: 2px solid var(--navy); background: #fff; color: var(--navy);
  font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none; }
.knopf.haupt { background: var(--navy); color: #fff; }
.knopf.breit { width: 100%; }
.knopf.gross { min-height: 58px; font-size: 1.1rem; }
.knopf.klein { min-height: 36px; padding: 0 10px; font-size: .85rem; }
.knopf.link { border: 0; padding: 0 4px; min-height: 40px; background: none; text-decoration: underline; font-weight: 500; }
.knopf.gefahr { border-color: var(--gefahr); background: var(--gefahr); color: #fff; }
.knopf.erledigen { background: var(--ok); border-color: var(--ok); color: #fff; }
.knopf.rechnung { border-color: var(--lila); color: #5B3F86; }
.formular .knopf.breit { margin-top: 10px; }
.zurueck-knopf { margin-top: 10px; }

.meldung { padding: 10px 12px; border-radius: 10px; margin-bottom: 10px; background: var(--info-hell); }
.meldung.error { background: var(--gefahr-hell); color: var(--gefahr); }
.meldung.success { background: var(--ok-hell); color: var(--ok); }

/* Kacheln */
.kacheln { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.kachel { background: #fff; border: 1px solid var(--rand); border-radius: 12px; padding: 10px 12px; }
.kachel.haupt { grid-column: 1 / -1; border-top: 4px solid var(--lila); }
@media (min-width: 560px) { .kacheln { grid-template-columns: 2fr 1fr 2fr; } .kachel.haupt { grid-column: auto; } }
.kz-wert { font-size: 1.5rem; font-weight: 700; color: var(--navy); line-height: 1.15; font-variant-numeric: tabular-nums; }
.kachel.haupt .kz-wert { font-size: 1.9rem; }
.kz-name { font-size: .82rem; color: var(--sek); }
.neu-knopf { margin-bottom: 12px; }
.neu-knopf span[aria-hidden] { font-size: 1.5rem; line-height: 1; }

.filterzeile { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; min-height: 42px; padding: 0 14px; border-radius: 21px;
  border: 2px solid var(--rand); background: #fff; color: var(--text); font-size: .9rem; text-decoration: none; }
.chip.an { background: var(--navy); border-color: var(--navy); color: #fff; }

/* Liste */
.liste { display: flex; flex-direction: column; gap: 8px; }
.eintrag { display: block; background: #fff; border: 1px solid var(--rand); border-left: 6px solid var(--orange);
  border-radius: 12px; padding: 10px 12px; color: inherit; text-decoration: none; }
.eintrag:active, .eintrag:hover { border-color: var(--navy); }
.eintrag.erledigt { border-left-color: var(--ok); }
.eintrag.storniert { border-left-color: #9CA3AF; opacity: .75; }
.eintrag-kopf { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.eintrag-thema { font-weight: 600; word-break: break-word; }
.eintrag-betrag { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.eintrag-fuss { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.eintrag-fuss .sek { margin: 2px 0 0; }
.marken { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kopf-karte .marken { margin: 8px 0; }
.marke { display: inline-flex; align-items: center; gap: 3px; font-size: .78rem; padding: 2px 8px; border-radius: 10px; background: var(--grund); color: var(--text); }
.marke.ok { background: var(--ok-hell); color: var(--ok); }
.marke.offen { background: #FEF3E2; color: #92400E; }
.marke.storno { background: #E5E7EB; color: #374151; }
.marke.leise { color: var(--sek); }
.marke.klammer { background: #F3EEFA; color: #5B3F86; }
.nur-lesen { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.betrag.leer { color: var(--sek); }

details.erledigt-block { margin-top: 18px; }
details.erledigt-block > summary, details.bearbeiten > summary, details.zusatz > summary, details.entfernte > summary {
  cursor: pointer; font-weight: 600; color: var(--navy); min-height: 44px; display: flex; align-items: center; gap: .3em; }
details.erledigt-block .liste { margin-top: 6px; }
.fuss-link { margin-top: 20px; text-align: center; font-size: .9rem; }
.gefahr-link { color: var(--gefahr); }
.zurueck { text-decoration: none; font-weight: 600; display: inline-flex; min-height: 40px; align-items: center; }

/* Detail */
.kopf-karte { border-top: 4px solid var(--orange); }
.kopf-karte.status-erledigt { border-top-color: var(--ok); }
.kopf-karte.status-storniert { border-top-color: #9CA3AF; }
.kopf-karte h1 { margin: 4px 0 4px; word-break: break-word; }
.gross-betrag { font-size: 2rem; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.notiz { white-space: normal; background: var(--grund); border-radius: 8px; padding: 8px 10px; margin: 8px 0 0; }
.aktionen { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.aktionen form { margin: 0; }
.aktionen .knopf { height: 100%; line-height: 1.2; text-align: center; padding: 6px 10px; }

.anhaenge { list-style: none; padding: 0; margin: 0 0 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.anhaenge li { display: flex; flex-direction: column; gap: 4px; }
.anhang-vorschau { display: flex; align-items: center; justify-content: center; aspect-ratio: 3 / 4; background: var(--grund);
  border: 1px solid var(--rand); border-radius: 8px; overflow: hidden; text-decoration: none; }
.anhang-vorschau img { width: 100%; height: 100%; object-fit: cover; }
.pdf-symbol { font-weight: 700; color: var(--gefahr); font-size: 1.4rem; }
.anhang-name { font-size: .78rem; color: var(--sek); word-break: break-all; }
.dateiwahl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dateiknopf { position: relative; margin: 0; text-align: center; line-height: 1.2; padding: 6px 10px; border-style: dashed; color: var(--navy); font-size: .92rem; }
.dateiknopf input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; min-height: 0; }
.dateiknopf:focus-within { outline: 3px solid var(--fokus); }
.dateiliste { list-style: none; padding: 0; margin: 6px 0; }
.schlicht { list-style: none; padding: 0; }
.schlicht li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; }
form.inline { display: inline; margin: 0; }
.bestaetigen-was { font-size: 1.05rem; }
.anmelde-logo { display: block; margin: 4px auto 14px; border-radius: 20px; }
