/* MX PROD — leitor de QR, ações rápidas, código QR na ficha, etiquetas e página pública "Encontrou este equipamento?" (qr.js) */
html.qrs-open, html.qrs-open body { overflow: hidden; }
.qrs { position: fixed; inset: 0; z-index: 300; background: #000; color: #fff; font-family: var(--font); -webkit-tap-highlight-color: transparent; animation: qrsIn .2s ease both; touch-action: manipulation; }
.qrs.out { opacity: 0; transition: opacity .2s; }
@keyframes qrsIn { from { opacity: 0; } }
.qrs .hidden { display: none !important; }
.qrs video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.qrs-aim { position: absolute; left: 50%; top: 44%; width: min(68vw, 52vh, 300px); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 22px; box-shadow: 0 0 0 200vmax rgba(0,0,0,.42); pointer-events: none; }
.qrs-aim i { position: absolute; width: 34px; height: 34px; border: 4px solid #fff; border-radius: 4px; }
.qrs-aim i:nth-child(1) { left: -2px; top: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 20px; }
.qrs-aim i:nth-child(2) { right: -2px; top: -2px; border-left: 0; border-bottom: 0; border-top-right-radius: 20px; }
.qrs-aim i:nth-child(3) { left: -2px; bottom: -2px; border-right: 0; border-top: 0; border-bottom-left-radius: 20px; }
.qrs-aim i:nth-child(4) { right: -2px; bottom: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 20px; }
.qrs-aim b { position: absolute; left: 8%; right: 8%; height: 2px; top: 50%; background: linear-gradient(90deg, transparent, #E2552B, transparent); border-radius: 2px; animation: qrsLine 2.2s ease-in-out infinite; opacity: .9; }
@keyframes qrsLine { 0%, 100% { transform: translateY(-120px); } 50% { transform: translateY(120px); } }
@media (prefers-reduced-motion: reduce) { .qrs-aim b { animation: none; } }
.qrs.fault .qrs-aim i { border-color: #ff6b57; } .qrs.fault .qrs-aim b { background: linear-gradient(90deg, transparent, #ff3b30, transparent); }
.qrs.nocam .qrs-aim { display: none; }
.qrs-top { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top) + 12px) 14px 12px; background: linear-gradient(rgba(0,0,0,.55), transparent); }
.qrs-ttl { flex: 1; min-width: 0; text-align: center; display: grid; } .qrs-ttl b { font-size: 16px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qrs-count { font-size: 13px; color: rgba(255,255,255,.8); font-variant-numeric: tabular-nums; }
.qrs-ib { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; background: rgba(30,30,30,.6); color: #fff; display: grid; place-items: center; cursor: pointer; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.qrs-ib svg { width: 22px; height: 22px; } .qrs-ib.on { background: #fff; color: #111; }
.qrs-hint { position: absolute; left: 50%; top: calc(44% + min(34vw, 26vh, 150px) + 18px); transform: translateX(-50%); padding: 8px 14px; border-radius: 999px; background: rgba(20,20,20,.65); font-size: 14px; font-weight: 600; white-space: nowrap; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.qrs-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 14px calc(env(safe-area-inset-bottom) + 14px); display: grid; gap: 10px; background: linear-gradient(transparent, rgba(0,0,0,.6) 35%); }
.qrs-tools { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.qrs-tb, .qrs-fault { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px; border-radius: 999px; border: 0; background: rgba(40,40,40,.72); color: #fff; font: 650 14px var(--font); cursor: pointer; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.qrs-tb svg { width: 19px; height: 19px; } .qrs-tb b { font-variant-numeric: tabular-nums; }
.qrs-fault input { position: absolute; opacity: 0; pointer-events: none; }
.qrs-fault span::before { content: ''; display: inline-block; width: 30px; height: 18px; border-radius: 999px; background: rgba(255,255,255,.3); margin-right: 8px; vertical-align: -4px; box-shadow: inset 0 0 0 2px transparent; transition: background .15s; background-image: radial-gradient(circle at 9px 9px, #fff 6px, transparent 6.5px); }
.qrs-fault input:checked + span::before { background-color: #ff3b30; background-image: radial-gradient(circle at 21px 9px, #fff 6px, transparent 6.5px); }
.qrs-fault input:focus-visible + span { outline: 2px solid #fff; outline-offset: 4px; }
.qrs-note { height: 44px; border-radius: 12px; border: 1px solid rgba(255,255,255,.25); background: rgba(20,20,20,.75); color: #fff; padding: 0 14px; font-size: 15px; }
.qrs-note::placeholder { color: rgba(255,255,255,.55); }
.qrs-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: #fff; color: #141414; box-shadow: 0 16px 44px rgba(0,0,0,.4); animation: qrsCard .22s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes qrsCard { from { transform: translateY(18px) scale(.97); opacity: 0; } }
.qrs-ci { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; background: #1f9d55; }
.qrs-ci svg { width: 20px; height: 20px; }
.qrs-card.bad .qrs-ci { background: #d93025; } .qrs-card.warn .qrs-ci { background: #E2552B; } .qrs-card.info .qrs-ci { background: #8a8a82; }
.qrs-ct { flex: 1; min-width: 0; display: grid; } .qrs-ct b { font-size: 15px; font-weight: 750; line-height: 1.25; } .qrs-ct span { font-size: 13px; color: #6b6b64; margin-top: 2px; }
.qrs-undo { height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid #e3e2dc; background: #f4f3ef; color: #141414; font: 700 14px var(--font); cursor: pointer; flex: none; }
.qrs-qty { display: flex; align-items: center; gap: 4px; flex: none; } .qrs-qty b { min-width: 26px; text-align: center; font-size: 17px; font-variant-numeric: tabular-nums; }
.qrs-qty button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid #e3e2dc; background: #f4f3ef; font: 700 20px var(--font); color: #141414; cursor: pointer; }
.qrs-panel { position: absolute; inset: 0; z-index: 2; display: grid; align-items: end; background: rgba(0,0,0,.55); padding: 14px 14px calc(env(safe-area-inset-bottom) + 14px); }
.qrs-man { background: #fff; color: #141414; border-radius: 22px; padding: 20px; display: grid; gap: 10px; max-width: 520px; width: 100%; margin: 0 auto; max-height: 80vh; overflow: auto; }
.qrs-man > b { font-size: 18px; } .qrs-man p { margin: 0; font-size: 14px; color: #55554f; line-height: 1.5; }
.qrs-man input { height: 52px; font: 700 22px ui-monospace, Menlo, Consolas, monospace; letter-spacing: .14em; text-transform: uppercase; text-align: center; }
.qrs-man input.err { border-color: #d93025; }
.qrs-man > div:last-child { display: flex; gap: 8px; justify-content: flex-end; } .qrs-man .btn { height: 44px; }
.qrs-done { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.qrs-done li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid #eeede8; font-size: 14px; }
.qrs-done li svg { width: 18px; height: 18px; color: #1f9d55; flex: none; margin-top: 2px; } .qrs-done li div { display: grid; } .qrs-done li span { color: #6b6b64; font-size: 13px; }
/* botão flutuante (telemóvel) */
.qr-fab { display: none; }
@media (max-width: 760px) {
  .qr-fab { display: inline-flex; align-items: center; gap: 8px; position: fixed; z-index: 25; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 76px); height: 54px; padding: 0 20px 0 16px; border: 0; border-radius: 999px; background: #E2552B; color: #fff; font: 800 15px var(--font); box-shadow: 0 12px 30px rgba(226,85,43,.42), 0 2px 6px rgba(0,0,0,.18); cursor: pointer; }
  .qr-fab svg { width: 24px; height: 24px; }
  .qr-fab:active { transform: scale(.96); }
  html.qrs-open .qr-fab, body:has(.modal-bg) .qr-fab { display: none; }
}
/* ações rápidas depois de ler */
.qa-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: -4px 0 14px; } .qa-head .mono { font-weight: 700; }
.qa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qa-b { display: grid; justify-items: start; gap: 2px; padding: 16px; min-height: 108px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); text-align: left; cursor: pointer; font: inherit; transition: transform .12s, border-color .12s; }
.qa-b svg { width: 26px; height: 26px; color: var(--accent); margin-bottom: 6px; } .qa-b b { font-size: 17px; } .qa-b span { font-size: 12.5px; color: var(--ink-3); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.qa-b:not(:disabled):active { transform: scale(.97); } .qa-b:not(:disabled):hover { border-color: var(--accent); }
.qa-b:disabled { opacity: .45; cursor: default; }
/* código QR na ficha */
.qr-card { display: flex; gap: 16px; align-items: center; }
.qr-img { width: 128px; flex: none; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #fff; } .qr-img svg { display: block; width: 100%; height: auto; }
.qr-info { min-width: 0; display: grid; gap: 6px; justify-items: start; } .qr-info h2 { margin: 0; } .qr-info p { margin: 0; }
.qr-code { font-size: 17px; font-weight: 750; letter-spacing: .12em; }
/* etiquetas: pré-visualização e lista */
.lbl-pick { display: grid; gap: 4px; max-height: 46vh; overflow: auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; }
.lbl-prev { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line-2, #d6d5cf); max-height: 46vh; overflow: auto; }
.lbl-more { align-self: center; font-weight: 700; color: var(--ink-3); padding: 0 8px; }
.lbl { box-sizing: border-box; background: #fff; color: #000; display: flex; align-items: center; gap: 2mm; padding: 1.5mm 2mm 1.5mm 1.5mm; overflow: hidden; font-family: Arial, Helvetica, sans-serif; border-radius: 1.5mm; box-shadow: 0 0 0 1px #d6d5cf; }
.lbl-qr { flex: none; } .lbl-qr svg { display: block; width: 100%; height: 100%; }
.lbl-t { min-width: 0; flex: 1; display: grid; gap: .6mm; line-height: 1.12; }
.lbl-t b { font-size: 9pt; font-weight: 800; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-transform: uppercase; }
.lbl-t b.sm { font-size: 7.6pt; }
.lbl-sn { font-size: 7pt; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbl-code { font: 800 8pt ui-monospace, Menlo, Consolas, monospace; letter-spacing: .08em; }
.lbl-co { font-size: 6.4pt; font-weight: 700; display: flex; align-items: center; gap: 1mm; white-space: nowrap; overflow: hidden; text-transform: uppercase; }
.lbl-co svg { width: 3.4mm; height: 3.4mm; flex: none; }
#lblprint { display: none; }
@media print {
  html.lbl-printing body > *:not(#lblprint) { display: none !important; }
  html.lbl-printing, html.lbl-printing body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  html.lbl-printing #lblprint { display: block !important; }
  #lblprint .lbl { box-shadow: none; border-radius: 0; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  #lblprint.roll .lbl { break-after: page; page-break-after: always; }
  #lblprint.roll .lbl:last-child { break-after: auto; page-break-after: auto; }
  #lblprint.sheet { width: 210mm; display: grid !important; grid-template-columns: repeat(3, 70mm); grid-auto-rows: 37mm; padding: .5mm 0; }
  #lblprint.sheet .lbl:nth-child(24n) { break-after: page; page-break-after: always; }
}
/* avisos de equipamento encontrado */
.found-card { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.found-card h2 { display: flex; align-items: center; gap: 8px; } .found-card h2 svg { width: 20px; height: 20px; color: var(--accent); }
/* página pública do QR */
.fnd { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 28px 18px calc(env(safe-area-inset-bottom) + 28px); background: radial-gradient(900px 600px at 50% 0%, #241812 0%, #0b0b0b 60%); color: #fff; font-family: var(--font); }
.fnd-box { width: 100%; max-width: 440px; display: grid; gap: 18px; justify-items: center; text-align: center; }
.fnd-sym { width: 92px; height: 92px; border-radius: 26px; background: #121212; border: 1px solid #2a2a2a; display: grid; place-items: center; box-shadow: 0 20px 60px rgba(226,85,43,.18); }
.fnd-sym svg { width: 60px; height: auto; }
.fnd h1 { margin: 0; font-size: 22px; font-weight: 800; }
.fnd-form { width: 100%; text-align: left; background: #151515; border: 1px solid #262626; border-radius: 20px; padding: 20px; display: grid; gap: 6px; }
.fnd-form h2 { margin: 0; font-size: 18px; } .fnd-form > p { margin: 0 0 8px; color: #a8a8a0; font-size: 14px; line-height: 1.5; }
.fnd-form a { color: #ff8a65; }
.fnd-form form { display: grid; gap: 12px; }
.fnd-form .field span { color: #c9c9c2; }
.fnd-form input, .fnd-form textarea { background: #0e0e0e; border-color: #2e2e2e; color: #fff; font-size: 16px; }
.fnd-form textarea { height: auto; padding: 10px 12px; resize: vertical; }
.fnd-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fnd-loc { height: 46px; justify-content: flex-start; gap: 10px; background: #1d1d1d; border-color: #333; color: #fff; }
.fnd-loc svg { width: 20px; height: 20px; color: #E2552B; flex: none; } .fnd-loc.on { border-color: #1f9d55; } .fnd-loc.on svg { color: #3ccf7a; }
.fnd-go { height: 52px; font-size: 16px; font-weight: 800; }
.fnd-ref { margin: 0; color: #6f6f68; font: 600 12px ui-monospace, Menlo, Consolas, monospace; letter-spacing: .1em; }
.lbl-co svg circle, .lbl-co svg .bdot { fill: #000 !important; } /* térmicas: só preto */

/* Formulário do material: interruptor "Imprimir etiqueta ao guardar" */
.qsw { display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 4px 0; -webkit-tap-highlight-color: transparent; }
.qsw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.qsw i { flex: none; width: 46px; height: 28px; border-radius: 99px; background: var(--line-2, #d6d5cf); position: relative; transition: background .2s; }
.qsw i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s cubic-bezier(.3,.7,.4,1); }
.qsw input:checked + i { background: var(--accent); }
.qsw input:checked + i::after { transform: translateX(18px); }
.qsw input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.qsw span { display: grid; gap: 2px; min-width: 0; }
.qsw small { color: var(--ink-3); font-size: 12.5px; line-height: 1.35; }

/* Folha "Material criado" */
.saved { display: grid; gap: 16px; }
.saved-top { display: flex; align-items: center; gap: 14px; }
.saved-top b { display: block; font-size: 17px; line-height: 1.25; }
.saved-top span:not(.saved-ok) { color: var(--ink-3); font-size: 13px; }
.saved-ok { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: #1f9d55; color: #fff; animation: savedPop .45s cubic-bezier(.3,1.5,.5,1) both; }
.saved-ok svg { width: 24px; height: 24px; }
@keyframes savedPop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.saved-prev { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--line-2, #d6d5cf); max-height: 40vh; overflow: auto; }
.saved-act { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.saved-act .btn { min-height: 50px; font-size: 15px; justify-content: center; }
.saved-act .btn svg { width: 18px; height: 18px; }
.saved-other { justify-self: center; background: none; border: 0; color: var(--ink-3); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; padding: 4px; }
@media (max-width: 640px) { .saved-act { grid-template-columns: 1fr; } .saved-act .btn[data-sp] { min-height: 56px; font-size: 16px; } }

/* Inventário: etiqueta QR por imprimir */
.lbl-due { display: inline-flex; align-items: center; gap: 4px; vertical-align: 2px; margin-left: 4px; padding: 2px 8px 2px 6px; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); font: inherit; font-size: 11.5px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.lbl-due svg { width: 13px; height: 13px; }
.lbl-due:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.saved-top .saved-sz { display: block; font-size: 12px; opacity: .8; }

/* Leitor de QR só em telemóveis e tablets (no computador não há câmara para ler etiquetas) */
@media (hover: hover) and (pointer: fine) { .qr-scan, .qr-fab { display: none !important; } }
/* frase para quem encontrar o equipamento (todas as etiquetas) */
.lbl-found { font-size: 6pt; font-weight: 600; line-height: 1.15; border-top: .25mm solid #000; padding-top: .5mm; margin-top: .2mm; }
