/* Verwaltung Feinkost-Shop. Handy zuerst, hell und dunkel.
   Lehre aus der CMA (cma-dunkles-thema-lesbarkeit): eine Farbe ist ENTWEDER Fläche ODER Schrift.
   Darum gibt es hier keine Marken-Farbnamen in den Regeln, nur Rollen. Die Marke steckt in den Werten. */

@font-face { font-family: "Cormorant Garamond"; font-weight: 400 600; font-display: swap; src: url("/fonts/cormorant.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 300 600; font-display: swap; src: url("/fonts/outfit.woff2") format("woff2"); }

:root {
  --flaeche: #fbf7ee; --flaeche-2: #ffffff; --flaeche-3: #f1e9d8; --kopf: #2c3720; --kopf-schrift: #f4eee1;
  --schrift: #2a2318; --schrift-leise: #6a5f4d; --linie: #e0d5bd;
  --akzent: #2c3720; --akzent-schrift: #fbf7ee; --gold: #7a5810; --gold-flaeche: #f6e9c6;
  --gut: #2f5d2a; --gut-flaeche: #e3efd9; --warn: #8a4b00; --warn-flaeche: #fbe7c8; --schlecht: #8c2318; --schlecht-flaeche: #f8dcd6;
  --ruhig: #4d5a6a; --ruhig-flaeche: #e6eaef;
  --schatten: 0 1px 2px rgba(58, 46, 34, .08), 0 6px 20px rgba(58, 46, 34, .06);
  --radius: 14px; --serif: "Cormorant Garamond", Georgia, serif; --sans: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-thema="hell"]) {
  --flaeche: #151a0f; --flaeche-2: #1f2716; --flaeche-3: #2a341e; --kopf: #10140b; --kopf-schrift: #f4eee1;
  --schrift: #f1ead9; --schrift-leise: #b3aa93; --linie: #38432a;
  --akzent: #e6c578; --akzent-schrift: #1a1608; --gold: #e6c578; --gold-flaeche: #3a3013;
  --gut: #a9d79b; --gut-flaeche: #1f3319; --warn: #f3c27a; --warn-flaeche: #3d2c10; --schlecht: #f2a297; --schlecht-flaeche: #42201b;
  --ruhig: #b5c2d2; --ruhig-flaeche: #252d38; --schatten: 0 1px 2px rgba(0, 0, 0, .4);
} }
:root[data-thema="dunkel"] {
  --flaeche: #151a0f; --flaeche-2: #1f2716; --flaeche-3: #2a341e; --kopf: #10140b; --kopf-schrift: #f4eee1;
  --schrift: #f1ead9; --schrift-leise: #b3aa93; --linie: #38432a;
  --akzent: #e6c578; --akzent-schrift: #1a1608; --gold: #e6c578; --gold-flaeche: #3a3013;
  --gut: #a9d79b; --gut-flaeche: #1f3319; --warn: #f3c27a; --warn-flaeche: #3d2c10; --schlecht: #f2a297; --schlecht-flaeche: #42201b;
  --ruhig: #b5c2d2; --ruhig-flaeche: #252d38; --schatten: 0 1px 2px rgba(0, 0, 0, .4);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--flaeche); color: var(--schrift); font: 400 16px/1.5 var(--sans); min-height: 100dvh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: .005em; }
h1 { font-size: 2rem; } h2 { font-size: 1.45rem; } h3 { font-size: 1.2rem; }
p { margin: 0; } a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.sprung { position: absolute; left: -999px; top: 0; background: var(--akzent); color: var(--akzent-schrift); padding: .6rem 1rem; z-index: 10; }
.sprung:focus { left: .5rem; top: .5rem; }

.testband { background: var(--gold-flaeche); color: var(--gold); text-align: center; font-size: .85rem; font-weight: 500; padding: .35rem 1rem; border-bottom: 1px solid var(--linie); }
.kopf { background: var(--kopf); color: var(--kopf-schrift); display: flex; align-items: center; gap: 1rem; padding: .7rem 1rem; padding-top: calc(.7rem + env(safe-area-inset-top)); position: sticky; top: 0; z-index: 5; }
.marke { text-decoration: none; display: flex; align-items: baseline; gap: .5rem; min-height: 44px; align-items: center; }
.marke-name { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; white-space: nowrap; }
.marke-ort { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: #e6c578; border: 1px solid rgba(230, 197, 120, .5); border-radius: 99px; padding: .1rem .55rem; }
.kopf-rechts { margin-left: auto; display: flex; gap: .25rem; align-items: center; }
.knopf-still { white-space: nowrap; background: none; border: 0; color: inherit; font: inherit; font-size: .9rem; min-width: 44px; min-height: 44px; border-radius: 10px; cursor: pointer; padding: 0 .6rem; }
.knopf-still:hover { background: rgba(255, 255, 255, .1); }

.nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--flaeche-2); border-top: 1px solid var(--linie); padding-bottom: env(safe-area-inset-bottom); z-index: 6; }
.nav a { flex: 1; text-align: center; text-decoration: none; padding: .95rem .5rem; min-height: 56px; color: var(--schrift-leise); font-weight: 500; border-top: 3px solid transparent; }
.nav a[aria-current="page"] { color: var(--schrift); border-top-color: var(--gold); }

main { max-width: 62rem; margin: 0 auto; padding: 1.25rem 1rem 2rem; outline: none; }
.seitenkopf { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 1rem; }
.leise { color: var(--schrift-leise); font-size: .9rem; }
.leer { color: var(--schrift-leise); text-align: center; padding: 2.5rem 1rem; }

.zaehler { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 1.25rem; }
.zahl { background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--schatten); text-decoration: none; display: block; }
.zahl b { display: block; font: 600 2.1rem/1.1 var(--serif); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.zahl span { color: var(--schrift-leise); font-size: .85rem; }
.zahl.betont { background: var(--akzent); border-color: var(--akzent); }
.zahl.betont b, .zahl.betont span { color: var(--akzent-schrift); }

.karte { background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten); margin-bottom: 1.25rem; overflow: hidden; }
.karte > h2, .karte > h3 { padding: 1rem 1rem .25rem; }
.karte-inhalt { padding: .75rem 1rem 1rem; }
.warnung { display: flex; gap: .6rem; align-items: flex-start; background: var(--warn-flaeche); color: var(--warn); border-radius: 10px; padding: .7rem .85rem; margin-bottom: .5rem; font-weight: 500; }
.warnung::before { content: "!"; flex: none; width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 2px solid currentColor; display: grid; place-items: center; font-size: .85rem; font-weight: 600; }

.zeilen { list-style: none; margin: 0; padding: 0; }
.zeile { display: grid; grid-template-columns: 1fr auto; gap: .15rem 1rem; padding: .85rem 1rem; border-top: 1px solid var(--linie); text-decoration: none; min-height: 64px; }
.zeile:first-child { border-top: 0; }
.zeile:hover { background: var(--flaeche-3); }
.zeile .wer { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zeile .summe { font-variant-numeric: tabular-nums; font-weight: 500; text-align: right; }
.zeile .neben { color: var(--schrift-leise); font-size: .85rem; }
.zeile .rechts { text-align: right; }

.marke-status { display: inline-block; font-size: .78rem; font-weight: 500; border-radius: 99px; padding: .12rem .6rem; background: var(--ruhig-flaeche); color: var(--ruhig); white-space: nowrap; }
.marke-status[data-s="bezahlt"], .marke-status[data-s="rechnung_erstellt"] { background: var(--gold-flaeche); color: var(--gold); }
.marke-status[data-s="gepackt"], .marke-status[data-s="versendet"], .marke-status[data-s="abgeschlossen"] { background: var(--gut-flaeche); color: var(--gut); }
.marke-status[data-s="widerrufen"], .marke-status[data-s="zahlung_ausstehend"] { background: var(--warn-flaeche); color: var(--warn); }
.marke-status[data-s="zahlung_fehlgeschlagen"], .marke-status[data-s="erstattet"] { background: var(--schlecht-flaeche); color: var(--schlecht); }

.filter { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .5rem; margin-bottom: .5rem; scrollbar-width: thin; }
.filter button { flex: none; border: 1px solid var(--linie); background: var(--flaeche-2); color: var(--schrift); font: inherit; font-size: .9rem; border-radius: 99px; padding: .5rem .95rem; min-height: 44px; cursor: pointer; }
.filter button[aria-pressed="true"] { background: var(--akzent); color: var(--akzent-schrift); border-color: var(--akzent); }

label { display: block; font-size: .85rem; font-weight: 500; color: var(--schrift-leise); margin-bottom: .3rem; }
input, textarea { width: 100%; font: inherit; color: var(--schrift); background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: 10px; padding: .75rem .85rem; min-height: 48px; }
textarea { min-height: 5rem; resize: vertical; }
input::placeholder { color: var(--schrift-leise); }
.feld { margin-bottom: 1rem; }
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; border: 0; border-radius: 12px; background: var(--akzent); color: var(--akzent-schrift); font: 500 1rem var(--sans); padding: .85rem 1.2rem; min-height: 52px; cursor: pointer; }
.knopf:disabled { opacity: .55; cursor: progress; }
.knopf.zweit { background: transparent; color: var(--schrift); border: 1px solid var(--linie); }
.fehler { background: var(--schlecht-flaeche); color: var(--schlecht); border-radius: 10px; padding: .7rem .85rem; margin-bottom: 1rem; font-weight: 500; }

.anmeldung { max-width: 24rem; margin: 8vh auto 0; }
.anmeldung h1 { margin-bottom: .35rem; } .anmeldung .leise { margin-bottom: 1.5rem; }

.zurueck { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; color: var(--schrift-leise); margin-bottom: .25rem; }
.paar { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
.tabelle { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tabelle th { text-align: left; font-weight: 500; color: var(--schrift-leise); font-size: .8rem; padding: .4rem 0; border-bottom: 1px solid var(--linie); }
.tabelle td { padding: .6rem 0; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tabelle td:last-child, .tabelle th:last-child { text-align: right; white-space: nowrap; }
.tabelle tfoot td { border-bottom: 0; padding: .3rem 0; }
.tabelle tfoot tr:last-child td { font-weight: 600; font-size: 1.05rem; padding-top: .6rem; }
.adresse { font-style: normal; line-height: 1.55; overflow-wrap: anywhere; }
.verlauf { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--linie); }
.verlauf li { position: relative; padding: 0 0 1rem .9rem; }
.verlauf li::before { content: ""; position: absolute; left: calc(-1rem - 6px); top: .45rem; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); border: 2px solid var(--flaeche-2); }
.verlauf .was { font-weight: 500; overflow-wrap: anywhere; }
.aktion { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--flaeche) 70%, transparent); padding: 1rem 0 .5rem; margin-top: -.5rem; z-index: 3; }

.meldung { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom)); background: var(--schrift); color: var(--flaeche); border-radius: 12px; padding: .7rem 1.1rem; box-shadow: var(--schatten); z-index: 9; max-width: calc(100vw - 2rem); }

@media (min-width: 48rem) {
  body { padding-bottom: 0; }
  .nav { position: static; background: none; border: 0; padding: 0; margin-left: 1.5rem; gap: .25rem; }
  .nav a { flex: none; color: rgba(244, 238, 225, .75); padding: .5rem .9rem; min-height: 44px; border-top: 0; border-radius: 10px; display: flex; align-items: center; }
  .nav a[aria-current="page"] { color: #f4eee1; background: rgba(255, 255, 255, .12); }
  .zaehler { grid-template-columns: repeat(4, 1fr); }
  .paar { grid-template-columns: 3fr 2fr; align-items: start; }
  .knopf { width: auto; }
  .aktion { position: static; background: none; padding: 0; margin: 0 0 1.25rem; }
  .meldung { bottom: 1.5rem; }
  main { padding-top: 2rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .zeile, .knopf, .filter button, .knopf-still { transition: background-color .15s ease, color .15s ease, opacity .15s ease; }
  main > * { animation: auf .28s ease both; }
  @keyframes auf { from { opacity: 0; transform: translateY(6px); } }
}
