/* ============================================================
   Revisao do relatorio de processo antes do Word (RelatorioRevisao,
   public/app/57-relatorio-revisao.js). Usa as variaveis e classes ja
   existentes (--primary, --border, .card, .btn, .badge) sem redesenhar
   a identidade visual do SARA.
   ============================================================ */

#proc-revisao-relatorio { display:block; margin-bottom:1rem; }

.rr-header { flex-wrap:wrap; gap:0.75rem; align-items:flex-start; }
.rr-header-actions { display:flex; gap:0.5rem; flex-wrap:wrap; }
.rr-meta { font-size:0.78rem; color:var(--text-secondary); margin-top:0.25rem; }

.rr-status { font-size:0.82rem; color:var(--text-secondary); margin-bottom:0.75rem; }
.rr-status:empty { display:none; }

.rr-secoes { display:flex; flex-direction:column; gap:1rem; }
.rr-secao { border:1px solid var(--border-light); border-radius:var(--radius); padding:0.75rem; background:var(--bg); }
.rr-secao-head { display:flex; align-items:center; justify-content:space-between; gap:0.5rem; flex-wrap:wrap; margin-bottom:0.4rem; }
.rr-secao-head label { font-weight:700; color:var(--text); font-size:0.82rem; }
.rr-secao-actions { display:flex; gap:0.4rem; flex-wrap:wrap; }

.rr-textarea {
  width:100%;
  min-height:84px;
  padding:0.6rem 0.7rem;
  border:1.5px solid var(--border);
  border-radius:8px;
  font-family:inherit;
  font-size:0.85rem;
  line-height:1.55;
  resize:vertical;
  background:white;
  overflow:hidden;
}
.rr-textarea:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px rgba(30,58,95,0.1); }

/* Historico */
.rr-historico-lista { display:flex; flex-direction:column; gap:0.5rem; }
.rr-historico-item { border:1px solid var(--border-light); border-radius:8px; padding:0.6rem 0.75rem; display:flex; align-items:flex-start; justify-content:space-between; gap:0.75rem; flex-wrap:wrap; background:white; }
.rr-historico-info { font-size:0.78rem; color:var(--text-secondary); min-width:220px; flex:1; line-height:1.5; }
.rr-historico-info strong { color:var(--text); }
.rr-historico-actions { display:flex; gap:0.4rem; flex-shrink:0; }

/* Ver versao (modo leitura) */
.rr-versao-leitura { display:flex; flex-direction:column; gap:0.75rem; }
.rr-versao-leitura .rr-secao { background:white; }
.rr-leitura-texto {
  white-space:pre-wrap;
  font-size:0.85rem;
  line-height:1.55;
  color:var(--text);
  background:white;
  border:1px solid var(--border-light);
  border-radius:8px;
  padding:0.6rem 0.7rem;
}

/* Modal de ajuste com instrucao: mais largo que o modal-box padrao (560px)
   para caber a comparacao lado a lado. */
.rr-modal-box { max-width:900px; }
.rr-ajuste-trecho {
  background:var(--primary-50);
  border:1px solid var(--primary-200);
  border-radius:8px;
  padding:0.6rem 0.75rem;
  font-size:0.8rem;
  color:var(--text);
  margin-bottom:0.75rem;
  white-space:pre-wrap;
}
.rr-ajuste-nota { font-size:0.78rem; color:var(--text-secondary); margin-bottom:0.5rem; }
.rr-ajuste-instrucao {
  width:100%;
  min-height:70px;
  padding:0.6rem 0.7rem;
  border:1.5px solid var(--border);
  border-radius:8px;
  font-family:inherit;
  font-size:0.85rem;
  resize:vertical;
}
.rr-ajuste-instrucao:focus { outline:none; border-color:var(--primary); }
.rr-ajuste-status { font-size:0.82rem; color:var(--text-secondary); margin-top:0.5rem; min-height:1em; }
.rr-ajuste-actions { display:flex; gap:0.5rem; flex-wrap:wrap; margin-top:0.75rem; justify-content:flex-end; }

.rr-proposta-grid { display:grid; grid-template-columns:1fr 1fr; gap:1rem; margin-top:0.5rem; }
.rr-proposta-col h4 { font-size:0.72rem; font-weight:700; text-transform:uppercase; letter-spacing:0.04em; color:var(--text-muted); margin-bottom:0.4rem; }
.rr-proposta-texto {
  white-space:pre-wrap;
  font-size:0.83rem;
  line-height:1.5;
  border:1px solid var(--border-light);
  border-radius:8px;
  padding:0.6rem 0.7rem;
  background:var(--bg);
  max-height:340px;
  overflow-y:auto;
}
.rr-proposta-col.proposta .rr-proposta-texto { border-color:var(--green); background:#f0fdf4; }

@media (max-width:900px) {
  .rr-proposta-grid { grid-template-columns:1fr; }
}
