/* ============================================================================
   Spicy Suite — helles Buchhaltungs-Design „Klar" (Update v166)
   Wird NACH den Seiten-Styles geladen und überschreibt das dunkle Theme.
   Nur auf Verwaltungs-/Buchhaltungsseiten einbinden — Kasse/Küche bleiben dunkel.
   Deckt beide Variablen-Familien ab (--karte/--card, --line/--rand) und Seiten
   ganz ohne Variablen (buchhaltung.php, bank.php, ustva.php) per !important.
   ============================================================================ */
:root{
  --bg:#faf9f5 !important; --karte:#ffffff !important; --card:#ffffff !important;
  --line:#e8e4da !important; --rand:#e8e4da !important; --linie:#e8e4da !important;
  --txt:#1b2233 !important; --tinte:#1b2233 !important; --mut:#6b7280 !important;
  --akz:#2f7d6e !important;                 /* Orange → Grün */
  --ok:#2f7d6e !important; --warn:#b9791f !important;
  --rot:#c23a3a !important;                 /* Signalrot bleibt, gedeckter */
  --h-blau:#3564c4; --h-blau-hell:#e9eefb; --h-gruen-hell:#e7f2ee;
  --h-amber-hell:#faf1df; --h-rot-hell:#f9e9e9;
}

/* Grundfläche & Text — greift auch ohne CSS-Variablen in der Seite */
body{background:#faf9f5 !important;color:#1b2233 !important;
     font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif !important}
a{color:#2f7d6e}

/* Karten/Boxen beider Namensfamilien */
.karte,.card,.box,.panel,section.karte,div[class*="karte"],div[class*="card"]{
  background:#fff !important;border-color:#e8e4da !important;color:#1b2233 !important;
  border-radius:14px}

/* Überschriften, gedämpfter Text */
h1,h2,h3,h4,legend{color:#1b2233 !important}
small,.mut,.muted,.hint,.hinweis{color:#6b7280 !important}

/* Tabellen */
table{color:#1b2233 !important}
th{color:#6b7280 !important;border-color:#e8e4da !important;background:transparent !important}
td{border-color:#f1eee6 !important}
tr:hover td{background:#fcfbf8}

/* Formulare */
input,select,textarea{
  background:#fff !important;color:#1b2233 !important;border:1px solid #e8e4da !important;
  border-radius:9px}
input::placeholder,textarea::placeholder{color:#9aa0ab !important}
:focus-visible{outline:2px solid #3564c4 !important;outline-offset:2px}

/* Knöpfe: neutral hell, Primäraktionen grün statt orange/rot */
button,.btn,input[type=submit]{
  background:#fff !important;color:#1b2233 !important;border:1px solid #e8e4da !important;
  border-radius:10px;font-weight:600}
button:hover,.btn:hover{border-color:#2f7d6e !important;color:#25655a !important}
button.primary,.btn.primary,.btn-voll,button[class*="haupt"],
input[type=submit].primary{
  background:#2f7d6e !important;border-color:#2f7d6e !important;color:#fff !important}
button.gefahr,.btn.rot,.btn-rot{border-color:#c23a3a !important;color:#c23a3a !important;background:#fff !important}

/* Statusfarben/Badges */
.ok,.gruen,.badge-ok{color:#25655a !important;background:#e7f2ee !important;border-color:#cfe4dd !important}
.warn,.badge-warn{color:#b9791f !important;background:#faf1df !important}
.fehler,.error,.badge-rot{color:#c23a3a !important;background:#f9e9e9 !important}

/* Reiter/Navigation der Buchhaltungsseiten */
nav a,.tabs a,.tab{color:#1b2233 !important}
nav a.aktiv,.tabs a.aktiv,.tab.aktiv,a[aria-current]{
  background:#e7f2ee !important;color:#25655a !important;border-color:#cfe4dd !important}

/* Geldbeträge: Tabellenziffern für saubere Ausrichtung */
td[class*="geld"],td[class*="betrag"],.betrag,.geld,td:last-child:not(:first-child){
  font-variant-numeric:tabular-nums}

/* Dunkle Inline-Hintergründe neutralisieren (style="background:#161616" u. ä.).
   AUSNAHME (v188): Das Kamera-Overlay des Beleg-Scanners (#scanOv) MUSS dunkel
   bleiben — ein weißer Rahmen um das Kamerabild wäre am Tresen unbrauchbar. */
[style*="background:#0d0d0d"]:not(#scanOv):not(#scanOv *),
[style*="background:#111"]:not(#scanOv):not(#scanOv *),
[style*="background:#161616"]:not(#scanOv):not(#scanOv *),
[style*="background:#1b1b1b"]:not(#scanOv):not(#scanOv *),
[style*="background:#000"]:not(#scanOv):not(#scanOv *){
  background:#fff !important;color:#1b2233 !important}

@media print{body{background:#fff !important}}

/* ==========================================================================
   v201 — Backend durchgaengig hell.

   Die Bestandsseiten wurden fuer dunklen Grund gebaut und tragen ihre Signal-
   farben INLINE am Element (style="color:#8fe0a3"). Inline schlaegt jede
   normale Regel — nur ein !important im Stylesheet gewinnt. Da sich Inline-
   Farben nicht per Klasse ansprechen lassen, greifen wir sie ueber den
   Teilstring im style-Attribut ab und ersetzen sie durch denselben Farbton in
   einer auf Weiss lesbaren Tiefe (Kontrast mindestens 4,5:1 nach WCAG AA).
   Das ist chirurgisch statt pauschal: Jede Farbe behaelt ihre Bedeutung —
   Gruen bleibt Erfolg, Amber bleibt Warnung, Rot bleibt Fehler.
   ========================================================================== */
[style*="color:#7db8ff"],[style*="color: #7db8ff"]{color:#1d4ed8 !important}
[style*="color:#9fc6ff"],[style*="color: #9fc6ff"]{color:#1d4ed8 !important}
[style*="color:#8fb8e8"],[style*="color: #8fb8e8"]{color:#1d4ed8 !important}
[style*="color:#ffcf7d"],[style*="color: #ffcf7d"]{color:#8a5a00 !important}
[style*="color:#ffd79a"],[style*="color: #ffd79a"]{color:#8a5a00 !important}
[style*="color:#ffd77a"],[style*="color: #ffd77a"]{color:#8a5a00 !important}
[style*="color:#f5a300"],[style*="color: #f5a300"]{color:#8a5a00 !important}
[style*="color:#ffb3ba"],[style*="color: #ffb3ba"]{color:#b3261e !important}
[style*="color:#ff9a9a"],[style*="color: #ff9a9a"]{color:#b3261e !important}
[style*="color:#fca5a5"],[style*="color: #fca5a5"]{color:#b3261e !important}
[style*="color:#8fe0a3"],[style*="color: #8fe0a3"]{color:#0f7a33 !important}
[style*="color:#9fe6b4"],[style*="color: #9fe6b4"]{color:#0f7a33 !important}
[style*="color:#54d98c"],[style*="color: #54d98c"]{color:#0f7a33 !important}
[style*="color:#4ade80"],[style*="color: #4ade80"]{color:#0f7a33 !important}
[style*="color:#c0a0e0"],[style*="color: #c0a0e0"]{color:#6b3fa0 !important}
[style*="color:#22c55e"],[style*="color: #22c55e"]{color:#0f7a33 !important}
[style*="color:#8ab4ff"],[style*="color: #8ab4ff"]{color:#1d4ed8 !important}
[style*="color:#9a9a9a"],[style*="color: #9a9a9a"]{color:#6b7280 !important}
[style*="color:#999"],[style*="color: #999"]{color:#6b7280 !important}
[style*="color:#888"],[style*="color: #888"]{color:#6b7280 !important}
[style*="color:#ccc"],[style*="color: #ccc"]{color:#6b7280 !important}
[style*="color:#ddd"],[style*="color: #ddd"]{color:#4b5563 !important}
[style*="color:#fff"],[style*="color: #fff"]{color:#1b2233 !important}
[style*="color:#eee"],[style*="color: #eee"]{color:#1b2233 !important}
[style*="color:#aaa"],[style*="color: #aaa"]{color:#6b7280 !important}
[style*="color:#bbb"],[style*="color: #bbb"]{color:#6b7280 !important}

[style*="background:#151515"],[style*="background: #151515"]{background:#ffffff !important;border-color:#e8e4da !important}
[style*="background:#161616"],[style*="background: #161616"]{background:#ffffff !important;border-color:#e8e4da !important}
[style*="background:#101010"],[style*="background: #101010"]{background:#ffffff !important;border-color:#e8e4da !important}
[style*="background:#111"],[style*="background: #111"]{background:#ffffff !important;border-color:#e8e4da !important}
[style*="background:#0c0c0e"],[style*="background: #0c0c0e"]{background:#ffffff !important;border-color:#e8e4da !important}
[style*="background:#2a1c05"],[style*="background: #2a1c05"]{background:#faf1df !important;border-color:#e8e4da !important}
[style*="background:#2a1010"],[style*="background: #2a1010"]{background:#f9e9e9 !important;border-color:#e8e4da !important}
[style*="background:#1e0708"],[style*="background: #1e0708"]{background:#f9e9e9 !important;border-color:#e8e4da !important}

/* Balken und Fortschrittsanzeigen: dunkle Spur wird zur hellen Spur */
.balken,.bar-spur,.progress{background:#eef2f6 !important}

/* Diagramm-Beschriftungen in SVG folgen dem Text, nicht dem alten Dunkelgrund */
svg text{fill:#1b2233 !important}
svg .achse,svg .grid line{stroke:#e8e4da !important}

/* Kopfleisten, die fest dunkel gesetzt waren */
header[style*="background:#0"],.kopf[style*="background:#0"]{background:#ffffff !important;color:#1b2233 !important}
