/* =========================================================
   Sistema de Assinatura de Pedidos — visual
   Cor do sistema neutra (azul). As cores das lojas aparecem
   só nos PDFs e na página do cliente (variável --cor).
   ========================================================= */
:root {
  --cor: #2f5bd3;
  --cor-escura: #2349b4;
  --cor-clara: #eef2fd;
  --texto: #111827;
  --texto-2: #374151;
  --suave: #6b7280;
  --borda: #e5e7eb;
  --borda-forte: #d1d5db;
  --fundo: #f5f6f8;
  --branco: #fff;
  --lateral: #111827;
  --lateral-texto: #9ca3af;
  --ok: #15803d;
  --ok-fundo: #ecfdf3;
  --alerta: #b45309;
  --alerta-fundo: #fffbeb;
  --erro: #b91c1c;
  --erro-fundo: #fef2f2;
  --info: #1d4ed8;
  --info-fundo: #eff6ff;
  --raio: 12px;
  --raio-p: 8px;
  --sombra: 0 1px 2px rgba(16, 24, 40, .05);
  --sombra-m: 0 4px 16px rgba(16, 24, 40, .08);
  --fonte: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--fonte);
  color: var(--texto);
  background: var(--fundo);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--cor); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; color: var(--texto); letter-spacing: -.01em; }
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.02rem; font-weight: 650; }
h3 { font-size: .92rem; font-weight: 650; }
p { margin: 0 0 .8em; }
.suave { color: var(--suave); }
.pequeno { font-size: .84rem; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .85em; word-break: break-all; }
.oculto { display: none !important; }
.centro { text-align: center; }
svg.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Estrutura: menu lateral + conteúdo ---------- */
body:has(#topo:not(.oculto)) { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.lateral {
  background: var(--lateral);
  color: var(--lateral-texto);
  display: flex; flex-direction: column;
  padding: 20px 14px 14px;
  position: sticky; top: 0; height: 100vh;
}
.lateral-marca { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; color: #fff; }
.lateral-marca .logo-app { width: 34px; height: 34px; border-radius: 9px; background: var(--cor); display: grid; place-items: center; flex: none; }
.lateral-marca .logo-app svg { width: 19px; height: 19px; stroke: #fff; }
.lateral-marca b { display: block; font-size: .98rem; line-height: 1.2; }
.lateral-marca small { color: var(--lateral-texto); font-size: .75rem; }
.lateral nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.lateral nav a {
  display: flex; align-items: center; gap: 11px;
  color: var(--lateral-texto); padding: 9px 11px; border-radius: 8px; font-weight: 500; text-decoration: none;
}
.lateral nav a:hover { background: rgba(255, 255, 255, .06); color: #e5e7eb; }
.lateral nav a.ativo { background: rgba(255, 255, 255, .1); color: #fff; }
.lateral nav a.destaque { background: var(--cor); color: #fff; margin: 0 0 12px; justify-content: center; font-weight: 600; }
.lateral nav a.destaque:hover { background: var(--cor-escura); }
.lateral nav .rotulo-nav { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #9ca3af; padding: 14px 11px 6px; }
.lateral-rodape { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid rgba(255, 255, 255, .08); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #374151; color: #fff; display: grid; place-items: center; font-weight: 600; font-size: .8rem; flex: none; }
.lateral-rodape .quem { flex: 1; min-width: 0; line-height: 1.25; }
.lateral-rodape .quem b { display: block; color: #fff; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lateral-rodape .quem small { font-size: .74rem; }
.botao-sair { background: none; border: 0; color: var(--lateral-texto); padding: 6px; min-height: 0; border-radius: 6px; cursor: pointer; }
.botao-sair:hover { background: rgba(255, 255, 255, .08); color: #fff; }

main { padding: 28px 36px 60px; min-width: 0; }
main > * { max-width: 1240px; margin-left: auto; margin-right: auto; }
.estreito { max-width: 440px; }

/* ---------- Tela de login ---------- */
.tela-login { min-height: 92vh; display: grid; place-items: center; }
.tela-login .cartao { width: min(420px, 100%); padding: 32px; box-shadow: var(--sombra-m); }
.tela-login .logo-app { width: 44px; height: 44px; border-radius: 12px; background: var(--cor); display: grid; place-items: center; margin-bottom: 18px; }
.tela-login .logo-app svg { stroke: #fff; width: 24px; height: 24px; }

/* ---------- Cabeçalho de página ---------- */
.cabecalho-pagina { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.cabecalho-pagina h1 { margin: 0; }
.subtitulo { color: var(--suave); margin-top: 4px; }
.titulo-linha { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.voltar { display: inline-flex; align-items: center; gap: 6px; color: var(--suave); font-size: .86rem; margin-bottom: 10px; }
.voltar svg { width: 16px; height: 16px; }

/* ---------- Cartões ---------- */
.cartao {
  background: var(--branco);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  padding: 20px 22px;
  box-shadow: var(--sombra);
  margin-bottom: 16px;
}
.cartao > h2:first-child, .cartao-cab h2 { margin-bottom: 4px; }
.cartao-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cartao .descricao { color: var(--suave); font-size: .86rem; margin: 0 0 16px; }
.cartao.sem-padding { padding: 0; overflow: hidden; }
.grade { display: grid; gap: 14px 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.linha-botoes { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Formulários ---------- */
label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 6px; color: var(--texto-2); }
input, select, textarea {
  width: 100%; font: inherit; font-size: .93rem;
  padding: 9px 12px; min-height: 40px;
  border: 1px solid var(--borda-forte); border-radius: var(--raio-p);
  background: var(--branco); color: var(--texto);
  transition: border-color .12s, box-shadow .12s;
}
input::placeholder, textarea::placeholder { color: #9ca3af; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cor); box-shadow: 0 0 0 3px var(--cor-clara); }
input[readonly] { background: #f9fafb; color: var(--texto-2); }
textarea { min-height: 84px; resize: vertical; }
.campo { margin-bottom: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .92rem; cursor: pointer; color: var(--texto); }
.check input { width: 18px; height: 18px; min-height: 0; margin-top: 2px; flex: none; accent-color: var(--cor); }

/* ---------- Botões ---------- */
button, .botao {
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; border-radius: var(--raio-p);
  padding: 8px 15px; min-height: 40px;
  background: var(--cor); color: #fff;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: background .12s, border-color .12s;
  white-space: nowrap;
}
button:hover, .botao:hover { background: var(--cor-escura); text-decoration: none; }
button svg, .botao svg { width: 17px; height: 17px; }
button:disabled { opacity: .5; cursor: not-allowed; }
.secundario { background: var(--branco); color: var(--texto-2); border-color: var(--borda-forte); box-shadow: var(--sombra); }
.secundario:hover { background: #f9fafb; color: var(--texto); }
.perigo { background: var(--branco); color: var(--erro); border-color: #fecaca; }
.perigo:hover { background: var(--erro-fundo); }
.whats { background: #16a34a; }
.whats:hover { background: #15803d; }
.grande { width: 100%; padding: 13px; font-size: 1rem; min-height: 50px; border-radius: 10px; }
.link-botao { background: none; color: var(--cor); padding: 2px 4px; min-height: 0; border: 0; font-weight: 600; box-shadow: none; }
.link-botao:hover { background: none; text-decoration: underline; }

/* ---------- Tabelas ---------- */
.rolagem { overflow-x: auto; }
.tabela { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabela th {
  text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600;
  color: var(--suave); padding: 10px 14px; background: #f9fafb; border-bottom: 1px solid var(--borda); white-space: nowrap;
}
.tabela td { padding: 13px 14px; border-bottom: 1px solid #f0f1f3; vertical-align: middle; }
.tabela tbody tr:last-child td { border-bottom: 0; }
.tabela tr.clicavel { cursor: pointer; }
.tabela tr.clicavel:hover td { background: #f9fafb; }
.tabela .principal { font-weight: 600; color: var(--texto); }
.tabela .sub { color: var(--suave); font-size: .8rem; }
.dir, .tabela .dir { text-align: right; }
.numero-pedido { font-variant-numeric: tabular-nums; color: var(--suave); font-weight: 600; }

/* ---------- Selos de status ---------- */
.selo { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 99px; font-size: .76rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.selo::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.selo.aguardando { background: #f3f4f6; color: #4b5563; border-color: #e5e7eb; }
.selo.visualizado { background: var(--alerta-fundo); color: var(--alerta); border-color: #fde68a; }
.selo.assinado { background: var(--ok-fundo); color: var(--ok); border-color: #bbf7d0; }
.selo.cancelado, .selo.expirado { background: var(--erro-fundo); color: var(--erro); border-color: #fecaca; }

/* ---------- Avisos ---------- */
.aviso { padding: 11px 14px; border-radius: var(--raio-p); margin-bottom: 14px; font-size: .9rem; border: 1px solid transparent; }
.aviso.erro { background: var(--erro-fundo); color: var(--erro); border-color: #fecaca; }
.aviso.ok { background: var(--ok-fundo); color: var(--ok); border-color: #bbf7d0; }
.aviso.info { background: var(--info-fundo); color: var(--info); border-color: #bfdbfe; }
.aviso.alerta { background: var(--alerta-fundo); color: var(--alerta); border-color: #fde68a; }

/* ---------- Lista de pedidos ---------- */
.contadores { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.contador {
  background: var(--branco); border: 1px solid var(--borda); border-radius: var(--raio); padding: 16px 18px;
  cursor: pointer; box-shadow: var(--sombra); display: flex; align-items: center; gap: 14px; transition: border-color .12s;
}
.contador:hover { border-color: var(--borda-forte); }
.contador.ativo { border-color: var(--cor); box-shadow: 0 0 0 3px var(--cor-clara); }
.contador .icone-contador { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.contador .icone-contador svg { width: 20px; height: 20px; }
.contador b { display: block; font-size: 1.45rem; line-height: 1.1; font-weight: 700; }
.contador span { color: var(--suave); font-size: .82rem; }
.ic-todos { background: #eef2ff; color: #4338ca; }
.ic-aguardando { background: #f3f4f6; color: #4b5563; }
.ic-visualizado { background: var(--alerta-fundo); color: var(--alerta); }
.ic-assinado { background: var(--ok-fundo); color: var(--ok); }
.barra-filtros { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px; border-bottom: 1px solid var(--borda); }
.barra-filtros .busca { position: relative; flex: 1; min-width: 220px; max-width: 380px; }
.barra-filtros .busca svg { position: absolute; left: 11px; top: 11px; width: 17px; height: 17px; color: #9ca3af; }
.barra-filtros .busca input { padding-left: 36px; }
.barra-filtros select { width: auto; min-width: 170px; }
.filtros { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filtros input { max-width: 340px; }
.filtros select { max-width: 240px; }
.vazio { padding: 48px 20px; text-align: center; color: var(--suave); }
.vazio svg { width: 40px; height: 40px; color: #d1d5db; margin-bottom: 8px; }

/* ---------- Formulário do pedido ---------- */
.itens-form { display: grid; gap: 10px; }
.item-linha {
  display: grid; grid-template-columns: 1fr 76px 66px 124px 112px 40px; gap: 10px; align-items: start;
  padding: 12px; border: 1px solid var(--borda); border-radius: 10px; background: #fcfcfd;
}
.item-linha .total-item { padding: 30px 0 0; text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.item-linha > button { min-height: 40px; padding: 0; margin-top: 23px; }
.resumo-totais { margin-left: auto; max-width: 340px; font-variant-numeric: tabular-nums; }
.resumo-totais div { display: flex; justify-content: space-between; padding: 5px 0; color: var(--texto-2); }
.resumo-totais .total { font-size: 1.2rem; font-weight: 700; color: var(--texto); border-top: 1px solid var(--borda); padding-top: 10px; margin-top: 6px; }
.rodape-form { display: flex; gap: 10px; justify-content: flex-end; align-items: center; padding: 16px 0 0; }

/* Escolha da loja */
.seletor-lojas { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.opcao-loja {
  display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--borda); border-radius: 10px;
  padding: 12px 14px; cursor: pointer; font-weight: 400; margin: 0; background: var(--branco); transition: border-color .12s;
}
.opcao-loja:hover { border-color: var(--borda-forte); }
.opcao-loja input { width: 17px; height: 17px; min-height: 0; accent-color: var(--cor); flex: none; }
.opcao-loja:has(input:checked) { border-color: var(--cor); background: var(--cor-clara); box-shadow: 0 0 0 3px var(--cor-clara); }
.opcao-loja img { width: 52px; height: 36px; object-fit: contain; flex: none; }
.opcao-loja b { color: var(--texto); }
.opcao-loja small { display: block; color: var(--suave); font-size: .74rem; word-break: break-all; font-weight: 400; }
.logo-vazio { width: 38px; height: 38px; border-radius: 9px; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex: none; }

/* Busca de produtos */
.autocompletar { position: relative; }
.sugestoes {
  position: absolute; left: 0; right: 0; top: 66px; z-index: 30;
  background: var(--branco); border: 1px solid var(--borda); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, .14); max-height: 340px; overflow-y: auto; padding: 4px;
}
.sugestao { display: flex; align-items: center; gap: 10px; padding: 7px 10px; cursor: pointer; font-size: .9rem; border-radius: 7px; }
.sugestao .nome { flex: 1; }
.sugestao small { color: var(--suave); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sugestao img, .sugestao .sem-foto { width: 40px; height: 40px; object-fit: contain; border-radius: 6px; background: #f3f4f6; flex: none; }
.sugestao:hover, .sugestao.ativa { background: var(--cor-clara); }
.sugestao.nova { color: var(--cor); font-weight: 600; border-top: 1px solid var(--borda); border-radius: 0 0 7px 7px; margin-top: 4px; padding: 11px 10px; }
.item-extra { display: flex; gap: 10px; align-items: center; margin-top: 8px; font-size: .79rem; color: var(--suave); line-height: 1.4; }
.item-extra:empty { display: none; }
.item-extra img { width: 46px; height: 46px; object-fit: contain; border-radius: 6px; background: #fff; border: 1px solid var(--borda); flex: none; }

/* ---------- Detalhe do pedido ---------- */
.progresso { display: flex; gap: 0; margin: -6px 0 20px; background: var(--branco); border: 1px solid var(--borda); border-radius: var(--raio); padding: 14px 18px; box-shadow: var(--sombra); }
.etapa { flex: 1; display: flex; align-items: center; gap: 9px; color: var(--suave); font-size: .86rem; font-weight: 500; position: relative; }
.etapa span { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--borda-forte); display: grid; place-items: center; font-size: .75rem; font-weight: 700; background: var(--branco); flex: none; }
.etapa::after { content: ""; flex: 1; height: 2px; background: var(--borda); margin: 0 10px; }
.etapa:last-child::after { display: none; }
.etapa.feita { color: var(--texto); }
.etapa.feita span { background: var(--ok); border-color: var(--ok); color: #fff; }
.etapa.feita::after { background: #86efac; }
.layout-detalhe { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.dados { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 0; }
.dados div { min-width: 0; }
.dados dt { font-size: .74rem; color: var(--suave); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; margin-bottom: 2px; }
.dados dd { margin: 0; color: var(--texto); word-break: break-word; }
.dados.duas { grid-template-columns: 1fr 1fr; }
.caixa-link { display: flex; gap: 8px; }
.caixa-link input { font-size: .85rem; font-family: ui-monospace, Consolas, monospace; }
.envio-acoes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.envio-acoes .botao, .envio-acoes button { width: 100%; }
.assinatura-grade { display: grid; grid-template-columns: 132px 1fr; gap: 18px; align-items: start; }
.assinatura-grade .selfie { width: 132px; height: 170px; object-fit: cover; border-radius: 10px; border: 1px solid var(--borda); background: #f3f4f6; }
.assinatura-grade .rubrica { max-width: 100%; max-height: 90px; display: block; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--borda-forte); }
.hash { margin-top: 14px; padding: 10px 12px; background: #f9fafb; border-radius: 8px; font-size: .78rem; color: var(--suave); }

/* Itens (detalhe e página do cliente) */
.item-cliente { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid #f0f1f3; }
.item-cliente:last-of-type { border-bottom: 0; }
.item-cliente .item-texto { flex: 1; min-width: 0; font-weight: 500; }
.item-cliente .qtd { color: var(--suave); font-size: .84rem; font-weight: 400; margin-top: 2px; }
.item-cliente b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.foto-item { width: 60px; height: 60px; object-fit: contain; border-radius: 10px; background: #fff; border: 1px solid var(--borda); flex: none; }
.detalhe-item { font-size: .79rem; color: var(--suave); margin-top: 3px; font-weight: 400; line-height: 1.4; }
.info-linha { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; font-size: .92rem; }
.info-linha span:first-child { color: var(--suave); }
.info-linha span:last-child { text-align: right; font-weight: 500; }

.linha-tempo { list-style: none; padding: 0; margin: 0; }
.linha-tempo li { padding: 0 0 14px 20px; border-left: 2px solid var(--borda); position: relative; font-size: .87rem; margin-left: 5px; }
.linha-tempo li:last-child { border-left-color: transparent; padding-bottom: 0; }
.linha-tempo li::before { content: ""; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--branco); border: 2px solid var(--cor); }
.linha-tempo time { display: block; color: var(--suave); font-size: .76rem; margin-top: 1px; }

/* Documentos do pedido (PDFs do sistema + anexos) */
.titulo-cartao { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.titulo-cartao h2 { margin-bottom: 4px; }
.docs-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin-bottom: 14px; }
.doc-item { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--borda); border-radius: 10px; background: var(--branco); min-width: 0; color: var(--texto); }
a.doc-item:hover { border-color: var(--borda-forte); background: #f9fafb; text-decoration: none; }
.doc-item.sistema { background: #f9fafb; }
.doc-item.sistema.destaque { background: var(--ok-fundo); border-color: #bbf7d0; }
.doc-miniatura { width: 58px; height: 58px; border-radius: 8px; border: 1px solid var(--borda); background: #f3f4f6; overflow: hidden; flex: none; display: grid; place-items: center; }
.doc-miniatura img { width: 100%; height: 100%; object-fit: cover; display: block; }
.doc-miniatura.pdf { background: #fef2f2; border-color: #fecaca; color: var(--erro); align-content: center; gap: 0; }
.doc-miniatura.pdf svg { width: 22px; height: 22px; }
.doc-miniatura.pdf span { font-size: .62rem; font-weight: 700; letter-spacing: .05em; }
.doc-item.destaque .doc-miniatura.pdf { background: #dcfce7; border-color: #86efac; color: var(--ok); }
.doc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; font-size: .8rem; color: var(--suave); }
.doc-info b, .doc-info .doc-nome { color: var(--texto); font-size: .86rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-tipo { color: var(--cor); font-weight: 600; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-acoes { display: flex; flex-direction: column; gap: 4px; }
.botao-icone { width: 32px; height: 32px; min-height: 0; padding: 0; border-radius: 7px; display: grid; place-items: center; background: transparent; border: 1px solid transparent; color: var(--suave); cursor: pointer; }
.botao-icone:hover { background: #f3f4f6; color: var(--texto); text-decoration: none; }
.botao-icone svg { width: 17px; height: 17px; }
.botao-icone.perigo-suave:hover { background: var(--erro-fundo); color: var(--erro); }
.anexar { display: grid; grid-template-columns: minmax(200px, 260px) 1fr; gap: 10px 14px; align-items: end; padding: 14px; border: 1.5px dashed var(--borda-forte); border-radius: 10px; background: #fafbfc; transition: background .12s, border-color .12s; }
.anexar.arrastando { border-color: var(--cor); background: var(--cor-clara); }
.anexar > p, .anexar > #msgAnexo { grid-column: 1 / -1; }
.anexar #msgAnexo .aviso { margin: 0; }
label.botao { margin: 0; }
input.invalido, select.invalido, textarea.invalido { border-color: var(--erro); box-shadow: 0 0 0 3px rgba(185, 28, 28, .12); }
.anexar.ocupado { opacity: .7; pointer-events: none; }
.maiusculas { text-transform: uppercase; }
.privacidade { margin: 14px 0 4px; font-size: .84rem; color: var(--suave); }
.privacidade summary { cursor: pointer; color: var(--texto-2); font-weight: 600; }
.privacidade p { margin: 8px 0 0; line-height: 1.5; }
tr.clicavel:focus-visible, .contador:focus-visible { outline: 2px solid var(--cor); outline-offset: -2px; }
@media (max-width: 600px) {
  .assinatura-grade { grid-template-columns: 1fr; }
  .assinatura-grade .selfie { width: 132px; }
  .assinatura-grade .dados.duas { grid-template-columns: 1fr; }
}
.tem-anexo { display: inline-flex; align-items: center; gap: 2px; vertical-align: middle; }
.tem-anexo svg { width: 13px; height: 13px; }
.so-celular { display: none !important; }
@media (pointer: coarse) { .so-celular { display: inline-flex !important; } }
@media (max-width: 600px) { .anexar { grid-template-columns: 1fr; } .anexar .linha-botoes .botao { flex: 1; } }

.evidencias { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.evidencias img { border: 1px solid var(--borda); border-radius: 8px; background: #fff; max-width: 100%; }

/* ---------- Produtos ---------- */
.mini-produto { width: 46px; height: 46px; object-fit: contain; border-radius: 8px; background: #fff; border: 1px solid var(--borda); display: block; }
.foto-produto img { width: 92px; height: 92px; object-fit: contain; border-radius: 10px; background: #fff; border: 1px solid var(--borda); }

/* ---------- Janela (dialog) ---------- */
.dialogo { border: 0; border-radius: 16px; padding: 26px; width: min(560px, calc(100vw - 24px)); box-shadow: 0 24px 64px rgba(16, 24, 40, .28); }
.dialogo::backdrop { background: rgba(17, 24, 39, .5); backdrop-filter: blur(2px); }
.dialogo h2 { font-size: 1.15rem; margin-bottom: 16px; }

.carregando { text-align: center; padding: 60px 0; color: var(--suave); }

/* ---------- Responsivo (painel) ---------- */
@media (max-width: 1100px) {
  .layout-detalhe { grid-template-columns: 1fr; }
  .contadores { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  body:has(#topo:not(.oculto)) { display: block; }
  .lateral { position: sticky; top: 0; z-index: 40; height: auto; flex-direction: row; align-items: center; padding: 8px 10px; gap: 6px; overflow-x: auto; }
  .lateral-marca { padding: 0 6px 0 0; }
  .lateral-marca div { display: none; }
  .lateral nav { flex-direction: row; flex: 1; justify-content: flex-end; }
  .lateral nav a { padding: 9px 11px; white-space: nowrap; }
  .lateral nav a span { display: none; }
  .tabela .opcional { display: none; }
  .tabela td, .tabela th { padding-left: 10px; padding-right: 10px; }
  .contador { padding: 12px; gap: 10px; }
  .contador .icone-contador { width: 34px; height: 34px; }
  .barra-filtros .busca { flex-basis: 100%; max-width: none; }
  .barra-filtros select { flex: 1; min-width: 0; }
  .lateral nav a.destaque { margin: 0; }
  .lateral nav .rotulo-nav, .lateral-rodape .quem { display: none; }
  .lateral-rodape { border: 0; padding: 0; }
  main { padding: 18px 14px 60px; }
  .item-linha { grid-template-columns: 1fr 1fr 1fr; }
  .item-linha .desc { grid-column: 1 / -1; }
  .envio-acoes { grid-template-columns: 1fr; }
  .caixa-link { flex-wrap: wrap; }
  .caixa-link input { flex: 1 1 100%; }
  .caixa-link > .botao, .caixa-link > button { flex: 1; }
  .progresso { overflow-x: auto; }
  .etapa { min-width: 120px; }
}

/* =========================================================
   Página do cliente (celular primeiro)
   ========================================================= */
.cliente-topo {
  background: var(--branco); border-bottom: 1px solid var(--borda);
  padding: 14px 18px; display: flex; align-items: center; justify-content: center; min-height: 66px;
  border-top: 4px solid var(--cor);
}
.cliente-topo .marca { font-size: 1.1rem; font-weight: 700; color: var(--texto); }
.cliente { max-width: 560px; margin: 0 auto; padding: 22px 16px 60px; }
.cliente h1 { font-size: 1.35rem; margin-bottom: 6px; }
.cliente .cartao { padding: 18px; }
.passos-rotulo { display: flex; justify-content: space-between; font-size: .78rem; color: var(--suave); margin-bottom: 6px; font-weight: 500; }
.passos { display: flex; gap: 5px; margin: 0 0 18px; }
.passos span { flex: 1; height: 4px; border-radius: 99px; background: #e5e7eb; }
.passos span.feito { background: var(--cor); }
.camera { position: relative; background: #0b0d12; border-radius: 16px; overflow: hidden; aspect-ratio: 3 / 4; max-height: 60vh; margin: 0 auto 14px; }
.camera video, .camera img { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera video { transform: scaleX(-1); }
.camera .guia { position: absolute; inset: 12% 18%; border: 3px dashed rgba(255, 255, 255, .65); border-radius: 50%; pointer-events: none; }
.quadro-assinatura { position: relative; border: 1.5px dashed var(--borda-forte); border-radius: 14px; background: var(--branco); touch-action: none; }
.quadro-assinatura canvas { display: block; width: 100%; height: 230px; cursor: crosshair; }
.quadro-assinatura .linha-base { position: absolute; left: 8%; right: 8%; bottom: 52px; border-top: 1.5px solid #d1d5db; pointer-events: none; }
.quadro-assinatura .dica { position: absolute; left: 0; right: 0; bottom: 24px; text-align: center; color: #9ca3af; font-size: .85rem; pointer-events: none; }
.sucesso-icone { width: 76px; height: 76px; border-radius: 50%; background: var(--ok-fundo); color: var(--ok); display: grid; place-items: center; font-size: 38px; margin: 6px auto 14px; border: 6px solid #f0fdf4; }
.codigo-grande { font-family: ui-monospace, Consolas, monospace; font-size: 1.25rem; font-weight: 700; letter-spacing: .06em; background: var(--fundo); padding: 10px; border-radius: 8px; margin: 10px 0; }
.seguranca { display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--suave); font-size: .78rem; margin-top: 18px; text-align: center; }
.total-cliente { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; margin-top: 6px; border-top: 1px solid var(--borda); }
.total-cliente b { font-size: 1.35rem; font-variant-numeric: tabular-nums; }

/* =========================================================
   Scanner de documentos (tela cheia)
   ========================================================= */
dialog.scanner { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #0b0d12; color: #fff; display: flex; flex-direction: column; overflow: hidden; }
dialog.scanner::backdrop { background: #000; }
dialog.scanner:not([open]) { display: none; }
.sc-topo { display: flex; align-items: center; gap: 10px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); background: rgba(0, 0, 0, .55); z-index: 2; }
.sc-topo.claro { background: #111827; }
.sc-status { flex: 1; text-align: center; font-size: .9rem; font-weight: 600; color: #e5e7eb; }
.sc-status.ok { color: #86efac; }
.sc-status.alerta { color: #fcd34d; }
.sc-status.erro { color: #fca5a5; }
.sc-icone { width: 42px; height: 42px; min-height: 0; padding: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); border: 0; color: #fff; display: grid; place-items: center; }
.sc-icone:hover { background: rgba(255, 255, 255, .2); }
.sc-icone.ativo { background: #facc15; color: #111; }
.sc-icone svg, .sc-mini-btn svg, .sc-adicionar svg, .sc-ferramentas svg, .sc-barra svg, .sc-seta svg, .sc-contador svg, .sc-miniatura > svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sc-visor { position: relative; flex: 1; min-height: 0; background: #000; }
.sc-visor video, .sc-visor svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.sc-visor polygon { fill: rgba(47, 91, 211, .18); stroke: #60a5fa; stroke-width: 6; stroke-linejoin: round; vector-effect: non-scaling-stroke; transition: fill .2s, stroke .2s; }
.sc-visor svg.pronto polygon { fill: rgba(34, 197, 94, calc(.12 + var(--progresso, 0) * .25)); stroke: #22c55e; }
.sc-visor polygon { stroke-width: 4px; }
.sc-clarao { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.sc-clarao.ativo { animation: sc-clarao .35s ease-out; }
@keyframes sc-clarao { from { opacity: .85; } to { opacity: 0; } }
.sc-rodape { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 14px 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); background: rgba(0, 0, 0, .7); }
.sc-miniatura { width: 54px; height: 54px; min-height: 0; padding: 0; border-radius: 8px; border: 2px solid rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .08); position: relative; overflow: visible; justify-self: start; }
.sc-miniatura img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.sc-miniatura span { position: absolute; top: -8px; right: -8px; background: #2f5bd3; color: #fff; border-radius: 99px; font-size: .75rem; font-weight: 700; min-width: 22px; height: 22px; display: grid; place-items: center; padding: 0 5px; }
.sc-disparo { width: 74px; height: 74px; min-height: 0; padding: 0; border-radius: 50%; border: 4px solid #fff; background: transparent; display: grid; place-items: center; }
.sc-disparo span { width: 58px; height: 58px; border-radius: 50%; background: #fff; transition: transform .1s; }
.sc-disparo:hover { background: transparent; }
.sc-disparo:active span { transform: scale(.88); }
.sc-direita { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.sc-auto { display: flex; align-items: center; gap: 6px; margin: 0; color: #e5e7eb; font-size: .8rem; font-weight: 600; cursor: pointer; }
.sc-auto input { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: #22c55e; }
.sc-concluir { background: #22c55e; color: #052e16; min-height: 38px; padding: 6px 16px; }
.sc-concluir:hover { background: #16a34a; }
.sc-revisao { flex: 1; overflow: auto; padding: 16px; background: #1f2937; }
.sc-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; max-width: 1100px; margin: 0 auto; }
.sc-pagina { background: #111827; border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 8px; border: 1px solid #374151; }
.sc-pag-img { position: relative; padding: 0; min-height: 0; background: #fff; border-radius: 6px; aspect-ratio: 3 / 4; overflow: hidden; border: 0; display: grid; place-items: center; }
.sc-pag-img:hover { background: #fff; outline: 3px solid #60a5fa; }
.sc-pag-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sc-num { position: absolute; left: 6px; top: 6px; background: rgba(17, 24, 39, .85); color: #fff; font-size: .75rem; font-weight: 700; border-radius: 6px; padding: 2px 7px; }
.sc-pag-acoes { display: flex; justify-content: space-between; gap: 2px; }
.sc-mini-btn { width: 32px; height: 32px; min-height: 0; padding: 0; border-radius: 8px; background: transparent; color: #d1d5db; border: 0; display: grid; place-items: center; }
.sc-mini-btn svg { width: 18px; height: 18px; }
.sc-mini-btn:hover { background: #374151; color: #fff; }
.sc-mini-btn.perigo:hover { background: #7f1d1d; color: #fff; }
.sc-mini-btn:disabled { opacity: .25; }
.sc-adicionar { align-items: center; justify-content: center; color: #93c5fd; border: 2px dashed #4b5563; background: transparent; min-height: 200px; font-weight: 600; cursor: pointer; margin: 0; }
.sc-adicionar:hover { background: rgba(96, 165, 250, .08); border-color: #60a5fa; }
.sc-adicionar svg { width: 30px; height: 30px; }
.sc-salvar { background: #fff; color: var(--texto); padding: 14px 16px; padding-bottom: max(14px, env(safe-area-inset-bottom)); display: grid; gap: 10px; }
.sc-salvar .grande { width: 100%; }
.sc-salvar #scMsg .aviso { margin: 0; }
.sc-editor { flex: 1; min-height: 0; display: grid; place-items: center; background: #111827; position: relative; touch-action: none; }
.sc-palco { position: relative; }
.sc-palco canvas { display: block; }
.sc-palco svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sc-palco polygon { fill: rgba(96, 165, 250, .15); stroke: #60a5fa; stroke-width: 2.5; }
.sc-canto { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: rgba(37, 99, 235, .35); border: 3px solid #fff; box-shadow: 0 0 0 2px #2563eb, 0 2px 8px rgba(0, 0, 0, .5); touch-action: none; cursor: grab; }
.sc-canto.arrastando { background: rgba(34, 197, 94, .45); box-shadow: 0 0 0 2px #16a34a; cursor: grabbing; }
.sc-canto:focus-visible { outline: 3px solid #facc15; }
.sc-lupa { position: absolute; top: 12px; left: 12px; border: 3px solid #fff; border-radius: 50%; overflow: hidden; width: 120px; height: 120px; box-shadow: 0 4px 16px rgba(0, 0, 0, .5); pointer-events: none; }
.sc-ferramentas { background: #fff; color: var(--texto); padding: 12px 16px; padding-bottom: max(14px, env(safe-area-inset-bottom)); display: grid; gap: 12px; }
.sc-filtros { display: flex; gap: 8px; overflow-x: auto; }
.sc-filtro { background: #f3f4f6; color: var(--texto-2); border: 1px solid var(--borda); min-height: 36px; padding: 6px 14px; font-weight: 600; flex: none; }
.sc-filtro:hover { background: #e5e7eb; }
.sc-filtro.ativo { background: var(--cor); color: #fff; border-color: var(--cor); }

/* Scanner: página escaneada (estilo app de scanner) */
.sc-texto { background: transparent; border: 0; color: #e5e7eb; font-weight: 600; min-height: 42px; padding: 6px 10px; }
.sc-texto:hover { background: rgba(255, 255, 255, .1); }
.sc-texto.forte { color: #fff; background: #ef4444; border-radius: 99px; padding: 6px 18px; }
.sc-texto.forte:hover { background: #dc2626; }
.sc-texto:disabled { opacity: .6; }
.sc-topo.claro { justify-content: space-between; }
.sc-contador { display: flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .1); border: 0; color: #fff; border-radius: 99px; min-height: 36px; padding: 4px 14px; font-weight: 700; }
.sc-contador svg { width: 18px; height: 18px; }
.sc-contador:hover { background: rgba(255, 255, 255, .2); }
.sc-vista { position: relative; flex: 1; min-height: 0; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; padding: 14px; background: #1f2937; touch-action: pan-y; user-select: none; }
.sc-vista img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, .5); -webkit-user-drag: none; }
.sc-seta { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; min-height: 0; padding: 0; border-radius: 50%; border: 0; background: rgba(17, 24, 39, .7); color: #fff; display: grid; place-items: center; }
.sc-seta:hover { background: rgba(17, 24, 39, .9); }
.sc-seta.esq { left: 8px; }
.sc-seta.dir { right: 8px; }
.sc-dica { position: absolute; left: 12px; right: 12px; bottom: 12px; background: rgba(120, 53, 15, .92); color: #fef3c7; border-radius: 10px; padding: 8px 12px; font-size: .85rem; text-align: center; }
.sc-processando { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(0, 0, 0, .55); color: #fff; font-weight: 700; z-index: 3; }
.sc-giro { width: 34px; height: 34px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: sc-girar .8s linear infinite; display: inline-block; }
@keyframes sc-girar { to { transform: rotate(360deg); } }
.sc-barra { display: flex; justify-content: space-around; background: #111827; padding: 8px 4px; padding-bottom: max(8px, env(safe-area-inset-bottom)); border-top: 1px solid #1f2937; }
.sc-barra button { flex: 1; max-width: 110px; display: flex; flex-direction: column; align-items: center; gap: 4px; background: transparent; border: 0; color: #f87171; font-size: .78rem; font-weight: 600; min-height: 0; padding: 6px 2px; border-radius: 10px; }
.sc-barra button span { color: #e5e7eb; }
.sc-barra button:hover, .sc-barra button.ativo { background: rgba(255, 255, 255, .08); }
.sc-barra button.ativo span { color: #fff; }
.sc-barra svg { width: 26px; height: 26px; }
.sc-previas { display: flex; gap: 10px; overflow-x: auto; padding: 10px 12px; background: #0b0d12; }
.sc-previa { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; background: transparent; border: 0; color: #d1d5db; font-size: .75rem; font-weight: 600; min-height: 0; padding: 0; }
.sc-previa-img { width: 64px; height: 84px; display: grid; place-items: center; background: #1f2937; border-radius: 8px; border: 2px solid transparent; overflow: hidden; }
.sc-previa-img img { max-width: 100%; max-height: 100%; }
.sc-previa-img .sc-giro { width: 20px; height: 20px; border-width: 3px; }
.sc-previa.ativo { color: #fff; }
.sc-previa.ativo .sc-previa-img { border-color: #ef4444; }
.sc-folha { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; justify-content: center; z-index: 5; }
.sc-folha-caixa { background: #fff; color: var(--texto); width: 100%; max-width: 520px; border-radius: 16px 16px 0 0; padding: 18px 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); display: grid; gap: 10px; }
.sc-folha-caixa h3 { margin: 0; font-size: 1.1rem; }
.sc-folha-caixa .campo { margin: 0; }
.sc-folha-caixa #scMsg .aviso { margin: 0; }
.sc-miniatura > svg { margin: auto; }
.sc-rodape .sc-miniatura { display: grid; place-items: center; color: #fff; }
