/* Eröz – gemeinsames Design (Büro, Vertrieb, Lager, Login) */
:root {
  --bg: #f4f5f7; --card: #ffffff; --ink: #14161a; --ink-2: #3b3f46; --muted: #6b7180; --line: #e4e6ea; --line-2: #eef0f2;
  --brand: #16191d; --brand-ink: #ffffff; --akzent: #1f7a4d; --akzent-bg: #e8f4ee;
  --ok: #157347; --ok-bg: #e6f4ec; --warn: #a15c07; --warn-bg: #fdf3e1; --err: #b42318; --err-bg: #fdecea;
  --info: #1d4ed8; --info-bg: #e9effd; --lila: #6d28d9; --lila-bg: #f2ecfd;
  --radius: 14px; --radius-s: 10px; --schatten: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --menue-breite: 256px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; }

/* ---------- Grundgerüst mit Seitenmenü ---------- */
.seitenmenue { position: fixed; inset: 0 auto 0 0; width: var(--menue-breite); background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 50; transition: transform .22s ease; }
.marke { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; text-decoration: none; }
.marke img { width: 34px; height: 39px; object-fit: contain; }
.marke b { display: block; font-size: 17px; letter-spacing: .01em; }
.marke small { display: block; color: var(--muted); font-size: 12px; margin-top: -2px; }
.menue-nav { flex: 1; overflow-y: auto; padding: 4px 10px 10px; }
.menue-gruppe { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding: 14px 10px 6px; }
.menue-punkt { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border-radius: 10px; border: 0; background: none; color: var(--ink-2); text-decoration: none; cursor: pointer; text-align: left; font-size: 14.5px; }
.menue-punkt svg { width: 19px; height: 19px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.menue-punkt:hover { background: var(--line-2); color: var(--ink); }
.menue-punkt.aktiv { background: var(--brand); color: #fff; font-weight: 600; }
.menue-punkt.aktiv svg { opacity: 1; }
.menue-punkt .zaehler { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 99px; background: #f59e0b; color: #1c1300; font-size: 12px; font-weight: 700; text-align: center; line-height: 20px; }
.menue-fuss { border-top: 1px solid var(--line); padding: 12px 14px 14px; display: grid; gap: 10px; }
.nutzer { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--line-2); display: grid; place-items: center; font-weight: 700; color: var(--ink-2); flex: none; }
.nutzer b { display: block; font-size: 14px; }
.nutzer small { display: block; color: var(--muted); font-size: 12px; }
.schleier { position: fixed; inset: 0; background: rgba(16,24,40,.42); z-index: 45; opacity: 0; pointer-events: none; transition: opacity .2s; }
.inhalt { margin-left: var(--menue-breite); min-height: 100vh; min-height: 100dvh; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: rgba(244,245,247,.88); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; min-height: 60px; }
.topbar h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-rechts { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.menueknopf { display: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; place-items: center; flex: none; }
.menueknopf svg { width: 20px; height: 20px; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; fill: none; }
.nur-mobil { display: none !important; }
main.seite { padding: 8px 24px 40px; max-width: 1400px; }

@media (max-width: 959px) {
  .seitenmenue { transform: translateX(-102%); box-shadow: 0 10px 40px rgba(0,0,0,.18); width: min(84vw, 300px); }
  body.menue-offen .seitenmenue { transform: none; }
  body.menue-offen .schleier { opacity: 1; pointer-events: auto; }
  body.menue-offen { overflow: hidden; }
  .inhalt { margin-left: 0; }
  .menueknopf { display: grid; }
  .topbar { padding: 10px 14px; background: rgba(255,255,255,.92); border-bottom-color: var(--line); min-height: 58px; }
  .topbar h1 { font-size: 17px; }
  main.seite { padding: 12px 12px 32px; }
  .nur-mobil { display: inline-flex !important; }
  .weg-mobil { display: none !important; }
  .menue-punkt { padding: 12px 12px; font-size: 15.5px; }
}

/* ---------- Bausteine ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--schatten); overflow: hidden; }
.card + .card { margin-top: 16px; }
.card > h2, .card-kopf { font-size: 15px; font-weight: 700; margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card > h2 .rechts, .card-kopf .rechts { margin-left: auto; font-weight: 400; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pad { padding: 14px 16px; }
.muted { color: var(--muted); font-size: 13.5px; }
.leer { padding: 36px 16px; text-align: center; color: var(--muted); }
.fehlerbox, .fehler { background: var(--err-bg); color: var(--err); padding: 11px 16px; font-weight: 600; }
.erfolg { background: var(--ok-bg); color: #0d4f2f; padding: 14px 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 14px; font-weight: 600; padding: 8px 14px; min-height: 38px; border-radius: var(--radius-s); border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--line-2); }
.btn.primaer { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primaer:hover { background: #2b3036; }
.btn.gruen { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.btn.gefahr { color: var(--err); }
.btn.klein { font-size: 13px; padding: 5px 10px; min-height: 32px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.geist { background: transparent; border-color: transparent; }

input.feld, textarea.feld, select.feld { font: inherit; font-size: 15px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); width: 100%; background: #fff; color: var(--ink); transition: border-color .12s, box-shadow .12s; }
input.feld:focus, textarea.feld:focus, select.feld:focus { outline: none; border-color: #9aa1ad; box-shadow: 0 0 0 3px rgba(22,25,29,.08); }
textarea.feld { min-height: 64px; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.formgrid label, label.f { font-size: 13px; color: var(--muted); display: block; font-weight: 500; }
.formgrid label > .feld, label.f > .feld { margin-top: 4px; }
.formgrid .breit { grid-column: 1 / -1; }

.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.chip.ok, .chip.s-bereit { background: var(--ok-bg); color: var(--ok); }
.chip.warn, .chip.s-kommissioniert, .chip.s-angebot_wahl { background: var(--warn-bg); color: var(--warn); }
.chip.info, .chip.s-abgeholt { background: var(--info-bg); color: var(--info); }
.chip.s-transport_angebote, .chip.s-auftrag_senden, .chip.s-warten_unterschrift { background: var(--lila-bg); color: var(--lila); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.tabelle { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: #fafbfc; white-space: nowrap; }
td.zahl, th.zahl, td.z, th.z { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.klickbar { cursor: pointer; }
tr.klickbar:hover td { background: #f8f9fa; }
tr.gewaehlt td { background: #eef1f4 !important; }

/* Listeneinträge (mobil freundlich) */
.eintrag { display: block; width: 100%; text-align: left; font: inherit; color: inherit; background: none; border: 0; border-bottom: 1px solid var(--line-2); padding: 13px 16px; cursor: pointer; }
.eintrag:last-child { border-bottom: 0; }
.eintrag:hover { background: #f8f9fa; }
.eintrag.gewaehlt { background: #eef1f4; }
.eintrag .z1 { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.eintrag .nr { font-weight: 700; }
.eintrag .betrag { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.eintrag .z2 { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.eintrag .chips { margin-top: 7px; }

.leiste { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.leiste .feld[type=search], .leiste .such-feld { flex: 1; min-width: 180px; }
.schalter { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--ink-2); cursor: pointer; user-select: none; }
.schalter input { width: 17px; height: 17px; accent-color: var(--brand); }

.seiten { display: flex; gap: 10px; justify-content: center; align-items: center; padding: 12px; }

#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(92vw, 380px); }
.toast { background: #16191d; color: #fff; border-radius: 12px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); cursor: pointer; border-left: 4px solid #f59e0b; }
.toast b { display: block; margin-bottom: 2px; }
.chip.s-zustellung_pruefen { background: var(--warn-bg); color: var(--warn); }
.chip.s-zugestellt { background: var(--ok-bg); color: var(--ok); }
.menueknopf { position: relative; }
.menueknopf[data-zahl]:not([data-zahl=""])::after { content: attr(data-zahl); position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--akzent); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }

/* Dokumenten-Scanner (Fahrer, Dokumente) */
.scan-start { text-align: center; padding: 26px 12px; display: grid; gap: 10px; justify-items: center; }
.scan-symbol { font-size: 44px; }
.scan-gross { min-height: 54px; font-size: 17px; width: 100%; max-width: 360px; }
.scan-hinweis { font-size: 14px; color: var(--ink-2); margin-bottom: 8px; text-align: center; }
.scan-flaeche { position: relative; margin: 0 auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.scan-flaeche canvas, .scan-flaeche svg { position: absolute; inset: 0; display: block; }
.scan-flaeche canvas { border-radius: 8px; }
.scan-rahmen { fill: rgba(31,122,77,.16); stroke: #1f7a4d; stroke-width: 2.5; }
.scan-griff-feld { fill: transparent; cursor: grab; }
.scan-griff { fill: #fff; stroke: #1f7a4d; stroke-width: 3; pointer-events: none; }
.scan-knoepfe { display: flex; gap: 8px; margin-top: 12px; }
.scan-knoepfe .btn { flex: 1; min-height: 48px; }
.scan-knoepfe.klein { display: grid; grid-template-columns: repeat(4, 1fr); }
.scan-knoepfe.klein .btn { min-height: 38px; font-size: 13px; padding: 5px 4px; white-space: normal; }
.scan-knoepfe .btn.aktiv { background: var(--brand); color: #fff; border-color: var(--brand); }
.scan-ergebnis { background: #e9ebee; border-radius: 12px; padding: 8px; text-align: center; }
.scan-ergebnis img { max-width: 100%; max-height: 60vh; box-shadow: 0 2px 10px rgba(0,0,0,.15); background: #fff; }
