/* Dashboard, Bestellungen, Bestelldetail, Warenkörbe */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dash { display: flex; flex-direction: column; gap: var(--gap); }
.dash-kpi { transition: border-color .15s, transform .15s; }
.dash-kpi:hover { border-color: var(--line-2); transform: translateY(-1px); }
.dash-recent .table-wrap { padding: 0 20px 16px; }
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.chart .line { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--blue); opacity: .08; }
.chart .dot { fill: #fff; stroke: var(--blue); stroke-width: 2; }
.chart .cross { stroke: var(--line-2); stroke-dasharray: 3 3; }
.chart-tip { position: absolute; top: 0; transform: translateX(-50%); background: var(--navy); color: #fff; border-radius: 10px; padding: 6px 10px; font-size: 12px; pointer-events: none; display: flex; flex-direction: column; align-items: center; white-space: nowrap; box-shadow: var(--shadow); }
.chart-tip span { opacity: .75; font-size: 11px; }
.stages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 6px 0 18px; }
.stage { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: var(--r); border: 1px solid var(--line); text-align: center; }
.stage:hover { border-color: var(--line-2); background: var(--sky-2); }
.stage-n { width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; display: grid; place-items: center; }
.stage-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.stage b { font-size: 22px; font-weight: 800; }
.stage-total { display: flex; justify-content: space-between; margin-bottom: 8px; font-weight: 600; }
.stage-total b { font-size: 20px; }
.big-zero { display: flex; align-items: center; gap: 14px; }
.big-zero b { font-size: 44px; font-weight: 800; line-height: 1; color: var(--navy); }
.mini-list { display: flex; flex-direction: column; }
.mini-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.mini-row:last-child { border-bottom: 0; }
.mini-row > :last-child { margin-left: auto; }
.card-mini { display: flex; gap: 16px; align-items: center; }
.card-mini .small { overflow-wrap: anywhere; }
.card-mini-actions { margin-top: 14px; }

/* Bestelldetail */
.od { display: flex; flex-direction: column; gap: var(--gap); }
.od-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 18px; }
.od-hero .back-link { margin: 0; }
.od-num { font-weight: 800; font-size: 18px; letter-spacing: .02em; color: var(--blue); }
.od-stats { display: flex; gap: 24px; flex-wrap: wrap; }
.od-hero-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.od-status { width: auto; height: 40px; border-radius: 999px; background-color: var(--sky); font-weight: 600; }
.od-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--gap); align-items: start; }
.od-main, .od-side { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.od-items { display: flex; flex-direction: column; gap: 8px; }
.od-item { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--r); cursor: pointer; }
.od-item.active { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.od-item-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--sky); color: var(--navy); display: grid; place-items: center; }
.od-item-copy { flex: 1; min-width: 160px; display: flex; flex-direction: column; }
.od-item-copy small { color: var(--muted); }
.od-item-actions { display: flex; gap: 6px; width: 100%; padding-left: 48px; }
.od-config-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.od-preview { width: 150px; background: var(--sky-2); border-radius: var(--r); padding: 6px; flex: none; }
.od-config { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.od-sec { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: var(--sky-2); }
.od-sec h4 { font-size: 15px; }
.od-sec .kv div { padding: 6px 0; font-size: 13px; }
.od-mails { display: flex; flex-direction: column; gap: 10px; }
.od-mail { display: flex; flex-direction: column; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.od-mail .btn { align-self: flex-start; }
.od-paygrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 10px; }
.od-paygrid.three { grid-template-columns: repeat(3, 1fr); }
.od-payform { margin-top: 10px; flex-wrap: nowrap; }
.od-payform .input { flex: 1; height: 40px; }
.od-comm { display: grid; grid-template-columns: 1fr 1fr 64px auto auto; gap: 6px; align-items: center; margin-bottom: 8px; }
.od-comm .select.sm { width: 100%; }
.od-pct { height: 34px !important; padding: 0 8px !important; }
.timeline { display: flex; flex-direction: column; }
.tl-row { display: flex; gap: 12px; padding-bottom: 14px; position: relative; }
.tl-row i { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); margin-top: 5px; flex: none; box-shadow: 0 0 0 4px var(--sky); }
.tl-row:not(:last-child)::before { content: ''; position: absolute; left: 4.5px; top: 16px; bottom: 0; width: 1px; background: var(--line-2); }
.od-docs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.od-doc { display: flex; gap: 10px; align-items: center; text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--sky-2); color: var(--navy); }
.od-doc:hover { border-color: var(--line-2); }
.od-doc span { display: flex; flex-direction: column; }
.od-doc small { color: var(--muted); font-size: 12px; }
.od-danger { border-color: #f1c9c6; }
.od-scan { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }

/* Druckbogen */
.print-sheet { position: fixed; inset: 0; z-index: 90; background: #fff; overflow-y: auto; padding: 0 24px 40px; }
.print-bar { position: sticky; top: 0; background: #fff; display: flex; gap: 10px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.labels { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.label { display: flex; gap: 12px; align-items: center; border: 1px dashed var(--line-2); border-radius: 8px; padding: 10px; font-size: 13px; break-inside: avoid; }
.factory header { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid var(--navy); padding-bottom: 12px; margin-bottom: 16px; }
.factory h1 { font-size: 22px; }
.factory-item { margin-bottom: 22px; break-inside: avoid; }
.factory-item h2 { font-size: 17px; margin-bottom: 8px; color: var(--blue); }
.factory-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 18px; }
.factory-grid h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 6px 0 4px; }
.fr { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; border-bottom: 1px solid var(--line); padding: 2px 0; }
/* Factory-PDF: Sprache/Einheiten, Thai-Schrift, mehrsprachige Zeilen */
.factory { font-family: 'Inter', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: var(--ink); }
.factory h1 { line-height: 1.2; }
.factory h1 .fx-multi { display: inline-flex; }
.factory .fx-no { white-space: nowrap; }
.fx-meta { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 8px 0 0; font-size: 12px; }
.fx-meta > div { display: flex; gap: 6px; align-items: baseline; }
.fx-meta dt { color: var(--muted); }
.fx-meta dd { margin: 0; font-weight: 600; }
.fx-meta dt::after { content: ':'; }
.fx-meta dt:has(.fx-multi)::after { content: none; }
.fx-multi { display: inline-flex; flex-direction: column; line-height: 1.25; }
.fx-multi > small { font-size: .82em; font-weight: 400; color: var(--muted); }
.factory .fr { align-items: flex-start; padding: 3px 0; }
.factory .fr > * { min-width: 0; overflow-wrap: anywhere; }
.factory .fx-k { flex: 1 1 50%; }
.factory .fx-v { flex: 1 1 50%; text-align: right; }
.factory .fx-v .fx-multi { align-items: flex-end; }
.factory .fx-m { white-space: nowrap; font-variant-numeric: tabular-nums; }
.factory .fx-m small { margin-left: 6px; font-weight: 400; color: var(--muted); }
.factory .fx-empty { font-size: 12px; color: var(--muted); }
.fx-sheet .print-bar { row-gap: 8px; }
.fx-opts { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.fx-opt { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.fx-opt .select.sm { max-width: 100%; }
.fx-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sp-page .fx-opts { margin-bottom: 10px; }
.sp-page .fx-opts + .sp-doc ~ .sp-doc { margin-top: 8px; }
@media screen and (max-width: 560px) {
  .print-sheet { padding: 0 16px 32px; }
  .fx-sheet .print-bar { position: static; }
  .fx-sheet .print-bar .spacer { display: none; }
  .fx-title { flex-basis: 100%; }
  .fx-opts, .fx-actions { flex-basis: 100%; }
  .fx-opt { flex: 1 1 140px; flex-direction: column; align-items: stretch; gap: 2px; }
  .fx-opt .select.sm { width: 100%; }
  .fx-actions .btn { flex: 1 1 auto; }
  .factory header { flex-direction: column-reverse; align-items: flex-start; }
  .factory-grid { grid-template-columns: 1fr !important; }
}
@media print {
  body:has(.print-sheet) .shell > *:not(.shell-content), body:has(.print-sheet) .od > *:not(.print-sheet) { display: none !important; }
  body:has(.print-sheet) .sp-page > *:not(.print-sheet), body:has(.print-sheet) .sp-admin-banner { display: none !important; }
  .print-sheet { position: static; padding: 0; overflow: visible; }
  .factory, .factory * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Warenkörbe */
.carts .toolbar { gap: 12px; }
.cart-rows { display: flex; flex-direction: column; gap: 10px; }
.cart-row { display: grid; grid-template-columns: auto minmax(160px, 1.4fr) auto auto auto auto auto auto; align-items: center; gap: 14px; padding: 12px 16px; }
.cart-ic { width: 38px; height: 38px; border-radius: 10px; background: var(--sky); color: var(--navy); display: grid; place-items: center; }
.cart-n { font-weight: 600; white-space: nowrap; }
.cart-sum { font-size: 15px; white-space: nowrap; }
.cart-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }

@media (max-width: 1100px) {
  .od-layout { grid-template-columns: 1fr; }
  .cart-row { grid-template-columns: auto 1fr auto; }
  .cart-row > .muted, .cart-row > .cart-n { display: none; }
  .cart-actions { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .stages { grid-template-columns: repeat(5, minmax(56px, 1fr)); overflow-x: auto; }
  .od-config { grid-template-columns: 1fr; }
  .od-config-head { flex-direction: column; }
  .od-hero-actions { margin-left: 0; width: 100%; }
  .od-item-actions { padding-left: 0; }
  .od-comm { grid-template-columns: 1fr 1fr; }
  .factory-grid { grid-template-columns: 1fr 1fr; }
}

/* Provisionen (Ansicht) & Warenkorb-Link */
.od-comm-view { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.od-comm-view .cell-2 { flex: 1; }
.od-comm-edit { margin-top: 12px; }
.od-comm-edit summary { cursor: pointer; margin-bottom: 10px; }
.od-cartlink { margin-top: 10px; }

/* QR Scan Ansicht (mobil) */
.standalone { min-height: 100vh; background: var(--bg); }
.scan { max-width: 560px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.scan-head { display: flex; align-items: center; gap: 14px; background: var(--navy); color: #fff; border-radius: var(--r-lg); padding: 18px; }
.scan-head .eyebrow { color: #9fb4d3; }
.scan-head h1 { font-size: 22px; }
.scan-head .muted { color: #b9c8de; }
.scan-head .badge-status { margin-left: auto; }
.scan .panel .btn-block { margin-top: 12px; }
.scan-check ol { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* Label-Druckbogen */
.labels-page { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }
.labels-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.labels-page .labels { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.labels-page .label { background: #fff; align-items: flex-start; }
.label-copy { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; min-width: 0; }
.label-copy .eyebrow { margin: 0; }
.label-copy dl { display: grid; grid-template-columns: auto 1fr; gap: 1px 8px; margin: 6px 0 0; }
.label-copy dt { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.label-copy dd { margin: 0; font-weight: 600; }
@media print { .labels-page { padding: 0; } .labels-page .label { border: 1px solid #999; } }
