:root {
  --bg: #f2f5fa;
  --card: #ffffff;
  --line: #e6eaf2;
  --text: #16203a;
  --muted: #6b7280;
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
  --green: #059669;
  --green-soft: #ecfdf5;
  --red: #dc2626;
  --amber: #b45309;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
}
.view { min-height: 100vh; display: flex; flex-direction: column; }
.hidden { display: none !important; }

/* ---------- Login ---------- */
#loginView { justify-content: center; align-items: center; padding: 24px; }
.login-box { width: 100%; max-width: 340px; text-align: center; }
.logo {
  width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 16px;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(79,70,229,.35);
}
.login-box h1 { font-size: 24px; margin: 0 0 2px; }
.login-box .sub { color: var(--muted); margin: 0 0 22px; }
.login-box input {
  width: 100%; padding: 14px; font-size: 16px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; color: var(--text); margin-bottom: 12px;
}
.login-box button {
  width: 100%; padding: 14px; font-size: 16px; font-weight: 700; border: none;
  border-radius: 12px; background: var(--accent); color: #fff; cursor: pointer;
}
.err { color: var(--red); min-height: 20px; margin: 12px 0 0; font-size: 14px; }

/* ---------- Header ---------- */
header {
  position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.9);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
}
.head-row { display: flex; align-items: center; justify-content: space-between; }
.brand { font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
#logoutBtn {
  border: none; background: none; color: var(--muted); font-size: 14px; cursor: pointer; padding: 4px;
}
.search-wrap { margin-top: 10px; }
.search-input-row { display: flex; gap: 8px; }
.search-input-row input {
  flex: 1; width: 100%; min-width: 0; padding: 12px 14px; font-size: 16px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; color: var(--text);
}
.search-input-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.scan-btn {
  flex: 0 0 auto; width: 48px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--accent-soft); color: var(--accent); font-size: 20px; cursor: pointer;
}
.scan-btn:active { background: #e0e7ff; }
.scan-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.search-wrap.hidden { display: none; }

/* Barcode-Scanner Overlay */
.scanner {
  position: fixed; inset: 0; z-index: 50; background: #000;
  display: flex; flex-direction: column;
}
.scanner.hidden { display: none; }
.scanner-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: max(14px, env(safe-area-inset-top)) 18px 14px; color: #fff;
  font-size: 16px; font-weight: 700;
}
.scanner-head button {
  border: none; background: rgba(255,255,255,.15); color: #fff;
  width: 36px; height: 36px; border-radius: 50%; font-size: 16px; cursor: pointer;
}
.reader { flex: 1; overflow: hidden; }
.reader video { width: 100% !important; height: 100% !important; object-fit: cover; }
.scan-hint { color: #fff; text-align: center; padding: 16px; font-size: 14px; opacity: .85; }

/* ---------- Content ---------- */
main { flex: 1; padding-bottom: 84px; }
.status { padding: 12px 18px 4px; color: var(--muted); font-size: 13px; min-height: 18px; }
.list { list-style: none; margin: 0; padding: 6px 12px 20px; }

/* Karte */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow);
}

/* Artikel-Karte */
.card-top-row { display: flex; align-items: flex-start; gap: 8px; }
.card-top-row .name { flex: 1; }
.edit-btn {
  flex: 0 0 auto; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--accent-soft); color: var(--accent); font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.edit-btn:active { background: #e0e7ff; }
.card .name { font-size: 15px; font-weight: 700; line-height: 1.3; }
.card .artnr {
  display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600;
}
.stats { display: flex; gap: 8px; margin-top: 12px; }
.stat {
  flex: 1; background: #f9fafb; border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 6px; text-align: center;
}
.stat .lbl { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
.stat .val { font-size: 15px; font-weight: 800; margin-top: 3px; }
.stat .sub { font-size: 10px; color: var(--muted); margin-top: 1px; }
.stat.stock .val.pos { color: var(--green); }
.stat.stock .val.zero { color: var(--muted); }
.stat.stock .val.neg { color: var(--red); }
.stat.marge-pos .val { color: var(--green); }
.stat.marge-neg .val { color: var(--red); }
.meta-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.meta-tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #f1f5f9; color: #475569; font-weight: 600; }
.meta-tag.sup { background: #fef3c7; color: #92400e; }

/* Sales-Karte */
.card .s-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card .s-nr { font-weight: 700; font-size: 15px; }
.card .s-date { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.card .s-kunde { margin-top: 4px; color: var(--text); font-size: 14px; }
/* Firmenname steht ueber dem Ansprechpartner - bei B2B ist die Firma die
   eigentliche Identitaet des Auftrags. */
.card .s-firma { margin-top: 4px; color: var(--text); font-size: 14px; font-weight: 700; }
.card .s-firma + .s-kunde { margin-top: 1px; color: var(--muted); font-size: 13px; }
.card .s-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.card .s-amount { font-size: 19px; font-weight: 800; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
}
.badge.paid { background: var(--green-soft); color: var(--green); }
.badge.open { background: #fff7ed; color: var(--amber); }
.badge.ship { background: #f1f5f9; color: #475569; }

/* ---------- Neue Artikelkarte (Soft & Friendly) ---------- */
.product-card { display: flex; flex-direction: column; gap: 8px; }
.product-card__main { display: flex; gap: 12px; align-items: flex-start; }
.product-card__left { flex: 0 0 auto; }
.product-image {
  position: relative; width: 76px; height: 76px; border-radius: 14px; overflow: hidden;
  background: #f8fafc; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.product-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; background: #fff; }
.product-image .pi-icon, .product-image .pi-label { display: none; }
.product-image.is-empty { border: 1px dashed #cbd5e1; }
.product-image.is-empty .pi-icon { display: block; font-size: 20px; opacity: .5; filter: grayscale(1); }
.product-image.is-empty .pi-label { display: block; font-size: 9.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
/* Kartenbild ist klickbar = direkt hochladen */
.product-image[data-imgupload] { cursor: pointer; }
.product-image[data-imgupload] img { cursor: pointer; }
.product-image.is-empty[data-imgupload]:active { background: var(--accent-soft); border-color: var(--accent); }
.product-image.is-uploading { opacity: .55; }
.product-image .pi-spin { display: flex !important; position: absolute; inset: 0; align-items: center; justify-content: center; font-size: 22px; z-index: 2; }

.product-card__content { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.product-card__header { display: flex; align-items: flex-start; gap: 8px; }
.product-card__title { flex: 1; margin: 0; font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--text); word-break: break-word; }
.product-card__actions { flex: 0 0 auto; display: flex; gap: 6px; }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 15px; cursor: pointer; }
.icon-btn--edit { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.icon-btn--edit:active { background: #e0e7ff; }
.icon-btn--delete { background: #fef2f2; color: var(--red); border-color: #fecaca; }
.icon-btn--delete:active { background: #fecaca; }

.product-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.product-badges .badge--sku { background: var(--accent-soft); color: var(--accent); }
.product-badges .badge--ean { background: transparent; color: var(--muted); padding-left: 0; }
.product-badges .badge--ean .k { font-weight: 700; margin-right: 3px; }
.product-badges .badge--idealo { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; text-decoration: none; }
.product-badges .badge--sup { background: #fef3c7; color: #92400e; }

.product-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 2px; }
.stat-card { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 14px; background: #f8fafc; min-width: 0; }
.sc-icon { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.75); }
.sc-svg { width: 17px; height: 17px; }
.sc-body { min-width: 0; }
.sc-lbl { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; font-weight: 600; }
.sc-val { font-size: 15px; font-weight: 800; margin-top: 1px; color: var(--text); white-space: nowrap; }
.sc-val.pos { color: var(--green); } .sc-val.zero { color: var(--muted); } .sc-val.neg { color: var(--red); }
.sc-sub { font-size: 9.5px; color: var(--muted); }
.sc-pct { font-size: 11px; font-weight: 700; color: var(--muted); }
.sc--stock { background: #eef2ff; } .sc--stock .sc-icon { color: #6366f1; }
.sc--ek { background: #ecfeff; } .sc--ek .sc-icon { color: #0d9488; }
.sc--vk { background: #eff6ff; } .sc--vk .sc-icon { color: #2563eb; }
.sc--marge { background: #ecfdf5; } .sc--marge .sc-icon { color: #059669; }
.sc--marge.pos .sc-val { color: var(--green); }
.sc--marge.neg { background: #fef2f2; } .sc--marge.neg .sc-icon { color: var(--red); } .sc--marge.neg .sc-val { color: var(--red); }
.product-card .vk-edit { cursor: pointer; }
/* Mobile: 4 kompakte Kacheln nebeneinander (statt 2x2) -> Artikelkarte deutlich kompakter & aufgeraeumter */
@media (max-width: 619px) {
  .card { padding: 11px; border-radius: 14px; }
  .product-card { gap: 9px; }
  .product-image { width: 66px; height: 66px; }
  .product-stats { grid-template-columns: repeat(4, 1fr); gap: 5px; align-items: stretch; }
  /* alle Kacheln gleich hoch (stretch) + Inhalt OBEN ausgerichtet -> Labels & Werte fluchten auf einer Hoehe */
  .stat-card { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 0; padding: 6px; border-radius: 9px; }
  .sc-icon { display: none; }
  .sc-lbl { font-size: 8.5px; letter-spacing: .01em; }
  .sc-val { font-size: 12.5px; margin-top: 1px; }
  .sc-sub, .sc-sub.sc-shop { font-size: 8px; }
  .sc-pct { font-size: 9px; }
}

@media (min-width: 620px) {
  .product-image { width: 96px; height: 96px; }
  .product-stats { grid-template-columns: repeat(4, 1fr); }
}

/* Leerstaende */
.empty { text-align: center; color: var(--muted); padding: 48px 24px; }
.empty .big { font-size: 40px; margin-bottom: 8px; }

/* Filter-Chips */
.filters { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 2px; }
.chip {
  flex: 0 0 auto; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--muted); font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Sortier-Zeile */
.sortrow { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.sortrow .sortlbl { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.sortrow select {
  flex: 1; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--text); font-size: 14px; font-weight: 600;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}

/* EAN mit Kopieren */
.ean { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.ean .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ean .v { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; font-weight: 700; }
.ean .copy {
  margin-left: auto; border: 1px solid var(--line); background: #f9fafb; color: var(--accent);
  font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 8px; cursor: pointer;
}
.ean .copy:active { background: var(--accent-soft); }

/* Artikeltyp-Badge */
.type-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; background: #f1f5f9; color: #475569; vertical-align: middle; }

/* Sales: externe Nr + Positionen */
.s-ext { color: var(--muted); font-size: 12px; margin-top: 2px; }
.pos { list-style: none; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); }
.pos li { font-size: 13.5px; color: var(--text); padding: 2px 0; }
.pos .pq { color: var(--accent); font-weight: 700; margin-right: 4px; }
/* Artikelname in einer Auftragsposition -> oeffnet die Artikel-Detailansicht.
   Blau = normaler Artikel, Lila = Stueckliste (Bundle). */
.pos-art { border: none; background: none; padding: 0; margin: 0; font: inherit; text-align: left;
  color: #2563eb; font-weight: 600; cursor: pointer; line-height: 1.4; }
.pos-art:hover { text-decoration: underline; }
.pos-art:active { opacity: .6; }
.pos-art.pos-bundle { color: #7c3aed; }

/* ---------- Tabbar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; background: rgba(255,255,255,.95);
  backdrop-filter: saturate(180%) blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; border: none; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 0 8px; color: var(--muted); font-size: 11px; font-weight: 600;
}
.tab .ico { font-size: 20px; filter: grayscale(1); opacity: .6; }
.tab.active { color: var(--accent); }
.tab.active .ico { filter: none; opacity: 1; }

/* ---------- Stock Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.modal-sheet {
  position: relative; width: 100%; max-width: 440px; background: var(--card);
  border-radius: 20px 20px 0 0; padding: 0 20px 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  max-height: min(85vh, 100%); overflow-y: auto; overscroll-behavior: contain;
  box-shadow: 0 -4px 24px rgba(0,0,0,.12);
}
/* Hintergrund komplett sperren, solange ein Overlay offen ist. iOS ignoriert overflow:hidden am
   Body -> zusaetzlich wird der Body per JS auf position:fixed gesetzt (siehe app.js). */
body.modal-open { overflow: hidden; }
/* iOS Safari zoomt beim Fokus in Felder mit Schrift < 16px automatisch rein -> alle Formularfelder
   auf 16px ERZWINGEN (!important schlaegt spezifischere Klassen wie .kg-input 13px / .edit-fields input 14px). */
input, select, textarea { font-size: 16px !important; }
/* Kein seitliches Wegziehen der Seite/Overlays (horizontaler Ueberlauf wird abgeschnitten statt scrollbar) */
html, body { overflow-x: hidden; }
.modal-sheet, .mm-panel { overflow-x: hidden; }
/* Kundengruppen-Preistabelle an die Breite anpassen, damit sie nicht ueber den Rand laeuft */
.kg-table { table-layout: fixed; }
.kg-table .kg-input, .kg-table .kg-shop-input { width: 100%; min-width: 0; box-sizing: border-box; text-align: right; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 16px;
  /* Kopf mit Titel + X bleibt beim Scrollen oben kleben -> X immer erreichbar */
  position: sticky; top: 0; z-index: 5; background: var(--card);
}
.modal-title { font-weight: 800; font-size: 17px; }
.modal-head button {
  border: none; background: #f3f4f6; color: var(--text); width: 34px; height: 34px;
  border-radius: 50%; font-size: 16px; cursor: pointer;
}
/* Zurueck oben links - fuehrt aus der Detailansicht zurueck in die Liste.
   Muss die runde 34px-Vorgabe von .modal-head button ueberschreiben. */
.modal-head button.modal-back { width: auto; height: auto; border-radius: 999px;
  padding: 6px 13px; font-size: 12.5px; font-weight: 700; background: #eef2ff; color: var(--accent);
  white-space: nowrap; }
.modal-head button.modal-back:hover { background: #e0e7ff; }
.stock-item-name { font-weight: 700; font-size: 16px; line-height: 1.3; }
.stock-item-artnr {
  display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600;
}
.stock-current {
  display: flex; align-items: center; justify-content: space-between;
  background: #f9fafb; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 16px; margin-top: 16px;
}
.stock-current-lbl { color: var(--muted); font-size: 13px; font-weight: 600; }
.stock-current-val { font-size: 22px; font-weight: 800; }
.stock-current-val.pos { color: var(--green); }
.stock-current-val.zero { color: var(--muted); }
.stock-current-val.neg { color: var(--red); }
.stock-mode {
  display: flex; gap: 8px; margin-top: 16px;
}
.stock-mode-btn {
  flex: 1; padding: 11px; border: 2px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--muted); font-size: 15px; font-weight: 700;
  cursor: pointer; transition: all .15s;
}
.stock-mode-btn.active[data-mode="zugang"] {
  border-color: var(--green); background: var(--green-soft); color: var(--green);
}
.stock-mode-btn.active[data-mode="abgang"] {
  border-color: var(--red); background: #fef2f2; color: var(--red);
}
.dc-mode { display: flex; gap: 8px; margin: 16px 0; }
.dc-mode-btn {
  flex: 1; padding: 11px; border: 2px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--muted); font-size: 15px; font-weight: 700; cursor: pointer; transition: all .15s;
}
.dc-mode-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.stock-input-row {
  display: flex; align-items: center; gap: 12px; margin-top: 14px;
}
.stock-step {
  width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 12px;
  background: #f9fafb; color: var(--text); font-size: 22px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.stock-step:active { background: var(--accent-soft); }
#stockQty {
  flex: 1; text-align: center; font-size: 24px; font-weight: 800; padding: 10px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text);
  -moz-appearance: textfield;
}
#stockQty::-webkit-inner-spin-button, #stockQty::-webkit-outer-spin-button {
  -webkit-appearance: none; margin: 0;
}
#stockEK, #stockComment {
  width: 100%; margin-top: 14px; padding: 12px 14px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text);
}
.stock-submit {
  width: 100%; margin-top: 16px; padding: 15px; font-size: 16px; font-weight: 700;
  border: none; border-radius: 12px; background: var(--accent); color: #fff; cursor: pointer;
}
.stock-submit:disabled { opacity: .6; cursor: not-allowed; }
.stock-submit:active:not(:disabled) { opacity: .85; }
.stock-result {
  text-align: center; margin-top: 12px; font-size: 14px; font-weight: 600; min-height: 20px;
}
.stock-result.success { color: var(--green); }
.stock-result.error { color: var(--red); }

/* Artikel-Karte klickbar */
.card[data-idx] { cursor: pointer; transition: box-shadow .15s; user-select: none; -webkit-user-select: none; }
.card[data-idx]:active { box-shadow: 0 0 0 2px var(--accent); }

/* ---------- Artikel-Edit Modal ---------- */
.modal-full { max-height: min(92vh, 100%); border-radius: 16px 16px 0 0; }

/* Ab Tablet/Desktop: Modal ueber die volle Breite und Inhalte mehrspaltig,
   damit der Platz genutzt wird. Auf dem Handy bleibt alles wie gehabt. */
@media (min-width: 900px) {
  .modal { align-items: center; }
  .modal-sheet { max-width: 1180px; border-radius: 16px; max-height: 90vh; padding: 0 28px 24px; }
  .modal-full { border-radius: 16px; }
  /* Formularblöcke nebeneinander statt untereinander */
  .item-form { column-count: 2; column-gap: 22px; }
  .item-form fieldset { break-inside: avoid; margin-bottom: 16px; }
  /* Abschnitte im Detail (Bestand, Kanäle, BuyBox, Idealo …) zweispaltig */
  #itemContent { column-count: 2; column-gap: 26px; }
  #itemContent .detail-section { break-after: avoid; }
  #itemContent > div, #itemContent > table, #itemContent > button { break-inside: avoid; }
}
@media (min-width: 1400px) {
  .modal-sheet { max-width: 1500px; }
  .item-form, #itemContent { column-count: 3; }
}
.item-loading { text-align: center; padding: 40px 0; color: var(--muted); font-size: 15px; }
.item-form fieldset {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 0 0 14px;
}
.item-form legend {
  font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--accent); padding: 0 6px;
}
.item-form label {
  display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 10px;
}
.item-form input[type="text"],
.item-form input[type="number"],
.item-form select,
.item-form textarea {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text);
}
.item-form input[readonly] { background: #f3f4f6; color: var(--muted); }
.item-form textarea { resize: vertical; font-family: inherit; }
.item-form .cb { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); }
.item-form .cb input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.field-row { display: flex; gap: 10px; }
.field-row label { flex: 1; }
.info-list { margin-bottom: 10px; }
.info-label { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.info-tag {
  display: inline-block; padding: 4px 10px; margin: 2px 4px 2px 0; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600;
}
.info-empty { font-size: 13px; color: var(--muted); font-style: italic; }
.item-save {
  width: 100%; margin-top: 8px; padding: 15px; font-size: 16px; font-weight: 700;
  border: none; border-radius: 12px; background: var(--accent); color: #fff; cursor: pointer;
}
.item-save:disabled { opacity: .6; cursor: not-allowed; }

/* Detail Modal */
.detail-name { font-weight: 800; font-size: 17px; line-height: 1.3; }
.detail-artnr { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; }
.detail-section { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); margin: 18px 0 8px; }
/* Klappbare Abschnitte in der Artikel-Detailleiste */
.detail-section.acc-head { display: flex; align-items: center; justify-content: space-between; cursor: pointer; user-select: none; }
.acc-chevron { font-size: 11px; opacity: .7; transition: transform .15s ease; }
.detail-section.acc-head.collapsed .acc-chevron { transform: rotate(-90deg); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.detail-tile { background: #f9fafb; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.dt-l { font-size: 10px; color: var(--muted); text-transform: uppercase; }
.dt-v { font-size: 16px; font-weight: 800; margin-top: 4px; }
.meta-tag.cat { background: #e0e7ff; color: #4338ca; }
.kg-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.kg-table th { text-align: left; font-size: 11px; color: var(--muted); padding: 6px 10px; border-bottom: 1px solid var(--line); }
.kg-table td { padding: 8px 10px; border-bottom: 1px solid #f3f4f6; }
.kg-table tr:last-child td { border-bottom: 0; }


/* Kategorie-Dropdown */
.cat-row { margin-top: 8px; }
.cat-row select { width: 100%; padding: 8px 12px; font-size: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); }

/* Edit-Felder im Detail */
.edit-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.edit-fields label { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.edit-fields input { width: 100%; margin-top: 4px; padding: 8px 10px; font-size: 14px; border: 1px solid var(--line); border-radius: 8px; }
.detail-info { font-size: 13px; color: var(--text); line-height: 1.8; }

.kg-input { width: 90px; padding: 6px 8px; font-size: 13px; border: 1px solid var(--line); border-radius: 6px; text-align: right; }
.kg-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px rgba(79,70,229,.15); }
.kg-brutto { color: var(--muted); font-size: 12px; }

.sn-add-row { display: flex; gap: 8px; margin-top: 8px; }
.sn-add-row input { flex: 1; padding: 10px 12px; font-size: 14px; border: 1px solid var(--line); border-radius: 10px; }
.sn-item { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; margin-top: 4px; background: #f0f4ff; border-radius: 8px; font-size: 13px; }
.sn-del { border: none; background: none; color: var(--red); font-weight: 700; cursor: pointer; font-size: 14px; }
#stockSNWrap { margin-top: 12px; padding: 12px; border: 1px dashed var(--accent); border-radius: 10px; background: #fafbff; }

.sn-label { font-size: 12px; font-weight: 600; color: var(--accent); margin-bottom: 8px; }
.sn-num { font-weight: 700; color: var(--muted); min-width: 24px; }
.sn-field { flex: 1; padding: 8px 10px; font-size: 14px; border: 1px solid var(--line); border-radius: 8px; }
.sn-field:focus { border-color: var(--accent); outline: none; }
.sn-item { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }

.sn-desc { width: 120px; flex: 0 0 120px; padding: 8px 10px; font-size: 13px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); }
.sn-desc:focus { border-color: var(--accent); outline: none; color: var(--text); }

.new-btn { background: var(--accent); color: #fff; border: none; padding: 6px 14px; border-radius: 8px; font-weight: 700; font-size: 13px; cursor: pointer; }
.edit-fields select { width: 100%; margin-top: 4px; padding: 8px 10px; font-size: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.edit-fields select[multiple] { padding: 4px; }
.edit-fields select[multiple] option { padding: 4px 8px; }

.del-btn { flex: 0 0 auto; width: 34px; height: 34px; border: 1px solid #fecaca; border-radius: 10px; background: #fef2f2; color: var(--red); font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.del-btn:active { background: #fecaca; }

.ch-field { margin-bottom: 6px; }
.ch-field label { display: block; }
.ch-field input { width: 100%; margin-top: 2px; padding: 7px 10px; font-size: 13px; border: 1px solid var(--line); border-radius: 6px; }
.ch-field input:focus { border-color: var(--accent); outline: none; }

.ch-tabs { display: flex; gap: 4px; margin: 8px 0; }
.ch-tab { font-size: 11px; font-weight: 600; padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--muted); cursor: pointer; }
.ch-tab.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.ch-section.hidden { display: none; }

.ship-select { padding: 3px 6px; font-size: 11px; border: 1px solid transparent; border-radius: 999px; transition: border-color .3s; cursor: pointer; }

.otto-link { color: #e65100; font-weight: 700; text-decoration: none; }
.otto-link:active { text-decoration: underline; }
.otto-cancel-btn { padding: 7px 14px; border: 1px solid var(--red); color: var(--red); background: transparent; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; }
.otto-cancel-btn:hover { background: var(--red); color: #fff; }
.otto-cancel-btn:disabled { opacity: .6; cursor: default; }
.otto-cancel-btn.done { border-color: var(--green); color: var(--green); }
.otto-pstatus { font-size: 10.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; margin-left: 4px; white-space: nowrap; }
.otto-pstatus.canc { color: var(--red); }
.s-zahlart { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 10px; background: #eef2ff; color: #4f46e5; font-size: 11px; font-weight: 700; vertical-align: middle; }
.muted-txt { color: var(--muted); font-style: italic; }

.copyable { cursor: copy; -webkit-user-select: none; user-select: none; }
.copyable:active { opacity: .5; }

.cat-row option.cat-parent { font-weight: 700; background: var(--accent); color: #fff; }
.cat-row option.cat-child { padding-left: 16px; }

.tracking-row { margin-top: 8px; }
.tracking-link { color: #4338ca; font-size: 13px; font-weight: 600; text-decoration: none; }
.tracking-link:active { text-decoration: underline; }
.tracking-id { color: var(--muted); font-size: 13px; font-family: monospace; }
/* --- Sendungsverfolgung (DHL) --- */
.ship-box { margin-top: 10px; padding: 9px 11px; border-radius: 10px; background: #f8fafc; border: 1px solid #e8edf3; }
.ship-box.ship-plain { background: none; border: none; padding: 0; margin-top: 8px; }
.ship-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dhl-status { display: inline-block; padding: 3px 10px; border-radius: 10px; font-size: 11.5px; font-weight: 700; background: #f1f5f9; color: var(--muted); }
.dhl-status.angekuendigt { background: #e9eef5; color: #475569; }
.dhl-status.abgeholt { background: #e0efff; color: #1d4ed8; }
.dhl-status.unterwegs { background: #fef3c7; color: #92400e; }
.dhl-status.abholbereit { background: #ede9fe; color: #6d28d9; }
.dhl-status.filiale { background: #f5f3ff; color: #7c5cd6; box-shadow: inset 0 0 0 1px #ddd6fe; }
.dhl-status.zugestellt { background: #dcfce7; color: #166534; }
.dhl-status.problem { background: #fee2e2; color: #991b1b; }
.dhl-status.lade { background: #f1f5f9; color: var(--muted); font-weight: 600; }
.ship-eta { margin-left: auto; font-size: 11.5px; font-weight: 700; color: #4338ca; white-space: nowrap; }
.ship-eta:empty { display: none; }
.ship-meta { margin-top: 4px; font-size: 11px; color: var(--muted); }
.ship-meta:empty { display: none; }
.ship-foot { display: flex; align-items: center; gap: 7px; margin-top: 7px; flex-wrap: wrap; }
.ship-paket { font-size: 12px; }
/* "Paket 2/5" - nur bei Auftraegen mit mehreren Sendungen */
.ship-zaehler { font-size: 10.5px; font-weight: 700; color: var(--muted); background: #eef2f7;
  padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.ship-nr { font-family: monospace; font-size: 11.5px; color: var(--muted); text-decoration: none; }
a.ship-nr:active, a.ship-nr:hover { text-decoration: underline; }
.ship-toggle { order: 3; border: none; background: none; padding: 2px 7px; font-size: 11.5px; font-weight: 700;
  color: #4338ca; cursor: pointer; border-radius: 7px; }
.ship-toggle::after { content: ' \25BE'; }
.ship-toggle.offen::after { content: ' \25B4'; }
.ship-toggle:hover { background: #eef2ff; }
.ship-events { list-style: none; margin: 9px 0 1px; padding: 0 0 0 11px; border-left: 2px solid #dbe3ec; }
.ship-events li { display: flex; gap: 10px; font-size: 11.5px; padding: 5px 0; align-items: baseline; }
.ev-zeit { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 92px; flex: none; }
.ev-txt { flex: 1 1 auto; line-height: 1.35; }
.ev-ort { color: var(--muted); white-space: nowrap; flex: none; padding-left: 4px; }
/* Hinweise (Benachrichtigungskarte, Wunschtag, haengende Sendung) - nur wenn relevant */
.ship-hint { display: block; margin-top: 3px; color: #92400e; font-weight: 600; }
/* Otto-Kontakt: dezent, ausser wenn der Kunde handeln muss (Abholbereit/Problem) */
.otto-mail-btn { order: 4; display: inline-block; text-decoration: none; margin-left: auto; border: 1px solid #dbe3ec; background: #fff; color: var(--muted);
  padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.otto-mail-btn:hover { border-color: #c3ccd8; color: #334155; }
.otto-mail-btn.wichtig { border-color: #c4b5fd; background: #f5f3ff; color: #6d28d9; }
.otto-mail-btn.wichtig:hover { background: #ede9fe; }

.label-link { color: var(--accent); font-size: 12px; font-weight: 600; text-decoration: none; margin-left: 8px; }
.label-wait { color: var(--muted); font-size: 12px; font-weight: 700; margin-left: 8px; }
.idealo-btn { display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 999px; background: #ff9b00; color: #fff; font-size: 11px; font-weight: 700; text-decoration: none; vertical-align: middle; }
.idealo-btn:active { opacity: .8; }

.loadmore-wrap { padding: 4px 18px 24px; text-align: center; }
.loadmore-btn { width: 100%; max-width: 420px; padding: 13px; border: none; border-radius: 12px; background: var(--accent); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; }
.loadmore-btn:disabled { opacity: .6; }
.loadmore-btn:active { opacity: .85; }
.loadmore-done { color: var(--muted); font-size: 12px; padding: 4px 0; }

.discord-btn { font-size: 11px; font-weight: 600; padding: 3px 8px; border: 1px solid #5865F2; border-radius: 6px; background: #fff; color: #5865F2; cursor: pointer; margin-left: 6px; }
.discord-btn:active { background: #5865F2; color: #fff; }

.rechnung-row { margin-top: 8px; }
.rechnung-link { display: inline-block; font-size: 13px; font-weight: 600; padding: 7px 12px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.rechnung-link:active { background: var(--accent); color: #fff; }

/* ---------- Kaufland Tickets ---------- */
.ticket-card { cursor: pointer; }
.ticket-card:active { box-shadow: 0 0 0 2px var(--accent); }
.ticket-row1 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ticket-topic { font-weight: 700; font-size: 15px; }
.ticket-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.ticket-preview {
  font-size: 13px; color: var(--text); margin-top: 6px; line-height: 1.4;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.ticket-wait { font-size: 11px; margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tw-wait { color: var(--muted); }
.tw-frist { font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.tw-ok { color: var(--green); background: var(--green-soft); }
.tw-warn { color: var(--amber); background: #fff7ed; }
.tw-late { color: #fff; background: var(--red); }
.tdh-frist { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 12px; }
/* Länder-Code statt (auf Windows nicht renderbarem) Flaggen-Emoji */
.flag-badge {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .03em;
  padding: 1px 6px; border-radius: 5px; background: var(--accent-soft); color: var(--accent);
  vertical-align: middle; margin-right: 6px;
}

/* Detail-Kopf */
.ticket-detail-head { padding: 2px 2px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.tdh-main { flex: 1; min-width: 0; }
.tdh-title { font-weight: 800; font-size: 17px; line-height: 1.3; }
.tdh-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.tdh-prod { display: flex; gap: 10px; margin-top: 10px; padding: 8px; background: #f9fafb; border: 1px solid var(--line); border-radius: 10px; align-items: center; }
.tdh-prod img { width: 52px; height: 52px; object-fit: contain; border-radius: 8px; background: #fff; flex: 0 0 auto; }
.tdh-prod-info { min-width: 0; }
.tdh-prod-title { font-size: 13px; font-weight: 600; line-height: 1.3; margin-bottom: 4px; }

/* Chat-Verlauf */
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow-y: auto; padding: 4px 2px; }
.msg { max-width: 82%; padding: 8px 12px; border-radius: 14px; }
.msg.seller { align-self: flex-end; background: var(--accent-soft); border: 1px solid #dfe3ff; }
.msg.buyer { align-self: flex-start; background: #f3f4f6; border: 1px solid var(--line); }
/* System-/Kundenservice-Meldungen: volle Breite im Kaufland-Portal-Stil */
.msg.system { align-self: stretch; max-width: 100%; background: #fff7ed; border: 1px solid #fde3c0; border-radius: 10px; padding: 10px 14px; text-align: left; }
.msg-sys-head { font-size: 12px; font-weight: 700; color: #b45309; margin-bottom: 5px; }
.msg-who { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; font-size: 14px; }
.msg.system .msg-text { font-size: 13.5px; font-style: italic; color: #7c5312; }
.msg-time { font-size: 10px; color: var(--muted); margin-top: 3px; text-align: right; }

/* Anhänge */
.msg-files { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin-top: 4px; padding: 8px 2px 2px; }
.msg-files-lbl { flex-basis: 100%; font-size: 11px; color: var(--muted); font-weight: 600; }
.att { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--muted); font-size: 10px; max-width: 130px; }
.att img { max-width: 130px; max-height: 130px; border-radius: 8px; border: 1px solid var(--line); object-fit: cover; }
.att span { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Antwort-Bereich */
.ticket-reply { margin-top: 14px; }
.ticket-reply textarea {
  width: 100%; padding: 10px 12px; font-size: 14px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--text); font-family: inherit; resize: vertical;
}
.ticket-reply textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px rgba(79,70,229,.15); }
.ticket-reply textarea.drag { border-color: var(--accent); border-style: dashed; background: var(--accent-soft); }
.ticket-att { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.att-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; background: #eef2ff; color: var(--accent); padding: 4px 8px; border-radius: 8px; font-weight: 600; }
.att-chip button { border: none; background: none; color: var(--accent); cursor: pointer; font-size: 13px; padding: 0; line-height: 1; }
.ticket-reply-bar { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.tr-tool { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); cursor: pointer; }
.tr-tool:active { background: #f3f4f6; }
.tr-baustein { font-size: 12px; font-weight: 600; padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); cursor: pointer; max-width: 170px; }
.ticket-reply-actions { display: flex; gap: 10px; margin-top: 10px; }
.ticket-reply-actions .stock-submit { flex: 1; margin-top: 0; }
.ticket-close-btn {
  flex: 0 0 auto; padding: 0 18px; border: 1px solid #fecaca; border-radius: 10px;
  background: #fef2f2; color: var(--red); font-weight: 700; font-size: 14px; cursor: pointer;
}
.ticket-close-btn:disabled { opacity: .6; cursor: not-allowed; }
.ticket-closed-note { margin-top: 14px; text-align: center; color: var(--muted); font-size: 13px; padding: 10px; }

/* Zwei-Spalten-Layout: Chat + Info-Seitenleiste (Sidebar wegklappbar) */
.ticket-layout { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; }
.ticket-main { flex: 1 1 340px; min-width: 0; }
.ticket-side { flex: 1 1 230px; min-width: 0; }
.ticket-layout.side-hidden .ticket-side { display: none; }
.ticket-layout.side-hidden .ticket-main { flex-basis: 100%; }

/* Ticket-Modal: Kopf oben, Chat/Infos scrollen, Antwortbox immer sichtbar am unteren Rand.
   Verhindert, dass das Textfeld auf kurzen Screens / am MacBook aus dem Bild rutscht. */
#ticketModal .modal-sheet { display: flex; flex-direction: column; overflow: hidden; }
#ticketModal .modal-head { flex-shrink: 0; }
#ticketModal .modal-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
#ticketModal #ticketContent { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#ticketModal .ticket-detail-head { flex-shrink: 0; }
#ticketModal .ticket-layout { flex: 1; min-height: 0; overflow-y: auto; }
#ticketModal .chat { max-height: none; overflow: visible; }        /* die Layout-Spalte scrollt, nicht der Chat selbst */
#ticketModal .ticket-reply,
#ticketModal .ticket-closed-note { flex-shrink: 0; margin-top: 0; padding-top: 12px; border-top: 1px solid var(--line); background: var(--card); }
/* Kundenanhang linksbuendig als Teil der Kundennachricht (nicht am unteren Rand) */
.msg-files.buyer-att { justify-content: flex-start; margin: 2px 0 6px; padding-top: 2px; }

/* Marktplatz-Umschalter (Kaufland | eBay) im Tickets-Tab */
.mkt-switch { margin-bottom: 8px; }
.mkt-switch .chip { font-weight: 700; }
.mkt-switch .chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.ebay-tag { display: inline-block; padding: 1px 7px; border-radius: 6px; background: #e53238; color: #fff; font-size: 11px; font-weight: 800; vertical-align: middle; letter-spacing: .2px; }
.otto-tag { display: inline-block; padding: 1px 7px; border-radius: 6px; background: #e2001a; color: #fff; font-size: 11px; font-weight: 800; vertical-align: middle; letter-spacing: .2px; }
.otto-regeln { font-size: 11px; color: var(--muted); margin: 8px 2px 0; line-height: 1.4; }
.esk-tag { display: inline-block; padding: 1px 6px; border-radius: 5px; background: var(--amber); color: #fff; font-size: 10px; font-weight: 800; vertical-align: middle; }
.amazon-tag { display: inline-block; padding: 1px 7px; border-radius: 6px; background: #232f3e; color: #ff9900; font-size: 11px; font-weight: 800; vertical-align: middle; letter-spacing: .2px; }
.amz-flag { font-size: 15px; vertical-align: middle; }
.msg-count { color: var(--muted); font-weight: 600; font-size: 12px; }
.tr-de { margin-top: 6px; padding: 6px 8px; border-left: 2px solid var(--accent); background: var(--accent-soft); border-radius: 6px; font-size: 13px; color: var(--text); }
.via-tag { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 4px; margin-left: 4px; }
.src-local { font-size: 11px; font-weight: 600; color: #9a6700; background: #fff3cd; border: 1px solid #ffe69c; padding: 1px 6px; border-radius: 5px; margin-left: 8px; cursor: help; }
.ebay-reply-soon { color: var(--muted); font-size: 13px; padding: 10px 2px; }
.mini-refresh { background: none; border: none; cursor: pointer; font-size: 14px; padding: 0 4px; vertical-align: middle; }
.mini-refresh:active { transform: rotate(90deg); }
.ts-artikel { font-size: 13px; word-break: break-word; line-height: 1.4; }
.ts-artikel a { color: var(--accent); font-weight: 600; }
.unread-dot { color: var(--red); font-size: 10px; vertical-align: middle; }
.tdh-actions { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }
.side-toggle-btn { font-size: 12px; font-weight: 700; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; white-space: nowrap; }
.side-toggle-btn:active { background: #f3f4f6; }
.ts-box { background: #f9fafb; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.ts-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); margin-bottom: 8px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.ts-h::-webkit-details-marker { display: none; }
.ts-h::after { content: '▾'; color: var(--muted); font-size: 11px; }
details.ts-box:not([open]) > .ts-h { margin-bottom: 0; }
details.ts-box:not([open]) > .ts-h::after { content: '▸'; }
.ts-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 13px; border-bottom: 1px solid #eef1f6; }
.ts-row:last-child { border-bottom: 0; }
.ts-l { color: var(--muted); flex: 0 0 auto; }
.ts-v { text-align: right; font-weight: 600; }
.ts-empty { font-size: 13px; color: var(--muted); font-style: italic; }

/* "Aktion wählen"-Dropdown */
.aktion-menu { position: relative; flex: 0 0 auto; }
.aktion-menu > summary { list-style: none; cursor: pointer; font-size: 13px; font-weight: 700; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; white-space: nowrap; }
.aktion-menu > summary::-webkit-details-marker { display: none; }
.aktion-menu > summary::after { content: ' ▾'; color: var(--muted); }
.aktion-list { position: absolute; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); min-width: 210px; padding: 6px; z-index: 5; display: flex; flex-direction: column; gap: 2px; }
.aktion-item { display: block; text-align: left; width: 100%; padding: 9px 12px; border: none; border-radius: 8px; background: none; font-size: 13px; color: var(--text); cursor: pointer; text-decoration: none; }
.aktion-item:hover { background: var(--accent-soft); }

/* VK-Preis inline in der Artikelliste bearbeiten */
.vk-edit { cursor: pointer; text-decoration: underline dotted var(--accent); text-underline-offset: 3px; }
.vk-edit:active { opacity: .6; }
.vk-saved { color: var(--green) !important; text-decoration: none; }
.vk-inline { width: 84px; padding: 3px 6px; font-size: 16px; font-weight: 800; border: 1px solid var(--accent); border-radius: 6px; text-align: center; color: var(--text); background: #fff; }
.vk-inline:focus { outline: none; box-shadow: 0 0 0 2px rgba(79,70,229,.2); }

/* ============================================================
   Marge-nach-Gebuehr-Modal (openMarginModal)
   ============================================================ */
.mm-overlay { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; background: rgba(16,24,42,.45); backdrop-filter: blur(2px); padding: 0; }
.mm-overlay.hidden { display: none; }
.mm-panel { width: 100%; max-width: 760px; max-height: 92vh; overflow-y: auto; background: var(--card); border-radius: 20px 20px 0 0; box-shadow: 0 -6px 30px rgba(0,0,0,.18); padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); animation: mmUp .18s ease-out; }
@keyframes mmUp { from { transform: translateY(24px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
@media (min-width: 560px) { .mm-overlay { align-items: center; } .mm-panel { border-radius: 20px; padding: 22px 22px; } }
/* Ab Tablet: Marktplatz-Karten nebeneinander (2 Spalten) */
@media (min-width: 680px) { .mm-fees { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; } }

.mm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.mm-title { font-size: 15px; font-weight: 800; color: var(--text); line-height: 1.3; }
.mm-close { flex: 0 0 auto; width: 32px; height: 32px; border: none; border-radius: 10px; background: #f1f5f9; color: var(--muted); font-size: 15px; cursor: pointer; }
.mm-close:active { background: #e2e8f0; }

.mm-inputs { display: flex; align-items: stretch; gap: 10px; padding: 12px 14px; background: var(--accent-soft); border-radius: 14px; margin-bottom: 8px; }
.mm-field { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.mm-field input { width: 100%; padding: 8px 10px; font-size: 19px; font-weight: 800; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); text-align: right; }
.mm-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.mm-meta { font-size: 12px; color: var(--muted); text-align: right; line-height: 1.5; margin-bottom: 14px; }

.mm-fees { display: flex; flex-direction: column; gap: 10px; }
.mm-loading, .mm-err { padding: 20px; text-align: center; color: var(--muted); font-size: 13px; }
.mm-err { color: var(--red); }

.mm-fee { background: #f8fafc; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.mm-fee-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 800; color: var(--text); }
.mm-fee-rate { font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 3px 8px; border-radius: 999px; }
.mm-fee-cat { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 11.5px; color: var(--muted); margin: 8px 0 4px; }
.mm-fee-cat b { color: var(--text); }
.mm-group { flex: 1 1 140px; min-width: 130px; padding: 6px 8px; font-size: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); }
.mm-group:focus { outline: none; border-color: var(--accent); }

.mm-fee-lines { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.mm-fee-lines > div { display: flex; align-items: center; justify-content: space-between; color: var(--text); }
.mm-fee-lines > div > span:first-child { color: var(--muted); }
.mm-neg { color: var(--red); }
.mm-fee-lines .mm-sub { font-weight: 700; margin-top: 2px; padding-top: 5px; border-top: 1px solid #eef1f6; }
.mm-fee-lines .mm-sub > span:first-child { color: var(--text) !important; }
.mm-fee-total { margin-top: 4px; padding-top: 7px; border-top: 1px dashed var(--line); font-weight: 800; }
.mm-fee-total.pos > span:last-child { color: var(--green); }
.mm-fee-total.neg > span:last-child { color: var(--red); }
.mm-fee-marge { font-weight: 800; font-size: 14px; }
.mm-fee-marge.pos { color: var(--green); } .mm-fee-marge.pos > span:first-child { color: var(--green); }
.mm-fee-marge.neg { color: var(--red); } .mm-fee-marge.neg > span:first-child { color: var(--red); }
.mm-fee-marge > span:first-child { color: var(--text) !important; }

.mm-fee-na { margin-top: 8px; font-size: 12.5px; color: var(--muted); font-style: italic; }
.mm-soon { display: flex; align-items: center; justify-content: space-between; opacity: .55; }
.mm-soon-tag { font-size: 11px; font-weight: 700; color: var(--muted); background: #eef2f7; padding: 3px 9px; border-radius: 999px; }

/* ============================================================
   Anlegen: Scanner-Button, MwSt-Hinweis, Details; + Nachpflege-Liste
   ============================================================ */
.ni-scanwrap { display: flex; gap: 6px; align-items: stretch; }
.ni-scanwrap input { flex: 1; min-width: 0; }
.ni-scan { flex: 0 0 auto; width: 44px; border: 1px solid var(--line); background: var(--accent-soft); color: var(--accent); border-radius: 10px; font-size: 18px; cursor: pointer; }
.ni-scan:active { background: #e0e7ff; }
.ni-nethint { font-size: 12px; color: var(--muted); margin: 2px 0 6px; font-variant-numeric: tabular-nums; }
.ni-more { margin: 6px 0 4px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; overflow: hidden; }
.ni-more > summary { cursor: pointer; padding: 11px 14px; font-size: 13px; font-weight: 700; color: var(--text); list-style: none; }
.ni-more > summary::-webkit-details-marker { display: none; }
.ni-more > summary::after { content: ' ▾'; color: var(--muted); float: right; }
.ni-more[open] > summary::after { content: ' ▴'; }
.ni-more > .edit-fields { padding: 0 12px 10px; }
.ni-dims { grid-template-columns: 1fr 1fr 1fr !important; }

.ghost-btn { position: relative; }
.badge-count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }
.badge-count.hidden { display: none; }

.created-hint { font-size: 13px; color: var(--muted); background: var(--accent-soft); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; line-height: 1.5; }
.created-list { display: flex; flex-direction: column; gap: 8px; }
.created-row { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.created-info { flex: 1; min-width: 0; }
.created-name { font-weight: 700; font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.created-sub { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.created-date { font-size: 12px; color: var(--muted); }
.created-done { flex: 0 0 auto; border: 1px solid var(--green); color: var(--green); background: var(--green-soft); border-radius: 10px; padding: 8px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.created-done:active { background: #d1fae5; }
.created-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 12px; }

/* --- SEO-Generator (KI-Beschreibung im Detail-Dialog) --- */
.seo-gen-result { margin-top: 8px; }
.seo-err { color: var(--red); font-size: 13px; font-weight: 600; }
.seo-preview { border: 1px solid var(--line, #e5e7eb); border-radius: 12px; padding: 12px; background: var(--card, #fff); }
.seo-meta { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.seo-field { margin-bottom: 10px; }
.seo-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin-bottom: 3px; font-weight: 700; }
.seo-px { text-transform: none; letter-spacing: 0; font-weight: 600; }
.seo-val { font-size: 13.5px; line-height: 1.45; word-break: break-word; }
.seo-val[data-seocopy] { cursor: pointer; }
.seo-val[data-seocopy]:active { opacity: .6; }
.seo-mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; color: var(--accent); }
.seo-bullets { margin: 2px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.5; }
.seo-html { font-size: 12.5px; line-height: 1.5; max-height: 260px; overflow: auto; border: 1px solid var(--line, #eee); border-radius: 8px; padding: 8px; margin-top: 4px; background: rgba(127,127,127,.03); }
.seo-html h2 { font-size: 15px; margin: 8px 0 4px; }
.seo-html h3 { font-size: 13.5px; margin: 8px 0 4px; }
.seo-html ul { padding-left: 18px; }

/* --- Bild-Upload Plattform-Picker --- */
.img-picker { margin: 4px 0 8px; }
.img-picker .ip-all { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; padding: 4px 0; }
.img-picker .ip-all input { width: 18px; height: 18px; }
.ip-list { display: none; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line, #e5e7eb); border-radius: 10px; background: rgba(127,127,127,.03); }
.ip-item { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; flex: 0 0 auto; min-width: 90px; }
.ip-item input { width: 16px; height: 16px; }

/* --- Shop-Produktlink-Badge (im "Ohne Beschreibung"-Filter) --- */
.badge--shop { background: #4f46e5; color: #fff; border-color: #4f46e5; text-decoration: none; cursor: pointer; font-weight: 600; }
.badge--shop:active { opacity: .8; }

/* --- Onlineshop-Preis-Unterzeile auf der Karte --- */
.sc-sub.sc-shop { color: var(--accent, #7c3aed); font-weight: 700; font-size: 11.5px; margin-top: 1px; }

/* --- Preisliste: Auswahl-Checkbox auf der Karte --- */
.pl-check { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 2px; margin-right: 2px; }
.pl-check input { width: 20px; height: 20px; cursor: pointer; accent-color: var(--accent, #2f6bff); }

/* --- Preisliste: schwebende Auswahl-Leiste (ueber der Tabbar) --- */
.pl-bar {
  position: fixed; left: 12px; right: 12px; z-index: 11;
  bottom: calc(58px + env(safe-area-inset-bottom));
  display: none; align-items: center; gap: 10px;
  background: #101828; color: #fff;
  padding: 10px 12px; border-radius: 14px;
  box-shadow: 0 8px 28px rgba(16,24,42,.32);
  max-width: 720px; margin: 0 auto;
}
.pl-bar.show { display: flex; }
.pl-bar__lbl { font-size: 14px; font-weight: 600; }
.pl-bar__lbl b { font-size: 15px; }
.pl-bar__btn { margin-left: auto; border: none; border-radius: 10px; padding: 9px 14px; font-size: 14px; font-weight: 700; cursor: pointer; background: var(--accent, #2f6bff); color: #fff; }
.pl-bar__btn--ghost { margin-left: 0; background: rgba(255,255,255,.14); color: #fff; font-weight: 600; }
.pl-bar__btn:active { transform: translateY(1px); }

/* --- "Im Shop ausgeblendet"-Filter: Badge + Freischalt-Button --- */
.badge--hidden { background: #fef2f2; color: #b42318; border-color: #fecaca; font-weight: 600; }
.badge--show { background: #16a34a; color: #fff; border-color: #16a34a; font-weight: 700; cursor: pointer; }
.badge--show:hover { background: #15803d; }
.badge--show:disabled { opacity: .6; cursor: default; }
/* Versendet-Filter: Kategorien ohne Treffer ausgrauen */
#versandFilter .chip.leer { opacity: .45; }

/* Nachfrage vor dem Sprung ins Otto-Portal */
.km-status { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 9px 11px; border-radius: 9px;
  background: #f1f5f9; }
.km-status.ok { background: #f0fdf4; color: #166534; }
.km-status.warn { background: #fffbeb; color: #92400e; }
.km-frage { margin: 14px 0 10px; font-size: 14.5px; font-weight: 700; line-height: 1.4; }
.km-vorschau { margin-bottom: 14px; }
.km-vorschau summary { font-size: 12px; font-weight: 700; color: var(--accent); cursor: pointer; }
.km-vorschau pre { margin: 8px 0 0; padding: 10px; border-radius: 9px; background: #f8fafc;
  border: 1px solid #e8edf3; font: inherit; font-size: 12px; line-height: 1.45; color: #334155;
  white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow-y: auto; }
.km-btns { display: flex; align-items: center; gap: 9px; }
.km-abbruch { flex: 0 0 auto; border: 1px solid #dbe3ec; background: #fff; color: #334155;
  padding: 10px 16px; border-radius: 999px; font-size: 13px; font-weight: 700; cursor: pointer; }
.km-abbruch:hover { background: #f1f5f9; }
.km-ok { flex: 1 1 auto; text-align: center; padding: 10px 16px; border-radius: 999px;
  background: #6d28d9; color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; }
.km-ok:hover { background: #5b21b6; }

/* --- Bundles in Serie anlegen --- */
.bu-hinweis { font-size: 12.5px; color: var(--muted); line-height: 1.5; padding: 9px 11px;
  background: #f8fafc; border: 1px solid #e8edf3; border-radius: 9px; margin-bottom: 4px; }
.bu-such { position: relative; margin-top: 8px; }
.bu-such input { width: 100%; box-sizing: border-box; padding: 9px 11px; border: 1px solid #dbe3ec;
  border-radius: 9px; font: inherit; font-size: 13px; background: #fff; }
.bu-treffer { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20;
  max-height: 260px; overflow-y: auto; background: #fff; border: 1px solid #dbe3ec;
  border-radius: 9px; box-shadow: 0 8px 22px rgba(15, 23, 42, .14); }
.bu-treffer-zeile { display: flex; align-items: baseline; gap: 8px; width: 100%; text-align: left;
  border: none; background: none; padding: 8px 11px; cursor: pointer; font: inherit; font-size: 12.5px;
  border-bottom: 1px solid #f1f5f9; }
.bu-treffer-zeile:last-child { border-bottom: none; }
.bu-treffer-zeile:hover { background: #f1f5f9; }
.bu-t-sku { font-family: monospace; font-size: 11.5px; color: var(--muted); flex: none; }
.bu-t-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bu-t-preis { flex: none; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.bu-liste { list-style: none; margin: 8px 0 0; padding: 0; }
.bu-liste li { display: flex; align-items: center; gap: 8px; padding: 7px 10px; font-size: 12.5px;
  border: 1px solid #e8edf3; border-radius: 9px; margin-bottom: 5px; background: #fff; }
.bu-leer { color: var(--muted); font-style: italic; border: none !important; padding: 6px 2px !important;
  background: none !important; font-size: 12.5px; }
.bu-weg { flex: none; margin-left: auto; border: none; background: none; color: var(--muted);
  font-size: 14px; cursor: pointer; padding: 2px 5px; border-radius: 6px; }
.bu-weg:hover { background: #fee2e2; color: var(--red); }
.bu-menge { flex: none; width: 54px; padding: 4px 6px; border: 1px solid #dbe3ec; border-radius: 7px;
  font: inherit; font-size: 12.5px; text-align: center; }
.bu-variante { border: 1px solid #e8edf3; border-radius: 11px; padding: 10px; margin-bottom: 9px; background: #fbfcfe; }
.bu-v-kopf { display: flex; align-items: center; gap: 8px; }
.bu-v-label { flex: 1 1 auto; min-width: 0; padding: 7px 10px; border: 1px solid #dbe3ec;
  border-radius: 8px; font: inherit; font-size: 13px; font-weight: 700; }
.bu-add { margin-top: 2px; border: 1px dashed #c3ccd8; background: none; color: var(--accent);
  padding: 8px 14px; border-radius: 9px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.bu-add:hover { background: #eef2ff; }
.bu-optionen { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 10px;
  font-size: 12.5px; color: var(--muted); }
.bu-inline { display: inline-flex; align-items: center; gap: 5px; margin-left: 6px; }
.bu-inline input { width: 72px; padding: 5px 7px; border: 1px solid #dbe3ec; border-radius: 7px;
  font: inherit; font-size: 12.5px; text-align: right; }
.bu-check { display: flex; align-items: center; gap: 7px; cursor: pointer; font-weight: 700; color: var(--text); }
.bu-check input { width: 17px; height: 17px; }
.bu-vorschau { overflow-x: auto; }
.bu-tab { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.bu-tab th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
  color: var(--muted); padding: 0 8px 6px 0; font-weight: 700; white-space: nowrap; }
.bu-tab td { padding: 5px 8px 5px 0; border-top: 1px solid #eef2f7; vertical-align: middle; }
.bu-tab .bu-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bu-name { width: 100%; min-width: 190px; padding: 6px 8px; border: 1px solid #dbe3ec;
  border-radius: 7px; font: inherit; font-size: 12.5px; }
.bu-preis { width: 96px; padding: 6px 8px; border: 1px solid #dbe3ec; border-radius: 7px;
  font: inherit; font-size: 12.5px; text-align: right; }
.bu-teile { font-family: monospace; font-size: 11px; color: var(--muted); white-space: nowrap; }
.bu-summe { margin-top: 9px; font-size: 12.5px; font-weight: 700; color: var(--accent); }
.bu-btns { display: flex; gap: 9px; margin-top: 16px; flex-wrap: wrap; }
.bu-sek { border: 1px solid #dbe3ec; background: #fff; color: #334155; padding: 11px 18px;
  border-radius: 999px; font-size: 13px; font-weight: 700; cursor: pointer; }
.bu-sek:hover { background: #f1f5f9; }
.bu-ok { flex: 1 1 auto; border: none; background: var(--accent); color: #fff; padding: 11px 18px;
  border-radius: 999px; font-size: 13px; font-weight: 700; cursor: pointer; }
.bu-ok:disabled, .bu-sek:disabled { opacity: .6; cursor: default; }
.bu-ergebnis { margin-top: 12px; }
.bu-ergebnis .bu-kopf { font-size: 12.5px; font-weight: 700; margin-bottom: 6px; }
.bu-ok-zeile { font-size: 12.5px; color: #166534; padding: 4px 0; }
.bu-fehl-zeile { font-size: 12.5px; color: #991b1b; padding: 4px 0; }
.bu-warn { font-size: 12.5px; font-weight: 700; color: #92400e; padding: 9px 11px;
  background: #fffbeb; border-radius: 9px; }
.bu-v-titel { margin-top: 10px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .03em; color: var(--muted); }
.bu-v-hint { text-transform: none; letter-spacing: 0; font-weight: 600; opacity: .85; }
.bu-sku { width: 108px; padding: 6px 8px; border: 1px solid #dbe3ec; border-radius: 7px;
  font: inherit; font-size: 12.5px; font-family: monospace; }
.bu-len { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bu-len.zu-lang { color: var(--red); font-weight: 700; }
.bu-summe-hint { font-weight: 600; color: var(--muted); }
.bu-felder { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.bu-felder label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.bu-felder select { padding: 8px 10px; border: 1px solid #dbe3ec; border-radius: 8px; font: inherit;
  font-size: 12.5px; font-weight: 400; color: var(--text); background: #fff; }
.bu-block { margin: 0 0 10px; }
.bu-beschr { margin-bottom: 14px; border: 1px solid #e8edf3; border-radius: 9px; padding: 9px 11px; background: #fbfcfe; }
.bu-beschr summary { font-size: 12.5px; font-weight: 700; color: var(--accent); cursor: pointer; }
.bu-beschr-inner { display: flex; flex-direction: column; gap: 9px; margin-top: 10px; }
.bu-beschr-inner label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.bu-beschr-inner input, .bu-beschr-inner textarea { padding: 8px 10px; border: 1px solid #dbe3ec;
  border-radius: 8px; font: inherit; font-size: 12.5px; font-weight: 400; color: var(--text); resize: vertical; }
.bu-beschr-hinweis { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.bu-gtin { width: 128px; padding: 6px 8px; border: 1px solid #dbe3ec; border-radius: 7px;
  font: inherit; font-size: 12.5px; font-family: monospace; }
.bu-nach { font-size: 11.5px; color: var(--muted); padding-left: 18px; }
@media (max-width: 560px) { .bu-felder { grid-template-columns: 1fr; } }
/* Bild-Upload direkt an der Ergebniszeile eines angelegten Bundles */
.bu-bildzeile { display: flex; align-items: center; gap: 9px; margin: 6px 0 10px 18px; }
.bu-thumb { flex: none; width: 40px; height: 40px; border-radius: 7px; border: 1px dashed #dbe3ec;
  background: #f8fafc; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.bu-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bu-bild-btn { border: 1px solid #dbe3ec; background: #fff; color: #334155; padding: 5px 12px;
  border-radius: 999px; font-size: 11.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.bu-bild-btn:hover { background: #f1f5f9; }
.bu-bild-btn.hat-bild { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.bu-bild-btn.fehler { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.bu-bild-btn:disabled { opacity: .6; cursor: default; }
/* --- Otto-Felder: Pflegeuebersicht --- */
.op-kopfzeile { display: flex; gap: 9px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.op-kopfzeile select { flex: 1 1 200px; min-width: 0; padding: 8px 10px; border: 1px solid #dbe3ec;
  border-radius: 8px; font: inherit; font-size: 12.5px; background: #fff; }
.op-summe { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.op-rot { color: var(--red); }
.op-karte { border: 1px solid #e8edf3; border-radius: 10px; padding: 10px 11px; margin-bottom: 8px; background: #fff; }
.op-kopf { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.op-name { flex: 1 1 auto; min-width: 0; font-size: 13.5px; font-weight: 600; }
.op-status { flex: none; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.op-status.ok { background: #dcfce7; color: #166534; }
.op-status.fehler { background: #fee2e2; color: #991b1b; }
.op-status.warten { background: #fef3c7; color: #92400e; }
.op-status.aus { background: #f1f5f9; color: var(--muted); }
.op-zeile { margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.op-fehler { margin-top: 7px; padding: 8px 10px; border-radius: 8px; background: #fef2f2;
  color: #991b1b; font-size: 12px; line-height: 1.5; }
.op-code { font-family: monospace; font-size: 10.5px; opacity: .75; }
.op-felder { margin-top: 7px; }
.op-felder summary { font-size: 11.5px; font-weight: 700; color: var(--accent); cursor: pointer; }
.op-tab { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; }
.op-tab td { padding: 3px 8px 3px 0; border-top: 1px solid #f1f5f9; vertical-align: top; }
.op-tab td:first-child { white-space: nowrap; color: var(--muted); width: 1%; }
.op-wert { word-break: break-word; }
.op-offen { margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.op-offen .op-pflicht { color: #991b1b; font-weight: 700; }
.op-hinweis { margin-top: 8px; font-size: 11.5px; line-height: 1.5; color: var(--muted);
  padding: 8px 10px; background: #f8fafc; border-radius: 8px; }
.op-leer { font-size: 12.5px; color: var(--muted); font-style: italic; padding: 10px 0; }
.op-warn { font-size: 12.5px; font-weight: 700; color: #92400e; padding: 9px 11px; background: #fffbeb; border-radius: 9px; }
/* Felder uebertragen */
.op-uebertragen { border: 1px solid #e8edf3; border-radius: 10px; padding: 10px 11px; margin-bottom: 12px; background: #fbfcfe; }
.op-uebertragen summary { font-size: 12.5px; font-weight: 700; color: var(--accent); cursor: pointer; }
.op-ue-inner { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.op-ue-inner > label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.op-ue-inner select { padding: 8px 10px; border: 1px solid #dbe3ec; border-radius: 8px; font: inherit; font-size: 12.5px; background: #fff; }
.op-ue-zeile { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.op-ue-titel { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.op-feldliste { max-height: 220px; overflow-y: auto; border: 1px solid #e8edf3; border-radius: 8px; background: #fff; }
.op-fcheck { display: flex; align-items: center; gap: 8px; padding: 6px 9px; font-size: 12px; border-bottom: 1px solid #f1f5f9; cursor: pointer; }
.op-fcheck:last-child { border-bottom: none; }
.op-fcheck input { width: 16px; height: 16px; flex: none; }
.op-fcheck > span:first-of-type { flex: 1 1 auto; min-width: 0; }
.op-fwert { flex: none; color: var(--muted); font-size: 11px; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-zielwahl { flex: none; display: flex; align-items: center; }
.op-zielwahl input { width: 17px; height: 17px; }
.op-plan { font-size: 12px; padding: 3px 0; }
.op-plan.anlegen { color: #166534; }
.op-plan.aendern { color: #92400e; }
.op-plan.unveraendert { color: var(--muted); }
.op-plan.abgelehnt, .op-plan.fehler { color: #991b1b; }
.op-grund { font-style: italic; }
.op-link { color: var(--accent); font-weight: 700; text-decoration: none; white-space: nowrap; }
.op-link:hover { text-decoration: underline; }
