/* =========================================================================
   componentes.css — componentes comuns do backoffice (js/componentes.js).
   Só tokens do tema (claro/escuro); nenhuma cor nova. Bordas finas,
   espaçamentos uniformes, 1 botão primário por ecrã.
   ========================================================================= */

/* ---------- PageHeader ---------- */
.pg-cab{display:flex; align-items:flex-end; justify-content:space-between; gap:12px 20px; flex-wrap:wrap; margin-bottom:18px;}
.pg-cab-txt{min-width:0; flex:1 1 320px;}
.pg-cab .h1{margin:2px 0 4px;}
.pg-desc{margin:0; color:var(--muted); font-size:.9rem; max-width:90ch;}
.pg-ajuda{display:inline-flex; align-items:center; gap:4px; background:none; border:none; padding:0; font:inherit; font-size:.86rem; font-weight:700; color:var(--green); cursor:pointer; white-space:nowrap;}
.pg-ajuda:hover{text-decoration:underline;}
.pg-ajuda:focus-visible{outline:2px solid var(--green); outline-offset:2px; border-radius:4px;}
.pg-acoes{display:flex; align-items:center; gap:8px; flex-wrap:wrap;}
.icone{display:inline-block; vertical-align:-0.15em; flex-shrink:0;}
.btn .icone{margin-right:6px;}

/* ---------- Drawer ---------- */
.ui-modal-overlay:has(> .ui-modal.drawer){justify-content:flex-end; align-items:stretch; padding:0;}
.ui-modal.drawer{width:min(520px,100%); max-height:none; height:100%; border-radius:0; border-width:0 0 0 1px; padding:0; display:flex; flex-direction:column;}
.drawer-cab{display:flex; align-items:center; justify-content:space-between; gap:10px; padding:16px 20px; border-bottom:1px solid var(--border);}
.drawer-cab h2{margin:0; font-size:1.15rem;}
.drawer-corpo{padding:16px 20px 24px; overflow-y:auto; flex:1;}
.drawer-corpo p{white-space:normal;}

/* ---------- EmptyState ---------- */
.vazio{display:flex; flex-direction:column; align-items:center; text-align:center; gap:6px; padding:32px 16px; border:1px dashed var(--border); border-radius:var(--radius); background:var(--surface);}
.vazio-ic{color:var(--muted); font-size:1.6rem; display:inline-flex;}
.vazio-tit{color:var(--ink); font-size:.98rem;}
.vazio-txt{color:var(--muted); font-size:.86rem; max-width:60ch;}
.vazio-acao{margin-top:6px;}
.btn-link{background:none; border:none; padding:0; font:inherit; color:var(--green); font-weight:700; cursor:pointer;}
.btn-link:hover{text-decoration:underline;}
.btn-link:focus-visible{outline:2px solid var(--green); outline-offset:2px; border-radius:4px;}

/* ---------- Loading (skeleton) ---------- */
.sk{display:block; height:12px; border-radius:6px; background:linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%); background-size:200% 100%; animation:sk-brilho 1.3s ease-in-out infinite;}
@keyframes sk-brilho{ from{background-position:200% 0;} to{background-position:-200% 0;} }
@media (prefers-reduced-motion:reduce){ .sk{animation:none;} }
.sk-tabela{border:1px solid var(--border); border-radius:var(--radius); background:var(--surface);}
.sk-linha{display:grid; grid-template-columns:90px 2fr 1.2fr 1fr; gap:16px; align-items:center; padding:14px 16px; border-top:1px solid var(--border);}
.sk-linha:first-child{border-top:none;}
.sk-cab{background:var(--surface-2);}
.sk-cab .sk{height:8px; width:60%;}
.sk-c0{width:70%;} .sk-c1{width:85%;} .sk-c2{width:55%;}
.sk-cartoes{display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:12px; margin-bottom:18px;}
.sk-cartao{display:flex; flex-direction:column; gap:10px; padding:16px; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface);}
.sk-n{height:22px; width:40%;} .sk-l{height:9px; width:75%;}

/* ---------- Separadores (1.º nível) e chips (2.º nível) ---------- */
.seg-tabs{display:flex; gap:4px; border-bottom:1px solid var(--border); margin:0 0 14px; overflow-x:auto; scrollbar-width:none;}
.seg-tab{display:inline-flex; align-items:center; gap:8px; padding:10px 14px; margin-bottom:-1px; background:none; border:none; border-bottom:2px solid transparent; font:inherit; font-weight:700; font-size:.92rem; color:var(--muted); cursor:pointer; white-space:nowrap;}
.seg-tab:hover{color:var(--ink);}
.seg-tab[aria-selected=true]{color:var(--ink); border-bottom-color:var(--green);}
.seg-tab:focus-visible{outline:2px solid var(--green); outline-offset:-2px; border-radius:6px;}
.seg-tab .n, .chip-filtro .n{font-variant-numeric:tabular-nums; font-size:.74rem; font-weight:700; padding:1px 7px; border-radius:999px; background:var(--surface-2); color:var(--muted);}
.seg-tab[aria-selected=true] .n{background:var(--green-soft); color:var(--green-deep);}
.seg-tab.zero, .chip-filtro.zero{opacity:.6;}
.chips-filtro{display:flex; flex-wrap:wrap; gap:6px; margin:0 0 12px;}
.chip-filtro{display:inline-flex; align-items:center; gap:6px; border:1px solid var(--border); background:var(--surface); color:var(--ink); border-radius:999px; padding:4px 11px; font:inherit; font-size:.8rem; font-weight:600; cursor:pointer;}
.chip-filtro:hover{border-color:var(--green);}
.chip-filtro[aria-pressed=true]{background:var(--green-soft); color:var(--green-deep); border-color:var(--green);}
.chip-filtro:focus-visible{outline:2px solid var(--green); outline-offset:2px;}

/* ---------- StatCard / StatGroup ---------- */
.stat-grupo{margin:0 0 18px;}
.stat-tit{margin:0 0 8px; font-size:.78rem; text-transform:uppercase; letter-spacing:.05em; color:var(--muted);}
.stat-grelha{display:grid; grid-template-columns:repeat(var(--cols, 4), minmax(0,1fr)); gap:12px;}
@media (max-width:760px){
  .stat-grelha{grid-template-columns:repeat(2, minmax(0,1fr));}
  .stat-grelha > :last-child:nth-child(odd){grid-column:1 / -1;}
}
.stat{display:flex; flex-direction:column; gap:2px; text-align:left; padding:14px 16px; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); color:var(--ink); font:inherit; min-width:0;}
button.stat{cursor:pointer;} button.stat:hover{border-color:var(--green);}
button.stat:focus-visible{outline:2px solid var(--green); outline-offset:2px;}
.stat-n{font-family:'Barlow Condensed'; font-size:1.8rem; font-weight:700; line-height:1.05; font-variant-numeric:tabular-nums;}
.stat-l{font-size:.74rem; font-weight:700; text-transform:uppercase; letter-spacing:.02em; color:var(--muted);}
.stat-s{font-size:.76rem; color:var(--muted); font-variant-numeric:tabular-nums;}
.stat.tom-alerta .stat-n{color:var(--amber);} .stat.tom-ok .stat-n{color:var(--green);} .stat.tom-critico .stat-n{color:var(--red);}

/* ---------- Barra empilhada (mesmas cores do Planeamento) ---------- */
.barra-emp{display:flex; height:10px; min-width:80px; border-radius:999px; overflow:hidden; background:var(--surface-2); border:1px solid var(--border);}
.barra-emp i{display:block; height:100%;}
.barra-legenda{display:flex; flex-wrap:wrap; gap:6px 16px; font-size:.76rem; color:var(--muted); margin:0 0 8px;}
.barra-legenda span{display:inline-flex; align-items:center; gap:6px;}
.barra-legenda i{display:inline-block; width:10px; height:10px; border-radius:3px;}
.seg-pend{background:var(--amber);} .seg-enc{background:var(--blue);} .seg-pronto{background:var(--green);} .seg-entr{background:var(--muted);}

/* ---------- DataTable ----------
   Uma só área de scroll (a página): sem contentor com overflow próprio; o
   cabeçalho fica preso ao topo da área de conteúdo. Colunas de prioridade
   3 e depois 2 escondem-se quando falta largura (container queries); abaixo
   de 768px as linhas passam a cartões. */
.dt{container:dt / inline-size; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface);}
.dt-tabela{width:100%; border-collapse:separate; border-spacing:0; font-size:.88rem;}
.dt-tabela thead th{position:sticky; top:var(--altura-topo, 0px); z-index:3; background:var(--surface-2); text-align:left; padding:10px 12px; font-size:.68rem; font-weight:800; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); border-bottom:1px solid var(--border); white-space:nowrap;}
.dt-tabela thead th:first-child{border-top-left-radius:var(--radius);}
.dt-tabela thead th:last-child{border-top-right-radius:var(--radius);}
.dt-tabela td{padding:10px 12px; border-top:1px solid var(--border); border-bottom:none; vertical-align:middle; white-space:normal; overflow-wrap:break-word; word-break:normal;}
.dt-tabela tbody tr:first-child td{border-top:none;}
.dt-tabela .dt-num{text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap;}
.dt-tabela .mono{font-family:'IBM Plex Mono', monospace; font-size:.82rem;}
.dt-linha.clicavel{cursor:pointer;}
.dt-linha:hover td{background:var(--surface-2);}
.dt-linha.clicavel:focus-visible{outline:2px solid var(--green); outline-offset:-2px;}
.dt-linha.clicavel:focus-visible td{background:var(--surface-2);}
.dt-pessoa{display:flex; flex-direction:column; min-width:0; max-width:34ch;}
.dt-pessoa strong{font-weight:700;}
.dt-sub{display:block; font-size:.78rem; color:var(--muted); font-weight:500;}
.dt-trunc{display:block; max-width:22ch; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.78rem; color:var(--muted);}
.dt-vazio{color:var(--muted);}
.dt-acoes{position:sticky; right:0; z-index:1; width:1%; white-space:nowrap; text-align:right; background:var(--surface);}
.dt-tabela thead th.dt-acoes{background:var(--surface-2); z-index:4;}
.dt-linha:hover td.dt-acoes{background:var(--surface-2);}
.dt-acoes-in{display:flex; align-items:center; justify-content:flex-end; gap:6px;}
.dt-flags{display:flex; flex-wrap:wrap; gap:4px; margin-top:4px;}
.dt-tabela .badge{white-space:normal; overflow-wrap:break-word;}
.dt-nota{display:block; margin-top:4px; font-size:.76rem; color:var(--muted);}
@container dt (max-width: 1040px){ .dt .p3{display:none;} }
@container dt (max-width: 700px){ .dt .p2{display:none;} }
@media (max-width:767px){
  .dt{border:none; background:none;}
  .dt-tabela thead{display:none;}
  .dt-tabela, .dt-tabela tbody{display:block;}
  .dt-tabela tr.dt-linha{display:grid; grid-template-columns:minmax(0,1fr); gap:6px; padding:12px 14px; margin-bottom:8px; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface);}
  .dt-tabela td{display:block; padding:0; border:none;}
  .dt-tabela td.dt-num{text-align:left;}
  .dt-tabela td[data-l]:not(:first-child)::before{content:attr(data-l); display:block; font-size:.62rem; font-weight:800; text-transform:uppercase; letter-spacing:.03em; color:var(--muted);}
  .dt-acoes{position:static; width:auto; background:none !important;}
  .dt-acoes-in{justify-content:flex-start;}
}
.sr-only{position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;}

/* ---------- Inscrições (página-piloto) ---------- */
.fila-filtros{border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); padding:12px 14px; margin:0 0 14px;}
.fila-filtros .chips{margin-top:10px;}

/* Ícones de estado (listas de verificação) */
.ic-ok{color:var(--green);} .ic-pend{color:var(--muted);} .ic-alerta{color:var(--red);}

/* ---------- Etapa 1: rascunhos, verificação de histórico ---------- */
.rascunho-linha{ display:flex; justify-content:space-between; align-items:flex-start; gap:12px; flex-wrap:wrap; padding:12px 0; border-top:1px solid var(--border); }
.rascunho-linha:first-child{ border-top:0; padding-top:0; }
.rascunho-linha .badge{ margin-top:6px; white-space:normal; }
.aviso-expiracao{ margin-top:6px; padding:6px 10px; border-radius:8px; background:var(--amber-soft); color:var(--ink); font-size:.84rem; display:flex; gap:6px; align-items:center; }
.painel-historico{ border:1px solid var(--border); background:var(--surface-2); border-radius:12px; padding:16px; display:grid; gap:10px; }
.painel-historico h3{ margin:0; font-size:1.05rem; text-wrap:balance; }
.painel-historico p{ margin:0; max-width:68ch; }
.verif-hist{ margin:6px 0 0; padding-left:18px; font-size:.88rem; font-variant-numeric:tabular-nums; }
.verif-cartao h3{ font-size:1.05rem; }
.resumo-servidor{ margin-top:14px; padding:10px 12px; border-radius:10px; background:var(--surface-2); font-size:.9rem; }
.resumo-servidor.ok{ background:var(--green-soft); }
.resumo-servidor.erro{ background:var(--red-soft); }

/* ---------- Etapa 2: fases, entrada, gravação, os seus atletas ---------- */
.fases-ee{ list-style:none; margin:0 0 6px; padding:0; display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:6px; }
.fases-ee li{ display:flex; align-items:center; gap:8px; padding:8px 10px; border-radius:10px; background:var(--surface-2); color:var(--muted); font-size:.84rem; min-width:0; }
.fases-ee li .fase-nome{ overflow-wrap:anywhere; line-height:1.2; }
.fases-ee li .fase-n{ flex:0 0 auto; width:22px; height:22px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; background:var(--surface); border:1px solid var(--border); font-weight:700; font-size:.78rem; }
.fases-ee li.feita{ color:var(--ink); }
.fases-ee li.feita .fase-n{ background:var(--green-soft); border-color:var(--green); color:var(--green); }
.fases-ee li.atual{ background:var(--green-soft); color:var(--ink); font-weight:700; }
.fases-ee li.atual .fase-n{ background:var(--green); border-color:var(--green); color:#fff; }
@media (max-width:640px){
  .fases-ee{ grid-template-columns:repeat(4, minmax(0,1fr)); gap:4px; }
  .fases-ee li{ flex-direction:column; align-items:flex-start; padding:6px; font-size:.72rem; gap:4px; }
  .fases-ee li:not(.atual) .fase-nome{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
}
.estado-gravacao{ margin:6px 0; font-size:.86rem; color:var(--muted); }
.estado-gravacao.ok{ color:var(--green); }
.estado-gravacao.erro{ color:var(--ink); background:var(--amber-soft); padding:8px 10px; border-radius:8px; }
.aviso-retoma{ margin:10px 0 0; padding:12px 14px; border-radius:10px; background:var(--amber-soft); }
.aviso-retoma ul{ margin:6px 0 0; padding-left:18px; }
.grupo-ee{ border:0; padding:0; margin:0 0 16px; min-width:0; }
.grupo-ee legend{ font-weight:700; margin-bottom:8px; padding:0; }
.opcoes-ee{ display:grid; grid-template-columns:repeat(auto-fill, minmax(200px, 1fr)); gap:8px; }
.opcao-ee{ display:flex; gap:10px; align-items:flex-start; padding:12px; border:1px solid var(--border); border-radius:10px; background:var(--surface); cursor:pointer; min-width:0; }
.opcao-ee span{ display:flex; flex-direction:column; gap:2px; min-width:0; overflow-wrap:anywhere; }
.opcao-ee.selected{ border-color:var(--green); background:var(--green-soft); }
.opcao-ee.disabled{ opacity:.7; cursor:not-allowed; }
.opcao-ee input{ margin-top:3px; }
.tipo-ee{ padding:12px 14px; border-radius:10px; background:var(--surface-2); }
.tipo-ee.ok{ background:var(--green-soft); }
.tipo-ee.aviso, .tipo-ee.erro{ background:var(--amber-soft); }
.atletas-ee{ list-style:none; margin:12px 0 0; padding:0; display:grid; gap:10px; }
.atleta-ee{ border:1px solid var(--border); border-radius:10px; padding:12px; display:grid; gap:6px; }
.atleta-ee-mods{ list-style:none; margin:0; padding:0; display:grid; gap:4px; font-size:.88rem; }
.atleta-ee-mods .badge{ white-space:normal; }
.anexo-ok{ color:var(--green); display:flex; gap:4px; align-items:center; }
.anexo-erro{ display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.fases-ee li{ position:relative; }

/* ---------- Campos de data dd/mm/aaaa (js/campo-data.js) ---------- */
.cd-original{ display:none !important; }
.campo-data{ display:flex; align-items:center; gap:6px; width:100%; max-width:100%; min-width:0; position:relative; }
.campo-data .cd-texto{ flex:1 1 0; width:auto; min-width:0; font-variant-numeric:tabular-nums; }
.campo-data .cd-formato{ flex:0 0 auto; font-size:.74rem; color:var(--muted); white-space:nowrap; }
.campo-data .cd-botao{ flex:0 0 auto; display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; border:1px solid var(--border); border-radius:8px; background:var(--surface); color:var(--ink); cursor:pointer; }
.campo-data .cd-botao:focus-visible{ outline:2px solid var(--green); outline-offset:2px; }
.campo-data .cd-botao:disabled{ opacity:.5; cursor:not-allowed; }
.cd-erro{ display:block; margin-top:4px; font-size:.8rem; color:var(--red); }
.cd-calendario{ position:absolute; z-index:10000; width:300px; max-width:calc(100vw - 16px); background:var(--surface); color:var(--ink); border:1px solid var(--border); border-radius:12px; box-shadow:0 10px 30px rgba(0,0,0,.18); padding:10px; }
.cd-calendario.folha{ position:fixed; left:8px; right:8px; bottom:8px; top:auto; width:auto; max-width:none; }
.cd-cab{ display:flex; gap:6px; align-items:center; margin-bottom:6px; }
.cd-cab select{ flex:1 1 auto; min-width:0; padding:6px; }
.cd-nav{ width:34px; height:34px; border:1px solid var(--border); border-radius:8px; background:var(--surface); color:var(--ink); font-size:1.1rem; cursor:pointer; }
.cd-grelha{ width:100%; border-collapse:collapse; table-layout:fixed; }
.cd-grelha th{ font-size:.72rem; color:var(--muted); font-weight:600; padding:4px 0; text-align:center; white-space:normal; }
.cd-grelha td{ padding:1px; text-align:center; }
.cd-dia{ width:100%; aspect-ratio:1; min-height:34px; border:0; border-radius:8px; background:transparent; color:var(--ink); cursor:pointer; font-variant-numeric:tabular-nums; }
.cd-dia:hover{ background:var(--surface-2); }
.cd-dia.hoje{ box-shadow:inset 0 0 0 1px var(--green); }
.cd-dia.sel{ background:var(--green); color:#fff; }
.cd-dia:disabled{ opacity:.35; cursor:not-allowed; }
.cd-dia:focus-visible, .cd-nav:focus-visible{ outline:2px solid var(--green); outline-offset:1px; }
.cd-rodape{ display:flex; justify-content:space-between; margin-top:6px; }
.cd-rodape button{ border:1px solid var(--border); background:var(--surface); color:var(--ink); border-radius:8px; padding:6px 10px; cursor:pointer; }
/* Telemóvel: a indicação do formato passa para baixo do campo (nunca desaparece). */
@media (max-width:420px){ .campo-data{ flex-wrap:wrap; } .campo-data .cd-formato{ order:3; flex-basis:100%; } }
.encontrar-ee{ margin-top:12px; padding:12px; border:1px dashed var(--border); border-radius:10px; display:grid; gap:8px; }
.cand-assoc span .muted{ display:block; }
.assoc-instrucoes{display:block; margin:4px 0 2px; padding:6px 10px; border-left:3px solid var(--border); background:var(--surface-2); border-radius:6px; font-size:.86rem;}
/* Estado de um escalão (arquivado/removido): tag neutra, nunca alarme. */
.tag-escalao{display:inline-block; padding:0 7px; border-radius:999px; font-size:.74rem; font-weight:600; line-height:1.55; border:1px solid var(--border); background:var(--surface-2); color:var(--muted); white-space:nowrap; vertical-align:baseline;}

/* ---------- Etapa 5: formulários do encarregado e resumo ---------- */
/* Mobile: o nome da fase atual já aparece na linha seguinte; dentro da
   caixa estreita partia-se letra a letra. */
@media (max-width:640px){ .fases-ee li.atual .fase-nome{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; } }
/* Grupos em leitura (dados já existentes) com «Editar». */
.grupo-leitura{ border:1px solid var(--border); border-radius:12px; padding:12px 14px; margin:0 0 14px; background:var(--surface); }
.grupo-cab{ display:flex; justify-content:space-between; align-items:center; gap:8px; flex-wrap:wrap; }
.grupo-cab h3, .grupo-cab h4{ margin:0; font-size:.98rem; }
.grupo-dl{ display:grid; grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); gap:8px 16px; margin:10px 0 0; }
.grupo-dl dt{ font-size:.76rem; color:var(--muted); }
.grupo-dl dd{ margin:2px 0 0; font-weight:600; overflow-wrap:anywhere; }
.aviso-rever{ margin:8px 0 0; padding:8px 10px; border-radius:8px; background:var(--amber-soft); font-size:.84rem; display:flex; gap:6px; align-items:flex-start; }
.btn .icone, .sel-flag .icone, .opcao-btn .icone{ vertical-align:-2px; }
/* Seleção: diferente do hover — borda, sombra, sinal e texto. */
.sel-flag{ display:none; align-items:center; gap:4px; margin-top:8px; font-size:.8rem; font-weight:700; color:var(--green-deep, var(--green)); }
.pack-card.selected .sel-flag{ display:inline-flex; }
/* Escolha com duas respostas de peso igual (sim/não). */
.opcao-dupla{ display:grid; grid-template-columns:repeat(auto-fit, minmax(140px, 1fr)); gap:10px; margin-top:8px; }
.opcao-btn{ border:2px solid var(--border); border-radius:12px; padding:12px 14px; background:var(--surface); color:var(--ink); font:inherit; text-align:left; cursor:pointer; display:flex; gap:8px; align-items:flex-start; }
.opcao-btn:hover{ border-color:var(--muted); }
.opcao-btn[aria-pressed="true"]{ border-color:var(--green); background:var(--green-soft); box-shadow:0 0 0 3px var(--green-soft); font-weight:700; }
.opcao-btn:focus-visible{ outline:3px solid var(--gold); outline-offset:2px; }
.bloco-socio{ border:1px solid var(--border); border-radius:12px; padding:14px; margin:0 0 14px; }
.bloco-socio h3{ margin:0 0 4px; font-size:1.02rem; }
/* Fotografia: orientações e pré-visualização. */
.foto-bloco{ border:1px solid var(--border); border-radius:12px; padding:14px; margin:0 0 12px; }
.foto-bloco ul{ margin:6px 0 10px; padding-left:18px; font-size:.86rem; }
.foto-bloco .foto-pre{ width:120px; height:150px; object-fit:cover; border-radius:10px; border:1px solid var(--border); display:block; }
.foto-acoes{ display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
.doc-linha{ display:flex; justify-content:space-between; align-items:flex-start; gap:10px; flex-wrap:wrap; padding:12px 0; border-bottom:1px dashed var(--border); }
.doc-linha .doc-info{ min-width:0; flex:1 1 200px; }
.doc-linha .doc-acoes{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
/* Autorizações: estado obrigatória/opcional; documentos ligados sem sair da margem. */
.aut-tipo{ font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.03em; color:var(--muted); }
.aut-docs{ display:flex; gap:8px; flex-wrap:wrap; }
.aut-docs .btn{ white-space:normal; text-align:left; max-width:100%; }
/* Resumo por secções. */
.resumo-sec{ border:1px solid var(--border); border-radius:12px; padding:12px 14px; margin:0 0 12px; background:var(--surface); }
.resumo-sec ul{ margin:8px 0 0; padding-left:18px; }
.resumo-sec .summary-line{ padding:6px 0; }
.condicoes{ border:1px solid var(--border); border-radius:12px; padding:12px 14px; margin:0 0 12px; background:var(--surface-2); }
.condicoes p{ margin:0 0 8px; max-width:68ch; }
.confirmacao-final{ margin-top:16px; padding:12px; border-radius:10px; border:1px solid var(--border); }
.confirmacao-final.has-err{ border-color:var(--red); background:var(--red-soft); }
.final-ee{ display:grid; gap:12px; }
.final-ee .referencia{ font-size:1.4rem; font-weight:800; font-variant-numeric:tabular-nums; letter-spacing:.02em; }
.final-ee ol{ margin:0; padding-left:20px; display:grid; gap:6px; }
/* Notas do assistente do encarregado: legíveis, mas secundárias ao conteúdo. */
.card-ee .hint{ font-size:.84rem; color:var(--muted); font-weight:500; }
.card-ee .lista-artigos{ margin:8px 0 0; padding-left:18px; display:grid; gap:4px; }
.resumo-sec .summary-line > span:last-child{ white-space:nowrap; text-align:right; }
.resumo-sec .summary-line > span:first-child{ min-width:0; overflow-wrap:anywhere; }
.tabela-pf .num{ text-align:right; white-space:nowrap; }
/* Pagamentos faseados: texto pode quebrar (os números não), para a tabela e
   o detalhe caberem sem cortar colunas. */
.tabela-pf th, .tabela-pf td{ white-space:normal; }
.tabela-pf td.num, .tabela-pf th.num, .tabela-pf td.mono{ white-space:nowrap; }
.tabela-pf td[colspan]{ padding:4px 12px 12px; }
