:root {
  --navy: #0f2a52; --navy2: #1f5fae; --red: #b4232a; --red-bg: #fdf0f0;
  --green: #1a7f4b; --green-bg: #eef8f2; --amber: #a15c00; --amber-bg: #fff6e6;
  --ink: #1d2433; --muted: #5b6577; --line: #d9dfe9; --bg: #f3f5f9; --card: #fff;
  --r: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Segoe UI", system-ui, Arial, sans-serif; font-size: 14px; color: var(--ink); background: var(--bg); line-height: 1.45; }
h1, h2, h3, h4 { color: var(--navy); margin: 0 0 10px; line-height: 1.25; }
h2 { font-size: 19px; } h3 { font-size: 16px; } h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; margin-top: 16px; }
p { margin: 6px 0; }
code { font-family: Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* topo */
.top { position: sticky; top: 0; z-index: 2000; display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--navy); color: #fff; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand b { display: block; font-size: 16px; }
.brand small { opacity: .75; font-size: 11.5px; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: #fff; position: relative; }
.logo::after { content: ""; position: absolute; inset: 7px; border-radius: 3px; background: repeating-linear-gradient(90deg, var(--navy) 0 3px, transparent 3px 5px); }
#nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; align-items: center; }
#nav button { background: transparent; color: #dfe7f5; border: 0; padding: 8px 12px; border-radius: 7px; font-size: 14px; cursor: pointer; position: relative; }
#nav button:hover { background: rgba(255,255,255,.08); }
#nav button.on { background: #fff; color: var(--navy); font-weight: 600; }
@media (max-width: 1000px) {
  .top { gap: 8px 12px; }
  .top > .ghost { margin-left: auto; }
  #nav { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; }
  #nav button { flex: none; }
  /* com o alerta de perdidos, os botões quebram linha e o alerta fica sozinho na linha de baixo */
  #nav:has(.alerta-perdidos) { flex-wrap: wrap; overflow: visible; min-width: 0; }
  #nav .alerta-perdidos { flex: 1 1 100%; width: auto; min-width: 0; margin-left: 0; }
}
.badge { background: var(--red); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 6px; margin-left: 4px; font-weight: 700; }
.demo-banner { background: var(--amber-bg); color: var(--amber); text-align: center; font-size: 12.5px; padding: 5px 12px; border-bottom: 1px solid #f0d9ad; }
main { max-width: 1280px; margin: 0 auto; padding: 20px; }

/* botões e campos */
button, .btn { font: inherit; border: 1px solid var(--navy); background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 7px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
button:hover { filter: brightness(1.12); }
button:disabled { opacity: .45; cursor: not-allowed; filter: none; }
button.ghost, .btn.ghost { background: transparent; color: var(--navy); }
.top button.ghost { color: #fff; border-color: rgba(255,255,255,.4); }
button.red { background: var(--red); border-color: var(--red); }
button.green { background: var(--green); border-color: var(--green); }
button.small { padding: 5px 10px; font-size: 12.5px; }
button.link { background: none; border: 0; color: var(--navy2); padding: 0; text-decoration: underline; }
input, select, textarea { font: inherit; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid #9cc0ef; border-color: var(--navy2); }
label.fld { display: block; }
label.fld > span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 14px; }
.form-sec { grid-column: 1 / -1; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--navy); border-bottom: 1px solid var(--line); padding: 12px 0 4px; }
.form-grid .wide { grid-column: 1 / -1; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline input { flex: 1; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btns-col { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.check input { width: auto; margin-top: 3px; }

/* layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid2.side { grid-template-columns: 320px 1fr; }
.grid2.phone { grid-template-columns: 1fr 400px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 960px) { .grid2, .grid2.side, .grid2.phone, .grid3 { grid-template-columns: 1fr; } }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 12px 0; }
.stat { background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.stat b { display: block; font-size: 22px; color: var(--navy); }
.stat span { font-size: 12px; color: var(--muted); }
.stat.red b { color: var(--red); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); border-bottom: 2px solid var(--line); padding: 7px 8px; }
td { border-bottom: 1px solid var(--line); padding: 7px 8px; vertical-align: top; }
tr.sub td:first-child { padding-left: 26px; color: var(--muted); }
tr.warn td { background: var(--red-bg); }
.table-wrap { overflow-x: auto; }

.pill { display: inline-block; font-size: 11.5px; font-weight: 700; border-radius: 20px; padding: 2px 9px; background: var(--bg); color: var(--muted); }
.pill.green { background: var(--green-bg); color: var(--green); }
.pill.red { background: var(--red-bg); color: var(--red); }
.pill.amber { background: var(--amber-bg); color: var(--amber); }
.pill.blue { background: #eaf1fb; color: var(--navy2); }

.stock-list { display: flex; flex-wrap: wrap; gap: 4px; max-height: 180px; overflow: auto; }
.stock-list code { background: var(--bg); padding: 2px 6px; border-radius: 4px; }
.offline { border: 1px dashed var(--line); border-radius: 8px; padding: 10px; margin-top: 8px; }
.offline.on { border-color: var(--amber); background: var(--amber-bg); }
.sw { display: flex; gap: 8px; align-items: center; font-weight: 600; cursor: pointer; }
.sw input { width: auto; }

/* início */
.hero { background: linear-gradient(120deg, var(--navy), var(--navy2)); color: #fff; border-radius: var(--r); padding: 28px; margin-bottom: 18px; }
.hero h1 { color: #fff; font-size: 26px; }
.hero p { opacity: .92; max-width: 760px; }
.part { cursor: pointer; transition: border-color .15s; }
.part:hover { border-color: var(--navy2); }
.part .n { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; padding: 9px 0 9px 38px; position: relative; border-bottom: 1px solid var(--line); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 8px; width: 26px; height: 26px; border-radius: 50%; background: var(--green-bg); color: var(--green); font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* telemóvel */
.phone-frame { width: 360px; max-width: 100%; margin: 0 auto; background: #11161f; border-radius: 34px; padding: 12px; box-shadow: 0 10px 30px rgba(15,42,82,.25); }
.phone-screen { background: #fff; border-radius: 24px; min-height: 640px; overflow: hidden; display: flex; flex-direction: column; }
.phone-bar { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); padding: 8px 18px 4px; }
.phone-url { margin: 0 12px 6px; font-size: 11px; background: var(--bg); border-radius: 14px; padding: 4px 10px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone-body { padding: 14px 16px 18px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.phone-empty { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--muted); padding: 30px; }

.pub-head { text-align: center; padding: 18px 12px; border-radius: 14px; }
.pub-head.red { background: var(--red); color: #fff; }
.pub-head.green { background: var(--green-bg); color: var(--green); }
.pub-head.grey { background: var(--bg); color: var(--muted); }
.pub-head b { display: block; font-size: 18px; letter-spacing: .3px; }
.pub-photo { width: 120px; height: 120px; border-radius: 12px; object-fit: cover; display: block; margin: 0 auto; }
.pub-fields { display: grid; gap: 6px; }
.pub-fields div { background: var(--bg); border-radius: 8px; padding: 7px 10px; }
.pub-fields small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.call-btn { font-size: 16px; padding: 12px; width: 100%; }
.pub-note { font-size: 11.5px; color: var(--muted); text-align: center; }
.lang { display: flex; justify-content: flex-end; gap: 4px; }
.lang button { padding: 2px 8px; font-size: 11px; }

.fam-top { display: flex; gap: 12px; align-items: center; }
.big-btn { font-size: 18px; font-weight: 800; padding: 18px; width: 100%; border-radius: 14px; letter-spacing: .4px; }
.alert-red { background: var(--red-bg); border: 1px solid #f1c2c4; color: var(--red); border-radius: 10px; padding: 10px 12px; }
.alert-green { background: var(--green-bg); border: 1px solid #bfe3cf; color: var(--green); border-radius: 10px; padding: 10px 12px; }
.list { display: flex; flex-direction: column; gap: 6px; }
.item { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.item.unread { border-left: 4px solid var(--red); background: #fffafa; }
.item.aviso { border-left: 4px solid var(--red); }

/* fotos */
.av { width: 54px; height: 54px; border-radius: 10px; object-fit: cover; flex: none; }
.av-lg { width: 110px; height: 110px; border-radius: 12px; object-fit: cover; flex: none; }
.av-ini { display: flex; align-items: center; justify-content: center; background: #dfe7f5; color: var(--navy); font-weight: 700; font-size: 18px; }
.av-lg.av-ini { font-size: 32px; }
.pub-photo.av-ini { font-size: 40px; }
.foto-box { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.btn-file { border: 1px solid var(--navy); color: var(--navy); padding: 8px 14px; border-radius: 7px; cursor: pointer; }
video.cam { width: 100%; border-radius: 8px; background: #000; }

/* polícia */
.pol-head { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.pol-head > * { flex: none; }
.pol-head form { flex: 1; min-width: 260px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs button { background: none; color: var(--muted); border: 0; border-bottom: 3px solid transparent; border-radius: 0; padding: 8px 12px; }
.tabs button.on { color: var(--navy); border-bottom-color: var(--navy); font-weight: 600; }
#mapa, .mapa { height: 460px; border-radius: 8px; border: 1px solid var(--line); background: #e6ebf2; }
.mapa.small { height: 300px; }
.lost { display: flex; gap: 10px; align-items: center; border: 1px solid #f1c2c4; background: #fffafa; border-radius: 10px; padding: 10px; }
.lost .grow { flex: 1; min-width: 0; }
.ficha { display: grid; grid-template-columns: 130px 1fr; gap: 16px; }
.kv { display: grid; grid-template-columns: 200px 1fr; gap: 4px 12px; font-size: 13px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; }
@media (max-width: 700px) { .ficha, .kv { grid-template-columns: 1fr; } }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(15,24,40,.5); z-index: 2100; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 12px; width: 520px; max-width: 100%; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { width: 920px; }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-h h3 { margin: 0; }
.modal-h .x { background: none; border: 0; color: var(--muted); font-size: 24px; padding: 0 4px; }
.modal-b { padding: 18px; display: flex; flex-direction: column; gap: 12px; }

/* folha de impressão */
.sheet { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.mini-band { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--navy2); border-radius: 6px; padding: 5px 8px; }
.mini-band svg { width: 64px; height: 64px; flex: none; }
.mini-band b { font-family: Consolas, monospace; font-size: 13px; color: var(--navy); display: block; }
.mini-band span { color: var(--red); font-weight: 800; font-size: 12px; }
.qr-box svg { width: 150px; height: 150px; display: block; }
.qr-off { font-size: 12px; color: var(--muted); border: 1px dashed var(--line); padding: 20px; text-align: center; }

/* folha de impressão dos QR */
.sheet-print { display: grid; gap: 4mm; }
.sheet-print.grande { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sheet-print.pulseira { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.etq { display: flex; align-items: center; gap: 3mm; border: 1px dashed #9aa5b8; border-radius: 2mm; padding: 3mm; break-inside: avoid; page-break-inside: avoid; min-width: 0; }
.grande .etq { flex-direction: column; text-align: center; }
.etq b, .etq span { white-space: nowrap; }
.etq svg { flex: none; display: block; }
.grande .etq svg { width: 40mm; height: 40mm; }
.pulseira .etq svg { width: 20mm; height: 20mm; }
.etq b { display: block; font-family: Consolas, monospace; color: var(--navy); letter-spacing: .5px; }
.grande .etq b { font-size: 14pt; }
.pulseira .etq b { font-size: 9pt; }
.etq span { display: block; color: var(--red); font-weight: 800; }
.grande .etq span { font-size: 12pt; }
.pulseira .etq span { font-size: 8pt; }
.etq small { display: block; color: var(--muted); font-size: 7.5pt; }
button.on-tam { background: #eaf1fb; }
@media print {
  @page { size: A4; margin: 10mm; }
  .modal-b { padding: 0; }
  .modal-h { display: none; }
}

/* pulseira de teste */
.test-band { display: flex; align-items: center; gap: 22px; border: 3px solid var(--navy2); border-radius: 14px; padding: 16px 22px; width: max-content; max-width: 100%; margin: 0 auto; }
.qr-big svg { width: 220px; height: 220px; display: block; }
.tnum { display: block; font-family: Consolas, monospace; font-size: 30px; letter-spacing: 2px; color: var(--navy); }
.tcall { display: block; color: var(--red); font-weight: 800; font-size: 22px; margin-top: 6px; }
.test-band small { display: block; color: var(--muted); margin-top: 6px; }
@media (max-width: 640px) { .test-band { flex-direction: column; } .tnum { font-size: 22px; } }

/* página pública aberta pelo QR (telemóvel) */
.publico .top, .publico .demo-banner { display: none; }
.publico main { padding: 14px; }
.pub-wrap { max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }

/* avisos */
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 2200; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.toast { background: var(--navy); color: #fff; padding: 11px 14px; border-radius: 9px; box-shadow: 0 6px 20px rgba(0,0,0,.2); font-size: 13.5px; transition: opacity .4s, transform .4s; }
.toast.erro { background: var(--red); }
.toast.ok { background: var(--green); }
.toast.out { opacity: 0; transform: translateY(8px); }

@media print {
  body { background: #fff; }
  body > *:not(.modal-bg) { display: none !important; }
  .modal-bg { position: static; background: none; padding: 0; }
  .modal { box-shadow: none; width: 100%; }
  .noprint, .modal-h .x { display: none !important; }
}

/* ---------- v2: Central, agente em passos, etiquetas com arte ---------- */
.alert-amber { background: var(--amber-bg); border: 1px solid #f0d9a8; color: var(--amber); border-radius: 10px; padding: 10px 12px; }
.cen-nota { flex: 1 1 260px !important; margin: 0; align-self: center; }
.tabs.scroll { overflow-x: auto; scrollbar-width: thin; }
.tabs.scroll button { white-space: nowrap; flex: none; }
.grid2.side-r { grid-template-columns: 1fr 340px; }
.grid2.gerar { grid-template-columns: minmax(0, 440px) minmax(0, 1fr); }
@media (max-width: 960px) { .grid2.side-r, .grid2.gerar { grid-template-columns: 1fr; } }
.stepper { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 16px; flex-wrap: wrap; }
.stepper li { flex: 1 1 140px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.stepper li span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--line); font-weight: 700; flex: none; }
.stepper li.agora { color: var(--navy); font-weight: 600; background: #eaf1fb; }
.stepper li.agora span { border-color: var(--navy); color: var(--navy); }
.stepper li.feito span { background: var(--green); border-color: var(--green); color: #fff; }
.previa { background: repeating-conic-gradient(#f2f4f8 0% 25%, #fff 0% 50%) 50% / 16px 16px; border: 1px solid var(--line); border-radius: 10px; padding: 18px; display: flex; justify-content: center; overflow-x: auto; margin-bottom: 8px; }

/* etiqueta: tudo em milímetros para sair do tamanho certo no papel ou na máquina */
.sheet2 { display: flex; flex-wrap: wrap; gap: 3mm; align-items: flex-start; }
.etq2 { --qr: 25mm; --k: 1; --cor: #0b3d91; --fundo: #fff; --txt: #111; --borda: #9aa5b8; --qrc: #000; box-sizing: border-box; background: var(--fundo); color: var(--txt); border: .3mm dashed var(--borda); border-radius: 2mm; display: flex; overflow: hidden; flex: none; break-inside: avoid; page-break-inside: avoid; font-family: var(--fonte, Arial, sans-serif); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.etq2 .e-corpo { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 1.5mm; gap: .6mm; }
.etq2 .e-topo { background: var(--cor); color: #fff; width: 100%; box-sizing: border-box; border-radius: 1mm; padding: .8mm 1mm; display: flex; align-items: center; justify-content: center; gap: 1mm; font-weight: 800; font-size: calc(2.3mm * var(--k)); line-height: 1.1; }
.etq2 .e-topo:empty { display: none; }
.etq2 .e-topo img { height: calc(3.6mm * var(--k)); width: auto; max-width: 40%; object-fit: contain; background: #fff; border-radius: .5mm; }
.etq2 .e-qr { width: var(--qr); height: var(--qr); flex: none; background: #fff; }
.etq2 .e-qr svg { width: 100%; height: 100%; display: block; }
.etq2 .e-qr svg path { fill: var(--qrc); }
.etq2 .e-txt { min-width: 0; max-width: 100%; }
.etq2 .e-txt b { display: block; font-family: Consolas, 'Courier New', monospace; font-size: calc(2.9mm * var(--k)); white-space: nowrap; color: var(--txt); }
.etq2 .e-txt span { display: block; color: var(--cor); font-weight: 800; font-size: calc(2.2mm * var(--k)); line-height: 1.15; white-space: nowrap; }
.etq2 .e-txt small { display: block; opacity: .75; font-size: calc(1.9mm * var(--k)); white-space: nowrap; }
.etq2.f-redondo { border-radius: 50%; }
.etq2.f-redondo .e-corpo { padding: 0 2mm; gap: .3mm; }
.etq2.f-redondo .e-topo { width: auto; max-width: 78%; background: none; color: var(--cor); padding: 0; font-size: calc(2mm * var(--k)); }
/* pulseiras e adesivo retangular: tudo numa linha */
.etq2.f-pulseira { border-radius: 1.5mm; }
.f-pulseira .e-corpo, .f-retangular .e-corpo { flex-direction: row; justify-content: flex-start; text-align: left; padding: 0 2.5mm; gap: 2.5mm; }
.f-pulseira .e-topo, .f-retangular .e-topo { width: auto; align-self: stretch; border-radius: 0; flex-direction: column; justify-content: center; padding: 0 2.5mm; max-width: 35%; text-align: center; }
.f-pulseira .e-topo img, .f-retangular .e-topo img { max-width: 100%; }
.etq2 .e-fecho { flex: none; align-self: stretch; border-left: .3mm dashed #c3cad6; display: flex; align-items: center; justify-content: center; background: repeating-linear-gradient(45deg, transparent 0 2mm, rgba(0, 0, 0, .05) 2mm 4mm); }
.etq2 .e-fecho span { font-size: 2mm; color: #8a93a3; writing-mode: vertical-rl; }
@media print { .sheet2 { gap: 2mm; } .etq2 .e-fecho { background: none; border: 0; } .etq2 .e-fecho span { display: none; } }
/* uma peça por página, para impressoras de pulseira e de etiquetas */
@media print {
  body.print-pagina .sheet2 { display: block; }
  body.print-pagina .etq2 { break-after: page; page-break-after: always; border-color: transparent; border-radius: 0; margin: 0; }
  body.print-pagina .modal, body.print-pagina .modal-b, body.print-pagina .modal-bg { padding: 0 !important; margin: 0 !important; border: 0 !important; width: auto !important; max-width: none !important; }
}
.avisos-arte:empty { display: none; }
.cores { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)) !important; }
.cores input[type=color] { height: 38px; padding: 2px; }
.modal .sheet2 { overflow-x: auto; padding-bottom: 2mm; }
@media print { .modal .sheet2 { overflow: visible; } }
@media (max-width: 960px) { .grid2.side > aside { order: 2; } }
.saidas { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.saida { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.saida p { margin: 0; flex: 1; }
.saida select { width: auto; }
.grid2 > *, .card { min-width: 0; }
.previa { max-width: 100%; }
/* entrada, conta e acessos */
.auth { max-width: 440px; margin: 40px auto; }
.auth .card { padding: 26px; }
.auth h2 { margin-top: 4px; }
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.auth-logo b { display: block; font-size: 18px; color: var(--navy); }
.auth-logo small { color: var(--muted); font-size: 12px; }
.auth-logo .logo { background-color: var(--navy); }
.barra-conta { display: flex; align-items: center; gap: 10px; margin-left: auto; text-align: right; line-height: 1.25; }
.barra-conta .sub { opacity: .75; font-size: 11.5px; }
.arv { margin-left: 14px; border-left: 1px solid var(--line); padding-left: 10px; }
.arv-raiz > .arv { margin-left: 0; border-left: 0; padding-left: 0; }
.arv summary { cursor: pointer; list-style-position: outside; }
.arv-l { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 5px 0; }
.pill.amber { background: var(--amber-bg); color: var(--amber); }
@media (max-width: 640px) { .barra-conta { order: 2; } .barra-conta .sub { display: none; } }

/* pessoas perdidas: quadrinho do alerta na barra do topo (foto 3x4, nome e descrição) */
.alerta-perdidos { display: flex; align-items: center; gap: 8px; background: var(--red); color: #fff; border: 2px solid #f6c344; border-radius: 8px; padding: 3px 10px 3px 3px; margin-left: 6px; width: 260px; max-width: 100%; cursor: pointer; }
.alerta-perdidos:hover, .alerta-perdidos:focus-visible { background: #c8303a; outline: 2px solid #fff; outline-offset: 1px; }
.ap-foto { width: 45px; height: 60px; flex: none; border-radius: 4px; overflow: hidden; background: rgba(255,255,255,.15); border: 2px solid #fff; }
.ap-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ap-foto .av-ini { width: 100%; height: 100%; font-size: 15px; }
.ap-pessoa { display: flex; flex-direction: column; gap: 1px; min-width: 0; line-height: 1.25; }
.ap-linha { font-size: 11px; }
.ap-tag { background: #fff; color: var(--red); font-weight: 800; font-size: 10.5px; padding: 0 5px; border-radius: 3px; letter-spacing: .6px; animation: piscar 1.4s ease-in-out infinite; }
@keyframes piscar { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .ap-tag { animation: none; } }
.ap-pessoa b, .ap-desc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-pessoa b { font-size: 13px; }
.ap-desc { font-size: 11px; color: #fde2e3; }

/* pessoas perdidas: página com todos os casos */
.per-head { margin-bottom: 12px; }
.per-lista { display: grid; gap: 16px; }
.per-cartao { display: grid; grid-template-columns: 260px 1fr; gap: 18px; border-left: 5px solid var(--red); }
.per-fotos { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-content: start; }
.per-fotos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; cursor: zoom-in; }
.per-fotos img:first-child:last-child { grid-column: 1 / -1; }
.per-info h3 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.per-relato { background: var(--red-bg); border: 1px solid #f1c2c4; border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.per-relato p { white-space: pre-line; margin: 4px 0 0; }
.foto-grande { display: block; max-width: 100%; max-height: 75vh; margin: 0 auto; border-radius: 10px; }

/* fotos escolhidas na queixa */
.fotos-q { display: flex; gap: 8px; flex-wrap: wrap; }
.fq { position: relative; width: 84px; height: 84px; }
.fq img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.fq-x { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 0; background: var(--red); color: #fff; font-size: 16px; line-height: 24px; cursor: pointer; }
.btn-file[hidden] { display: none; }

@media (max-width: 700px) {
  .alerta-perdidos { width: 100%; margin-left: 0; }
  .per-cartao { grid-template-columns: 1fr; }
}

/* app público de alertas (#alertas) */
.app-topo { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.app-topo b { display: block; font-size: 18px; color: var(--red); }
.app-topo small { color: var(--muted); font-size: 12px; }
.app-cartao { background: var(--card); border: 1px solid #f1c2c4; border-left: 5px solid var(--red); border-radius: var(--r); padding: 12px; margin: 12px 0; }
.app-cartao h3 { margin: 10px 0 6px; font-size: 18px; }
.app-cartao .kv { margin-bottom: 10px; }
.app-fotos { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; }
.app-fotos img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; display: block; }
.app-fotos .av-ini { aspect-ratio: 3 / 4; border-radius: 8px; font-size: 40px; max-width: 160px; }
.app-como { margin: 10px 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
.app-como summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.app-link { display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; border: 2px solid var(--red); color: var(--red); background: #fff; border-radius: 10px; font-weight: 600; }
.app-previa { max-width: 360px; }
.app-prov { margin-bottom: 10px; }
.app-prov.falta select { border: 2px solid var(--red); }
.app-secao { margin: 16px 0 0; font-size: 14px; color: var(--navy); text-transform: uppercase; letter-spacing: .03em; }
.app-partilha { display: flex; gap: 8px; margin-top: 8px; }
.app-partilha .partilha { flex: 1; text-align: center; padding: 10px 6px; border-radius: 10px; font-weight: 600; font-size: 14px; text-decoration: none; color: #fff; }
.app-partilha .wa { background: #1f9d55; }
.app-partilha .fb { background: #1f4fa3; }
.per-app { margin-top: 8px; align-items: center; }
