/* HandyBarcodeScanner - Dolibarr integrated CSS */ /* General */ .hidden { display: none !important; } .scanner-wrapper { max-width: 800px; margin: 0 auto; } /* Mode Tabs */ .scanner-mode-tabs { display: flex; gap: 0; margin-bottom: 10px; border-bottom: 2px solid var(--colorborder, #ddd); } .scanner-tab { flex: 1; padding: 10px 15px; border: none; background: none; font-size: 14px; font-weight: 500; color: var(--colortexttitlenotab, #666); cursor: pointer; position: relative; transition: color 0.2s ease; } .scanner-tab:hover { color: var(--colortextlink, #333); } .scanner-tab.active { color: var(--butactionbg, #0077b3); font-weight: 600; } .scanner-tab.active::after { content: ''; position: absolute; bottom: -2px; left: 0; right: 0; height: 2px; background: var(--butactionbg, #0077b3); } /* Scanner Video Box */ .scanner-box { background: #333; border-radius: 8px; overflow: hidden; margin-bottom: 10px; } .scanner-video-box { position: relative; width: 100%; aspect-ratio: 16/9; max-height: 150px; background: #000; } #scanner-video { width: 100%; height: 100%; object-fit: cover; } .scan-region-highlight { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 70%; height: 60%; border: 3px solid var(--butactionbg, #0077b3); border-radius: 8px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5); pointer-events: none; } .scanner-video-box.scanning .scan-region-highlight { animation: pulse 1.5s ease-in-out infinite; } @keyframes pulse { 0%, 100% { border-color: var(--butactionbg, #0077b3); } 50% { border-color: #00b894; } } /* Scanner Controls */ .scanner-controls { padding: 8px; background: #444; } .scanner-controls .button { min-width: 150px; font-size: 16px; padding: 10px 25px; } /* Last Scan Info */ .scanner-last-scan { padding: 10px 15px; background: var(--colorbacklinepair1, #f8f8f8); border-radius: 6px; font-size: 14px; } .scanner-last-scan .badge { font-family: monospace; font-size: 14px; padding: 4px 10px; } /* Result Area */ .scanner-result { animation: slideUp 0.3s ease; } @keyframes slideUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } } /* Product Card */ .product-card { background: var(--colorbacklinepair1, #f8f8f8); border: 1px solid var(--colorborder, #ddd); border-radius: 8px; padding: 15px; margin-bottom: 15px; } .product-name { font-size: 18px; font-weight: 600; margin-bottom: 5px; color: var(--colortextlink, #333); } .product-ref { font-size: 13px; color: var(--colortexttitlenotab, #666); margin-bottom: 10px; } .product-stock { font-size: 14px; padding: 6px 12px; background: var(--colorbacktitle1, #e8e8e8); border-radius: 6px; display: inline-block; } /* Supplier Selection */ .supplier-list { margin: 15px 0; } .supplier-label { font-size: 14px; font-weight: 600; color: var(--colortexttitlenotab, #666); margin-bottom: 10px; display: block; } .supplier-option { display: flex; align-items: center; padding: 12px 15px; background: var(--colorbacklinepair1, #fff); border: 2px solid var(--colorborder, #ddd); border-radius: 8px; margin-bottom: 8px; cursor: pointer; transition: all 0.2s ease; } .supplier-option:hover { background: var(--colorbacklinepair2, #f5f5f5); } .supplier-option.selected { border-color: var(--butactionbg, #0077b3); background: rgba(0, 119, 179, 0.05); } .supplier-option:active { transform: scale(0.99); } .supplier-radio { width: 20px; height: 20px; border: 2px solid var(--colorborder, #999); border-radius: 50%; margin-right: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; } .supplier-option.selected .supplier-radio { border-color: var(--butactionbg, #0077b3); } .supplier-option.selected .supplier-radio::after { content: ''; width: 10px; height: 10px; background: var(--butactionbg, #0077b3); border-radius: 50%; } .supplier-info { flex: 1; } .supplier-name { font-size: 15px; font-weight: 500; } .supplier-ref { font-size: 12px; color: var(--colortexttitlenotab, #888); margin-top: 3px; } .supplier-price { font-size: 16px; font-weight: 700; color: var(--butactionbg, #0077b3); text-align: right; white-space: nowrap; } .cheapest-badge { background: #00b894; color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 3px; margin-left: 8px; text-transform: uppercase; } /* Quantity Input */ .quantity-section { margin: 20px 0; text-align: center; } .quantity-label { font-size: 14px; font-weight: 600; color: var(--colortexttitlenotab, #666); margin-bottom: 10px; display: block; } .quantity-controls { display: flex; align-items: center; justify-content: center; gap: 10px; } .qty-btn { width: 50px; height: 50px; border: 1px solid var(--colorborder, #ddd); border-radius: 8px; background: var(--colorbacklinepair1, #f8f8f8); color: var(--colortextlink, #333); font-size: 24px; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.15s ease; } .qty-btn:hover { background: var(--colorbacktitle1, #e8e8e8); } .qty-btn:active { transform: scale(0.95); } .qty-input { width: 80px; height: 50px; text-align: center; font-size: 20px; font-weight: 700; border: 1px solid var(--colorborder, #ddd); border-radius: 8px; background: var(--colorbacklinepair1, #f8f8f8); color: var(--colortextlink, #333); } .qty-input:focus { border-color: var(--butactionbg, #0077b3); outline: none; } /* Action Buttons */ .action-btn { width: 100%; padding: 14px; font-size: 16px; font-weight: 600; border: none; border-radius: 6px; cursor: pointer; transition: all 0.2s ease; margin-top: 15px; } .action-btn:active { transform: scale(0.98); } .btn-primary { background: var(--butactionbg, #0077b3); color: #fff; } .btn-primary:hover { opacity: 0.9; } .btn-secondary { background: var(--colorbacklinepair1, #f8f8f8); color: var(--colortextlink, #333); border: 1px solid var(--colorborder, #ddd); } .btn-danger { background: #dc3545; color: #fff; } /* Inventory Mode */ .stock-display { display: flex; justify-content: space-around; align-items: center; padding: 20px; background: var(--colorbacklinepair1, #f8f8f8); border: 1px solid var(--colorborder, #ddd); border-radius: 8px; margin-bottom: 15px; } .stock-item { text-align: center; } .stock-value { font-size: 28px; font-weight: 700; color: var(--butactionbg, #0077b3); } .stock-label { font-size: 12px; color: var(--colortexttitlenotab, #666); text-transform: uppercase; margin-top: 5px; } .stock-arrow { font-size: 24px; color: var(--colortexttitlenotab, #999); } /* Shop Mode Links */ .shop-links { margin-top: 15px; } .shop-link-btn { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: var(--colorbacktitle1, #3b3c3e) !important; border: 1px solid var(--colorborder, #2b2c2e) !important; border-radius: 8px; margin-bottom: 10px; text-decoration: none; color: var(--colortext, #ddd) !important; transition: all 0.2s ease; width: 100%; cursor: pointer; text-align: left; } .shop-link-btn:hover { background: var(--colorbackline, #444) !important; text-decoration: none; } .shop-link-btn:active { transform: scale(0.99); } .shop-link-name { font-size: 15px; font-weight: 600; flex: 1; } .shop-link-ref { font-size: 12px; color: var(--colortextmuted, #999); margin: 0 15px; } .shop-link-arrow { font-size: 18px; color: var(--butactionbg, #ad8c4f); } /* Confirmation Dialog */ .confirm-dialog { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.6); display: flex; align-items: center; justify-content: center; z-index: 10000; padding: 20px; } .confirm-content { background: #fff; border-radius: 12px; padding: 25px; width: 100%; max-width: 350px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,0.3); } .confirm-title { font-size: 18px; font-weight: 600; margin-bottom: 10px; } .confirm-message { font-size: 14px; color: #666; margin-bottom: 20px; } .confirm-buttons { display: flex; gap: 10px; } .confirm-buttons .action-btn { flex: 1; margin-top: 0; padding: 12px; font-size: 14px; } /* Toast Notifications - use Dolibarr's setEventMessages style */ .scanner-toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); padding: 12px 24px; border-radius: 6px; font-size: 14px; font-weight: 500; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); z-index: 10001; animation: toastIn 0.3s ease; } .scanner-toast.success { background: #00b894; color: #fff; } .scanner-toast.error { background: #dc3545; color: #fff; } @keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(15px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } } /* Error State */ .error-message { text-align: center; padding: 30px 20px; color: #dc3545; } .error-icon { font-size: 40px; margin-bottom: 15px; } .error-text { font-size: 15px; } /* No Supplier State */ .no-supplier { text-align: center; padding: 15px; background: #fff3cd; border: 1px solid #ffc107; border-radius: 8px; color: #856404; margin-bottom: 15px; } /* Mobile Optimizations */ @media (max-width: 768px) { .scanner-wrapper { padding: 0 10px; } .scanner-video-box { max-height: 250px; } .qty-btn { width: 60px; height: 60px; font-size: 28px; } .qty-input { width: 100px; height: 60px; font-size: 24px; } .action-btn { padding: 16px; font-size: 17px; } .supplier-option { padding: 15px; } .stock-value { font-size: 32px; } } /* Touch optimizations */ @media (pointer: coarse) { .qty-btn, .supplier-option, .action-btn, .shop-link-btn { min-height: 48px; } }