/* Klein Vendor: Farbwelt Teaktrend (Teak- und Holztöne, Braun als Akzent). Alles lokal, keine fremden Quellen. */
:root {
  --grund: #f5efe6;          /* helles Teak, Seitenhintergrund */
  --flaeche: #fffdf9;        /* Kacheln, Karten */
  --flaeche-2: #faf4ec;      /* abwechselnde Tabellenzeile */
  --kopfzeile: #efe4d4;      /* Tabellenkopf */
  --text: #2a2119;
  --leise: #6e6156;          /* Kontrast auf --flaeche ≥ 4.5:1 */
  --linie: #e4d7c5;
  --akzent: #5b4a2f;         /* vorhandenes Braun */
  --akzent-hell: #7a6342;
  --teak: #b07a45;
  --leiste: #3a2b1d;         /* dunkles Teak */
  --leiste-text: #f3e8d8;
  --leiste-leise: #cbb79d;
  --gruen: #24692a;  --gruen-bg: #e5f2e3;  --gruen-rand: #b5d8b1;
  --gelb: #7a5200;   --gelb-bg: #fff1cc;   --gelb-rand: #ecd08a;
  --rot: #a3221b;    --rot-bg: #fbe6e4;    --rot-rand: #efb5b0;
  --grau: #555049;   --grau-bg: #ebe7e1;   --grau-rand: #cfc8be;
  --schatten: 0 1px 2px rgba(58, 43, 29, .06), 0 4px 14px rgba(58, 43, 29, .07);
  --rund: 12px;
  --abstand: 20px;
  --leistenbreite: 232px;
  --obenhoehe: 56px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--grund); color: var(--text); }
a { color: var(--akzent); text-underline-offset: 2px; }
a:hover { color: var(--teak); }
:focus-visible { outline: 3px solid var(--teak); outline-offset: 2px; }
h1 { font-size: 1.55rem; margin: 0 0 var(--abstand); letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 0 0 8px; }
.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sym { flex: none; vertical-align: -4px; }

/* ---------- Grundgerüst: Leiste links, Kopf oben, Inhalt ---------- */
.menue-schalter { position: absolute; opacity: 0; pointer-events: none; }
.leiste { position: fixed; inset: 0 auto 0 0; width: var(--leistenbreite); background: var(--leiste); color: var(--leiste-text); display: flex; flex-direction: column; z-index: 30; overflow-y: auto; }
.marke { display: flex; align-items: center; gap: 10px; padding: 16px 18px; color: var(--leiste-text); text-decoration: none; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,.08); }
.marke:hover { color: #fff; }
.marke small { display: block; font-weight: 400; font-size: .75rem; color: var(--leiste-leise); }
.marke-zeichen { width: 36px; height: 36px; border-radius: 9px; background: var(--teak); color: #fff; display: grid; place-items: center; font-size: .9rem; letter-spacing: .02em; }
.leiste nav { display: flex; flex-direction: column; padding: 10px 8px; gap: 2px; }
.leiste nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; color: var(--leiste-text); text-decoration: none; border-left: 4px solid transparent; }
.leiste nav a .sym { color: var(--leiste-leise); }
.leiste nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.leiste nav a.aktiv { background: #f5e6d1; color: var(--leiste); font-weight: 700; border-left-color: var(--teak); }
.leiste nav a.aktiv .sym { color: var(--akzent); }
.rahmen { margin-left: var(--leistenbreite); min-height: 100vh; display: flex; flex-direction: column; }
.oben { position: sticky; top: 0; z-index: 20; height: var(--obenhoehe); display: flex; align-items: center; gap: 12px; padding: 0 24px; background: rgba(255,253,249,.96); border-bottom: 1px solid var(--linie); backdrop-filter: blur(4px); }
.oben-titel { font-weight: 600; color: var(--leise); }
.oben-rechts { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.wer { display: inline-flex; align-items: center; gap: 6px; color: var(--leise); }
.abmelden { margin: 0; }
.menue-knopf { display: none; cursor: pointer; padding: 6px; border-radius: 8px; color: var(--text); }
.menue-schatten { display: none; }
main { width: 100%; max-width: 1600px; margin: 0 auto; padding: 24px; flex: 1; }
body.ohne-leiste main { max-width: none; }

/* ---------- Karten und Kacheln ---------- */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--rund); box-shadow: var(--schatten); padding: var(--abstand); margin: 0 0 var(--abstand); }
.karte > :last-child { margin-bottom: 0; }
details.karte > summary { margin: 0; }
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin: 0 0 var(--abstand); }
.kachel { position: relative; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--rund); box-shadow: var(--schatten); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; color: var(--text); text-decoration: none; }
a.kachel:hover { border-color: var(--teak); box-shadow: 0 2px 4px rgba(58,43,29,.08), 0 8px 22px rgba(58,43,29,.12); color: var(--text); }
.kachel .zahl { font-size: 2.1rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kachel .beschriftung { color: var(--leise); font-size: .88rem; display: flex; align-items: center; gap: 6px; }
.kachel .beschriftung .sym { color: var(--teak); }
.kachel.rot .zahl { color: var(--rot); }
.kachel.rot { border-color: var(--rot-rand); }
.abschnitt-titel { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--leise); margin: 0 0 10px; font-weight: 700; }

/* Plattform-Kacheln auf der Übersicht */
.plattformen { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin: 0 0 28px; }
.pkachel { background: var(--flaeche); border: 1px solid var(--linie); border-left: 6px solid var(--grau-rand); border-radius: var(--rund); box-shadow: var(--schatten); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.pkachel.pk-gruen { border-left-color: var(--gruen); }
.pkachel.pk-gelb { border-left-color: #d9a400; }
.pkachel.pk-rot { border-left-color: var(--rot); }
.pkachel-kopf { display: flex; align-items: center; gap: 12px; }
.plogo { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: .95rem; color: #fff; flex: none; }
.plogo.shop { background: #5b4a2f; } .plogo.amazon { background: #232f3e; } .plogo.ebay { background: #0f5bb5; } .plogo.hood { background: #6b3fa0; }
.pkachel-name { font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.pkachel-name small { display: block; font-weight: 400; color: var(--leise); font-size: .8rem; }
.pkachel-kopf .etikett { margin-left: auto; }
.pwerte { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pwerte div { background: var(--flaeche-2); border-radius: 8px; padding: 8px 10px; }
.pwerte strong { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.pwerte span { font-size: .8rem; color: var(--leise); }
.ampel { display: flex; align-items: flex-start; gap: 8px; font-size: .9rem; padding: 8px 10px; border-radius: 8px; border: 1px solid; }
.ampel.gruen { background: var(--gruen-bg); color: var(--gruen); border-color: var(--gruen-rand); }
.ampel.gelb { background: var(--gelb-bg); color: var(--gelb); border-color: var(--gelb-rand); }
.ampel.rot { background: var(--rot-bg); color: var(--rot); border-color: var(--rot-rand); }
.ampel.grau { background: var(--grau-bg); color: var(--grau); border-color: var(--grau-rand); }
.pkachel-fuss { display: flex; gap: 14px; flex-wrap: wrap; font-size: .88rem; }

/* Erinnerungen */
.erinnerungen { display: flex; flex-direction: column; gap: 8px; }
.erinnerung { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.erinnerung strong { font-variant-numeric: tabular-nums; }

/* ---------- Etiketten (Plattform, Status) ---------- */
.etikett, .status { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 600; line-height: 1.4; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--grau-rand); background: var(--grau-bg); color: var(--grau); white-space: nowrap; }
.etikett .sym { width: 14px; height: 14px; vertical-align: -2px; }
.etikett.p-shop { background: #f1e6d6; border-color: #dcc6a6; color: #5b4a2f; }
.etikett.p-amazon { background: #fff0d9; border-color: #f0c98a; color: #6b4300; }
.etikett.p-ebay { background: #e3edfb; border-color: #a9c4ec; color: #134a91; }
.etikett.p-hood { background: #efe6f8; border-color: #cdb5e6; color: #4d2a7a; }
.etikett.ok, .status.gebucht { background: var(--gruen-bg); border-color: var(--gruen-rand); color: var(--gruen); }
.etikett.gelb, .status.storno, .status.retoure, .status.warnung { background: var(--gelb-bg); border-color: var(--gelb-rand); color: var(--gelb); }
.etikett.rot, .status.fehler { background: var(--rot-bg); border-color: var(--rot-rand); color: var(--rot); }
.etikett.grau, .status.neu, .status.ignoriert { background: var(--grau-bg); border-color: var(--grau-rand); color: var(--grau); }
.status.hinweis { background: #e7eef7; border-color: #b9cbe3; color: #234a78; }
.etikett.scharf { background: var(--rot-bg); border-color: var(--rot-rand); color: var(--rot); letter-spacing: .04em; }

/* ---------- Tabellen ---------- */
.tabelle { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--rund); box-shadow: var(--schatten); overflow: auto; max-height: calc(100vh - 210px); margin: 0 0 var(--abstand); }
.tabelle.kurz-hoch { max-height: none; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--linie); vertical-align: top; }
th { font-weight: 700; color: var(--leise); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.tabelle thead th { position: sticky; top: 0; z-index: 2; background: var(--kopfzeile); }
.tabelle tbody tr:nth-child(even) td { background: var(--flaeche-2); }
.tabelle tbody tr:hover td { background: #f6ead9; }
.tabelle tbody tr:last-child td { border-bottom: none; }
.karte table th, .karte table td { padding: 7px 8px; }
td.zahl, th.zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.zahl { font-weight: 600; }
.nowrap { white-space: nowrap; }
.leise { color: var(--leise); }
.rot { color: var(--rot); }
.gruen { color: var(--gruen); }
.warn { color: var(--gelb); }
tr.inaktiv td { color: var(--leise); }
.leer td { color: var(--leise); text-align: center; padding: 22px; }

/* Werkzeugleiste über Tabellen: Suche und Filter */
.filter, .zeile { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 14px; }
.zeile form { margin: 0; }
.suchfeld { position: relative; display: inline-flex; align-items: center; }
.suchfeld .sym { position: absolute; left: 10px; color: var(--leise); pointer-events: none; }
.suchfeld input { padding-left: 34px; min-width: 240px; }
.anzahl { color: var(--leise); font-size: .9rem; margin-left: auto; }

/* ---------- Formulare und Knöpfe ---------- */
input, select, button, .knopf { font: inherit; padding: 8px 12px; border: 1px solid var(--linie); border-radius: 8px; background: #fff; color: var(--text); min-height: 38px; }
input:focus, select:focus { border-color: var(--teak); }
input.kurz { width: 96px; }
/* zurückhaltender Standardknopf */
button, .knopf { display: inline-flex; align-items: center; gap: 6px; background: var(--flaeche); color: var(--akzent); border-color: #cdb898; cursor: pointer; font-weight: 600; text-decoration: none; }
button:hover, .knopf:hover { background: #f5ead9; color: var(--akzent); }
/* Hauptknopf: einer pro Seite */
button.haupt, .knopf.haupt { background: var(--akzent); color: #fff; border-color: var(--akzent); }
button.haupt:hover, .knopf.haupt:hover { background: var(--akzent-hell); color: #fff; }
/* Gefährliche Aktionen: deutlich abgesetzt */
button.gefahr { background: var(--rot); color: #fff; border-color: var(--rot); }
button.gefahr:hover { background: #8a1c16; color: #fff; }
button.gefahr-leise, .knopf.gefahr-leise { background: #fff; color: var(--rot); border-color: var(--rot-rand); }
button.gefahr-leise:hover, .knopf.gefahr-leise:hover { background: var(--rot-bg); color: var(--rot); }
button.leise, button.dezent { background: none; border: none; color: var(--leise); padding: 4px 6px; min-height: 0; font-weight: 500; }
button.leise { text-decoration: underline; }
button.leise:hover, button.dezent:hover { color: var(--akzent); background: none; }
button:disabled { opacity: .5; cursor: not-allowed; }
.gefahrzone { border: 2px solid var(--rot-rand); background: #fffaf9; }
.gefahrzone h2 { color: var(--rot); display: flex; align-items: center; gap: 8px; }
label { display: block; margin-bottom: 12px; }
.zeile label { margin: 0; }
label input { display: block; width: 100%; margin-top: 4px; }
.zeile label input, label.haken input { display: inline-block; width: auto; margin: 0 6px; min-height: 0; }
label.haken { margin: 12px 0; }

/* Reiter (Abgleich) */
.reiter { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--abstand); border-bottom: 2px solid var(--linie); }
.reiter a, .reiter strong { padding: 8px 16px; border-radius: 8px 8px 0 0; text-decoration: none; margin-bottom: -2px; border-bottom: 3px solid transparent; }
.reiter a { color: var(--leise); }
.reiter a:hover { color: var(--akzent); background: #f5ead9; }
.reiter strong { color: var(--akzent); border-bottom-color: var(--teak); background: var(--flaeche); }

/* Meldungen (immer mit Symbol) */
.meldung { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 10px; margin: 0 0 var(--abstand); border: 1px solid; }
.meldung .sym { margin-top: 1px; }
.meldung.ok { background: var(--gruen-bg); border-color: var(--gruen-rand); color: var(--gruen); }
.meldung.fehler { background: var(--rot-bg); border-color: var(--rot-rand); color: var(--rot); }
.meldung.hinweis { background: var(--gelb-bg); border-color: var(--gelb-rand); color: var(--gelb); }

/* Anmeldung */
.anmeldung { max-width: 380px; margin: 10vh auto; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--rund); box-shadow: var(--schatten); padding: 28px; }
.anmeldung .marke-zeichen { margin-bottom: 12px; }
.anmeldung button { width: 100%; justify-content: center; margin-top: 8px; }

details summary { cursor: pointer; font-weight: 700; }
details[open] summary { margin-bottom: 12px; }
details form { margin-top: 12px; }
ul.liste-ruhig { margin: 0; padding-left: 20px; }
ul.liste-ruhig li { margin: 4px 0; }
.zweispaltig { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: var(--abstand); }

/* ---------- Handy und Tablet ---------- */
@media (max-width: 960px) {
  .leiste { transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; }
  .menue-schalter:checked ~ .leiste { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .menue-schalter:checked ~ .menue-schatten { display: block; position: fixed; inset: 0; background: rgba(30,20,10,.35); z-index: 25; }
  .rahmen { margin-left: 0; }
  .menue-knopf { display: inline-flex; }
  .oben { padding: 0 12px; }
  main { padding: 16px 12px; }
  .wer { display: none; }
  .zweispaltig { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --abstand: 14px; }
  h1 { font-size: 1.3rem; }
  .kacheln { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kachel { padding: 12px; }
  .kachel .zahl { font-size: 1.6rem; }
  .plattformen { grid-template-columns: 1fr; }
  .tabelle { max-height: none; }
  .suchfeld input { min-width: 0; width: 100%; }
  .suchfeld { flex: 1 1 100%; }
  .anzahl { margin-left: 0; }
  th, td { padding: 8px; }
  .tabelle .weg-handy { display: none; }
}
@media (prefers-reduced-motion: reduce) { .leiste { transition: none; } }
/* Seitenkopf: Titel links, Hauptknopf rechts */
.seitenkopf { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 var(--abstand); }
.seitenkopf h1 { margin: 0; }
.seitenkopf > form, .seitenkopf > .rechts { margin: 0 0 0 auto; }
.seitenkopf .zurueck { flex-basis: 100%; font-size: .9rem; }
.kachel.breit { grid-column: span 2; }
.kachel.breit .erinnerungen { margin-top: 8px; }
/* Kachel "Sendungen": drei Zahlen nebeneinander */
.kachel.gelb { border-color: var(--gelb-rand); border-left: 6px solid #d9a400; }
.kachel.rot-rand { border-color: var(--rot-rand); }
.sendungszahlen { display: flex; gap: 22px; flex-wrap: wrap; margin: 6px 0; }
.sendungszahlen a { display: flex; flex-direction: column; color: var(--text); text-decoration: none; }
.sendungszahlen a:hover strong { color: var(--akzent); }
.sendungszahlen strong { font-size: 1.7rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.sendungszahlen span { color: var(--leise); font-size: .85rem; }
.sendungszahlen a.rot strong { color: var(--rot); }
.kachel .ampel { margin-top: 8px; }
@media (max-width: 640px) { .kachel.breit { grid-column: 1 / -1; } }

/* ---------- Ladeanzeige: Balken oben, Hinweis unten, Knöpfe gesperrt ---------- */
body.laedt { cursor: progress; }
body.laedt::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 100; background: linear-gradient(90deg, transparent, var(--teak), var(--akzent), var(--teak), transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: kv-balken 1.1s linear infinite; }
@keyframes kv-balken { from { background-position: -50% 0; } to { background-position: 150% 0; } }
#laedt-hinweis { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: none; align-items: center; gap: 10px; background: var(--leiste); color: var(--leiste-text); padding: 10px 18px; border-radius: 999px; box-shadow: 0 6px 24px rgba(0,0,0,.25); font-weight: 600; max-width: calc(100vw - 24px); }
/* erst nach einer halben Sekunde einblenden, damit es bei schnellen Seiten nicht flackert */
body.laedt #laedt-hinweis { display: inline-flex; animation: kv-ein .2s ease .5s both; }
#laedt-hinweis::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 3px solid rgba(255,255,255,.3); border-top-color: #fff; animation: kv-dreh .8s linear infinite; flex: none; }
@keyframes kv-ein { from { opacity: 0; } to { opacity: 1; } }
@keyframes kv-dreh { to { transform: rotate(360deg); } }
button[data-gesperrt] { opacity: .6; cursor: progress; }
@media (prefers-reduced-motion: reduce) { body.laedt::before, #laedt-hinweis::before { animation-duration: 3s; } }

/* Packliste und Warenausgang */
.packliste td { vertical-align: middle; }
.packliste .haken-spalte { width: 34px; }
.packliste .bild-spalte { width: 92px; height: 88px; }
.packliste .bild-spalte img { display: block; width: 76px; height: 76px; object-fit: contain; border-radius: 6px; background: #fff; }
.packliste .kaestchen { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--text); border-radius: 3px; vertical-align: middle; }
.packliste td.menge { font-size: 1.5rem; font-weight: 700; }
table.liste tfoot td { border-top: 2px solid var(--linie); background: var(--flaeche); }
.seitenkopf > .rechts.zeile { margin-bottom: 0; }

/* Drucken: nur der Inhalt, ohne Leiste, Kopf und Knöpfe */
@media print {
  .leiste, .oben, .menue-schalter, .menue-schatten, .kein-druck, #laedt-hinweis, .meldung { display: none !important; }
  body, main { background: #fff !important; }
  .rahmen { margin-left: 0 !important; }
  main { max-width: none; padding: 0; }
  .tabelle { max-height: none; overflow: visible; border: none; box-shadow: none; }
  table.liste thead th { position: static; }
  .packliste tr { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* Etiketten: Vorschau beim Profil */
.etikett-vorschau { display: block; max-width: 100%; height: auto; background: #fff; border: 1px solid var(--linie); border-radius: 4px; box-shadow: var(--schatten); }
.etikett-vorschau.klein { box-shadow: none; }
.etikett-seite { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--abstand); align-items: start; }
@media (max-width: 900px) { .etikett-seite { grid-template-columns: minmax(0, 1fr); } }
form.inline { display: inline-block; margin: 0 0 0 6px; }

/* Kundenname in den Listen (zum Zuordnen von Bestellungen und Rechnungen) */
.kunde { font-size: .88rem; color: var(--text); }
.kunde-gross { color: var(--text); font-size: 1rem; }
