/* JGT Sales App: Styles. Hell/dunkel per prefers-color-scheme, Touch-Ziele >= 44px, Safe-Area. */
:root {
  --bg: #f3f5f4; --surface: #ffffff; --surface-2: #eaeeed; --text: #18211f; --muted: #525e5b; --line: #d5dbd9;
  --accent: #0b5e59; --accent-ink: #ffffff; --accent-soft: #d9efec;
  --ok: #17602f; --ok-bg: #dff1e5; --warn: #7a4e00; --warn-bg: #fcefcf; --err: #9c1f25; --err-bg: #fae0e0; --info: #1d4f8a; --info-bg: #dfeaf7;
  --radius: 12px; --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 14px rgba(0, 0, 0, .06);
  --nav-w: 92px; --nav-h: 62px;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1413; --surface: #182120; --surface-2: #212c2a; --text: #e8efed; --muted: #a2b2ae; --line: #2f3c39;
    --accent: #5cd0c6; --accent-ink: #03201d; --accent-soft: #163a37;
    --ok: #7fdc9f; --ok-bg: #153625; --warn: #f2c66b; --warn-bg: #3a2d10; --err: #ff9fa0; --err-bg: #43191c; --info: #8bbcf5; --info-bg: #172a43;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text);
  overscroll-behavior: none; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent;
  padding: var(--sat) var(--sar) 0 var(--sal);
}
body.noscroll { overflow: hidden; }
h1 { font-size: 1.3rem; margin: 0; line-height: 1.2; } h2 { font-size: 1.15rem; margin: 0; } h3 { font-size: 1rem; margin: 0 0 .5rem; } h4 { margin: .5rem 0 .25rem; }
p { margin: .25rem 0; }
a { color: var(--accent); }
.muted { color: var(--muted); } .small { font-size: .85rem; } .strong { font-weight: 700; } .big { font-size: 1.25rem; font-weight: 700; }
.grow { flex: 1 1 auto; min-width: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.warn-t { color: var(--warn); font-weight: 600; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* ---- Rahmen ---- */
#shell { height: 100%; height: 100dvh; display: flex; flex-direction: column-reverse; }
.main-col { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
#view { flex: 1 1 auto; min-height: 0; overflow: auto; outline: none; -webkit-overflow-scrolling: touch; }
.nav { display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: var(--sab); flex: 0 0 auto; }
.nav-brand { display: none; }
.nav-i { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--nav-h); color: var(--muted); text-decoration: none; font-size: .75rem; }
.nav-i[aria-current="page"] { color: var(--accent); font-weight: 700; box-shadow: inset 0 3px 0 var(--accent); }
body[data-mode="auth"] .nav { display: none; }
body[data-mode="auth"] #shell { flex-direction: column; }
@media (max-width: 899px) { body[data-focus="1"] .nav { display: none; } }
@media (min-width: 900px) {
  #shell { flex-direction: row; }
  .nav { flex-direction: column; width: var(--nav-w); border-top: 0; border-right: 1px solid var(--line); padding: 8px 0; }
  .nav-brand { display: flex; justify-content: center; padding: 8px 0 12px; }
  .nav-i { flex: 0 0 auto; width: 100%; min-height: 68px; box-shadow: none !important; }
  .nav-i[aria-current="page"] { background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent) !important; }
}
.banners { flex: 0 0 auto; }
.banner { display: flex; gap: 10px; align-items: center; padding: 8px 14px; font-size: .9rem; }
.banner.off { background: var(--warn-bg); color: var(--warn); } .banner.warn { background: var(--warn-bg); color: var(--warn); } .banner.info { background: var(--info-bg); color: var(--info); }
.banner span { flex: 1; }
.banner-inline { padding: 8px 12px; border-radius: 8px; margin: 8px 0; background: var(--info-bg); color: var(--info); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.banner-inline.warn { background: var(--warn-bg); color: var(--warn); } .banner-inline.err { background: var(--err-bg); color: var(--err); }

/* ---- Bedienelemente ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; touch-action: manipulation; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--err); color: #fff; border-color: var(--err); }
.btn.danger-o { color: var(--err); border-color: var(--err); }
.btn.small { min-height: 44px; padding: 0 12px; font-size: .9rem; }
.btn.block { width: 100%; }
.btn.big-btn { min-height: 52px; padding: 0 22px; font-size: 1.05rem; }
.btn.icon-btn { padding: 0; width: 44px; font-size: 1.4rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; min-height: 44px; padding: 0 6px; }
.link.danger { color: var(--err); }
.input { width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; }
textarea.input { min-height: 70px; resize: vertical; }
.input.bad { border-color: var(--err); box-shadow: 0 0 0 2px var(--err-bg); }
.input.pin { text-align: center; font-size: 1.6rem; letter-spacing: .4em; margin: 8px 0; }
.input.small-sel { width: auto; min-width: 140px; }
.field { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.field-l { font-weight: 600; font-size: .9rem; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 14px; }
.check, .switch { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input, .switch input { width: 22px; height: 22px; accent-color: var(--accent); flex: 0 0 auto; }
.form-err { color: var(--err); font-weight: 600; margin: 6px 0; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--surface-2); color: var(--text); white-space: nowrap; text-decoration: none; min-height: 24px; }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.warn { background: var(--warn-bg); color: var(--warn); } .chip.err { background: var(--err-bg); color: var(--err); } .chip.neutral { background: var(--surface-2); }
.badge { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .8rem; text-align: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg-b { min-height: 44px; min-width: 52px; padding: 0 14px; border: 0; background: transparent; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.seg-b[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.seg-b:disabled { opacity: .45; }
.tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { min-height: 44px; padding: 0 14px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--accent); border-color: var(--accent); }
.db4 { display: inline-flex; gap: 4px; align-items: center; padding: 2px 10px; border-radius: 999px; font-weight: 700; font-size: .85rem; }
.db4.l-green { background: var(--ok-bg); color: var(--ok); } .db4.l-yellow { background: var(--warn-bg); color: var(--warn); } .db4.l-red { background: var(--err-bg); color: var(--err); }

/* ---- Karten, Listen ---- */
.page { padding: 14px 16px 24px; max-width: 1100px; margin: 0 auto; }
.narrow-page { max-width: 760px; }
.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.page-head .ph-t { flex: 1; min-width: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; padding: 12px; }
.cards.one { grid-template-columns: 1fr; padding: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.card.wide { grid-column: 1 / -1; }
.page > .card, .page > form > .card { margin-bottom: 12px; }
a.link-card { display: block; text-decoration: none; color: inherit; }
.cardlist { list-style: none; margin: 0; padding: 12px; display: grid; gap: 10px; }
.page .cards { padding: 0; }
.kv { margin: 0; } .kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed var(--line); } .kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; font-weight: 600; }
.plain { list-style: none; margin: 0; padding: 0; } .plain li { padding: 6px 0; }
.ph-row { display: flex; align-items: center; gap: 8px; } .ph-row.wrap, .row-actions.wrap { flex-wrap: wrap; }
.row-actions { display: flex; gap: 10px; align-items: center; margin: 10px 0; padding: 0 12px; }
.page .row-actions { padding: 0; }
.empty { text-align: center; padding: 40px 20px; } .empty-t { font-size: 1.1rem; font-weight: 600; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; } .tbl th, .tbl td { padding: 8px 8px; border-bottom: 1px solid var(--line); text-align: left; } .tbl .num { text-align: right; font-variant-numeric: tabular-nums; } .tbl tr.grp th { background: var(--surface-2); }
.tot { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px 16px; margin: 8px 0 0; } .tot > div { display: flex; flex-direction: column; } .tot dt { color: var(--muted); font-size: .8rem; } .tot dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi-v { font-size: 1.8rem; font-weight: 800; margin: 0; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; } .bars li { display: grid; grid-template-columns: 90px 1fr 100px; gap: 8px; align-items: center; font-size: .9rem; }
.bar-t { background: var(--surface-2); height: 14px; border-radius: 7px; overflow: hidden; } .bar-f { display: block; height: 100%; background: var(--accent); } .bar-v { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- Split (iPad quer: zwei Spalten) ---- */
.split { height: 100%; display: grid; grid-template-columns: 1fr; min-height: 0; }
.pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.list-pane { border-right: 1px solid var(--line); background: var(--surface); }
.pane-head { padding: 12px 14px 8px; display: grid; gap: 8px; border-bottom: 1px solid var(--line); }
.detail-pane { overflow: auto; }
.split:not(.has-detail) .detail-pane { display: none; }
.split.has-detail .list-pane { display: none; }
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(320px, 400px) 1fr; }
  .split:not(.has-detail) .detail-pane, .split.has-detail .list-pane { display: flex; }
  .only-narrow { display: none !important; }
}
.vlist { position: relative; flex: 1 1 auto; overflow: auto; min-height: 0; contain: strict; }
.vl-spacer { width: 1px; }
.vl-win { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.row { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; overflow: hidden; }
.row.sel { background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent); }
.row-main { flex: 1; min-width: 0; } .row-t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .row-s { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .88rem; }
.row-r { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.cust-head { display: flex; gap: 10px; align-items: center; padding: 14px 14px 6px; }
.cust-actions { display: flex; gap: 10px; flex-wrap: wrap; padding: 6px 14px 10px; }
.tab-body { min-height: 200px; }

/* ---- Katalog ---- */
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid-wrap { flex: 1 1 auto; overflow: auto; padding: 12px; min-height: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: inherit; }
.tile.sel { outline: 3px solid var(--accent); }
.tile-t { font-weight: 700; font-size: .92rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 2.6em; } .tile-s { font-size: .8rem; }
.thumb { position: relative; background: var(--surface-2); border-radius: 8px; overflow: hidden; flex: 0 0 auto; }
.thumb.sq { width: 100%; aspect-ratio: 1 / 1; }
.thumb.sm { width: 52px; height: 52px; }
.thumb.big { width: 100%; max-width: 340px; aspect-ratio: 1 / 1; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .2s; }
.thumb.loaded img { opacity: 1; }
.thumb-ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.6rem; font-weight: 800; color: var(--muted); opacity: .5; }
.prod { display: grid; grid-template-columns: 1fr; gap: 14px; padding: 8px 14px; }
@media (min-width: 600px) { .prod { grid-template-columns: 240px 1fr; } .thumb.big { max-width: 240px; } }
.dot.s-ok { color: var(--ok); background: none; } .dot.s-later { color: var(--warn); background: none; }
.pricebox { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--surface); margin: 8px 0; }
.pricebox dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 6px 14px; margin: 0; } .pricebox dt { font-size: .78rem; color: var(--muted); } .pricebox dd { margin: 0; font-weight: 700; }
.pricebox.none { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.tiers { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0 0; padding: 0; font-size: .85rem; }

/* ---- Matrix ---- */
.mx { margin: 8px 0; }
.mx-controls { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding: 6px 0; }
.legend { display: flex; gap: 12px; font-size: .8rem; margin-left: auto; }
.mx-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); -webkit-overflow-scrolling: touch; }
.mx-table { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.mx-table th, .mx-table td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 4px; text-align: center; vertical-align: top; }
.mx-table thead th { background: var(--surface-2); position: sticky; top: 0; z-index: 1; min-height: 44px; padding: 10px 6px; white-space: nowrap; }
.mx-rowh, .mx-corner { position: sticky; left: 0; z-index: 2; background: var(--surface-2); text-align: left !important; min-width: 96px; max-width: 130px; padding: 8px !important; font-weight: 700; }
.mx-corner { z-index: 3; font-size: .8rem; }
.mx-sum { background: var(--surface-2); font-weight: 700; min-width: 48px; }
.mx-foot td, .mx-foot th { background: var(--surface-2); font-weight: 700; }
.mx-empty { color: var(--muted); background: repeating-linear-gradient(45deg, transparent 0 6px, var(--surface-2) 6px 12px); }
.cell { min-width: 84px; width: 84px; }
.cell-in { width: 100%; min-height: 44px; text-align: center; font: inherit; font-size: 1.1rem; font-weight: 700; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); padding: 0 2px; }
.cell-in:disabled { opacity: .5; }
.cell-view { display: block; font-weight: 700; font-size: 1.1rem; padding: 6px 0 2px; }
.cell-meta { display: block; font-size: .72rem; line-height: 1.2; margin-top: 2px; min-height: 2.4em; }
.cell.s-ok { background: var(--ok-bg); color: var(--ok); } .cell.s-later { background: var(--warn-bg); color: var(--warn); } .cell.s-none { background: var(--err-bg); color: var(--err); } .cell.s-blocked { background: var(--surface-2); color: var(--muted); }
.cell.has-qty .cell-in { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.cell.flash { animation: flash .9s; }
@keyframes flash { 0%, 60% { box-shadow: inset 0 0 0 4px var(--accent); } 100% { box-shadow: none; } }
.s-ok { color: var(--ok); } .s-later { color: var(--warn); } .s-none { color: var(--err); }

/* ---- Auftrag ---- */
.order { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.order-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface); border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.order-head h1 { font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-switch { margin: 8px 12px; align-self: stretch; flex: 0 0 auto; } .order-switch .seg-b { flex: 1; }
.ocols { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 1fr; }
.ocol { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.ocol-body { flex: 1 1 auto; overflow: auto; padding: 8px 12px 16px; min-height: 0; }
.order[data-pane="items"] .lines-col, .order[data-pane="lines"] .pick-col { display: none; }
@media (min-width: 900px) {
  .ocols { grid-template-columns: minmax(380px, 1.15fr) minmax(380px, 1fr); direction: rtl; }
  .ocols > * { direction: ltr; }
  .order[data-pane] .lines-col, .order[data-pane] .pick-col { display: flex; }
  .order-switch { display: none; }
  .pick-col { border-right: 1px solid var(--line); }
}
.scan-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; } .scan-in { font-family: ui-monospace, monospace; }
.pick { display: grid; gap: 6px; max-height: 60vh; overflow: auto; margin-top: 8px; }
.pick-row { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-align: left; font: inherit; color: inherit; cursor: pointer; }
.mx-head { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.lgroup { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 10px 0; overflow: hidden; }
.lgroup-h { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--surface-2); }
.line { display: grid; grid-template-columns: 1fr auto auto; gap: 6px 12px; align-items: center; padding: 8px 10px; border-top: 1px solid var(--line); }
.line.has-err { background: var(--err-bg); }
.line-main { grid-column: 1 / 2; } .line-t { font-weight: 700; } .line-s { font-size: .82rem; }
.line-price { grid-column: 1 / 3; font-size: .9rem; } .line-date { grid-column: 1 / 3; display: grid; gap: 2px; max-width: 280px; }
.line > .btn.icon-btn { grid-column: 3; grid-row: 3; }
.stepper { display: inline-flex; align-items: center; gap: 4px; grid-column: 2; grid-row: 1; }
.qty-in { width: 58px; min-height: 44px; text-align: center; font: inherit; font-size: 1.1rem; font-weight: 700; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); }
.lines-col .ocol-body, .order { container-type: inline-size; }
.line > * { min-width: 0; overflow-wrap: anywhere; }
@container (min-width: 640px) {
  .line { grid-template-columns: minmax(110px, 1fr) auto minmax(150px, 1.2fr) minmax(150px, 1fr) auto; }
  .line-main { grid-column: auto; } .stepper { grid-column: auto; grid-row: auto; } .line-price, .line-date { grid-column: auto; } .line > .btn.icon-btn { grid-column: auto; grid-row: auto; }
}
.totals { flex: 0 0 auto; border-top: 1px solid var(--line); background: var(--surface); padding: 8px 14px calc(8px + var(--sab)); box-shadow: 0 -4px 12px rgba(0, 0, 0, .06); }
.totals .tot { margin: 0; grid-template-columns: repeat(4, auto); justify-content: space-between; }
.send-bar { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0 calc(10px + var(--sab)); display: grid; gap: 6px; }
.send-bar .btn { width: 100%; }
.legal { font-size: .9rem; padding: 8px 12px; border-left: 4px solid var(--warn); background: var(--warn-bg); color: var(--warn); border-radius: 6px; }
.result .big { color: var(--ok); }

/* ---- Unterschrift ---- */
.sig-box { position: relative; height: 260px; border: 2px dashed var(--line); border-radius: 12px; background: #fff; margin: 10px 0; }
.sig-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.sig-line { position: absolute; left: 14px; right: 14px; bottom: 44px; border-bottom: 1px solid #999; color: #888; font-size: 1.3rem; pointer-events: none; }
.sig-img { max-width: 100%; max-height: 160px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.task { display: grid; grid-template-columns: 1fr 160px 44px; gap: 6px; margin-bottom: 6px; }

/* ---- Anmeldung ---- */
.auth-wrap { min-height: 100%; display: grid; place-items: center; padding: 20px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.auth-form { display: grid; gap: 8px; } .auth-foot { margin-top: 10px; text-align: center; }

/* ---- Dialog, Toast, Scanner ---- */
dialog.modal { border: 0; padding: 0; background: transparent; max-width: 94vw; width: 480px; color: var(--text); }
dialog.modal::backdrop { background: rgba(0, 0, 0, .5); }
.modal-box { background: var(--surface); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); max-height: 86vh; overflow: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.pick-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 40vh; overflow: auto; } .row-btn { width: 100%; min-height: 48px; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); font: inherit; color: inherit; cursor: pointer; }
.toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--sab) + 12px); display: grid; justify-items: center; gap: 8px; z-index: 50; pointer-events: none; padding: 0 12px; }
@media (min-width: 900px) { .toasts { bottom: 20px; left: var(--nav-w); } }
body[data-focus="1"] .toasts { bottom: calc(var(--sab) + 12px); }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: center; background: #1f2927; color: #fff; padding: 10px 16px; border-radius: 12px; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); max-width: 560px; font-weight: 600; }
.toast.ok { background: #14532d; } .toast.warn { background: #6b4300; } .toast.err { background: #8e1c22; }
.scan-overlay { position: fixed; inset: 0; z-index: 100; background: #000; color: #fff; display: flex; flex-direction: column; padding: var(--sat) 0 var(--sab); }
.scan-top { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; }
.scan-stage { position: relative; flex: 1; min-height: 0; background: #000; }
.scan-video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; left: 10%; right: 10%; top: 30%; bottom: 30%; border: 3px solid rgba(255, 255, 255, .85); border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .35); pointer-events: none; }
.scan-msg { padding: 12px 16px; min-height: 3.2em; font-weight: 600; text-align: center; background: #222; }
.scan-msg.ok { background: #14532d; } .scan-msg.warn { background: #6b4300; } .scan-msg.err { background: #8e1c22; }
.scan-manual { display: flex; gap: 8px; padding: 10px 14px; background: #111; }

.only-phone { display: none; }
@media (max-width: 599px) { .only-phone { display: inline; } .hide-narrow { display: none; } .totals .tot { grid-template-columns: repeat(2, auto); } .task { grid-template-columns: 1fr 44px; } .task input[type="date"] { grid-column: 1; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---- iPhone-Feinschliff: nichts ragt über den Rand ---- */
.input, select.input, textarea.input { box-sizing: border-box; max-width: 100%; min-width: 0; }
input[type="date"], input[type="time"], input[type="datetime-local"] { -webkit-appearance: none; appearance: none; display: block; width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; text-align: left; line-height: 1.2; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; min-height: 1.2em; }
.field, .fgrid > *, .card { min-width: 0; }
.scan-row { flex-wrap: wrap; }
.scan-row .scan-in { flex: 1 1 160px; min-width: 0; }
.scan-row .btn { flex: 0 0 auto; white-space: nowrap; padding: 0 12px; }
@media (max-width: 599px) { .scan-row .scan-in { flex-basis: 100%; } .scan-row .btn { flex: 1 1 0; } }
.page { padding-bottom: calc(96px + var(--sab)); }
.banner-inline > span { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.line-t, .lgroup-h strong, .mx-head strong { overflow-wrap: anywhere; }
.pack-note { margin: 4px 0 8px; padding: 6px 10px; border-radius: 8px; background: var(--info-bg); color: var(--info); font-weight: 600; }
.cell-pack { display: block; font-size: .7rem; font-weight: 700; color: var(--muted); }
.take-bar { position: sticky; bottom: 0; padding: 10px 0 calc(10px + var(--sab)); background: linear-gradient(to top, var(--bg) 75%, transparent); z-index: 2; }