/* Relatórios de acompanhamento na ficha da EOP. */

.eopReportsSection { padding: 0; overflow: hidden; }

.eopReportHead {
  margin: 0;
  padding: 17px 18px;
  position: static;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.eopReportHead h2 { margin: 3px 0 2px; }
.eopReportHead p { margin: 0; color: var(--muted); font-size: var(--txt-xs); }

.eopReportGenerate {
  flex: none;
}

.eopReportList { display: grid; }

.eopReportRow {
  min-height: 72px;
  padding: 12px 18px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto 34px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.eopReportRow:last-child { border-bottom: 0; }

.eopReportNumber {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--accent) 11%, var(--panel));
  color: var(--accent);
  font-size: var(--txt-sm);
  font-weight: 800;
}

.eopReportIdentity { min-width: 0; }
.eopReportIdentity h3 { margin: 0; font-size: var(--txt-sm); }
.eopReportIdentity p { margin: 2px 0 0; color: var(--muted); font-size: var(--txt-xs); }

.eopReportFiles { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.eopReportFile {
  min-height: 30px;
  padding: 5px 9px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--panel);
  color: var(--accent);
  font-size: var(--txt-xs);
  font-weight: 750;
  text-decoration: none;
}
.eopReportFile:hover { border-color: var(--accent); }

.eopReportDelete {
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.eopReportDelete:hover { background: color-mix(in srgb, var(--vermelho) 8%, var(--panel)); color: var(--vermelho); }
.eopReportDelete svg { width: 16px; height: 16px; }

.eopReportAudit {
  grid-column: 1 / -1;
  margin: 0 0 2px 50px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
}
.eopReportAudit summary {
  min-height: 38px;
  padding: 8px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  color: var(--muted);
  font-size: var(--txt-xs);
  font-weight: 750;
}
.eopReportAuditState {
  padding: 3px 8px;
  border-radius: var(--r-pill);
  font-size: 10px;
}
.eopReportAuditState.isOk { color: var(--verde); background: color-mix(in srgb, var(--verde) 10%, var(--panel)); }
.eopReportAuditState.isWarning { color: var(--amarelo); background: color-mix(in srgb, var(--amarelo) 11%, var(--panel)); }
.eopReportAuditGrid {
  padding: 0 11px 11px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.eopReportAuditGrid > div {
  min-width: 0;
  padding: 8px 9px;
  border-radius: var(--r-sm);
  background: var(--panel);
}
.eopReportAuditGrid span,
.eopReportAuditGrid b { display: block; overflow-wrap: anywhere; }
.eopReportAuditGrid span { margin-bottom: 2px; color: var(--muted); font-size: 10px; }
.eopReportAuditGrid b { color: var(--ink); font-size: var(--txt-xs); }
.eopReportAuditWarnings { margin: 0 11px 11px; padding: 10px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--amarelo) 8%, var(--panel)); font-size: var(--txt-xs); }
.eopReportAuditWarnings ul { margin: 6px 0 0; padding-left: 18px; }

.eopReportEmpty { min-height: 220px; margin: 0; border: 0; border-radius: 0; }

/* A LISTA DE FECHO, imediatamente antes do Anexo B.
   Neutra de propósito: um ponto por cumprir não é um erro nem uma derrapagem,
   é trabalho que falta. Só o essencial ao Relatório Final ganha cor, e é a do
   aviso - nunca a do vermelho, que aqui significaria incumprimento declarado. */
.eopClosureCheck { border-top: 1px solid var(--line); }
.eopClosureHead {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 15px 18px 0; border: 0; background: transparent;
}
.eopClosureHead .eyebrow { display: block; }
.eopClosureHead h3 { margin: 3px 0 0; }
.eopClosureHead p { margin: 4px 0 0; font-size: var(--txt-sm); }
.eopClosureScore {
  padding: 4px 10px; border-radius: var(--r-pill); white-space: nowrap;
  color: var(--muted); background: var(--subtle);
  font-size: var(--txt-sm); font-weight: 720;
}
.eopClosureCheck.isReady .eopClosureScore {
  color: var(--verde); background: color-mix(in srgb, var(--verde) 13%, var(--panel));
}
.eopClosureNote { margin: 8px 18px 0; font-size: var(--txt-xs); }
.eopClosureList {
  display: grid; gap: 2px; margin: 10px 0 17px; padding: 0; list-style: none;
}
.eopClosureList li {
  display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px;
  padding: 7px 18px;
}
.eopClosureList li > div { display: grid; gap: 2px; }
.eopClosureList li span { color: var(--muted); font-size: var(--txt-sm); }
.eopClosureMark { justify-self: center; font-weight: 720; }
.eopClosureList li.isDone .eopClosureMark { color: var(--verde); }
.eopClosureList li.isPending { color: var(--ink); }
.eopClosureList li.isPending .eopClosureMark { color: var(--muted); }
/* Por apurar: não é falha, e não se pinta como tal. */
.eopClosureList li.isUnknown { opacity: .72; }
.eopClosureList li.isUnknown .eopClosureMark { color: var(--line); }
.eopClosureList li.isBlocking {
  background: color-mix(in srgb, var(--amarelo) 7%, transparent);
  border-left: 3px solid var(--amarelo); padding-left: 15px;
}
.eopClosureList li.isBlocking .eopClosureMark {
  color: color-mix(in srgb, var(--amarelo) 72%, var(--ink));
}

/* O ANEXO B, no fim do separador.
   Não é mais um mensal: sai uma vez, fecha o processo e não se apaga daqui -
   reemitir substitui-o. Por isso a linha perde a coluna do botão de apagar e o
   número dá lugar ao "B" do anexo. */
.eopFinalReport {
  border-top: 1px solid var(--line);
}

/* Uma regra genérica põe os `header` de secção em linha, e o rótulo colava-se
   ao título: "ENCERRAMENTO DO CONTRATO Relatório Final (Anexo B)" lia-se como
   uma frase só. Aqui empilham-se, como no cabeçalho dos mensais. */
.eopFinalReportHead {
  display: block;
  padding: 15px 18px 0;
  border: 0;
  background: transparent;
}

/* O rótulo por cima do título, como no cabeçalho dos mensais: em linha, lia-se
   "ENCERRAMENTO DO CONTRATO Relatório Final (Anexo B)" como se fosse uma frase
   só. Lá em cima o empilhamento vem do `<div>` à volta; aqui é explícito. */
.eopFinalReportHead .eyebrow { display: block; }
.eopFinalReportHead h3 { margin: 3px 0 0; }

.eopReportRow.isFinalReport {
  grid-template-columns: 38px minmax(0, 1fr) auto;
  border-bottom: 0;
}

.eopReportNumber.isFinalReport {
  background: color-mix(in srgb, var(--verde) 13%, var(--panel));
  color: var(--verde);
}

.eopFinalReportEmpty,
.eopFinalReportState {
  margin: 8px 18px 17px;
  font-size: var(--txt-xs);
}

.eopFinalReportState { margin-top: 0; }

@media (max-width: 620px) {
  .eopReportHead { align-items: stretch; flex-direction: column; padding: 15px 14px; }
  .eopFinalReportHead { padding: 15px 14px 0; }
  .eopClosureHead { display: block; padding: 15px 14px 0; }
  .eopClosureScore { display: inline-block; margin-top: 8px; }
  .eopClosureNote { margin-inline: 14px; }
  .eopClosureList li { padding-inline: 14px; }
  .eopClosureList li.isBlocking { padding-left: 11px; }
  .eopReportRow.isFinalReport { grid-template-columns: 38px minmax(0, 1fr); }
  .eopFinalReportEmpty, .eopFinalReportState { margin-inline: 14px; }
  .eopReportGenerate { width: 100%; }
  .eopReportRow {
    padding: 14px;
    grid-template-columns: 38px minmax(0, 1fr) 44px;
  }
  .eopReportFiles { grid-column: 1 / -1; justify-content: flex-start; }
  .eopReportFile { min-height: 44px; padding-inline: 14px; }
  .eopReportDelete { grid-column: 3; grid-row: 1; width: 44px; height: 44px; }
  .eopReportAudit { margin-left: 0; }
  .eopReportAuditGrid { grid-template-columns: minmax(0, 1fr); }
}
