/* ════════════════════════════════════════════════════════════
   DFB Sendtool — Token-basiertes Design-System (SP3)
   Organisiert nach Komponenten (nicht nach Versions-Historie).
   Einzige Stilquelle. Kein Build-Schritt.
   ════════════════════════════════════════════════════════════ */

/* ── 1. Design-Tokens ── */
:root {
  --bg: #F7F3EF;
  --surface: #FFFFFF;
  --surface-alt: #FBF8F4;
  --text: #2D2D2D;
  --muted: #A78F73;
  --muted-dark: #7A6850;
  --border: #E7DFD4;
  --border-strong: #D8CCBC;
  --accent: #2C4E8A;
  --accent-hover: #243F70;
  --accent-soft: #EAEFF7;
  --accent-border: #C5D1E8;
  --danger: #B3161D;
  --danger-strong: #D7262E;
  --danger-bg: #FDECEA;
  --danger-border: #F0C5C7;
  --success: #0F6E56;
  --success-strong: #1D9E75;
  --success-bg: #E3F3EC;
  --warn: #8A6D1F;
  --warn-bg: #FBF3DC;
  --radius-sm: 7px;
  --radius-md: 9px;
  --radius-lg: 13px;
  --radius-pill: 999px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Spacing scale */
  --space-1: 4px; --space-2: 8px; --space-3: 12px;
  --space-4: 16px; --space-5: 24px; --space-6: 32px;
  /* Type scale */
  --text-xs: 0.72rem; --text-sm: 0.82rem; --text-md: 0.92rem; --text-lg: 1.15rem;
  --leading-tight: 1.25; --leading-normal: 1.5;
  /* Weights */
  --weight-normal: 400; --weight-medium: 500; --weight-semibold: 600;
}

/* ── 2. Icons ── */
.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* V2.1 D3: Login-Ladefeedback */
.login-spinner { display: inline-block; width: 0.9em; height: 0.9em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: -0.1em; }

/* V2.1 D4: Entfernen-Buttons (Paket-/Label-Eintraege) rund, wie das uebrige UI.
   Beta-QC: im Kreis lebt NUR das ✕ — das Text-Label wuerde ueberquellen
   (title-Attribut behaelt die Bedeutung fuer den Hover). */
.btn-remove-box, .btn-remove-label-item { border-radius: 50%; width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.btn-remove-box .btn-lbl, .btn-remove-label-item .btn-lbl { display: none; }
.btn-remove-box .btn-ico, .btn-remove-label-item .btn-ico { display: inline-flex; align-items: center; justify-content: center; line-height: 1; margin: 0; }

/* Beta-QC: Switch-Optik fuer An/Aus-Einstellungen (Bumperetikett) */
.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch-slider { position: absolute; inset: 0; background: var(--border-strong, #C9CFD8); border-radius: 10px; transition: background 0.15s; cursor: pointer; }
.switch-slider::before { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0,0,0,0.25); }
.switch input:checked + .switch-slider { background: var(--accent); }
.switch input:checked + .switch-slider::before { transform: translateX(16px); }
.busy-spinner { width: 0.9em; height: 0.9em; display: inline-block; flex: 0 0 auto; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: busy-spin 0.7s linear infinite; }
@keyframes busy-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .busy-spinner { animation-duration: 1.8s; } }

/* ── 3. Basis + App-Shell ── */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--font); color: var(--text); background: var(--bg); }
body.app { display: flex; flex-direction: column; overflow: hidden; }
strong { font-weight: 600; }

/* ── 4. Tabs ── */
nav.tabs { display: flex; align-items: center; background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 1.2rem; flex-shrink: 0; }
nav.tabs .tab { display: inline-flex; align-items: center; gap: 7px; background: none; border: none; font: inherit; font-size: 0.92rem; font-weight: 500; color: var(--muted); padding: 0.75rem 1.1rem; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
nav.tabs .tab:hover { color: var(--text); }
nav.tabs .tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
nav.tabs .nav-actions { margin-left: auto; display: flex; gap: 8px; }
.tab-panel { display: none; }
.tab-panel.active { display: flex; flex: 1; min-height: 0; }

/* ── 5. App-Layout: Sidebar fix, nur Content scrollt ── */
.layout, #app-wrapper, #label-app-wrapper { display: flex; width: 100%; }
body.app .tab-panel.active > .layout,
body.app #app-wrapper, body.app #label-app-wrapper { flex: 1; min-height: 0; }
aside.catalog, #catalog-sidebar, #label-catalog-sidebar {
  width: 260px; min-width: 220px; flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; height: 100%; overflow: hidden;
}
.catalog-head { display: flex; align-items: center; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 0.85rem; font-weight: 600; }
.catalog-search { padding: 10px 12px; border-bottom: 1px solid #F2EDE5; position: relative; }
.catalog-search .icon { position: absolute; left: 21px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.catalog-search input, #sidebar-filter, #label-sidebar-filter { width: 100%; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 6px 10px 6px 30px; font-size: 0.82rem; outline: none; font-family: inherit; }
.catalog-search input:focus, #sidebar-filter:focus, #label-sidebar-filter:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(44,78,138,0.15); }
.catalog-list, #sidebar-list, #label-sidebar-list { flex: 1; overflow-y: auto; font-size: 0.8rem; }
.catalog-foot { padding: 10px 12px; border-top: 1px solid var(--border); }
.catalog-foot button { width: 100%; justify-content: center; }

main.content, #main-content, #label-main-content { flex: 1; min-width: 0; overflow-y: auto; height: 100%; padding: 1.4rem 2rem; }

.page-head { display: flex; align-items: center; gap: 9px; margin-bottom: 1.1rem; flex-wrap: wrap; }
.page-head h1 { display: flex; align-items: center; gap: 9px; font-size: 1.25rem; margin: 0; font-weight: 600; }
.page-head .version { font-size: 0.75rem; color: var(--muted); }
.page-head .head-actions { margin-left: auto; display: flex; gap: 8px; }

/* ── 6. Karten ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); margin-bottom: var(--space-3); }
.card h2, .card h6 { font-size: 0.88rem; margin: 0 0 0.7rem; font-weight: 600; }
.card .card-sub { font-size: 0.78rem; color: var(--muted-dark); margin: -0.3rem 0 0.7rem; }
.addr { font-size: 0.78rem; color: var(--muted); margin: 0.6rem 0 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 0.88rem; font-weight: 600; margin: 1.3rem 0 0.7rem; flex-wrap: wrap; }
.section-head .tools { display: flex; gap: 8px; align-items: center; }
.actions-row { display: flex; justify-content: flex-end; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin: 1.1rem 0; }
.box-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 0.7rem; flex-wrap: wrap; }
.box-head .box-title { margin: 0; }

/* ── 7. Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 0.85rem; border-radius: var(--radius-md); padding: 8px 16px; cursor: pointer; border: 1px solid transparent; text-decoration: none; line-height: 1.2; }
.btn-primary, .btn-success { background: var(--accent); color: #fff; font-weight: 600; border: none; }
.btn-primary:hover, .btn-success:hover { background: var(--accent-hover); color: #fff; }
.btn-outline, .btn-outline-secondary, .btn-outline-primary { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.btn-outline:hover, .btn-outline-secondary:hover, .btn-outline-primary:hover { background: var(--bg); }
.btn-outline.selected, .btn-primary.selected { background: var(--accent); color: #fff; border-color: var(--accent); }
/* btn-primary muss gewinnen, wenn ein Button btn-outline + btn-primary trägt (Toggle-Pattern) */
.btn.btn-primary, .btn.btn-success { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.btn-primary:hover, .btn.btn-success:hover { background: var(--accent-hover); }
.btn-outline-danger, .btn-danger-soft { background: var(--surface); color: var(--danger); border: 1px solid var(--danger-border); }
.btn-outline-danger:hover, .btn-danger-soft:hover { background: var(--danger-bg); }
.btn-secondary { background: var(--surface-alt); color: var(--text); border: 1px solid var(--border-strong); }
.btn-sm { font-size: 0.78rem; padding: 7px 11px; }
.btn-lg { font-size: 1rem; padding: 11px 26px; }
.btn-icon { padding: 7px 8px; }
.btn:disabled, .btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-ghost { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--muted-dark); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 5px 12px; cursor: pointer; text-decoration: none; }
.btn-ghost:hover { border-color: var(--border-strong); background: var(--bg); }
.btn .btn-ico { line-height: 1; }
.btn .btn-lbl { font-weight: 500; }
dfb-toggle-group[aria-busy="true"] { opacity: 0.55; pointer-events: none; }
.date-echo { display: block; margin-top: 2px; color: var(--muted-dark); font-size: 0.72rem; line-height: 1.1; }

/* ── 8. Inputs / Formularfelder ── */
.inp, input[type="text"].inp, input[type="number"].inp, input[type="date"].inp, .form-control, .form-select, select.select {
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 7px 10px; font-size: 0.82rem; outline: none; font-family: inherit; background: var(--surface); color: var(--text);
}
.inp:focus, .form-control:focus, .form-select:focus, select.select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(44,78,138,0.15); }
label { font-size: 0.82rem; }
.checkbox, .form-check { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--muted-dark); }
.form-check-input { width: 14px; height: 14px; }

/* Maß-/Mengen-Felder (mit Einheit) */
.dim-field { position: relative; display: inline-block; }
.dim-field input { width: 92px; padding-right: 30px; }
.dim-field .unit { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-size: 0.7rem; color: var(--muted); pointer-events: none; }

/* ── 9. Artikel-/Box-Bereich ── */
.artikel-row { width: 100%; }
.artikel-row .row-heading, .field-label { font-size: 0.72rem; font-weight: 600; color: var(--muted-dark); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.4rem; }
.artikel-row-list { border-top: 1px solid var(--border); padding-top: 0.75rem; }

.box-block { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); padding: 1.1rem 1.3rem; margin-bottom: 0.9rem; transition: box-shadow 120ms ease; }
.box-block + .box-block { margin-top: 0; }
.box-block.box-active { box-shadow: 0 0 0 2px var(--accent-border); }
.box-block.box-compact { padding: 0.6rem 1.3rem; background: var(--surface-alt); }
.box-block.box-compact strong { font-weight: 600; }
.box-title { font-size: 0.88rem; font-weight: 600; cursor: default; }
.box-actions { display: flex; gap: var(--space-2); }
.box-hint { color: var(--muted-dark); font-size: 0.8rem; }
.box-preset-container { margin-top: 0.5rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Gewicht-Feld als geteiltes Eingabe-/Hinweis-Feld */
.weight-split { display: inline-flex; align-items: stretch; width: 100%; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.weight-split input.inp { flex: 1; border: none; border-radius: 0; }
.weight-split .inp:focus { box-shadow: none; }
.weight-split .box-weight-warning { display: flex; align-items: center; padding: 0 0.5rem; border-left: 1px solid var(--border-strong); font-size: 0.72rem; font-weight: 600; white-space: nowrap; }
.weight-split .box-weight-warning:empty { display: none; border-left: none; }
.weight-split.has-warn { border-color: #E0B23C; }
.weight-split.has-warn .box-weight-warning { background: var(--warn-bg); color: var(--warn); }
.weight-split.has-block { border-color: var(--danger); }
.weight-split.has-block .box-weight-warning { background: var(--danger-bg); color: var(--danger); }
.weight-warn { background: var(--warn-bg); border: 1px solid #E0B23C; border-radius: var(--radius-sm); padding: 0.5rem 1rem; margin-top: 0.5rem; }
.weight-block { background: var(--danger-bg); border: 1px solid var(--danger); border-radius: var(--radius-sm); padding: 0.5rem 1rem; margin-top: 0.5rem; color: var(--danger); }

/* MHD-Teilfelder DD/MM/YY */
.expiry-part { width: 42px; text-align: center; padding: 0.4rem 0.3rem; }
.expiry-part.is-invalid { border-color: var(--danger) !important; color: var(--danger); background-image: none !important; }
.expiry-error { color: var(--danger); font-size: 0.78rem; margin-top: 0.25rem; width: 100%; flex-basis: 100%; }

/* Box-Detail (Historie) */
.boxes-detail-row { display: flex; flex-direction: column; gap: 10px; }
.box-detail { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px 12px; background: var(--surface-alt); }
.box-detail-head { font-weight: 600; margin-bottom: 6px; }

#box-buttons-hint { font-size: 0.78rem; color: var(--muted-dark); }
#btn-label-log-reload { height: 33.5px; }
#btn-versenden:disabled, #btn-add-box:disabled, #btn-duplicate-box:disabled { cursor: not-allowed; }
.input-group { display: inline-flex; }
.input-group .form-control, .input-group input.inp { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; }

/* ── 10. Label-Item-Zeilen ── */
.label-item { display: grid; grid-template-columns: 1fr auto auto auto auto; align-items: center; gap: 0.8rem; padding: 0.6rem 0.8rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 0.5rem; font-size: 0.82rem; }
.label-item .li-name { font-weight: 500; min-width: 0; }
.label-item .li-name small { color: var(--muted); font-weight: 400; }
.label-item label { font-size: 0.78em; color: var(--muted-dark); display: flex; align-items: center; gap: 0.3rem; }
.label-item input[type="number"] { width: 60px; }
.label-item input[type="date"].invalid { border-color: var(--danger); }
/* V2.1 D4: Entfernen-Buttons rund statt eckig — passend zum uebrigen UI */
.btn-remove-item { display: inline-flex; align-items: center; justify-content: center; background: var(--danger-bg); border: none; color: var(--danger); width: 26px; height: 26px; border-radius: 50%; cursor: pointer; line-height: 1; }
.btn-remove-item:hover { background: var(--danger-border); }
.box-item-list .inp.is-invalid { border-color: var(--danger); }
.box-item-list .inp.is-warning { border-color: #E0B23C; background: var(--warn-bg); }
.expiry-warn-hint { margin-top: 0.25rem; max-width: 260px; font-size: 0.72rem; line-height: 1.3; }
.expiry-warn-hint.is-invalid { color: var(--danger); }
.expiry-warn-hint.is-warning { color: var(--warn); }

/* ── 11. Status-Meldungen ── */
.msg, .label-msg { margin-top: 0.7rem; padding: 0.6rem 0.9rem; border-radius: var(--radius-md); font-size: 0.82rem; display: none; align-items: center; gap: 8px; }
.msg.ok, .label-msg.ok { display: flex; background: var(--success-bg); color: var(--success); }
.msg.error, .label-msg.error { display: flex; background: var(--danger-bg); color: var(--danger); }
.msg.info, .label-msg.info { display: flex; background: var(--accent-soft); color: var(--accent); }

/* ── 12. Label-Shortcut-Banner (Senden-Tab) ── */
.banner-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); margin-bottom: 1rem; }
.banner-card-header { display: flex; align-items: center; margin-bottom: 0.4rem; }
.banner-card-header h2 { margin: 0; font-size: 0.88rem; font-weight: 600; }
.label-pills-row { display: flex; align-items: center; gap: 0.4rem; }
.label-pills { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; scroll-behavior: smooth; gap: 0.4rem; flex: 1; min-width: 0; height: 36px; scrollbar-width: none; }
.label-pills::-webkit-scrollbar { display: none; }
.label-pill { flex: 0 0 auto; height: 100%; display: inline-flex; align-items: stretch; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; font-size: 0.82em; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; color: var(--text); }
.label-pill-qty { width: 40px; height: 34px; line-height: 34px; border: none; border-right: 1px solid var(--border-strong); text-align: center; font: inherit; font-weight: 700; background: var(--surface-alt); color: var(--text); padding: 0; }
.label-pill-qty:focus { outline: none; background: var(--accent-soft); }
.label-pill-sku { display: flex; align-items: center; padding: 0 0.7rem; cursor: pointer; font-family: var(--font); }
.label-pill-sku:hover { background: var(--accent-soft); }
.label-pill-remove { border: none; border-left: 1px solid var(--border-strong); background: var(--danger-bg); color: var(--danger); padding: 0 0.6rem; cursor: pointer; font-weight: 700; }
.label-pill-remove:hover { background: var(--danger-border); }
.label-pill.used { opacity: 0.5; }
.label-pill-loading { flex: 0 0 auto; height: 100%; display: inline-flex; align-items: center; padding: 0 1rem; color: var(--muted); font-size: 0.82em; font-style: italic; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-pill); }
.label-pills-arrow { flex: 0 0 28px; width: 28px; height: 28px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 50%; cursor: pointer; font-size: 1.1rem; line-height: 1; display: flex; align-items: center; justify-content: center; color: var(--muted-dark); padding: 0; }
.label-pills-arrow-next .icon { transform: scaleX(-1); }
.label-pills-arrow:hover { background: var(--accent-soft); }
.label-pills-arrow:disabled { opacity: 0.3; cursor: default; }

/* ── 13. Label-Log ── */
/* .label-log-job / .log-job-* removed in Task 25 — rows now use dfb-job-card */
.log-units-table { font-size: 0.85rem; margin-top: 0.3rem; width: 100%; border-collapse: collapse; }
.log-units-table th { font-weight: 600; color: var(--muted-dark); }
.log-units-table td { vertical-align: middle; }
.log-units-table code { font-size: 0.78rem; word-break: break-all; }
.label-set-card { margin-bottom: var(--space-3); }
.label-set-card:last-of-type { margin-bottom: 0; }
.label-set-head { font-weight: 600; margin-bottom: var(--space-1); }
.label-set-product { margin-bottom: var(--space-2); }
.label-set-foot { display: flex; justify-content: flex-end; margin-top: var(--space-2); }
.label-detail-foot { display: flex; justify-content: flex-end; margin-top: var(--space-3); align-items: flex-start; gap: var(--space-3); }

/* D2: Profil-Favoriten — Stern im Profilbutton, Trennlinie nach den Favoriten */
/* Beta2-QC Fix 2: Profil-Pille mit integriertem Stern-Segment (Design wie
   .label-pill im Sendtool: Segmente, Trennlinie, rechtes Aktions-Segment). */
dfb-toggle.profile-pill { padding: 0; gap: 0; align-items: stretch; overflow: hidden; }
.profile-pill-name { display: flex; align-items: center; padding: 6px var(--space-3); }
.profile-pill-fav { display: flex; align-items: center; padding: 0 var(--space-2); border-left: 1px solid var(--border-strong); background: var(--surface-alt); color: var(--text-muted); cursor: pointer; font-size: 0.95em; }
.profile-pill-fav:hover { color: #E8A100; }
.profile-pill-fav.active { background: #FDF0D2; color: #E8A100; }
dfb-toggle[active] .profile-pill-fav { border-left-color: var(--accent); }
.fav-sep-line { align-self: stretch; border-left: 1px solid var(--border); margin: 0 var(--space-1); }

/* D1: Arbeitsplatz-Einstellungen (Labeltool, pro User) */
.label-prefs-body { display: flex; gap: var(--space-4); flex-wrap: wrap; align-items: center; font-size: 0.85rem; }
.label-prefs-body label { display: flex; align-items: center; gap: var(--space-2); margin: 0; }
.label-prefs-switch { cursor: pointer; }

/* B3: Fehldruck-Rettung — bewusst laut (roter Button + fetter Warntext) */
.reuse-codes-box { max-width: 34rem; text-align: right; }
.btn-reuse-codes { background: var(--danger); color: #fff; border: 1px solid var(--danger); }
.btn-reuse-codes:hover:not(:disabled) { background: var(--danger-strong); border-color: var(--danger-strong); }
.reuse-codes-warn { color: var(--danger); font-weight: 700; font-size: 0.78rem; margin: var(--space-1) 0 0; }

/* Beta-QC: Lockout nach Code-Wiederverwendung — Auftrag ausgegraut */
.job-codes-reused .label-set-card { opacity: 0.55; }
.job-codes-reused .label-detail-foot { opacity: 1; }
.btn-reuse-codes-done { background: var(--surface); color: var(--text-muted); border: 1px solid var(--border); cursor: default; }
.reuse-codes-box .btn-print-again { margin-left: var(--space-2); }

/* ── 14. Sendungs-Karten (eine Anatomie: Einzel + Gruppe) ── */
.ship-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0.95rem 1.2rem; margin-bottom: 0.7rem; }
.ship-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.ship-titlewrap { min-width: 0; }
.ship-title { font-size: 0.88rem; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ship-meta { font-size: 0.76rem; color: var(--muted-dark); margin-top: 3px; }
.ship-track { font-size: 0.73rem; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.ship-error { font-size: 0.76rem; color: var(--danger); margin-top: 3px; }
.ship-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.ship-status { display: inline-flex; align-items: center; gap: 5px; font-size: 0.78rem; font-weight: 600; white-space: nowrap; }
.ship-status.ok { color: var(--success); }
.ship-status.fail { color: var(--danger); }
.ship-status.run { color: var(--accent); }
.ship-status.wait { color: var(--muted-dark); }
.ship-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.group-tag { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); border-radius: 5px; padding: 2px 8px; }
.group-counts { display: flex; gap: 12px; font-size: 0.76rem; margin-top: 5px; flex-wrap: wrap; }
.group-counts span { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.group-counts .c-ok { color: var(--success); }
.group-counts .c-run { color: var(--accent); }
.group-counts .c-fail { color: var(--danger); }
.badge-pill { font-size: 0.66rem; font-weight: 600; border-radius: var(--radius-pill); padding: 2px 9px; background: var(--accent-soft); color: var(--accent); }

/* Arbeits-Zeile während des Versands */
.work-status { display: none; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--accent); margin-top: 10px; font-weight: 500; }
.ship-card.running .work-status { display: flex; }
.work-status .spinner { width: 12px; height: 12px; border: 2px solid var(--accent-border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.9s linear infinite; flex-shrink: 0; }
.work-status .pct { color: var(--muted); font-weight: 400; margin-left: auto; }

/* Ladebalken (Fill per transform: scaleX, Schiene clippt runde Enden) */
.progress-rail { position: relative; height: 7px; border-radius: var(--radius-pill); background: #F0EAE2; margin-top: 11px; overflow: hidden; }
.progress-rail.multi { display: flex; }
.progress-fill { position: absolute; inset: 0; transform: scaleX(0); transform-origin: left center; transition: transform 0.45s ease; }
.progress-fill.run { background: var(--accent); }
.progress-fill.ok { background: var(--success-strong); }
.progress-fill.fail { background: var(--danger-strong); }
.progress-rail .seg { transition: none; }
.progress-rail .seg.ok { background: var(--success-strong); }
.progress-rail .seg.run { background: var(--accent); }
.progress-rail .seg.fail { background: var(--danger-strong); }
.progress-rail .seg.run.pulse { animation: pulseflow 1.6s ease-in-out infinite alternate; }
@keyframes pulseflow { from { opacity: 0.6; } to { opacity: 1; } }

/* Gruppen-Bundle */
.bundle { display: none; margin-top: 0.9rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.8rem; }
.ship-card.open .bundle, .group-card.open .bundle { display: block; }
.bundle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.mini-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px 11px 10px; font-size: 0.76rem; }
.mini-card .mc-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.mini-card .mc-sub { color: var(--muted); margin-top: 2px; }
.mini-card .st { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.mini-card .st.ok { color: var(--success); }
.mini-card .st.run { color: var(--accent); }
.mini-card .st.fail { color: var(--danger); }
.mini-rail { position: relative; height: 4px; border-radius: var(--radius-pill); background: #F0EAE2; margin-top: 7px; overflow: hidden; }
.mini-fill { position: absolute; inset: 0; transform-origin: left center; }
.mini-fill.ok { background: var(--success-strong); }
.mini-fill.fail { background: var(--danger-strong); }
.mini-fill.run { background: var(--accent); animation: pulseflow 1.6s ease-in-out infinite alternate; }
.bundle-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 0.7rem; flex-wrap: wrap; }

/* ── 15. Legacy Shipment-Card (bis main.js auf .ship-card umgestellt ist) ── */
.shipment-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0.95rem 1.2rem; margin-bottom: 0.7rem; }
.card-header-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.card-title { font-size: 1.05rem; font-weight: 600; }
.card-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: flex-end; }
.card-actions .btn { white-space: nowrap; }
.expand-toggle { display: inline-flex; font-weight: bold; }
.shipment-card.open .expand-toggle { background: var(--accent); color: #fff; border-color: var(--accent); }
.shipment-card .details-pane { display: none; margin-top: 0.5rem; padding: 0.5rem; background: var(--surface-alt); border-radius: var(--radius-sm); }
.shipment-card.open .details-pane { display: block; }
.shipment-card .details-pane table { font-size: 0.82rem; }
.btn-pin.active { background: var(--warn-bg); border-color: var(--warn); color: var(--text); }
.price-preview { font-size: 0.85rem; color: var(--muted-dark); background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.5rem; margin-top: 0.75rem; }

/* Step-Badges (Legacy-Status; werden in der neuen Karte vom Ladebalken abgelöst) */
.step-badge { display: inline-block; padding: 2px 8px; border-radius: var(--radius-pill); font-size: 0.75rem; font-weight: 600; }
.step-pending { background: var(--bg); color: var(--muted-dark); }
.step-in_progress { background: var(--accent-soft); color: var(--accent); }
.step-completed { background: var(--success-bg); color: var(--success); }
.step-failed { background: var(--danger-bg); color: var(--danger); }

/* Amazon-Transparency-Badge im Katalog */
.badge-transparency { display: inline-flex; align-items: center; justify-content: center; font-size: 0.65rem; font-weight: 700; background: var(--accent); color: #fff; border-radius: 3px; padding: 0 4px; min-width: 14px; height: 14px; letter-spacing: 0.02em; }

/* ── 16. Modal-Overlay ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(45,45,45,0.5); z-index: 2000; display: flex; align-items: center; justify-content: center; }
.modal-overlay[hidden] { display: none; }
.modal-box { background: var(--surface); padding: 1.5rem; border-radius: var(--radius-lg); max-width: 520px; width: 90%; box-shadow: 0 8px 30px rgba(0,0,0,0.18); }
.modal-box h3 { margin-top: 0; font-size: 1.1rem; }
.modal-box code { background: var(--surface-alt); padding: 1px 4px; border-radius: 3px; font-size: 0.88em; }
.modal-actions { margin-top: 1.2rem; display: flex; gap: 0.7rem; justify-content: flex-end; }

/* ── 17. Admin ── */
.admin-top { display: flex; align-items: center; justify-content: space-between; background: var(--surface); border-bottom: 1px solid var(--border); padding: 0.7rem 1.4rem; }
.admin-top h1 { display: flex; align-items: center; gap: 9px; font-size: 1.05rem; font-weight: 600; margin: 0; }
.admin-top .top-actions { display: flex; gap: 8px; }
.admin-wrap { max-width: min(1720px, 96vw); margin: 1.5rem auto; padding: 0 1.4rem; }
/* Fließt mit dem Fenster (Deckel 1720px) — der alte 1180px-Deckel machte
   den Label-Designer auf großen Monitoren unnötig eng. */
.alert { display: flex; align-items: center; gap: 8px; padding: 0.6rem 0.9rem; border-radius: var(--radius-md); font-size: 0.82rem; margin-bottom: 1rem; }
.alert.ok, .alert-success { background: var(--success-bg); color: var(--success); }
.alert.error, .alert-danger { background: var(--danger-bg); color: var(--danger); }
.alert .btn-close { margin-left: auto; background: none; border: none; color: inherit; cursor: pointer; font-size: 1rem; line-height: 1; }

.admin-shell { display: grid; grid-template-columns: 240px 1fr; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; min-height: 560px; }
.admin-sidebar { background: var(--surface-alt); border-right: 1px solid var(--border); padding: 0.85rem 0.6rem; overflow-y: auto; }
.side-group { margin-bottom: 1.1rem; }
.side-group-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; color: var(--muted); padding: 0.25rem 0.7rem 0.4rem; letter-spacing: 0.05em; }
.side-link { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.7rem; margin: 0.12rem 0; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-size: 0.86rem; line-height: 1.2; }
.side-link:hover { background: var(--accent-soft); }
.side-link.active { background: var(--accent); color: #fff; font-weight: 500; }
.side-link .side-icon, .side-link .icon { font-size: 1.05rem; }
/* Beta2-QC Fix 3+5: eingerückte Untermenüpunkte (Profile / Transparency-Konten) */
.side-sublink { padding-left: 2.35rem; font-size: 0.82rem; color: var(--text-muted); }
.side-sublink.active { color: #fff; }
/* Obermenü bei aktivem Untermenüpunkt: blaue Umrandung statt Füllung */
.side-link.active-parent { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); font-weight: 500; }

/* Beta2-QC: In-Page-Dialoge (Ersatz fuer confirm/prompt, die eingebettete
   Browser stummschalten) */
.dfb-dialog-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; z-index: 2000; }
.dfb-dialog { max-width: 460px; margin: 0; padding: var(--space-4); }
.dfb-dialog-msg { font-size: 0.92rem; margin-bottom: var(--space-3); white-space: normal; }
.dfb-dialog-input { margin-bottom: var(--space-3); }
.dfb-dialog-actions { display: flex; gap: var(--space-2); justify-content: flex-end; }

/* Beta2-QC: Neues-Profil-Wizard — Schritte, gesperrte Schritte ausgegraut */
.np-step { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--space-3); margin-top: var(--space-3); }
.np-step-title { font-weight: 600; font-size: 0.9rem; margin-bottom: var(--space-2); display: flex; align-items: center; gap: var(--space-2); }
.np-step-no { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--accent); color: #fff; font-size: 0.8rem; }
.np-step.locked { opacity: 0.45; pointer-events: none; }
.np-step.locked .np-step-no { background: var(--muted, #999); }
.admin-content { padding: 1.5rem; overflow: auto; }
.admin-content > h2 { margin: 0 0 0.3rem; font-size: 1.05rem; font-weight: 600; }
.admin-content > .lead { color: var(--muted-dark); font-size: 0.84rem; margin: 0 0 1.2rem; max-width: 65ch; }

.cred-group { border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 1.4rem; overflow: hidden; }
.cred-group-header { background: var(--surface-alt); padding: 0.7rem 1rem; font-weight: 600; font-size: 0.9rem; border-bottom: 1px solid var(--border); }
.cred-desc, .cred-section-desc { padding: 0.7rem 1rem; color: var(--muted-dark); font-size: 0.82rem; line-height: 1.5; border-bottom: 1px solid #F2EDE5; }
.cred-actions { padding: 0.7rem 1rem; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; border-bottom: 1px solid #F2EDE5; }
.cred-row { display: grid; grid-template-columns: 220px 1fr; gap: 1rem; align-items: start; padding: 0.75rem 1rem; border-bottom: 1px solid #F2EDE5; }
.cred-row:last-of-type { border-bottom: none; }
.cred-label { font-size: 0.82rem; color: var(--text); font-weight: 500; padding-top: 0.45rem; }
.cred-row .inp, .cred-row .form-control, .cred-row .select, .cred-row .form-select { width: 100%; }
.cred-hint { font-size: 0.74rem; color: var(--muted); margin-top: 0.35rem; line-height: 1.4; overflow-wrap: anywhere; }
.cred-body { padding: 1rem; }
.cred-save-row { padding: 0.75rem 1rem; background: var(--surface-alt); border-top: 1px solid var(--border); display: flex; justify-content: flex-end; }
.pill-status { display: inline-flex; align-items: center; gap: 5px; font-size: 0.74rem; font-weight: 600; padding: 2px 9px; border-radius: var(--radius-pill); }
.pill-status.ok { background: var(--success-bg); color: var(--success); }
.pill-status.off { background: var(--bg); color: var(--muted-dark); }

/* Admin-Log-Tabelle */
.log-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.log-table th { text-align: left; font-weight: 600; color: var(--muted-dark); padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--border); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.03em; }
.log-table td { padding: 0.55rem 0.7rem; border-bottom: 1px solid #F2EDE5; vertical-align: middle; }
.log-table tr:hover td { background: var(--surface-alt); }
.log-table code { font-size: 0.76rem; color: var(--muted-dark); }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; font-weight: 600; padding: 2px 9px; border-radius: var(--radius-pill); }
.badge.completed, .badge-completed { background: var(--success-bg); color: var(--success); }
.badge.failed, .badge-failed { background: var(--danger-bg); color: var(--danger); }
.badge.pending, .badge-pending { background: var(--bg); color: var(--muted-dark); }
.badge.started, .badge-started { background: var(--accent-soft); color: var(--accent); }
.badge-archived { background: var(--surface-alt); color: var(--muted-dark); font-size: 0.7rem; }
tr.row-archived { opacity: 0.55; }
.ref-preview-card { background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: var(--radius-md); padding: 1.5rem; text-align: center; margin-bottom: 1.5rem; }
.ref-preview-nr { font-size: 2rem; font-weight: 700; font-family: ui-monospace, monospace; color: var(--accent); letter-spacing: 2px; }
.ref-preview-fmt { font-size: 0.8rem; color: var(--muted-dark); margin-top: 0.25rem; }
pre.api-block { background: #1e1e1e; color: #d4d4d4; border-radius: var(--radius-sm); padding: 1rem; font-size: 0.78rem; max-height: 300px; overflow: auto; white-space: pre-wrap; word-break: break-all; }

/* ── 17b. Login / Auth-Seiten ── */
body.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; background: var(--bg); }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.6rem 1.7rem; }
.auth-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); font-size: 1.05rem; }
.auth-brand .version { font-size: 0.72rem; color: var(--muted); font-weight: 400; }
.auth-title { font-size: 1.05rem; font-weight: 600; margin: 1.1rem 0 0.2rem; }
.auth-sub { font-size: 0.8rem; color: var(--muted-dark); margin: 0 0 1rem; }
.auth-label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--muted-dark); margin: 0.8rem 0 0.3rem; }
.auth-card .inp { width: 100%; }
.auth-card .btn-primary { width: 100%; justify-content: center; margin-top: 1.1rem; }
.auth-foot { text-align: center; margin-top: 1rem; }
.auth-foot a { color: var(--muted-dark); font-size: 0.8rem; text-decoration: none; }
.auth-foot a:hover { color: var(--accent); }

/* ── 18. Fokus ── */
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── 19. reduced-motion ── */
@media (prefers-reduced-motion: reduce) {
  .icon-spin, .work-status .spinner { animation: none !important; }
  .progress-fill, .mini-fill { transition: none !important; }
  .progress-rail .seg.run.pulse, .mini-fill.run { animation: none !important; }
}

/* ── 20. Responsive ── */
@media (max-width: 768px) {
  body.app { overflow: visible; height: auto; }
  /* Let the top nav wrap so the action buttons (Einstellungen/Logout) drop to
     their own line on phones instead of forcing a horizontal scrollbar. */
  nav.tabs { flex-wrap: wrap; padding: 0 0.6rem; }
  .tab-panel.active { flex-direction: column; }
  .layout, #app-wrapper, #label-app-wrapper { flex-direction: column; }
  aside.catalog, #catalog-sidebar, #label-catalog-sidebar { width: 100%; min-width: 0; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .catalog-list, #sidebar-list, #label-sidebar-list { max-height: 220px; }
  main.content, #main-content, #label-main-content { height: auto; overflow: visible; padding: 1rem; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { border-right: none; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 4px; }
  .side-group { margin-bottom: 0; }
  .cred-row { grid-template-columns: 1fr; gap: 0.4rem; }
  .label-item { grid-template-columns: 1fr; gap: 0.5rem; }
}

/* ── 21. Minimal-Utilities (Markup-Kompat; bewusst klein gehalten) ── */
.text-muted { color: var(--muted-dark); }
.text-warning { color: var(--warn); }
.fw-bold, .fw-semibold { font-weight: 600; }
.small, small { font-size: 0.82em; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.ms-1 { margin-left: 0.25rem; }
.ms-2 { margin-left: 0.5rem; }
.me-1 { margin-right: 0.25rem; }
.d-block { display: block; }
.w-100 { width: 100%; }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.row.g-2 > [class*="col-"] { flex: 1 1 0; min-width: 120px; }
.col-md-3 { flex: 1 1 22%; min-width: 120px; }
.form-label { display: block; font-size: 0.82rem; }

/* ── 22. Bootstrap-Kompat-Shims (Admin-Markup ohne Bootstrap; Klassen → Tokens) ── */
.table { width: 100%; border-collapse: collapse; font-size: 0.82rem; border-radius: var(--radius-sm); overflow: hidden; }
.table th, .table td { padding: 0.5rem 0.6rem; border-bottom: 1px solid #F2EDE5; text-align: left; vertical-align: middle; }
.table-sm th, .table-sm td { padding: 0.35rem 0.5rem; }
.table-bordered th, .table-bordered td { border: 1px solid var(--border); }
thead.table-light, .table-light th { background: var(--surface-alt); color: var(--muted-dark); font-weight: 600; }
.font-monospace { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.form-control-sm, .form-select-sm { padding: 5px 8px; font-size: 0.8rem; }
.form-switch { display: inline-flex; align-items: center; gap: 8px; }
.form-switch .form-check-input { width: 34px; height: 18px; border-radius: var(--radius-pill); -webkit-appearance: none; appearance: none; background: var(--border-strong); position: relative; cursor: pointer; border: none; }
.form-switch .form-check-input:checked { background: var(--accent); }
.form-switch .form-check-input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.form-switch .form-check-input:checked::after { transform: translateX(16px); }
.form-check-label { font-size: 0.84rem; }
.badge.bg-success { background: var(--success-bg); color: var(--success); }
.badge.bg-danger { background: var(--danger-bg); color: var(--danger); }
.badge.bg-warning { background: var(--warn-bg); color: var(--warn); }
.badge.bg-secondary { background: var(--bg); color: var(--muted-dark); }
.badge.bg-info { background: var(--accent-soft); color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-dark { color: var(--text); }
.text-nowrap { white-space: nowrap; }
.text-center { text-align: center; }
.col { flex: 1 1 0; min-width: 120px; }
.col-auto { flex: 0 0 auto; }
.align-items-end { align-items: flex-end; }
.btn-warning { background: var(--warn-bg); color: var(--warn); border: 1px solid #E0B23C; }
.card-body { padding: 1.1rem 1.3rem; }
.card-title { font-weight: 600; }
.p-4 { padding: 1.5rem; }
.shadow-sm { box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
/* Modal-Shim (ersetzt Bootstrap-Modal-JS via .modal-open-shim) */
.modal { display: none; }
.modal.modal-open-shim { display: flex; position: fixed; inset: 0; background: rgba(45,45,45,0.5); z-index: 2000; align-items: center; justify-content: center; padding: 1rem; }
.modal-dialog { width: 100%; max-width: 600px; }
.modal-xl { max-width: 1000px; }
.modal-content { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); width: 100%; }
.modal-dialog-scrollable .modal-content { max-height: 85vh; overflow: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 1rem; font-weight: 600; margin: 0; }
.modal-body { padding: 1.1rem; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 0.9rem 1.1rem; border-top: 1px solid var(--border); }
.btn-close { background: none; border: none; font-size: 1.05rem; line-height: 1; cursor: pointer; color: var(--muted-dark); padding: 2px 6px; }
.btn-close::before { content: "\00d7"; }

/* Collapse-Shim (ersetzt Bootstrap-Collapse-JS via .show-shim) */
.collapse:not(.show-shim) { display: none; }
.accordion-collapse.show-shim { display: block; }
.accordion-item { margin-bottom: 0.4rem; }
.accordion-button { display: flex; width: 100%; text-align: left; background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.5rem 0.8rem; cursor: pointer; font: inherit; }

/* ── 23. Bausteine (dfb-*) ── */
dfb-badge { display: inline-flex; align-items: center; gap: var(--space-1);
  font-size: var(--text-xs); font-weight: var(--weight-semibold);
  line-height: 1; padding: 2px var(--space-2); border-radius: var(--radius-pill);
  background: var(--surface-alt); color: var(--muted-dark); border: 1px solid var(--border); }
dfb-badge[variant="ok"]   { background: var(--success-bg); color: var(--success); border-color: transparent; }
dfb-badge[variant="run"]  { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-border); }
dfb-badge[variant="fail"] { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
dfb-badge[variant="info"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-border); }
dfb-badge[variant="warn"] { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
dfb-badge:not(:defined) { visibility: hidden; }
dfb-badge[hidden] { display: none; }

dfb-field { display: inline-flex; flex-direction: column; gap: var(--space-1); }
dfb-field .dfb-field-label { font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--muted-dark); }
dfb-field .dfb-field-hint { font-size: var(--text-xs); color: var(--muted); }
dfb-field .inp, dfb-field input, dfb-field select {
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 6px var(--space-3); font: inherit; font-size: var(--text-sm); outline: none; width: 100%; }
dfb-field .inp:focus, dfb-field input:focus, dfb-field select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(44,78,138,0.15); }
dfb-field[invalid] .inp, dfb-field[invalid] input { border-color: var(--danger); }
.field-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: flex-end; }
.field-row dfb-field { width: 9rem; }

dfb-toggle-group { display: inline-flex; flex-wrap: wrap; gap: var(--space-2); }
dfb-toggle { display: inline-flex; align-items: center; gap: var(--space-1);
  cursor: pointer; user-select: none; font-size: var(--text-sm); font-weight: var(--weight-medium);
  padding: 6px var(--space-3); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
dfb-toggle:hover { border-color: var(--accent-border); }
dfb-toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(44,78,138,0.25); }
dfb-toggle[active] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: var(--weight-semibold); }

dfb-catalog-item { display: block; padding: var(--space-2) var(--space-4); cursor: pointer;
  border-bottom: 1px solid #F2EDE5; font-size: var(--text-sm); line-height: var(--leading-tight); }
dfb-catalog-item:hover { background: var(--accent-soft); }
dfb-catalog-item:focus-visible { background: var(--accent-soft); outline: none; box-shadow: inset 3px 0 0 var(--accent), 0 0 0 3px rgba(44,78,138,0.25); }
dfb-catalog-item[selected] { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
dfb-catalog-item .cat-sku { display: flex; align-items: center; gap: var(--space-2);
  font-weight: var(--weight-semibold); color: var(--text); }
dfb-catalog-item .cat-title { color: var(--muted-dark); font-size: var(--text-xs); }
dfb-catalog-item .cat-price { color: var(--muted); font-size: var(--text-xs); }
dfb-catalog-item.cat-item-incomplete { opacity: 0.5; cursor: not-allowed; }
dfb-catalog-item.cat-item-incomplete:focus-visible { outline: none; box-shadow: none; }
.cat-item-error { font-size: 0.7rem; color: var(--danger); margin-top: 2px; }

dfb-job-card { display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); margin-bottom: var(--space-3); }
dfb-job-card .job-head { display: flex; align-items: center; gap: var(--space-3); cursor: pointer; }
dfb-job-card .job-titlewrap { flex: 1; min-width: 0; }
dfb-job-card .job-title { font-weight: var(--weight-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
dfb-job-card .job-track, dfb-job-card .job-error { font-size: var(--text-xs); color: var(--muted); }
dfb-job-card .job-error:not(:empty) { color: var(--danger); }
dfb-job-card .job-right { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-1); margin-left: auto; flex-shrink: 0; }
dfb-job-card .job-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; justify-content: flex-end; }
dfb-job-card .job-actions .btn:not(.expand-toggle) .btn-lbl { display: none; }
dfb-job-card .job-actions .btn:not(.expand-toggle):hover .btn-lbl,
dfb-job-card .job-actions .btn:not(.expand-toggle):focus-visible .btn-lbl { display: inline; }
dfb-job-card .job-badges { display: flex; gap: var(--space-2); }
dfb-job-card .job-badges:empty { display: none; }
dfb-job-card .job-work { font-size: var(--text-xs); color: var(--muted-dark); margin-top: var(--space-2);
  display: flex; gap: var(--space-2); }
dfb-job-card .progress-rail { height: 4px; background: var(--border); border-radius: var(--radius-pill);
  overflow: hidden; margin-top: var(--space-2); }
dfb-job-card .progress-fill { height: 100%; transform-origin: left; transform: scaleX(0);
  transition: transform .35s ease; background: var(--accent); }
dfb-job-card .progress-fill.ok { background: var(--success); }
dfb-job-card .progress-fill.fail { background: var(--danger); }
dfb-job-card .progress-fill.partial { background: var(--warn); }
dfb-job-card .progress-fill.indeterminate { transform: none; width: 35%;
  animation: dfb-indet 1.1s ease-in-out infinite; }
@keyframes dfb-indet { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
dfb-job-card .job-detail { margin-top: var(--space-3); }
dfb-job-card.dry-run { opacity: 0.75; }
dfb-job-card[open] .expand-toggle { background: var(--accent); color: #fff; border-color: var(--accent); }
@media (prefers-reduced-motion: reduce) {
  dfb-job-card .progress-fill { transition: none; }
  dfb-job-card .progress-fill.indeterminate { animation: none; width: 100%; opacity: .4; }
}
.catalog-empty { padding: var(--space-2) var(--space-3); color: var(--muted); font-size: var(--text-sm); }
.catalog-error { padding: var(--space-2) var(--space-3); color: var(--danger); font-size: var(--text-sm); }
