/* ════════════════════════════════════════════════════════════════════════
   bo-ocr.css — "Importar factura por foto" (mirror of iOS InvoiceImportView).
   Photo → Tesseract.js OCR → parse lines → review/edit → add to inventory.
   This is the sanctioned stock-increase path (stock only grows via invoice/
   albarán, never from a Tienda order). Tokens only (DESIGN.md).
   ════════════════════════════════════════════════════════════════════════ */

/* Launch button injected at the top of the inventory sub-view */
.bo-ocr-launch {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px;
  font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  color: var(--crimson); padding: 11px 16px;
  background: rgba(var(--crimson-rgb), 0.12); border: 1px solid rgba(var(--crimson-rgb), 0.3);
  border-radius: 12px;
}
.bo-ocr-launch:hover { background: rgba(var(--crimson-rgb), 0.18); }

.bo-ocr-overlay { position: fixed; inset: 0; z-index: 1000; display: none; align-items: flex-start; justify-content: center; background: rgba(0,0,0,0.66); backdrop-filter: blur(4px); padding: 24px 16px; overflow-y: auto; }
.bo-ocr-overlay.open { display: flex; }
.bo-ocr-modal { width: 100%; max-width: 520px; margin: auto; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-lg, 24px); box-shadow: 0 25px 50px -12px rgba(0,0,0,0.7); overflow: hidden; }
.bo-ocr-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border-color); position: sticky; top: 0; background: var(--bg-secondary); z-index: 2; }
.bo-ocr-head h3 { font-size: 18px; font-weight: 800; }
.bo-ocr-head .x { background: none; border: none; color: var(--text-secondary); font-size: 18px; cursor: pointer; }
.bo-ocr-body { padding: 20px; display: grid; gap: 14px; }

.bo-ocr-pick { display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 700; color: #fff; background: var(--crimson); border-radius: 12px; padding: 13px; }
.bo-ocr-pick:hover { background: #b53333; }

.bo-ocr-preview { max-height: 180px; width: 100%; object-fit: contain; border-radius: 12px; border: 1px solid var(--border-color); display: none; }
.bo-ocr-preview.show { display: block; }

.bo-ocr-status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.bo-ocr-status .bar { flex: 1; height: 5px; border-radius: 3px; background: var(--bg-tertiary); overflow: hidden; }
.bo-ocr-status .bar span { display: block; height: 100%; background: var(--crimson); width: 0; transition: width 0.2s ease; }

.bo-ocr-suppliers { display: flex; gap: 6px; flex-wrap: wrap; }
.bo-ocr-suppliers label { cursor: pointer; }
.bo-ocr-suppliers input { position: absolute; opacity: 0; pointer-events: none; }
.bo-ocr-suppliers span { display: block; font-size: 12.5px; font-weight: 600; padding: 8px 13px; border-radius: 999px; background: var(--bg-tertiary); border: 1px solid var(--border-color); color: var(--text-secondary); }
.bo-ocr-suppliers input:checked + span { background: rgba(var(--crimson-rgb), 0.14); border-color: var(--crimson); color: var(--text-primary); }

.bo-ocr-detected { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.bo-ocr-item { background: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: 12px; padding: 12px; display: grid; gap: 8px; }
.bo-ocr-item.off { opacity: 0.5; }
.bo-ocr-item .r1 { display: flex; align-items: center; gap: 10px; }
.bo-ocr-item .tog { background: none; border: none; cursor: pointer; font-size: 20px; color: var(--accent); flex: 0 0 auto; }
.bo-ocr-item.off .tog { color: var(--text-muted); }
.bo-ocr-item .r2 { display: flex; gap: 8px; }
.bo-ocr-item input { font-family: inherit; font-size: 14px; color: var(--text-primary); background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 8px; padding: 9px 10px; outline: none; }
.bo-ocr-item input.name { flex: 1; }
.bo-ocr-item input.qty { width: 64px; }
.bo-ocr-item input.price { width: 90px; }
.bo-ocr-item input:focus { border-color: var(--crimson); }

.bo-ocr-add { width: 100%; font-family: inherit; font-size: 15px; font-weight: 800; cursor: pointer; color: #fff; background: var(--accent); border: none; border-radius: 12px; padding: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.bo-ocr-add:hover { background: #6b8e67; }
.bo-ocr-add:disabled { opacity: 0.5; cursor: default; }
