/* Zelo v1 · Relatórios e PDF (01/11): passo 3 em blocos com setas, assinaturas no relatório emitido, margens das folhas A4.
   Este ficheiro carrega antes das folhas da demo (v40…v52): os seletores levam «html body» para valerem sobre elas. */

/* ---------- 1 · novo relatório, passo 3: blocos pela ordem em que se preenchem ---------- */
@media (min-width:701px){
 html body #view.re51c .rg51c.z3g{display:grid;grid-template-columns:minmax(0,1.15fr) 26px minmax(0,1fr) 26px minmax(0,1fr);grid-template-rows:minmax(0,1fr) 26px auto;column-gap:6px;row-gap:0;align-items:stretch}
 html body .z3g>.sub{min-height:0;overflow:auto;margin:0!important}
 html body .z3g>.sub[data-z3="1"]{grid-column:1;grid-row:1}
 html body .z3g>.sub[data-z3="2"]{grid-column:3;grid-row:1}
 html body .z3g>.sub[data-z3="3"]{grid-column:5;grid-row:1}
 html body .z3g>.sub[data-z3="4"]{grid-column:1/-1;grid-row:3;overflow:visible}
 html body .z3g>.z3a1{grid-column:2;grid-row:1}
 html body .z3g>.z3a2{grid-column:4;grid-row:1}
 html body .z3g>.z3a3{grid-column:5;grid-row:2}
 html body .z3g .fsel{grid-template-columns:minmax(0,1fr)}
 html body .z3g .tipos.sm{grid-template-columns:repeat(3,minmax(0,1fr))!important}
}
.z3a{display:flex;align-items:center;justify-content:center;align-self:center;justify-self:center;width:26px;height:26px;border-radius:50%;background:var(--sf,#fff);border:1px solid var(--bd);color:var(--ac);flex:none}
.z3a svg.i40{width:15px;height:15px}
/* «Adicionar Fotos» centrado no seu quadro; sem fotos, o quadro ocupa a largura */
html body .z3g .thumbs3 .addf{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:4px;padding:6px}
html body .z3g .thumbs3 .addf span{display:block;width:100%;text-align:center;line-height:1.25}
html body .z3g .thumbs3.z3vz{display:flex}
html body .z3g .thumbs3.z3vz .addf{width:100%;height:auto;min-height:76px;flex-direction:row;gap:8px}
html body .z3g .thumbs3.z3vz .addf span{width:auto}
/* ecrã de computador mais estreito: um bloco por baixo do outro, com a seta para baixo; a área faz scroll por dentro */
@media (min-width:701px) and (max-width:1180px){
 html body #view.re51c .rg51c.z3g{display:flex;flex-direction:column;gap:6px;overflow:auto}
 html body .z3g>.sub,html body .z3g>.z3a{flex:none}
 html body .z3g>.sub{overflow:visible;min-height:auto}
 html body .z3g>.z3a1 svg,html body .z3g>.z3a2 svg{transform:rotate(90deg)}
 html body .z3g .fsel{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* ---------- 2 · assinaturas ---------- */
.z1-nota{display:flex;align-items:center;gap:8px;margin-top:10px;padding:8px 12px;border:1px solid var(--bd);border-radius:10px;background:var(--bg);font-size:12.5px;color:var(--mu);line-height:1.4}
.z1-nota svg.i40{width:16px;height:16px;flex:none;color:var(--ac)}
.z1-sgm .sg45e{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.z1-sg{display:flex;flex-direction:column;gap:6px;min-width:0}
.z1-sg .sigc{width:100%}
.z1-sg .row{margin-top:0;flex-wrap:nowrap;gap:8px}
.z1-sg .row .inp{flex:1;min-width:0}
.z1-sg.ok .z1-sgi{height:130px;border:1px solid var(--bd);border-radius:10px;background:#fff;display:flex;align-items:center;justify-content:center;padding:8px}
.z1-sg.ok .z1-sgi img{max-width:100%;max-height:100%;display:block}
.z1-sg.ok em{font-style:normal;font-size:12.5px;color:#1f7a4c;display:flex;align-items:center;gap:5px}
.z1-sg.ok em svg.i40{width:14px;height:14px}
@media (max-width:700px){.z1-sgm .sg45e{grid-template-columns:1fr}}

/* ---------- 3 · folhas A4: margens iguais no ecrã, no PDF e na impressão ----------
   A folha desenha-se com 500 px de largura (210 mm). Margem lateral: 36 px = 15,1 mm, igual para o texto, para a tabela,
   para o texto do cabeçalho e para o texto do rodapé. A faixa do cabeçalho e a do rodapé vão de uma ponta à outra da folha.
   Uma só faixa no rodapé (sem a linha de cor por cima, que parecia uma linha dupla). */
html body .a4{--zmx:36px;padding-left:var(--zmx);padding-right:var(--zmx)}
html body .a4 .hd.bn42{margin-left:calc(-1 * var(--zmx));margin-right:calc(-1 * var(--zmx));padding-left:var(--zmx);padding-right:var(--zmx)}
html body .a4 .bn50g{margin-left:calc(-1 * var(--zmx));margin-right:calc(-1 * var(--zmx))}
html body .a4 .ft.ft51a{margin-left:calc(-1 * var(--zmx));margin-right:calc(-1 * var(--zmx))}
html body .a4 .ft51a .fb51a{display:none}
html body .a4 .ft51a .fc51a{padding-left:var(--zmx);padding-right:calc(var(--zmx) + 60px)}
html body .a4 .ft51a .pg51a{right:var(--zmx)}
/* dados do cliente no relatório: o mesmo quadro do orçamento (linha fina), para não parecer texto desalinhado quando o fundo não sai */
html body .a4 .cl:not(:has(.od51a)){border:1px solid #ece7dd}

/* margem da folha 0: com «Predefinição», o Chrome (e o «Microsoft Print to PDF») usa esta margem, e as faixas tocam nas bordas */
@page{size:A4;margin:0}
@media print{
 @page{size:A4;margin:0}
 html,body{margin:0!important;padding:0!important}
 /* 500 px × 1,5874 = 793,7 px = 210 mm exatos (antes 1,58: a folha ficava com 790 px, 1,1 mm em branco à direita e 1,6 mm por baixo do rodapé).
    Altura 707 px × 1,5874 = 1122,3 px (297 mm = 1122,5 px): nunca passa para uma folha em branco. */
 html body #printArea .a4{zoom:1.5874016;width:500px!important;height:707px!important;aspect-ratio:auto;box-shadow:none!important;margin:0!important;overflow:hidden}
 /* o PDF sai igual com e sem «Gráficos de fundo» (quadros, faixas, linhas da tabela) */
 html body #printArea .a4,html body #printArea .a4 *{-webkit-print-color-adjust:exact;print-color-adjust:exact}
}
