/* ==================== SHARED SCAN / ITEM CARD STYLES ==================== */
/* Used by: PZAcceptanceScan, AcceptSubiektDoc, DocumentScanItemCard          */

/* ===== Container & Header ===== */
.pz-scan-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f4f6f8;
}

.pz-scan-header {
    background: linear-gradient(135deg, #009244, #c1d11c);
    color: #fff;
    padding: 1rem 1.25rem;
}

.pz-scan-title {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pz-scan-subtitle {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

.pz-scan-header-stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
}

.pz-stat {
    text-align: center;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    padding: 0.4rem 0.75rem;
    flex: 1;
}

.pz-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
}

.pz-stat-label {
    font-size: 0.7rem;
    opacity: 0.85;
}

/* ===== Scan Input ===== */
.pz-scan-input-area {
    padding: 0.75rem 1rem;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.pz-scan-input-group {
    display: flex;
    gap: 0.5rem;
}

.pz-scan-input {
    font-size: 1.1rem;
    padding: 0.75rem 1rem;
    border-radius: 12px !important;
    border: 2px solid #dee2e6;
    transition: border-color 0.2s;
}

.pz-scan-input:focus {
    border-color: #009244;
    box-shadow: 0 0 0 0.2rem rgba(0, 146, 68, 0.15);
}

.pz-scan-btn {
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    font-size: 1.1rem;
}

.pz-qty-input-area {
    margin-top: 0.5rem;
    padding: 0.5rem 0;
}

.pz-qty-input {
    width: 100px;
    text-align: center;
    font-weight: 600;
    border-radius: 10px;
}

.pz-scan-mode-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* ===== Continuous Mode Toggle ===== */
.toggle-tile-scan {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: #fff;
    border: 1.5px solid #e9ecef;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.toggle-tile-scan:hover {
    border-color: #b8d4c8;
    background: #f8fdfb;
}

.toggle-tile-scan.active {
    border-color: #009244;
    background: rgba(0, 146, 68, 0.06);
}

.toggle-tile-scan .form-check-input {
    width: 2.75em;
    height: 1.4em;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 2em;
}

.toggle-tile-scan .form-check-input:checked {
    background-color: #009244;
    border-color: #009244;
}

.toggle-tile-scan .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(0, 146, 68, 0.15);
}

.toggle-label-scan {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a1a2e;
}

.toggle-desc-scan {
    font-size: 0.78rem;
    color: #6c757d;
}

.pz-mode-select {
    max-width: 200px;
    border-radius: 8px;
    font-size: 0.82rem;
}

/* ===== Progress ===== */
.pz-progress-bar {
    margin-bottom: 0.5rem;
}

/* ===== Items List & Cards ===== */
.pz-items-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.pz-item-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    transition: all 0.25s ease;
    border-left: 4px solid transparent;
}

.pz-item-pending {
    background: #fff;
    border-left-color: #dee2e6;
}

.pz-item-matched {
    background: #d1fae5;
    border-left-color: #10b981;
}

.pz-item-mismatch {
    background: #fef3c7;
    border-left-color: #f59e0b;
}

.pz-item-extra {
    background: #fef9c3;
    border-left-color: #eab308;
}

.pz-item-unknown {
    background: #fee2e2;
    border-left-color: #ef4444;
}

.pz-item-scanned {
    background: #eff6ff;
    border-left-color: #3b82f6;
}

.pz-item-status-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.pz-item-thumb-wrap {
    position: relative;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    cursor: pointer;
}

.pz-item-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 10px;
    background: #f0f0f0;
}

.pz-item-thumb-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    font-size: 0.75rem;
    line-height: 1;
    background: #fff;
    border-radius: 50%;
    padding: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.pz-item-info {
    flex: 1;
    min-width: 0;
}

.pz-item-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pz-item-codes {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    margin-top: 0.15rem;
}

.pz-item-codes .badge {
    font-size: 0.68rem;
    font-weight: 500;
}

.pz-item-qty {
    font-size: 0.82rem;
    margin-top: 0.15rem;
}

.pz-item-notes {
    font-size: 0.78rem;
    color: #6b7280;
    margin-top: 0.25rem;
    font-style: italic;
}

.pz-item-actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding-left: 0.5rem;
}

/* ===== Item Action Buttons ===== */
.pz-act-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.pz-act-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.35) 0%, transparent 70%);
    transition: opacity 0.3s;
}

.pz-act-btn:active::after {
    opacity: 1;
}

/* +/- quantity row */
.pz-act-qty-row {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.pz-act-minus,
.pz-act-plus {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.pz-act-minus {
    background: #fff;
    color: #e74c3c;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.12), inset 0 0 0 1.5px rgba(231, 76, 60, 0.25);
}

.pz-act-minus:hover {
    background: #fef2f2;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.2), inset 0 0 0 1.5px rgba(231, 76, 60, 0.45);
    transform: translateY(-1px);
}

.pz-act-minus:active {
    transform: translateY(0) scale(0.95);
    box-shadow: 0 1px 3px rgba(231, 76, 60, 0.15), inset 0 0 0 1.5px rgba(231, 76, 60, 0.35);
}

.pz-act-plus {
    background: #fff;
    color: #10b981;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.12), inset 0 0 0 1.5px rgba(16, 185, 129, 0.25);
}

.pz-act-plus:hover {
    background: #ecfdf5;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2), inset 0 0 0 1.5px rgba(16, 185, 129, 0.45);
    transform: translateY(-1px);
}

.pz-act-plus:active {
    transform: translateY(0) scale(0.95);
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.15), inset 0 0 0 1.5px rgba(16, 185, 129, 0.35);
}

/* Accept position — prominent CTA */
.pz-act-accept {
    width: 100%;
    min-width: 76px;
    height: 34px;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
}

.pz-act-accept:hover {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 5px 16px rgba(5, 150, 105, 0.4);
    transform: translateY(-1px);
}

.pz-act-accept:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}

/* Secondary actions row */
.pz-act-secondary-row {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.pz-act-edit,
.pz-act-delete {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 0.78rem;
}

.pz-act-edit {
    background: #f8fafc;
    color: #64748b;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06), inset 0 0 0 1px rgba(100, 116, 139, 0.15);
}

.pz-act-edit:hover {
    background: #eef2ff;
    color: #4f46e5;
    box-shadow: 0 3px 10px rgba(79, 70, 229, 0.15), inset 0 0 0 1px rgba(79, 70, 229, 0.3);
    transform: translateY(-1px);
}

.pz-act-edit:active {
    transform: translateY(0) scale(0.95);
}

.pz-act-delete {
    background: #f8fafc;
    color: #94a3b8;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06), inset 0 0 0 1px rgba(148, 163, 184, 0.2);
}

.pz-act-delete:hover {
    background: #fef2f2;
    color: #dc2626;
    box-shadow: 0 3px 10px rgba(220, 38, 38, 0.15), inset 0 0 0 1px rgba(220, 38, 38, 0.3);
    transform: translateY(-1px);
}

.pz-act-delete:active {
    transform: translateY(0) scale(0.95);
}

/* ===== Floating Action Buttons ===== */
.pz-floating-actions {
    position: fixed;
    bottom: 80px;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    /* Ponad modalami kroków (intake/odkładanie/ilość = z-index ~1060), żeby ręczne wpisanie
       kodu (ołówek) działało także wewnątrz tych okien — bez skanera. */
    z-index: 1075;
}

.btn-floating-pz {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #009244, #c1d11c);
    color: #fff;
    border: none;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 146, 68, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-floating-pz:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 146, 68, 0.45);
}

.pz-manual-entry-panel {
    display: flex;
    gap: 0.4rem;
    background: #fff;
    padding: 0.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    animation: pz-growIn 0.2s ease;
}

.pz-manual-entry-panel .form-control {
    min-width: 160px;
    border-radius: 8px;
}

@keyframes pz-growIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* ===== Bottom Action Bar ===== */
.pz-action-bar {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #e9ecef;
    padding: 0.75rem 1rem;
    display: flex;
    gap: 0.75rem;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
    z-index: 10;
}

.pz-action-btn {
    flex: 1;
    border-radius: 12px;
    padding: 0.65rem;
    font-weight: 600;
}

/* ===== Mobile Optimizations ===== */
@media (max-width: 576px) {
    .pz-scan-header-stats {
        gap: 0.5rem;
    }

    .pz-stat {
        padding: 0.3rem 0.5rem;
    }

    .pz-stat-value {
        font-size: 1.1rem;
    }

    .pz-item-card {
        padding: 0.5rem 0.75rem;
    }

    .pz-item-name {
        font-size: 0.85rem;
    }

    .pz-act-minus,
    .pz-act-plus {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .pz-act-accept {
        min-width: 66px;
        height: 30px;
        font-size: 0.95rem;
    }

    .pz-act-edit,
    .pz-act-delete {
        width: 30px;
        height: 30px;
    }
}
