﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font, 'Open Sans', Arial, sans-serif);
    background: var(--bg-grad, var(--bg, #f4f4f4));
    color: var(--text, #1a1a1a);
    padding: 12px;
    -webkit-tap-highlight-color: transparent;
    min-height: 100vh;
    min-height: 100dvh;
}

.container {
    max-width: 680px;
    margin: 16px auto;
    background: var(--surface, white);
    border-radius: var(--r-lg, 18px);
    box-shadow: var(--shadow-md, 0 18px 44px rgba(22, 22, 22, 0.12));
    overflow: hidden;
    border: 1px solid var(--border, #e6e6e6);
}

/* Kopfzeile (Glas, Titel, Untertitel, Zurück-Link) kommt aus common/theme.css (PP-311) */

.header-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.btn-switch-user {
    background: none;
    color: var(--header-text-muted, var(--text-muted, #555555));
    border: none;
    border-radius: 0;
    padding: 0;
    font-size: 11px;
    font-weight: 400;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    text-decoration: underline;
    text-underline-offset: 2px;
    opacity: 0.85;
}

.btn-switch-user:hover {
    color: var(--header-text, var(--text, #161616));
    background: none;
    opacity: 1;
}

.btn-switch-user:active {
    transform: none;
}

.status-badge {
    background: var(--header-chip-bg, var(--surface-2, #fafafa));
    padding: 6px 12px;
    border-radius: var(--r-pill, 999px);
    font-size: 12px;
    text-transform: none;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid var(--border, #e6e6e6);
    line-height: 1.35;
    text-align: right;
    max-width: 100%;
}

.offline-badge {
    display: none;
    align-items: center;
    gap: 6px;
    background: var(--surface-2, #fafafa);
    padding: 4px 10px;
    border-radius: var(--r-pill, 999px);
    font-size: 11px;
    font-weight: 700;
    border: 1px solid var(--border, #e6e6e6);
    white-space: nowrap;
}

.offline-badge {
    cursor: pointer;
    color: inherit;
    font-family: inherit;
}

.offline-badge.is-offline {
    background: rgba(220, 38, 38, 0.85);
    border-color: rgba(220, 38, 38, 0.95);
    color: #fff;
}

/* PP-106: dauerhaft unzustellbare Aktionen – braucht Nutzer-Eingriff */
.offline-badge.is-failed {
    background: rgba(217, 119, 6, 0.9);
    border-color: rgba(217, 119, 6, 0.95);
    color: #fff;
}

/* PP-106: Offline-Sync-Panel unter dem Header */
.offline-panel {
    background: var(--surface-2, #fafafa);
    border-bottom: 1px solid var(--border, #e6e6e6);
    padding: 12px 16px;
}

.offline-panel-body {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.offline-panel-status {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text, #1f2937);
}

.offline-panel-error {
    margin: 0;
    font-size: 12px;
    color: var(--danger, #dc2626);
    word-break: break-word;
}

.offline-panel-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.offline-panel-actions button {
    flex: 1 1 auto;
    min-height: 44px;
    padding: 8px 14px;
    border-radius: var(--r-sm, 8px);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-offline-retry {
    background: var(--brand-grad-btn, #d00000);
    color: #fff;
}

.btn-offline-retry:disabled {
    opacity: 0.5;
    cursor: default;
}

.btn-offline-discard {
    background: transparent;
    color: var(--danger, #dc2626);
    border-color: var(--danger, #dc2626);
}

.picklist-info {
    padding: 0;
    background: var(--surface-2, #fafafa);
    border-bottom: 1px solid var(--border, #e6e6e6);
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.info-item .label {
    font-weight: 600;
    color: var(--text-muted, #666);
}

.scan-section,
.cart-scan-section {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border, #e6e6e6);
    background: var(--surface, white);
}

.cart-scan-section {
    background: var(--warning-bg, #fffbeb);
    border-bottom-color: var(--warning-border, #fcd34d);
}

.section-head {
    margin-bottom: 14px;
}

.section-head h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text, #1a1a1a);
    margin-bottom: 0;
}

.section-head p {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-muted, #555555);
    line-height: 1.45;
}

.section-head--inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 10px;
    border-radius: var(--r-pill, 999px);
    background: var(--surface-2, #fafafa);
    border: 1px solid var(--border, #e6e6e6);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted, #555555);
}

.cart-gate-banner {
    background: var(--success-bg, #dcfce7);
    border: 1px solid var(--success-border, #86efac);
    padding: 12px 16px;
    border-radius: var(--r-sm, 8px);
    margin: 0 20px 12px;
    font-size: 14px;
    color: var(--success-text, #166534);
    line-height: 1.45;
}

.cart-gate-banner strong {
    font-weight: 700;
}

.cart-gate-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted, #555555);
}

.pick-scan-hero {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

#scan-input,
.pick-scan-hero-input,
.cart-scan-section input,
#cart-input {
    width: 100%;
    padding: 14px 15px;
    font-size: 18px;
    border: 1.5px solid var(--border-strong, #cfcfcf);
    border-radius: var(--r-sm, 8px);
    margin-bottom: 10px;
    text-align: center;
    background: var(--surface, white);
    color: var(--text, #1a1a1a);
    transition: border-color var(--t, 0.2s), box-shadow var(--t, 0.2s);
}

.pick-scan-hero-input,
#scan-input.pick-scan-hero-input {
    margin-bottom: 0;
    padding-right: 52px;
}

.pick-scan-hero-cam {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--r-sm, 8px);
    background: var(--brand-50, #fff0f0);
    color: var(--brand-600, #d00000);
    cursor: pointer;
    margin: 0;
    padding: 0;
    min-height: 0;
    -webkit-tap-highlight-color: transparent;
    transition: background var(--t, 0.18s), transform var(--t, 0.18s);
}

.pick-scan-hero-cam:hover {
    background: var(--brand-100, #ffd1d1);
}

.pick-scan-hero-cam:active {
    transform: translateY(-50%) scale(0.94);
}

.cart-scan-section input,
#cart-input {
    border-color: var(--warning, #f59e0b);
}

#scan-input:focus,
.pick-scan-hero-input:focus,
.cart-scan-section input:focus,
#cart-input:focus {
    outline: none;
    border-color: var(--brand-500, #fe0000);
    box-shadow: 0 0 0 4px var(--brand-100, #ffd1d1);
}

.cart-scan-section .btn-primary,
.cart-scan-section .btn-secondary {
    width: 100%;
    margin-bottom: 10px;
}

.btn-primary, .btn-secondary {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: var(--r-sm, 8px);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 10px;
    min-height: 44px;
    transition: background-color var(--t, 0.2s), opacity var(--t, 0.2s);
}

.btn-primary {
    background: var(--brand-grad-btn, #d00000);
    color: white;
}

.btn-primary:active {
    background: var(--brand-600, #d00000);
    opacity: 0.9;
}

.btn-secondary {
    background: var(--surface-3, #e0e0e0);
    color: var(--text, #333);
}

.btn-secondary:active {
    background: var(--border-strong, #d0d0d0);
    opacity: 0.9;
}

#camera-container {
    margin-top: 15px;
    margin-bottom: 15px;
    border: 2px solid var(--brand-500, #fe0000);
    border-radius: 8px;
    padding: 15px;
    background: var(--surface-2, #f9fafb);
    display: flex;
    flex-direction: column;
    align-items: center;
}

#camera-container video, 
#camera-container canvas,
#barcode-detector-video,
#quagga-container video,
#quagga-container canvas,
#camera-container #html5qr-code-full-region video,
#camera-container #html5qr-code-full-region canvas {
    width: 100% !important;
    height: auto !important;
    max-width: 500px;
    border-radius: 8px;
    margin: 0 auto;
    object-fit: contain;
    box-shadow: none;
}

#camera-container #html5qr-code-full-region {
    width: 100% !important;
    max-width: 500px;
    margin: 0 auto;
    border-radius: 8px;
    background: transparent !important;
    box-shadow: none !important;
}

#quagga-container {
    width: 100% !important;
    max-width: 500px;
    margin: 0 auto;
    border-radius: 8px;
    background: transparent !important;
    box-shadow: none !important;
    position: relative;
    overflow: hidden;
}

#quagga-container .drawingBuffer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

#stop-camera-btn {
    width: 100%;
    margin-top: 15px;
    margin-bottom: 0;
}

/* Ensure no specific ID selector overrides the class for the stop button */
#camera-container #stop-camera-btn {
    margin: 15px 0 0 0;
    background: var(--border, #e0e0e0); /* Reset to secondary button style if needed, but class handles it */
    color: var(--text, #333);
    box-shadow: none;
    position: static;
}

#camera-container #stop-camera-btn:hover {
    background: var(--border-strong, #d0d0d0);
}

.scan-feedback {
    padding: 15px 20px;
    margin: 0 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    display: none;
    min-height: 3.25rem;
    box-sizing: border-box;
}

#next-order-btn.is-highlighted {
    animation: next-picklist-pulse 1.2s ease-in-out infinite;
}

@keyframes next-picklist-pulse {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand-500, #fe0000) 45%, transparent); }
    50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand-500, #fe0000) 0%, transparent); }
}

.scan-feedback.success {
    background: var(--success-bg, #d4edda);
    color: var(--success-text, #155724);
    border: 1px solid var(--success-border, #c3e6cb);
}

.scan-feedback.error {
    background: var(--danger-bg, #f8d7da);
    color: var(--danger-text, #721c24);
    border: 1px solid var(--danger-border, #f5c6cb);
}

.picklist-skip-btn {
    display: none;
    width: calc(100% - 40px);
    margin: 12px 20px 0;
}

.items-section-wrapper {
    position: relative;
}

.items-section-wrapper.cart-locked .items-section {
    filter: blur(6px);
    pointer-events: none;
    user-select: none;
}

.cart-items-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 16px;
    background: rgba(245, 243, 243, 0.72);
    backdrop-filter: blur(4px);
    pointer-events: none;
}
.cart-items-overlay.is-hidden {
    display: none !important;
}

.cart-overlay-panel {
    pointer-events: auto;
    width: 100%;
    max-width: 360px;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e6e6e6);
    border-radius: var(--r-lg, 16px);
    padding: 24px 20px;
    box-shadow: var(--shadow-lg, 0 24px 50px rgba(22, 22, 22, 0.18));
    text-align: center;
}

.cart-overlay-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 12px;
    border-radius: 50%;
    background: var(--warning-bg, #fffbeb);
    color: var(--warning-text, #92400e);
}

.cart-overlay-message {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--text, #1a1a1a);
    margin-bottom: 6px;
}

.cart-overlay-hint {
    font-size: 14px;
    color: var(--text-muted, #555555);
    line-height: 1.5;
    margin: 0;
}

.items-section {
    padding: 18px 20px 20px;
}

.items-section h2 {
    font-size: 16px;
    margin-bottom: 0;
    color: var(--text, #1a1a1a);
}

.item-card {
    background: var(--surface, white);
    border: 1.5px solid var(--border, #e6e6e6);
    border-radius: var(--r, 12px);
    padding: 14px;
    margin-bottom: 10px;
    transition: border-color var(--t, 0.2s), box-shadow var(--t, 0.2s), background-color var(--t, 0.2s);
    position: relative;
}

.item-card.open {
    border-color: var(--warning, #ffc107);
    background: var(--warning-bg-soft, #fffdf5);
}

.item-card.picked {
    border-color: var(--success, #28a745);
    background: var(--success-bg, #f0f9f4);
}

/* v2 (PP-305): blockiert = roter Streifen + Badge, Fläche bleibt ruhig */
.item-card.blacklisted {
    border-color: var(--danger-border, #fecaca) !important;
    border-left-color: var(--danger, #dc3545) !important;
    background: var(--surface, #fff) !important;
}

.item-blacklist-badge {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 10px;
    background: var(--danger-bg, #fee2e2);
    color: var(--danger-text, #991b1b);
    border: 1px solid var(--danger-border, #fca5a5);
    border-radius: var(--r-pill, 999px);
    font-size: 12px;
    font-weight: 700;
}

.item-card.clickable {
    cursor: pointer;
    user-select: none;
}

.item-card.clickable:hover {
    border-color: var(--brand-400, #fe0000);
    box-shadow: var(--shadow-sm);
}

.item-card.clickable:active {
    border-color: var(--success, #28a745) !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--success, #16a34a) 25%, transparent);
}

.click-hint {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 12px;
    color: var(--brand-500, #fe0000);
    opacity: 0.7;
}

.item-card h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text, #333);
    font-weight: 700;
}

.item-info {
    font-size: 14px;
    color: var(--text-muted, #666);
    margin-bottom: 8px;
}

.item-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.progress-bar {
    flex: 1;
    height: 10px;
    background: var(--surface-3, #e0e0e0);
    border-radius: var(--r-pill, 4px);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--brand-grad-btn, #fe0000);
    transition: width 0.2s ease;
}

.progress-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--brand-600, #fe0000);
    min-width: 72px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* PP-108: Korrektur-Button – gepickte Menge verringern */
.item-unpick-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 1.5px solid var(--border, #e6e6e6);
    border-radius: var(--r-sm, 8px);
    background: var(--surface-2, #fafafa);
    color: var(--text, #333);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.item-unpick-btn:hover {
    border-color: var(--brand-400, #fe6161);
    color: var(--brand-600, #fe0000);
}

.item-unpick-btn:active {
    background: var(--brand-100, #ffd1d1);
    border-color: var(--brand-500, #fe0000);
}

.picklist-card {
    background: var(--surface, white);
    border: 1.5px solid var(--border, #e6e6e6);
    border-radius: var(--r, 12px);
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: border-color var(--t, 0.2s), box-shadow var(--t, 0.2s), transform var(--t, 0.2s);
}

.picklist-card:hover {
    border-color: var(--brand-400, #fe6161);
    box-shadow: var(--shadow, 0 6px 16px rgba(22, 22, 22, 0.08));
}

.picklist-card:active {
    transform: translateY(0);
    border-color: var(--brand-500, #fe0000);
}

/* Von einem Kollegen gesperrte Liste: sichtbar, aber nicht zu öffnen */
.picklist-card.is-locked {
    cursor: not-allowed;
    opacity: 0.6;
}

.picklist-card.is-locked:hover,
.picklist-card.is-locked:active {
    border-color: var(--border, #e6e6e6);
    box-shadow: none;
}

.picklist-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.picklist-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text, #1a1a1a);
    line-height: 1.3;
}

.picklist-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.picklist-stat {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: var(--r-sm, 8px);
    background: var(--surface-2, #fafafa);
    border: 1px solid var(--border, #e6e6e6);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted, #555555);
}

/* PP-305: Kennzahl „blockiert“ als Badge und Bearbeiter mit Avatar */
.picklist-stat--danger {
    color: var(--danger-text, #991b1b);
    background: var(--danger-bg, #fee2e2);
    border-color: var(--danger-border, #fecaca);
}

.picklist-picker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted, #555555);
}

/* PP-336: Hinweis „In Combi #N“ in der Bestellübersicht */
.combi-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: var(--r-pill, 999px);
    background: var(--info-bg, #d1ecf1);
    color: var(--info-text, #0c5460);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.picklist-station {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted, #555555);
}

.picklist-card .meta {
    font-size: 14px;
    color: var(--text-muted, #666);
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.status-indicator {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--r-pill, 999px);
    font-size: 11px;
    font-weight: 700;
    text-transform: none;
    white-space: normal;
    text-align: right;
    line-height: 1.35;
    max-width: 58%;
    flex-shrink: 1;
}

.status-indicator.open {
    background: var(--warning-bg, #fff3cd);
    color: var(--warning-text, #856404);
}

.status-indicator.picking {
    background: var(--info-bg, #d1ecf1);
    color: var(--info-text, #0c5460);
}

.status-indicator.picked {
    background: var(--success-bg, #d4edda);
    color: var(--success-text, #155724);
}

.loading, .error-message, .complete-message, .list-empty {
    padding: 20px;
    text-align: center;
    font-size: 15px;
    line-height: 1.5;
}

.loading {
    color: var(--text-muted, #555555);
}

.list-empty {
    color: var(--text-muted, #555555);
    padding: 28px 20px;
}

.info-banner {
    margin: 0 20px 12px;
    padding: 12px 14px;
    background: var(--info-bg, #eff6ff);
    color: var(--info-text, #1e40af);
    border: 1px solid var(--info-border, #bfdbfe);
    border-radius: var(--r-sm, 8px);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
}

.error-message {
    background: var(--danger-bg, #fee2e2);
    color: var(--danger-text, #991b1b);
    border-radius: var(--r-sm, 8px);
    margin: 20px;
    border: 1px solid var(--danger-border, #fca5a5);
}

.complete-message {
    background: var(--success-bg, #dcfce7);
    color: var(--success-text, #166534);
    border-radius: var(--r-sm, 8px);
    margin: 20px;
    font-size: 16px;
    font-weight: 700;
    border: 1px solid var(--success-border, #86efac);
}

/* PP-305: Abschluss-Ansicht mit gezeichnetem Haken. `.complete-message` wird per
   setDisplay(block) gezeigt, deshalb liegt das Flex-Layout im inneren Element. */
.complete-hero {
    margin: 12px 20px;
    padding: 18px 20px;
    text-align: left;
    border-radius: var(--r, 14px);
    box-shadow: var(--elev-1);
}
.complete-hero-inner {
    display: flex;
    align-items: center;
    gap: 16px;
}
.complete-hero-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.complete-hero-text strong { font-size: 18px; font-weight: 800; }
.complete-hero-text span { font-size: 13px; font-weight: 600; opacity: .85; }
.complete-hero-check {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    fill: none;
    stroke: var(--success, #16a34a);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.complete-hero-check circle {
    stroke-dasharray: 151;
    stroke-dashoffset: 151;
    animation: complete-hero-draw .5s ease-out forwards;
}
.complete-hero-check path {
    stroke-dasharray: 36;
    stroke-dashoffset: 36;
    animation: complete-hero-draw .35s .4s ease-out forwards;
}
@keyframes complete-hero-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
    .complete-hero-check circle,
    .complete-hero-check path { animation: none; stroke-dashoffset: 0; }
}

.complete-picklist-section {
    padding: 20px;
    text-align: center;
    border-top: 1px solid var(--border, #e6e6e6);
    background: var(--surface-2, #fafafa);
}

.btn-complete-picklist {
    font-size: 17px;
    padding: 15px 30px;
    font-weight: 700;
    width: 100%;
    max-width: 400px;
}

.admin-search-section {
    padding: 14px 20px;
    background: var(--surface-2, #fafafa);
    border-bottom: 1px solid var(--border, #e6e6e6);
}

.search-container {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.search-container input {
    flex: 1;
    min-width: 180px;
    padding: 12px 14px;
    font-size: 15px;
    border: 1.5px solid var(--border-strong, #cfcfcf);
    border-radius: var(--r-sm, 8px);
    outline: none;
    background: var(--surface, white);
    transition: border-color var(--t, 0.2s), box-shadow var(--t, 0.2s);
}

.search-container input:focus {
    border-color: var(--brand-500, #fe0000);
    box-shadow: 0 0 0 4px var(--brand-100, #ffd1d1);
}

.search-container button {
    padding: 12px 18px;
    font-size: 14px;
    white-space: nowrap;
    width: auto;
    margin-bottom: 0;
    min-height: 44px;
}

.picklists-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 18px 20px 10px;
}

.picklists-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text, #1a1a1a);
}

.picklists-total-line {
    margin: 0 0 12px;
    padding: 0 20px;
    color: var(--text-muted);
    font-size: 13px;
}

.picklists-total-line a {
    color: var(--brand-600);
    font-weight: 600;
}

.picklists-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    border-radius: var(--r-pill, 999px);
    background: var(--brand-50, #fff0f0);
    color: var(--brand-600, #d00000);
    font-size: 12px;
    font-weight: 700;
}

#picklists-list {
    padding: 0 20px 20px;
}

/* PP-305: Filter-Chips bündig mit den Karten */
#picklist-filters { padding: 0 20px; }

/* PP-305: Bilder-Schalter und Scan-Ton nebeneinander im Kopf der Pickliste */
.header-actions-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* PP-378: Ab Desktop-Breite Status-Pill, Bilder und Ton in einer Zeile statt übereinander –
   die Kopfzeile bleibt so flach wie auf den übrigen Seiten. Darunter (768–1199 px) bricht
   neben der Menüleiste sonst der Titel um, dort bleibt die Pill über den Buttons. */
@media (min-width: 1200px) {
    body.picklist-detail-page .container > header .header-actions {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
        gap: 8px;
    }
    body.picklist-detail-page .container > header .status-badge {
        white-space: nowrap;
    }
    body.picklist-detail-page .container > header .status-badge:empty { display: none; }
}

header .btn-scan-sound {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
}

/* Kopf der Pickliste am Handy: drei feste Zeilen statt einer umbrechenden Flex-Reihe.
   Die Aktionsspalte war nicht schrumpfbar und drückte den Titel unter die Status-Pill.
     Zeile 1: ☰  ← Zurück ............ [Bilder] [Ton]
     Zeile 2: Pickliste #2
     Zeile 3: ● Wird gepickt · Name
     Zeile 4: Offline-Hinweis / Benutzer wechseln (meist versteckt)
   `display: contents` reicht die Kinder von .header-actions direkt ans Grid weiter. */
@media (max-width: 767px) {
    body.picklist-detail-page .container > header {
        display: grid;
        grid-template-columns: auto auto minmax(0, 1fr) auto auto;
        align-items: center;
        column-gap: 8px;
        row-gap: 4px;
    }

    body.picklist-detail-page .container > header .header-actions,
    body.picklist-detail-page .container > header .header-actions-row {
        display: contents;
    }

    body.picklist-detail-page .container > header #menu-placeholder { grid-area: 1 / 1; }
    body.picklist-detail-page .container > header .back-link { grid-area: 1 / 2; }
    body.picklist-detail-page .container > header .btn-product-images { grid-area: 1 / 4; }
    body.picklist-detail-page .container > header .btn-scan-sound { grid-area: 1 / 5; }

    body.picklist-detail-page .container > header .header-title-group--detail {
        grid-area: 2 / 1 / 3 / -1;
        text-align: left;
        padding-left: 4px;
    }
    body.picklist-detail-page .container > header .header-title-group--detail h1 {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Status-Pill: eine Zeile, bei langem Namen mit Auslassung statt Umbruch */
    body.picklist-detail-page .container > header .status-badge {
        grid-area: 3 / 1 / 4 / -1;
        justify-self: start;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        text-align: left;
    }
    body.picklist-detail-page .container > header .status-badge:empty { display: none; }

    body.picklist-detail-page .container > header .offline-badge,
    body.picklist-detail-page .container > header .btn-switch-user {
        grid-column: 1 / -1;
        justify-self: end;
    }

    /* Bilder-Pill und Ton-Kapsel gleich hoch (36 px), sonst gewinnt .btn-icon aus dem Theme */
    body.picklist-detail-page .container > header .btn-scan-sound,
    body.picklist-detail-page .container > header .btn-product-images {
        height: 36px;
        min-height: 36px;
    }
    body.picklist-detail-page .container > header .btn-scan-sound {
        width: 36px;
        min-width: 36px;
    }
}

/* Vibrationsanimation entfernt - verursachte Browser-Fenster-Verschiebung */
.vibrate {
    /* Animation entfernt */
}

/* Warning Popup */
.warning-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.warning-popup-content {
    background: var(--surface, white);
    border-radius: 12px;
    max-width: 95%;
    width: 500px;
    max-height: 85%;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7);
    animation: slideUp 0.4s;
    border: 4px solid;
    position: relative;
}

@keyframes slideUp {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.warning-popup-content.warning {
    border-color: var(--warning, #ffc107);
    background: var(--warning-bg, #fffbf0);
}

.warning-popup-content.error {
    border-color: var(--danger, #dc3545);
    background: var(--danger-bg, #fff5f5);
    animation: slideUp 0.4s;
}

/* Pulse-Animationen entfernt - verursachten Browser-Fenster-Verschiebung */

.warning-popup-header {
    padding: 20px;
    border-bottom: 1px solid var(--border, #eee);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-2, #f8f9fa);
    border-radius: 12px 12px 0 0;
}

.warning-popup-header h2 {
    margin: 0;
    font-size: 24px;
    color: var(--danger, #dc3545);
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.warning-popup-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-muted, #666);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 28px;
    border-radius: 50%;
    transition: all 0.2s;
}

.warning-popup-close:hover {
    background: var(--border, #e0e0e0);
    color: var(--text, #333);
}

.warning-popup-body {
    padding: 25px;
    font-size: 18px;
    line-height: 1.8;
    color: var(--text, #333);
    font-weight: 500;
}

.warning-popup-body pre {
    margin: 0;
    font-size: 18px;
    line-height: 1.8;
    color: var(--danger-text, #721c24);
    font-weight: 500;
}

.warning-popup-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border, #eee);
    text-align: right;
    background: var(--surface-2, #f8f9fa);
    border-radius: 0 0 12px 12px;
}

/* Debug Panel */
.debug-panel {
    margin: 10px 20px;
    background: #1e1e1e;
    border-radius: 8px;
    border: 2px solid #333;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    max-height: 300px;
    display: flex;
    flex-direction: column;
}

.debug-header {
    background: #2d2d2d;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #444;
    border-radius: 6px 6px 0 0;
}

.debug-header h3 {
    margin: 0;
    font-size: 14px;
    color: #fff;
    flex: 1;
}

.debug-toggle, .debug-clear {
    background: #444;
    border: 1px solid #666;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 5px;
}

.debug-toggle:hover, .debug-clear:hover {
    background: #555;
}

.debug-content {
    padding: 10px;
    overflow-y: auto;
    flex: 1;
    max-height: 250px;
}

.debug-log {
    padding: 4px 0;
    border-bottom: 1px solid #333;
    line-height: 1.4;
}

.debug-log.camera {
    color: #4fc3f7;
}

.debug-log.scanner {
    color: #81c784;
}

.debug-log.scan {
    color: #ffb74d;
}

.debug-log.error {
    color: #e57373;
    font-weight: bold;
}

.debug-log.success {
    color: #81c784;
    font-weight: bold;
}

.debug-timestamp {
    color: #888;
    font-size: 10px;
    margin-right: 8px;
}

#show-debug-btn {
    width: auto;
    margin: 10px 20px;
    padding: 6px 12px;
    font-size: 12px;
}


/* ---------- Picker-Basis (Karten, Tabellen, Status-Badges) ----------
   Stand aus der alten Bestellungsübersicht; gilt für alle Picker-Seiten. Die Live-Übersicht
   (PP-406) lädt diese Datei nicht mehr, sie hat picker/uebersicht.css. */
        .table {
            width: 100%;
            border-collapse: collapse;
            background: var(--surface, white);
            font-size: 14px;
        }

        .table th,
        .table td {
            padding: 10px 8px;
            text-align: left;
            border-bottom: 1px solid var(--border, #eee);
            white-space: nowrap;
        }

        .table th {
            background: var(--surface-2, #f8f9fa);
            font-weight: 600;
            color: var(--text, #333);
            cursor: pointer;
            user-select: none;
        }

        .table tbody tr:hover {
            background-color: var(--surface-3, #f5f5f5);
        }

        .status-badge {
            display: inline-block;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 12px;
            font-weight: 600;
            text-transform: uppercase;
        }

        .status-open { background: #ffc107; color: #000; }
        .status-picking { background: #17a2b8; color: #fff; }
        .status-picked { background: #28a745; color: #fff; }
        .status-packing { background: #6c757d; color: #fff; }
        .status-packed { background: #007bff; color: #fff; }
        .status-abgeholt { background: #6c757d; color: #fff; }

        .card {
            background: var(--surface, white);
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            margin-bottom: 20px;
        }

        .card h2 {
            color: var(--brand-500, #fe0000);
            margin-bottom: 15px;
            margin-top: 0;
        }

        main {
            padding: 20px 10px;
        }

        @media (min-width: 768px) {
            .container {
                max-width: 1400px;
            }
        }
/* Info-Button je Picklisten-Position: Lagerplatz (map-pin wie Sidebar) */
.item-loc-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border, #e0e0e0);
    border-radius: 8px;
    background: var(--surface, #fff);
    color: var(--text-muted, #6b7280);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.item-loc-btn:hover,
.item-loc-btn:focus-visible {
    border-color: var(--brand-500, #fe0000);
    color: var(--brand-500, #fe0000);
    background: var(--surface-2, #fafafa);
    outline: none;
}
.item-loc-btn:active { transform: scale(0.96); }
.item-loc-icon { display: block; pointer-events: none; }
.item-card > h3 { padding-right: 48px; }

/* Lagerplatz-Chip sitzt rechts neben EAN/Bestellnummer, damit die Karte mit und
   ohne Lagerplatz gleich hoch bleibt (der Chip ist niedriger als die zwei Infozeilen). */
.item-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.item-info-row .item-info {
    margin-bottom: 0;
    min-width: 0;
}
.item-info-row .item-loc-chip {
    flex: 0 1 auto;
    min-width: 0;
    margin: 0;
}
.item-info-row .item-loc-chip > span:not(.item-loc-chip-more) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* PP-138: Produktbild-Thumbnail (nur wenn der Geräte-Toggle aktiv ist).
   Float statt Grid, damit Name und EAN daneben umbrechen und die bestehende
   Kartenstruktur unverändert bleibt. */
.item-thumb {
    float: left;
    width: 48px;
    height: 48px;
    margin: 0 10px 6px 0;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border, #e6e6e6);
    background: var(--surface-3, #f0f0f0);
}
/* Fortschrittszeile darf nicht neben dem Bild kleben */
.item-card .item-progress { clear: both; }

/* Header-Toggle „Bilder an/aus" – Pill im Stil des Offline-Badges */
.btn-product-images {
    padding: 6px 12px;
    border: 1px solid var(--border, #e0e0e0);
    border-radius: var(--r-pill, 999px);
    background: var(--surface, #fff);
    color: var(--text-muted, #6b7280);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.btn-product-images:hover,
.btn-product-images:focus-visible {
    border-color: var(--brand-500, #fe0000);
    color: var(--brand-500, #fe0000);
    outline: none;
}
.btn-product-images.is-on {
    border-color: var(--brand-500, #fe0000);
    background: var(--brand-grad-btn, #d00000);
    color: #fff;
}

/* Lagerplatz-Popup – bewusst ohne <header> (Kopf-Stile in theme.css gelten nur für .container > header) */
.loc-popup {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background: var(--modal-scrim, rgba(22, 22, 22, .55));
    backdrop-filter: blur(6px);
    color: var(--text);
}
.loc-popup-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    color: var(--text);
    border-radius: var(--r-lg, 12px);
    box-shadow: var(--shadow-lg, 0 20px 40px rgba(0, 0, 0, 0.2));
    border: 1px solid var(--border);
    overflow: hidden;
}
.loc-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    color: var(--text);
    box-shadow: none;
}
.loc-popup-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.loc-popup-title-icon {
    display: flex;
    color: var(--brand-500);
    flex-shrink: 0;
}
.loc-popup-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    text-shadow: none;
    letter-spacing: normal;
}
.loc-popup-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}
.loc-popup-close:hover {
    background: var(--surface-3);
    color: var(--text);
}
.loc-popup-body {
    padding: 8px 12px 4px;
    background: var(--surface);
    color: var(--text);
}
.loc-popup-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.loc-popup-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 10px;
    border-radius: 10px;
}
.loc-popup-row + .loc-popup-row { border-top: 1px solid var(--border); }
.loc-popup-row-icon {
    display: flex;
    color: var(--brand-500);
    margin-top: 2px;
    flex-shrink: 0;
    opacity: 0.9;
}
.loc-popup-row-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.loc-popup-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    word-break: break-word;
}
.loc-popup-hall {
    font-size: 13px;
    color: var(--text-muted);
}
.loc-popup-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 28px 16px;
    text-align: center;
    color: var(--text-muted);
}
.loc-popup-empty-icon { color: var(--text-faint); }
.loc-popup-empty p { margin: 0; font-size: 15px; color: var(--text-muted); }
.loc-popup-footer {
    padding: 12px 18px 18px;
    background: var(--surface);
    border-top: 1px solid var(--border);
}
.loc-popup-ok {
    width: 100%;
}

/* CSP: Warning/Confirm popups (no inline styles) */
.warning-popup-content.error .warning-popup-header {
    background: var(--danger, #dc3545);
    color: white;
    border-radius: 12px 12px 0 0;
}
.warning-popup-content.error .warning-popup-header h2 { color: white; }
.warning-popup-content.error .warning-popup-close { color: white; }
.warning-popup-content.warning .warning-popup-header {
    background: var(--warning, #ffc107);
    color: #000;
    border-radius: 12px 12px 0 0;
}
.warning-popup-content.warning .warning-popup-header h2 { color: #000; }
.popup-body-lg { padding: 30px; font-size: 20px; line-height: 1.6; }
.popup-footer-lg { padding: 20px; border-top: 1px solid var(--border, #e6e6e6); }
.popup-pre { white-space: pre-wrap; font-family: inherit; text-align: center; margin: 0; font-weight: 600; }
.popup-btn-full { font-size: 20px; padding: 18px 40px; width: 100%; font-weight: 700; cursor: pointer; }
.popup-btn-confirm-yes { font-size: 20px; padding: 18px 40px; flex: 1; font-weight: 700; cursor: pointer; background: var(--success-grad, #16a34a); border: none; color: var(--success-on, #fff); border-radius: var(--r-sm, 8px); }
.popup-btn-confirm-no { font-size: 20px; padding: 18px 40px; flex: 1; font-weight: 700; cursor: pointer; background: var(--surface, #fff); border: 1px solid var(--border-strong, #cfcfcf); color: var(--text, #161616); border-radius: var(--r-sm, 8px); }
.popup-close-lg { font-size: 40px; line-height: 40px; background: transparent; border: none; cursor: pointer; padding: 0; width: 40px; height: 40px; }
.popup-title-lg { font-size: 28px; font-weight: 700; margin: 0; flex: 1; text-align: center; }
.popup-title-xl { font-size: 32px; font-weight: 700; margin: 0; flex: 1; text-align: center; }


/* ---------- Scan-Leiste in der Daumenzone (Handy, PP-305) ----------
   Eingabe, Kamera und „Nächste Pickliste“ sitzen unten, wo der Daumen ist.
   --scan-bar-h misst picklist.js (trackElementHeight), damit Liste und Meldung
   nie unter der Leiste verschwinden. Ab 768px bleibt die Leiste oben (sticky). */
@media (max-width: 767px) {
    body.picklist-detail-page #product-scan-section {
        position: fixed;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 60;
        max-height: 75vh;
        overflow-y: auto;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
        background: var(--glass-bg, var(--surface));
        border-top: 1px solid var(--glass-border, var(--border));
        border-bottom: 0;
        box-shadow: 0 -8px 24px rgba(22, 22, 22, .08);
        -webkit-backdrop-filter: var(--glass-blur, none);
        backdrop-filter: var(--glass-blur, none);
    }

    body.picklist-detail-page #product-scan-section .section-head { display: none; }

    body.picklist-detail-page .container {
        padding-bottom: calc(var(--scan-bar-h, 84px) + 12px);
    }

    /* Meldung schwebt über der Leiste statt zwischen Leiste und Liste */
    body.picklist-detail-page #scan-feedback {
        position: fixed;
        right: 12px;
        bottom: calc(var(--scan-bar-h, 84px) + 8px);
        left: 12px;
        z-index: 61;
        min-height: 0;
        margin: 0;
        box-shadow: var(--elev-3);
    }

    body.picklist-detail-page #scan-feedback:empty { display: none !important; }

    /* Schwebend über Inhalt: Tönung auf deckender Fläche (im Dunkelmodus sind die
       *-bg-Tokens halbtransparent und der Kartentext schiene durch) */
    body.picklist-detail-page #scan-feedback.error {
        background: linear-gradient(var(--danger-bg), var(--danger-bg)) var(--surface);
    }
    body.picklist-detail-page #scan-feedback.success {
        background: linear-gradient(var(--success-bg), var(--success-bg)) var(--surface);
    }
}
