﻿/* ============================================================
   SpargelCRM – Kommissionierung Touchscreen & Desktop Styles
   ============================================================ */

/* === TOUCHSCREEN LAYOUT === */

.commission-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--ct-body-bg, #f5f6f8);
    font-size: 20px;
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
}

.commission-header {
    background: #2b3a4a;
    color: #fff;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    min-height: 64px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.commission-header .logo {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.commission-header .logo .dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #4ecf7d;
    display: inline-block;
}

.commission-header .station-info {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 17px;
}

.commission-header .user-area {
    display: flex;
    align-items: center;
    gap: 16px;
}

.commission-header .user-area .user-name {
    font-weight: 600;
}

.commission-main {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
}

.commission-footer {
    background: #fff;
    border-top: 2px solid #dee2e6;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    min-height: 72px;
}

.commission-footer .progress-text {
    font-size: 18px;
    font-weight: 600;
    color: #6c757d;
}

/* === TOUCH BUTTONS === */

.btn-touch {
    min-height: 60px;
    font-size: 18px;
    font-weight: 600;
    padding: 14px 28px;
    border-radius: 10px;
    border: 2px solid transparent;
    touch-action: manipulation;
    transition: background-color 0.15s, border-color 0.15s;
}

.btn-touch:active {
    transform: scale(0.97);
}

.btn-touch-primary {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.btn-touch-primary:active {
    background: #2563eb;
}

.btn-touch-success {
    background: #22c55e;
    color: #fff;
    border-color: #22c55e;
}

.btn-touch-success:active {
    background: #16a34a;
}

.btn-touch-danger {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

.btn-touch-light {
    background: #f3f4f6;
    color: #374151;
    border-color: #d1d5db;
}

.btn-touch-outline {
    background: transparent;
    color: #374151;
    border-color: #d1d5db;
}

.btn-touch-sm {
    min-height: 48px;
    font-size: 16px;
    padding: 10px 20px;
}

.btn-touch-lg {
    min-height: 72px;
    font-size: 22px;
    padding: 18px 36px;
}

/* === COMMISSION CARDS === */

.commission-card {
    background: #fff;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    padding: 20px;
    margin-bottom: 16px;
    transition: border-color 0.15s;
    touch-action: manipulation;
}

.commission-card:active {
    background: #f9fafb;
}

.commission-card.card-completed {
    border-color: #22c55e;
    background: #f0fdf4;
}

.commission-card.card-in-progress {
    border-color: #f59e0b;
    background: #fffbeb;
}

.commission-card.card-locked {
    border-color: #9ca3af;
    background: #f9fafb;
    opacity: 0.8;
}

.commission-card.card-urgent {
    border-color: #ef4444;
    border-width: 3px;
    background: rgba(255, 0, 0, 0.03);
    animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

.commission-card .card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.commission-card .card-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.commission-card .card-subtitle {
    font-size: 16px;
    color: #6b7280;
    margin-top: 4px;
}

.commission-card .card-meta {
    font-size: 15px;
    color: #9ca3af;
}

/* === PROGRESS BAR (Touch) === */

.progress-touch {
    height: 14px;
    border-radius: 7px;
    background: #e5e7eb;
    overflow: hidden;
    margin: 10px 0;
}

.progress-touch .progress-fill {
    height: 100%;
    border-radius: 7px;
    transition: width 0.4s ease;
}

.progress-touch .progress-fill.fill-green { background: #22c55e; }
.progress-touch .progress-fill.fill-yellow { background: #f59e0b; }
.progress-touch .progress-fill.fill-red { background: #ef4444; }

/* === STATUS INDICATORS === */

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-dot.open { background: #ef4444; }
.status-dot.in-progress { background: #f59e0b; }
.status-dot.completed { background: #22c55e; }
.status-dot.locked { background: #9ca3af; }

.urgent-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    background: #fef2f2;
    color: #dc2626;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
}

.lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 15px;
}

/* === NUMPAD OVERLAY === */

.numpad-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.numpad-dialog {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    width: 380px;
    max-width: 95vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.numpad-dialog .numpad-title {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 16px;
    text-align: center;
}

.numpad-dialog .numpad-display {
    background: #f9fafb;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    padding: 16px;
    font-size: 32px;
    font-weight: 700;
    text-align: right;
    margin-bottom: 20px;
    min-height: 68px;
    font-variant-numeric: tabular-nums;
}

.numpad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.numpad-grid .numpad-key {
    min-height: 64px;
    font-size: 24px;
    font-weight: 600;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    cursor: pointer;
    transition: background 0.1s;
}

.numpad-grid .numpad-key:active {
    background: #e5e7eb;
}

.numpad-grid .numpad-key.key-backspace {
    font-size: 20px;
}

.numpad-actions {
    display: flex;
    gap: 12px;
}

.numpad-actions .btn-touch {
    flex: 1;
}

/* === CHECKLIST ITEMS (B2C Picking) === */

.pick-item {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: border-color 0.15s, background 0.15s;
    touch-action: manipulation;
}

.pick-item.item-picked {
    border-color: #22c55e;
    background: #f0fdf4;
}

.pick-item.item-skipped {
    border-color: #9ca3af;
    background: #f9fafb;
    opacity: 0.6;
}

.pick-item .pick-check {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
}

.pick-item.item-picked .pick-check {
    background: #22c55e;
    border-color: #22c55e;
    color: #fff;
}

.pick-item .pick-details {
    flex: 1;
    min-width: 0;
}

.pick-item .pick-product {
    font-size: 19px;
    font-weight: 700;
}

.pick-item .pick-product-translated {
    font-size: 15px;
    color: #6b7280;
    margin-top: 2px;
}

.pick-item .pick-qty {
    font-size: 16px;
    color: #6b7280;
    margin-top: 4px;
}

.pick-item .pick-price {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.pick-item .price-input {
    width: 140px;
    height: 48px;
    font-size: 20px;
    font-weight: 600;
    text-align: right;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    padding: 0 12px;
    background: #fff;
}

.pick-item .price-input:focus {
    border-color: #3b82f6;
    outline: none;
}

.pick-item .price-input.price-locked {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}

.pick-item .price-suffix {
    font-size: 18px;
    font-weight: 600;
    color: #6b7280;
}

.pick-item .price-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    background: #dbeafe;
    color: #1d4ed8;
}

/* === TOTALS BAR === */

.totals-bar {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.totals-bar .total-amount {
    font-size: 24px;
    font-weight: 700;
}

.totals-bar .total-progress {
    font-size: 16px;
    color: #64748b;
}

/* === MODE SELECTOR (B2B) === */

.mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 700px;
    margin: 40px auto;
}

.mode-card {
    background: #fff;
    border: 3px solid #e5e7eb;
    border-radius: 16px;
    padding: 36px 28px;
    text-align: center;
    cursor: pointer;
    touch-action: manipulation;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.mode-card:active {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.mode-card .mode-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.mode-card .mode-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.mode-card .mode-desc {
    font-size: 16px;
    color: #6b7280;
    line-height: 1.4;
}

/* === FILTER TABS === */

.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-tab {
    min-height: 48px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    border: 2px solid #d1d5db;
    background: #fff;
    color: #374151;
    touch-action: manipulation;
    cursor: pointer;
}

.filter-tab.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.filter-tab:active {
    opacity: 0.85;
}

/* === LABEL BUTTON === */

.label-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    background: #8b5cf6;
    color: #fff;
    border: none;
    touch-action: manipulation;
}

.label-btn:active {
    background: #7c3aed;
}

.label-btn .label-count {
    background: rgba(255,255,255,0.25);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 14px;
}

/* === OVERVIEW STATS === */

.overview-stats {
    display: flex;
    gap: 12px;
    font-size: 16px;
    color: #6b7280;
    margin-top: 8px;
    flex-wrap: wrap;
}

.overview-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* === LANGUAGE SWITCHER === */

.btn-lang {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    border: 2px solid rgba(255,255,255,0.2);
    background: transparent;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    touch-action: manipulation;
    transition: background 0.15s, color 0.15s;
}

.btn-lang.active {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border-color: rgba(255,255,255,0.4);
}

.btn-lang:active {
    background: rgba(255,255,255,0.3);
}

/* === RESPONSIVE === */

@media (max-width: 768px) {
    .commission-main { padding: 12px; }
    .commission-header { padding: 10px 16px; }
    .mode-selector { grid-template-columns: 1fr; }
}
