﻿:root{font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#111827;background:#f3f4f6}*{box-sizing:border-box}body{margin:0;min-height:100vh}.topbar{position:sticky;top:0;z-index:10;background:#111827;color:#fff;display:flex;justify-content:space-between;align-items:center;padding:14px max(16px,calc((100vw - 1180px)/2));box-shadow:0 2px 12px #0002}.brand{color:#fff;text-decoration:none;font-weight:800;font-size:1.05rem}.topbar nav{display:flex;gap:14px;align-items:center;flex-wrap:wrap}.topbar nav a,.link-button{color:#e5e7eb;text-decoration:none;background:none;border:0;padding:0;font:inherit;cursor:pointer}.topbar nav a:hover,.link-button:hover{color:#fff}.user{color:#93c5fd}.inline-form{display:inline}.container{max-width:1180px;margin:auto;padding:22px 16px 48px}.card{background:#fff;border:1px solid #e5e7eb;border-radius:18px;padding:20px;box-shadow:0 8px 30px #1118270d}h1,h2{margin:.1em 0 .25em}p{line-height:1.45}.muted{color:#6b7280}.alert{padding:12px 14px;border-radius:12px;margin-bottom:16px}.success{background:#ecfdf5;color:#065f46;border:1px solid #a7f3d0}.validation{color:#b91c1c;font-size:.9rem;display:block;margin-top:4px}label{display:block;font-weight:700;margin:14px 0 6px}input{width:100%;font:inherit;border:1px solid #d1d5db;border-radius:12px;padding:12px 13px;background:#fff}input:focus{outline:3px solid #bfdbfe;border-color:#2563eb}.btn{display:inline-flex;justify-content:center;align-items:center;border:0;border-radius:12px;padding:11px 16px;font-weight:800;text-decoration:none;cursor:pointer;font-size:.95rem}.btn:disabled{opacity:.5;cursor:not-allowed}.primary{background:#2563eb;color:#fff}.success.btn{background:#059669;color:#fff;border:0}.secondary{background:#e5e7eb;color:#111827}.wide{width:100%;margin-top:16px}.auth-card{max-width:460px;margin:7vh auto}.scan-grid{display:grid;grid-template-columns:1.15fr .85fr;gap:18px}.step-title{display:flex;gap:12px;align-items:flex-start;margin-bottom:14px}.step-title>span{width:34px;height:34px;display:grid;place-items:center;background:#111827;color:#fff;border-radius:50%;font-weight:800;flex:none}.step-title p{margin:0;color:#6b7280}.reader{overflow:hidden;border-radius:14px;background:#111827;min-height:260px}.scanner-status{margin:12px 0;color:#4b5563}.button-row{display:flex;gap:10px}.photo-preview{width:100%;max-height:420px;object-fit:contain;border-radius:14px;border:1px solid #e5e7eb;margin-top:12px;background:#f9fafb}.page-header{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px}.filters{display:grid;grid-template-columns:2fr 1.2fr 1fr 1fr auto;gap:12px;align-items:end;margin-bottom:16px}.filters label{margin-top:0}.filter-actions{display:flex;gap:8px}.table-wrap{padding:0;overflow:auto}table{width:100%;border-collapse:collapse;min-width:800px}th,td{padding:12px 14px;border-bottom:1px solid #e5e7eb;text-align:left;vertical-align:middle}th{background:#f9fafb;font-size:.85rem;text-transform:uppercase;letter-spacing:.04em;color:#4b5563}.thumb{width:76px;height:64px;object-fit:cover;border-radius:9px;background:#e5e7eb}.empty{text-align:center;color:#6b7280;padding:32px}.pager{display:flex;justify-content:center;align-items:center;gap:12px;margin-top:18px}@media(max-width:820px){.scan-grid{grid-template-columns:1fr}.filters{grid-template-columns:1fr 1fr}.filter-actions{grid-column:1/-1}.topbar{align-items:flex-start}.topbar nav{justify-content:flex-end;font-size:.9rem}.user{display:none}}@media(max-width:520px){.filters{grid-template-columns:1fr}.filter-actions{grid-column:auto}.container{padding:14px 10px 36px}.card{padding:16px;border-radius:14px}.topbar{padding:12px}.topbar nav{gap:10px}.brand{font-size:.95rem}.reader{min-height:230px}.page-header{align-items:flex-start;flex-direction:column}}
.checkbox-row{display:flex;align-items:center;gap:9px;margin-top:16px}.checkbox-row input{width:auto}.checkbox-row span{font-weight:700}

/* Captura móvil de tracking + foto */
.scan-card,.photo-card{min-width:0}.camera-stage{position:relative;width:100%;overflow:hidden;border-radius:16px;background:#111827}.barcode-camera-stage{min-height:260px}.reader{width:100%;min-height:260px}.reader video{width:100%!important;height:auto!important;object-fit:cover}.photo-camera-stage{aspect-ratio:4/3;display:grid;place-items:center}.photo-video,.photo-preview{width:100%;height:100%;object-fit:cover;border:0;border-radius:0;margin:0;background:#111827}.photo-preview{max-height:none}.photo-placeholder{position:absolute;inset:0;display:grid;place-items:center;padding:24px;text-align:center;color:#e5e7eb;background:#111827}.photo-locked{display:flex;flex-direction:column;gap:5px;margin-top:16px;padding:18px;border:1px dashed #cbd5e1;border-radius:14px;background:#f8fafc;color:#475569}.photo-locked strong{color:#111827}.photo-capture-area{margin-top:16px}.photo-actions{margin-top:12px}.native-camera-fallback{margin-top:12px;padding-top:12px;border-top:1px solid #e5e7eb}.native-file-input{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.native-photo-button{margin-top:0}.native-help{display:block;margin-top:7px;font-size:.86rem}.save-photo-button{min-height:52px;font-size:1rem}.btn{min-height:44px}.photo-card input[readonly]{background:#f8fafc;font-weight:700}.photo-card .scanner-status{min-height:24px}.mobile-stack{flex-wrap:wrap}.mobile-stack>.btn{flex:1 1 190px}

@media(max-width:820px){.scan-grid{grid-template-columns:minmax(0,1fr);max-width:720px;margin:0 auto}.barcode-camera-stage,.reader{min-height:220px}.photo-camera-stage{aspect-ratio:3/4;max-height:72vh}.photo-video,.photo-preview{object-fit:cover}.card{width:100%}}
@media(max-width:520px){.container{padding-left:10px;padding-right:10px}.scan-grid{gap:12px}.step-title{gap:10px}.step-title>span{width:32px;height:32px}.step-title h1,.step-title h2{font-size:1.25rem}.step-title p{font-size:.92rem}.mobile-stack{display:grid;grid-template-columns:1fr;gap:10px}.mobile-stack>.btn{width:100%;min-height:52px;font-size:1rem}.barcode-camera-stage,.reader{min-height:210px}.photo-camera-stage{aspect-ratio:3/4;max-height:68vh}.scanner-status{font-size:.92rem}.native-camera-fallback{margin-top:10px}.save-photo-button{min-height:56px;font-size:1.05rem}.photo-locked{padding:14px}.card{padding:14px;border-radius:14px}}

/* Flujo automatico: escaneo -> camara de foto -> Guardar */
.auto-scan-shell{width:100%;max-width:760px;margin:0 auto}.auto-scan-card{min-width:0}.auto-step-title{margin-bottom:16px}.barcode-camera-stage{position:relative}.scan-guide{pointer-events:none;position:absolute;left:8%;right:8%;top:50%;height:34%;transform:translateY(-50%);border:2px solid rgba(255,255,255,.9);border-radius:14px;box-shadow:0 0 0 999px rgba(0,0,0,.12)}.tracking-readout{display:flex;flex-direction:column;gap:4px;padding:13px 15px;margin-bottom:14px;border:1px solid #d1d5db;border-radius:14px;background:#f8fafc}.tracking-readout span{font-size:.82rem;color:#64748b;font-weight:700;text-transform:uppercase;letter-spacing:.04em}.tracking-readout strong{font-size:1.15rem;overflow-wrap:anywhere}.auto-scan-card .photo-camera-stage{margin-top:0}.auto-scan-card .photo-video{display:block}.auto-scan-card .scanner-status{min-height:24px}.auto-scan-card .save-photo-button{margin-top:14px;min-height:58px;font-size:1.08rem}.auto-scan-card .save-photo-button:disabled{opacity:.45}.auto-scan-card [hidden]{display:none!important}
@media(max-width:520px){.auto-scan-shell{max-width:none}.auto-scan-card{padding:12px}.auto-scan-card .barcode-camera-stage,.auto-scan-card .reader{min-height:64vw;max-height:52vh}.auto-scan-card .photo-camera-stage{aspect-ratio:3/4;max-height:66vh}.auto-scan-card .save-photo-button{position:sticky;bottom:8px;z-index:3;min-height:60px;border-radius:14px}.tracking-readout strong{font-size:1.05rem}}

/* Lector de códigos lineales de tracking: área amplia para Code 128 / GS1-128. */
.auto-scan-card .barcode-camera-stage{min-height:300px;background:#080b12}
.auto-scan-card .reader{min-height:300px}
.auto-scan-card .reader video{min-height:300px;object-fit:cover}
.auto-scan-card .scan-guide{left:2.5%;right:2.5%;top:50%;height:56%;border-radius:16px;border-width:3px;box-shadow:0 0 0 999px rgba(0,0,0,.08)}
.auto-scan-card .scan-guide>span{position:absolute;left:4%;right:4%;top:50%;height:2px;transform:translateY(-50%);background:rgba(255,255,255,.9);box-shadow:0 0 8px rgba(0,0,0,.45)}
.barcode-scan-tip{display:flex;flex-direction:column;gap:3px;margin-top:12px;padding:12px 14px;border:1px solid #dbe3ec;border-radius:13px;background:#f8fafc}
.barcode-scan-tip strong{font-size:.95rem;color:#111827}
.barcode-scan-tip span{font-size:.88rem;color:#64748b;line-height:1.35}
@media(max-width:520px){.auto-scan-card .barcode-camera-stage,.auto-scan-card .reader,.auto-scan-card .reader video{min-height:72vw;max-height:58vh}.auto-scan-card .scan-guide{height:58%;left:2%;right:2%}.barcode-scan-tip{padding:11px 12px}.barcode-scan-tip strong{font-size:.92rem}.barcode-scan-tip span{font-size:.84rem}}

/* El lector se renderiza internamente a 1280 px y se reduce visualmente al ancho del teléfono. */
.auto-scan-card .barcode-camera-stage{min-height:0;aspect-ratio:auto}
.auto-scan-card .reader.reader-hires-surface{position:absolute;left:0;top:0;width:1280px;min-height:960px;margin:0;border-radius:0;overflow:hidden;will-change:transform}
.auto-scan-card .reader.reader-hires-surface video{width:100%!important;max-width:none!important;height:auto!important;min-height:0!important;object-fit:cover}
@media(max-width:520px){.auto-scan-card .barcode-camera-stage{min-height:0;max-height:none}.auto-scan-card .reader.reader-hires-surface{min-height:960px}}
