:root {
  --grafite: #222222;
  --amarelo: #e0de60;
  --papel: #f4f1ea;
  --branco: #ffffff;
  --linha: #d8d4c9;
  --suave: #5f5c55;
  --erro: #a8231a;
  --ok: #1f6b35;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Montserrat, "Segoe UI", system-ui, sans-serif; font-size: 15px; background: var(--papel); color: var(--grafite); }
a { color: var(--grafite); text-underline-offset: 3px; }
h1 { font-size: 1.45rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin-top: 0; }
.topo { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; align-items: center; padding: .7rem 1.2rem; background: var(--grafite); color: var(--branco); border-bottom: 4px solid var(--amarelo); }
.topo a { color: var(--branco); }
.marca { text-decoration: none; font-size: 1.15rem; }
.marca strong, .destaque { color: var(--amarelo); }
.folha .destaque { background: var(--grafite); padding: 0 .3rem; }
.topo-direita { display: flex; flex-wrap: wrap; gap: .9rem; align-items: center; }
.corpo { display: flex; min-height: calc(100vh - 62px); }
.menu { width: 200px; flex: none; padding: 1rem 0; background: var(--branco); border-right: 1px solid var(--linha); }
.menu a { display: block; padding: .65rem 1.2rem; text-decoration: none; }
.menu a:hover, .menu a:focus-visible { background: var(--amarelo); }
main { flex: 1; padding: 1.4rem; min-width: 0; }
.centro { max-width: 440px; margin: 8vh auto; }
.barra { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; }
.barra h1 { margin: 0; }
.barra { margin-bottom: 1rem; }
.folha { background: var(--branco); border: 1px solid var(--linha); border-radius: 8px; padding: 1.3rem; max-width: 720px; margin-bottom: 1rem; }
.estreita { max-width: 440px; }
.campo { margin-bottom: .9rem; display: flex; flex-direction: column; gap: .3rem; }
.campo label, .campo legend { font-weight: 600; }
.campo.marcar label { display: flex; gap: .5rem; align-items: center; }
fieldset { border: 1px solid var(--linha); border-radius: 6px; margin: 0; }
fieldset div div label { font-weight: 400; display: flex; gap: .5rem; align-items: center; padding: .25rem 0; }
input, select, textarea { font: inherit; padding: .55rem .65rem; border: 1px solid #aaa69b; border-radius: 6px; background: var(--branco); color: var(--grafite); max-width: 100%; }
input[type=checkbox] { width: 1.1rem; height: 1.1rem; }
textarea { min-height: 6rem; }
.com-erro input, .com-erro select, .com-erro textarea { border-color: var(--erro); }
.erro { color: var(--erro); font-size: .9rem; }
small { color: var(--suave); }
.botao { font: inherit; font-weight: 600; display: inline-block; padding: .55rem 1rem; border: 1px solid var(--grafite); border-radius: 6px; background: var(--grafite); color: var(--branco) !important; text-decoration: none; cursor: pointer; }
.botao.claro { background: var(--branco); color: var(--grafite) !important; }
.botao.pequeno { padding: .2rem .6rem; font-size: .85rem; }
.botao:hover { background: var(--amarelo); color: var(--grafite) !important; border-color: var(--grafite); }
.acoes { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .6rem; }
.em-linha { display: inline-flex; gap: .4rem; align-items: center; margin: 0; }
.filtros { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .6rem; }
.rolagem { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--branco); }
th, td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--linha); vertical-align: top; }
th { background: var(--amarelo); font-size: .85rem; }
.juntas { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; }
.etiqueta { display: inline-block; padding: .1rem .6rem; border-radius: 99px; border: 1px solid var(--linha); font-size: .85rem; }
.etiqueta.ok { border-color: var(--ok); color: var(--ok); }
.aviso { padding: .7rem 1rem; border-radius: 6px; background: var(--branco); border-left: 5px solid var(--ok); margin-bottom: 1rem; }
.aviso.error { border-left-color: var(--erro); color: var(--erro); }
.cartoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.cartao { background: var(--branco); border: 1px solid var(--linha); border-top: 5px solid var(--amarelo); border-radius: 8px; padding: 1rem; display: flex; flex-direction: column; }
.cartao strong { font-size: 2.2rem; }
.linha-tempo { list-style: none; padding: 0; }
.linha-tempo li { border-left: 3px solid var(--amarelo); padding: 0 0 1rem 1rem; }
.qr svg { width: 210px; height: 210px; background: var(--branco); }
.codigos { columns: 2; font-size: 1.1rem; }
code { word-break: break-all; }
.paginas { display: flex; gap: 1rem; }
[hidden] { display: none !important; }
.larga { max-width: 1000px; }
.secao { background: var(--branco); border: 1px solid var(--linha); border-radius: 8px; padding: .6rem 1.2rem 1rem; margin: 0 0 1rem; max-width: 1000px; }
.secao > legend { font-weight: 700; padding: 0 .4rem; background: var(--amarelo); border-radius: 4px; }
.grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 1rem; align-items: start; }
.linha-contato { border-bottom: 1px dashed var(--linha); margin-bottom: .6rem; }
.ficha { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .8rem 1rem; margin: 0; }
.ficha dt { font-size: .8rem; color: var(--suave); }
.ficha dd { margin: 0; overflow-wrap: anywhere; }
.publico { max-width: 1040px; margin: 0 auto; }
.publico input[readonly], input[readonly] { background: #ece9e0; width: 100%; }
a.etiqueta { text-decoration: none; }
tfoot td { font-weight: 700; }
.impressao { background: var(--branco); padding: 1.5rem; font-size: 12px; }
.impressao .so-tela { margin-bottom: 1.2rem; }
.impressao .ficha { margin-top: 1rem; }
.impressao h2 { border-bottom: 2px solid var(--amarelo); padding-bottom: .2rem; margin: 1.2rem 0 .6rem; }
.atalhos { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.atalhos a { background: var(--branco); border: 1px solid var(--linha); border-radius: 99px; padding: .3rem .8rem; text-decoration: none; }
.atalhos a:hover { background: var(--amarelo); }
.mapa { height: 340px; border: 1px solid var(--linha); border-radius: 6px; background: var(--branco) !important; z-index: 0; }
.mapa.grande { height: min(62vh, 620px); max-width: 1000px; }
.galeria { display: flex; flex-wrap: wrap; gap: 1rem; }
.galeria figure { margin: 0; max-width: 300px; }
.galeria img { width: 100%; max-height: 220px; object-fit: cover; border-radius: 6px; border: 1px solid var(--linha); }
.galeria figcaption { font-size: .85rem; color: var(--suave); }
.leitor { width: 100%; height: 70vh; border: 1px solid var(--linha); border-radius: 6px; }
.leitor-imagem, .croqui { max-width: 100%; border: 1px solid var(--linha); }
.parecer { border-top: 1px solid var(--linha); padding-top: .6rem; }
.texto { line-height: 1.55; }
.barra-editor { display: flex; flex-wrap: wrap; gap: .3rem; }
.editor { min-height: 260px; border: 1px solid #aaa69b; border-radius: 6px; padding: .8rem 1rem; background: var(--branco); }
details summary { cursor: pointer; font-weight: 600; padding: .4rem 0; }
.soltar { display: flex; flex-direction: column; align-items: center; gap: .4rem; text-align: center; border: 2px dashed #8d897d; border-radius: 8px; padding: 1.4rem; cursor: pointer; }
.soltar.sobre { background: var(--amarelo); border-color: var(--grafite); }
.fila-envio { list-style: none; padding: 0; margin: .6rem 0 0; }
.fila-envio li { display: grid; grid-template-columns: minmax(0, 1fr) 140px minmax(0, 1.4fr); gap: .6rem; align-items: center; padding: .3rem 0; border-bottom: 1px solid var(--linha); }
.fila-envio span { overflow-wrap: anywhere; }
.fila-envio progress { width: 100%; }
.fila-envio .ok em { color: var(--ok); }
.fila-envio .falha em { color: var(--erro); }
.leitor-texto { max-height: 70vh; overflow: auto; border: 1px solid var(--linha); border-radius: 6px; padding: .8rem 1rem; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.leitor-texto table { white-space: normal; }
.comentario { color: var(--suave); }
.folha form + h2, .cartoes + h2 { margin-top: 1.4rem; }
.barras .barra-linha { display: grid; grid-template-columns: 130px minmax(0, 1fr) 130px; gap: .6rem; align-items: center; padding: .25rem 0; }
.barra-linha i { display: block; height: 14px; min-width: 2px; background: var(--amarelo); border: 1px solid var(--grafite); border-radius: 3px; }
.progresso { width: 100%; height: 1.2rem; }
@media (max-width: 600px) {
  .fila-envio li { grid-template-columns: 1fr; }
  .barras .barra-linha { grid-template-columns: 100px minmax(0, 1fr) 80px; }
}
.area-mapa { display: flex; gap: .6rem; height: calc(100vh - 250px); min-height: 420px; background: var(--papel); }
.area-mapa:fullscreen { padding: .6rem; height: 100vh; }
.area-mapa.ampliado { position: fixed; inset: 0; z-index: 2000; height: 100vh; padding: .6rem; }
.mapa-web { flex: 1; min-width: 0; border: 1px solid var(--linha); border-radius: 6px; background: var(--branco) !important; z-index: 0; }
.resultados { list-style: none; margin: 0; padding: 0; width: 190px; flex: none; overflow-y: auto; }
.resultados button { font: inherit; font-size: .85rem; width: 100%; text-align: left; display: flex; gap: .4rem; align-items: center; padding: .45rem .5rem; border: 0; border-bottom: 1px solid var(--linha); background: var(--branco); cursor: pointer; }
.resultados button:hover, .resultados button:focus-visible { background: var(--amarelo); }
.resultados i, .legenda i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; background: var(--cor); flex: none; border: 1px solid #0003; }
.painel-lote { width: 320px; flex: none; overflow-y: auto; background: var(--branco); border: 1px solid var(--linha); border-radius: 6px; padding: .8rem 1rem; }
.painel-lote h2 { margin: .6rem 0; }
.painel-lote h3 { font-size: .95rem; border-bottom: 2px solid var(--amarelo); }
.painel-lote ul { padding-left: 1.1rem; }
.estreita-ficha { grid-template-columns: 1fr 1fr; }
.foto-painel { width: 100%; border-radius: 6px; }
.legenda { background: var(--branco); border: 1px solid var(--linha); border-radius: 6px; padding: .2rem .6rem; font-size: .78rem; max-height: 46vh; overflow-y: auto; }
.legenda div { display: flex; gap: .4rem; align-items: center; padding: .1rem 0; }
.legenda i.traco { height: 4px; }
.legenda i.contorno { background: transparent; border: 2px dashed var(--cor); }
.botao-mapa { width: 34px; height: 34px; font-size: 1.2rem; line-height: 1; background: var(--branco); border: 2px solid #0000004d; border-radius: 4px; cursor: pointer; }
@media (max-width: 900px) {
  .area-mapa { flex-direction: column; height: auto; }
  .mapa-web { height: 65vh; flex: none; }
  .resultados { width: 100%; max-height: 140px; order: 2; }
  .painel-lote { width: 100%; order: 3; }
}
@media print {
  .so-tela-bloco { height: 90vh; }
  .so-tela { display: none; }
  .impressao { padding: 0; }
  .ficha { grid-template-columns: repeat(3, 1fr); }
  h2 { break-after: avoid; }
  .ficha div { break-inside: avoid; }
  /* qualquer tela impressa ou salva em PDF sai sem menu, filtros e botões */
  .topo, .menu, .atalhos, .filtros, .paginas, .botao, .soltar, .aviso { display: none !important; }
  body { background: #fff; }
  .corpo { display: block; }
  main { padding: 0; }
  .folha { border: 0; padding: .4rem 0; max-width: none; }
  .rolagem, .leitor-texto { overflow: visible; max-height: none; }
  th { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
@media (max-width: 760px) {
  .corpo { flex-direction: column; }
  .menu { width: 100%; display: flex; overflow-x: auto; padding: 0; border-right: 0; border-bottom: 1px solid var(--linha); }
  .menu a { white-space: nowrap; }
  main { padding: 1rem; }
}
