/* FluxDoc 2.0 · Etappe 1: Nahansicht, Verlauf. Werte aus app.css. */
.v2-chip { display: inline-flex; justify-content: center; font: 650 14px/1 var(--body); padding: 6px 9px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text); background: var(--surface); white-space: nowrap; }
.v2-chip.warn { color: var(--amber); background: var(--amber-50); border-color: var(--amber-line); }
.v2-chip.bad { color: var(--red); background: var(--red-50); border-color: var(--error-line); }
.v2-chip.info { color: var(--blue-700); background: var(--blue-50); border-color: var(--blue-100); }
.v2-chip.muted { color: var(--muted); background: var(--sunken); }
.v2-nah { position: relative; width: 100%; max-height: 160px; margin: 10px 0 4px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background-color: var(--on-accent); background-repeat: no-repeat; box-shadow: var(--shadow-1); overflow: hidden; }
.v2-nah i { position: absolute; border: 2px solid var(--amber); border-radius: 3px; background: var(--warning-wash); }

.v2-verlauf { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.v2-verlauf summary { cursor: pointer; padding: 12px 14px; font-weight: 650; min-height: 44px; display: flex; align-items: center; }
.v2-verlauf__body { padding: 0 14px 14px; }
.v2-zust { margin-bottom: 12px; }
.v2-zeitleiste { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: grid; gap: 10px; }
.v2-zeitleiste li { position: relative; display: grid; gap: 2px; font-size: 16px; }
.v2-zeitleiste li::before { content: ''; position: absolute; left: -20px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); border: 2px solid var(--surface); }

/* Etappe 2: Abgleich am Beleg, Lieferanten */
.v2-abgleich ul { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.v2-hw { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; align-items: start; padding: 9px 12px; border-radius: var(--r); font-size: 16px; line-height: 1.45; border: 1px solid var(--line); background: var(--surface); }
.v2-hw svg { width: 16px; height: 16px; margin-top: 2px; }
.v2-hw.ok { color: var(--green); background: var(--green-50); border-color: var(--safe-line); }
.v2-hw.ok span { color: var(--ink); }
.v2-hw.hinweis svg { color: var(--blue); }
.v2-hw.warnung { background: var(--amber-50); border-color: var(--amber-line); color: var(--amber); }
.v2-hw.warnung span { color: var(--ink); }
.v2-hw a { font-weight: 650; }
.v2-lief td, .v2-lief th { vertical-align: top; }

.rstate.v2-warn b { color: var(--amber); }

/* Etappe 3: Lieferanten-Karten, Buchhaltung, vier Augen */
.v2-ltools { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: space-between; margin: 0 0 18px; }
.v2-suche { position: relative; flex: 1 1 280px; max-width: 420px; }
.v2-suche svg { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.v2-suche input { width: 100%; min-height: 44px; padding: 10px 12px 10px 38px; border: 1px solid var(--line-strong); border-radius: var(--r); font: inherit; background: var(--surface); }
.v2-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.v2-filter { min-height: 38px; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font: 600 16px/1 var(--body); color: var(--text); cursor: pointer; transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease); }
.v2-filter span { margin-left: 4px; color: var(--faint); font-weight: 700; }
.v2-filter[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: var(--on-accent); }
.v2-filter[aria-pressed=true] span { color: var(--white-muted); }
.v2-lgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; }
.v2-lk { display: grid; gap: 14px; align-content: start; padding: 18px 18px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); transition: box-shadow .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease); }
.v2-lk:hover { box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.v2-lk.auffaellig { border-color: var(--error-line); box-shadow: inset 3px 0 0 var(--red), var(--shadow-1); }
.v2-lk__kopf { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.v2-lk__av { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--blue-50); color: var(--blue-700); font: 700 16px/1 var(--head); letter-spacing: .02em; }
.v2-lk__av.absender { background: var(--sunken); color: var(--muted); }
.v2-lk__name { min-width: 0; display: grid; gap: 2px; }
.v2-lk__name h3 { font-size: 16.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2-lk__zahlen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--line); }
.v2-lk__zahlen div { display: grid; gap: 4px; align-content: start; }
.v2-lk__zahlen dt { font-size: 16px; color: var(--muted); font-weight: 600; }
.v2-lk__zahlen dd { margin: 0; font: 700 20px/1.1 var(--head); color: var(--ink); }
.v2-meter { display: block; height: 4px; border-radius: 4px; background: var(--sunken); overflow: hidden; }
.v2-meter i { display: block; height: 100%; width: var(--w); border-radius: inherit; background: var(--faint); transform-origin: left; }
.v2-meter.ok i { background: var(--green); } .v2-meter.mid i { background: var(--unsure); } .v2-meter.low i { background: var(--red); }
.v2-lk__auff { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.v2-lk__auff li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 8px; align-items: start; padding: 8px 10px; border-radius: var(--r-sm); background: var(--red-50); font-size: 16px; }
.v2-lk__auff svg { width: 16px; height: 16px; color: var(--red); margin-top: 2px; }
.v2-lk__auff a { color: var(--red); font-weight: 600; }
.v2-lk__fakten { display: grid; gap: 8px; margin: 0; font-size: 16px; }
.v2-lk__fakten div { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.v2-lk__fakten dt { color: var(--muted); font-size: 16px; }
.v2-lk__fakten dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.v2-iban { white-space: nowrap; font-size: 16px; letter-spacing: -.01em; }
.v2-konto { width: 100%; max-width: 150px; min-height: 36px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); font: inherit; font-variant-numeric: tabular-nums; transition: border-color .3s var(--ease), box-shadow .3s var(--ease); }
.v2-konto.v2-gespeichert { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-50); }
.v2-leer { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 44px 24px; }
.v2-leer > svg { width: 36px; height: 36px; color: var(--faint); }
.v2-fuss { margin-top: 18px; }

.v2-steuerbuero { margin: 0 0 18px; }
.v2-buch { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.v2-felder { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.v2-felder .field { display: grid; gap: 4px; }
.v2-felder input, .v2-felder select, .v2-buch .field input { min-height: 42px; }
.v2-vier__kopf { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; }
.v2-vier__kopf > svg { width: 26px; height: 26px; color: var(--blue); }
.v2-schalter { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.v2-schalter input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.v2-schalter span { position: relative; flex: none; width: 46px; height: 28px; border-radius: 999px; background: var(--line-strong); transition: background .2s var(--ease); }
.v2-schalter span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px var(--shadow-alpha-mid); transition: transform .24s var(--ease); }
.v2-schalter input:checked + span { background: var(--blue); }
.v2-schalter input:checked + span::after { transform: translateX(18px); }
.v2-schalter input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--blue) 55%, transparent); outline-offset: 2px; }
.v2-schalter input:disabled + span { opacity: .55; }
.v2-schritte { margin: 0; padding: 0 0 0 20px; display: grid; gap: 6px; font-size: 16px; color: var(--text); }
.v2-buch__aktion { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 18px; }

.v2-vier { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; margin: 0 0 14px; padding: 14px; border-radius: var(--r); border: 1px solid var(--blue-100); background: var(--blue-50); }
.v2-vier > svg { width: 22px; height: 22px; color: var(--blue); margin-top: 1px; }
.v2-vier > div { display: grid; gap: 6px; }
.v2-vier .btn { justify-self: start; margin-top: 4px; white-space: normal; text-align: left; }
.v2-vier.ok { border-color: var(--safe-line); background: var(--green-50); }
.v2-vier.ok > svg { color: var(--green); }
.v2-datev b { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.v2-datev .v2-chip { padding: 4px 7px; font-size: 14px; }

@media (max-width: 900px) {
  .v2-buch { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .v2-felder { grid-template-columns: minmax(0, 1fr); }
  .v2-lk__fakten div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .v2-suche { max-width: none; }
  .v2-lk { padding: 16px 14px 14px; }
}

/* Etappe 4: Foto-Erfassung, Exportvorlagen */
.v2-foto-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 10px; }
.v2-foto-cta .btn svg { width: 18px; height: 18px; }
body.v2-foto-offen { overflow: hidden; }
.v2-foto { position: fixed; inset: 0; z-index: 300; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--side-deep); color: var(--text); }
.v2-foto__kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); }
.v2-foto__kopf h2 { color: var(--on-accent); font-size: 17px; }
.v2-foto__kopf .btn { color: var(--text); } .v2-foto__kopf .btn:hover { background: var(--white-line-soft); }
.v2-foto__buehne { display: grid; place-items: center; min-height: 0; padding: 8px 20px; }
.v2-foto__bild { position: relative; touch-action: none; }
.v2-foto__bild canvas { display: block; width: 100%; height: 100%; border-radius: 4px; }
.v2-foto__maske { position: absolute; inset: 0; overflow: hidden; pointer-events: none; border-radius: 4px; }
.v2-foto__maske i { position: absolute; box-shadow: 0 0 0 9999px var(--overlay-strong); }
.v2-foto__rahmen { position: absolute; border: 2px solid var(--surface); cursor: move; border-radius: 2px; }
.v2-foto__griff { position: absolute; width: 34px; height: 34px; margin: -17px; padding: 0; border: 0; background: transparent; cursor: pointer; touch-action: none; }
.v2-foto__griff::after { content: ''; position: absolute; inset: 8px; border-radius: 50%; background: var(--surface); border: 3px solid var(--blue); box-shadow: 0 1px 6px var(--overlay-strong); }
.v2-foto__griff:focus-visible { outline: 3px solid var(--surface); outline-offset: 0; border-radius: 50%; }
.v2-foto__griff.nw { left: 0; top: 0; } .v2-foto__griff.ne { left: 100%; top: 0; } .v2-foto__griff.sw { left: 0; top: 100%; } .v2-foto__griff.se { left: 100%; top: 100%; }
.v2-foto__leiste { display: grid; gap: 12px; padding: 12px 16px; padding-bottom: max(14px, env(safe-area-inset-bottom)); background: var(--side-deep); border-top: 1px solid var(--white-line-soft); }
.v2-foto__seiten { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; overflow-x: auto; }
.v2-foto__seiten button { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--white-line); background: transparent; color: var(--text); font: 700 16px/1 var(--body); cursor: pointer; display: grid; place-items: center; }
.v2-foto__seiten button[aria-current=true] { background: var(--surface); color: var(--ink); border-color: var(--on-accent); }
.v2-foto__seiten svg { width: 18px; height: 18px; }
.v2-foto__werkzeug { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.v2-foto__werkzeug .btn { background: var(--white-faint); color: var(--text); border-color: var(--white-line); }
.v2-foto__werkzeug .btn:disabled { opacity: .45; }
.v2-foto__werkzeug .btn svg { width: 17px; height: 17px; }
.v2-foto__werkzeug .v2-schalter { color: var(--text); font-weight: 600; font-size: 16px; }
.v2-foto__leiste > .btn.primary { width: 100%; }
@media (min-width: 760px) { .v2-foto__leiste { grid-template-columns: auto 1fr auto; align-items: center; } .v2-foto__leiste > .btn.primary { width: auto; } }

.v2-empf { border: 0; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.v2-empf__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.v2-empf__chips .v2-filter span { font-weight: 600; }
.v2-empf__neu { display: flex; flex-wrap: wrap; gap: 6px; }
.v2-empf__neu input { flex: 1 1 180px; min-height: 36px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); font: inherit; }

/* Bewegung: ruhig, kurz, nur wenn das Betriebssystem es erlaubt. Nichts blinkt, nichts springt. */
@keyframes v2-auf { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes v2-ein { from { opacity: 0; transform: translateY(-4px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes v2-leuchten { 0% { box-shadow: 0 0 0 0 var(--warning-wash); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes v2-fuellen { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: no-preference) {
  .v2-abgleich.v2-erst .v2-hw, .v2-vier.v2-erst { animation: v2-ein .36s var(--ease) both; }
  .v2-abgleich.v2-erst li:nth-child(2) { animation-delay: .05s; } .v2-abgleich.v2-erst li:nth-child(3) { animation-delay: .1s; }
  /* Die Fundstelle leuchtet zweimal kurz auf, wenn das Feld zur Prüfung kommt. */
  .v2-nah i { animation: v2-leuchten 1.6s .25s var(--ease) 2; }
  .rstate.v2-warn { animation: v2-ein .3s var(--ease) both; }
  .v2-lgrid.v2-erst > li { animation: v2-auf .4s var(--ease) both; }
  .v2-lgrid.v2-erst > li:nth-child(2) { animation-delay: .04s; } .v2-lgrid.v2-erst > li:nth-child(3) { animation-delay: .08s; } .v2-lgrid.v2-erst > li:nth-child(4) { animation-delay: .12s; }
  .v2-lgrid.v2-erst > li:nth-child(5) { animation-delay: .16s; } .v2-lgrid.v2-erst > li:nth-child(n+6) { animation-delay: .2s; }
  .v2-lk:hover { transform: translateY(-2px); }
  .v2-lgrid.v2-erst .v2-meter i { animation: v2-fuellen .7s .25s var(--ease) both; }
  .v2-buch.v2-erst > section { animation: v2-auf .4s var(--ease) both; } .v2-buch.v2-erst > section + section { animation-delay: .06s; }
  .v2-foto { animation: v2-ein .24s var(--ease) both; }
}
