:root {
  --bg: #f4f2ee;
  --panel: #ffffff;
  --ink: #1c1a17;
  --muted: #7c766c;
  --line: #e4e0d8;
  --line-strong: #d3cec3;
  --accent: #2f6f5e;      /* verde sóbrio, neutro (empreendimento litorâneo) */
  --accent-ink: #1f4e42;
  --accent-soft: #eaf1ee;
  --danger: #a3492f;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(28,26,23,.05), 0 8px 24px rgba(28,26,23,.06);
  font-family: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 100vh;
}

/* -------- Sidebar -------- */
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.brand { display: flex; flex-direction: column; gap: 2px; }
.brand h1 { font-size: 17px; margin: 0; letter-spacing: -.2px; }
.brand p { font-size: 12.5px; color: var(--muted); margin: 0; }
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
/* Configurações é ajuste do sistema, não uso diário: desce para o pé do menu,
   separado do bloco de navegação. Separador em currentColor para funcionar tanto
   no menu claro do design base quanto no rail navy da pele RBFD. */
.side-nav-pe { margin-top: auto; position: relative; }
.side-nav-pe::before {
  content: ""; position: absolute; left: 11px; right: 11px; top: -9px;
  height: 1px; background: currentColor; opacity: .18;
}
.side-nav-item {
  text-align: left; background: transparent; border: none; cursor: pointer;
  padding: 9px 11px; border-radius: 8px; font: inherit; font-size: 14px; font-weight: 600;
  color: #4a463f; display: flex; align-items: center; gap: 8px;
}
.side-nav-item:hover { background: #fafaf8; }
.side-nav-item.ativo { background: var(--accent-soft); color: var(--accent-ink); }
.badge {
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 10px; padding: 1px 7px; margin-left: auto;
}
.sidebar-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted); font-weight: 600; margin-top: 4px;
}
#lista-modelos { display: flex; flex-direction: column; gap: 8px; }
.modelo-item {
  text-align: left; background: transparent; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 13px; cursor: pointer;
  display: flex; flex-direction: column; gap: 3px; transition: .15s;
}
.modelo-item:hover { border-color: var(--line-strong); background: #fafaf8; }
.modelo-item.ativo { border-color: var(--accent); background: var(--accent-soft); }
.mi-nome { font-weight: 600; font-size: 14px; }
.mi-desc { font-size: 12px; color: var(--muted); line-height: 1.35; }
.sidebar-foot { margin-top: auto; font-size: 11.5px; color: var(--muted); }
.user-chip { margin-top: auto; display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.user-chip .uc-nome { font-weight: 600; color: #4a463f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .uc-sair { margin-left: auto; background: none; border: none; color: var(--accent-ink); cursor: pointer; font: inherit; font-size: 12px; }
.user-chip .uc-sair:hover { text-decoration: underline; }
.user-chip:not(:empty) + .sidebar-foot { margin-top: 10px; }

/* -------- Tela de login -------- */
.login-gate {
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-gate[hidden] { display: none; }
.lg-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 40px 38px; max-width: 380px; width: 100%; text-align: center;
}
.lg-logo { font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.lg-sub { color: var(--muted); margin: 4px 0 26px; font-size: 14px; }
.lg-btn { width: 100%; padding: 13px; font-size: 15px; }
.login-msg { font-size: 13px; color: var(--muted); min-height: 18px; margin: 14px 0 0; }
.login-msg.erro { color: var(--danger); font-weight: 600; }
.lg-nota { font-size: 12px; color: var(--muted); margin: 18px 0 0; }
/* porta do cliente (construtora) — discreta, no pé do cartão de login.
   Herda a cor de .lg-nota (o irmão logo acima) para funcionar tanto no fundo claro
   do design base quanto no fundo navy que a pele RBFD aplica na porta. Cor fixa aqui
   ficaria ilegível num dos dois. */
.lg-cliente { margin: 20px 0 0; font-size: 11.5px; color: inherit; }
.lg-cliente a { color: inherit; opacity: .8; text-decoration: none; border-bottom: 1px solid transparent; }
.lg-cliente a:hover { opacity: 1; border-bottom-color: currentColor; }

/* -------- Main -------- */
.main { padding: 30px 34px 60px; overflow: auto; max-width: 920px; }
#estado-vazio {
  color: var(--muted); text-align: center; margin-top: 22vh; font-size: 15px;
}
.form-head { margin-bottom: 22px; }
.form-head h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.3px; }
.form-head p { margin: 0; color: var(--muted); }

.bloco {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.bloco h3 {
  margin: 0 0 14px; font-size: 13px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--accent-ink); font-weight: 700;
}

.grid2, .grid3 { display: grid; gap: 12px 14px; }
.grid2 { grid-template-columns: 1fr 1fr; }
.grid3 { grid-template-columns: 1fr 1fr 1fr; }
.col2 { grid-column: 1 / -1; }

label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 12.5px; font-weight: 600; color: #4a463f;
}
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 9px 11px; background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: #b3ada2; }

/* comprador cards */
.card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 15px; margin-bottom: 10px; background: #fcfbf9;
}
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.card-head-right { display: flex; align-items: center; gap: 10px; }
.tipo-pessoa { width: auto; min-width: 150px; font-weight: 600; padding: 6px 10px; }
.card-title { font-weight: 700; font-size: 13px; }
.link-danger {
  background: none; border: none; color: var(--danger);
  cursor: pointer; font-size: 12.5px; padding: 2px 4px;
}
.link-danger:hover { text-decoration: underline; }

.btn-ghost {
  background: #fff; border: 1px dashed var(--line-strong); color: var(--accent-ink);
  border-radius: 8px; padding: 9px 14px; cursor: pointer; font: inherit;
  font-weight: 600; font-size: 13px;
}
.btn-ghost:hover { border-color: var(--accent); background: var(--accent-soft); }

/* formas de pagamento */
.forma { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; background: #fcfbf9; }
.forma-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.forma-tipo { width: auto; min-width: 170px; font-weight: 600; }
.rm-forma { margin-left: auto; }
.venc-toggle { display: flex; gap: 16px; padding: 4px 0; }
.radiobtn { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; }
.radiobtn input { width: auto; }

.linha-add { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.soma-pct { font-size: 12.5px; font-weight: 600; }
.soma-pct.ok { color: var(--accent-ink); }
.soma-pct.erro { color: var(--danger); }

/* assistente de pagamento */
.assist {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 15px; margin-bottom: 12px; background: #fbfaf7;
}
.assist-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.muted { color: var(--muted); font-weight: 400; font-size: 12px; }

.preview-wrap {
  display: flex; flex-direction: column; gap: 5px; justify-content: flex-end;
  padding-bottom: 2px;
}
.preview-label {
  font-size: 12.5px; font-weight: 600; color: #4a463f;
}
.preview-val {
  font-size: 13px; color: var(--accent-ink); font-style: italic;
  min-height: 20px; padding: 6px 0;
}

/* barra de ação */
.actionbar {
  position: sticky; bottom: 0; margin-top: 22px;
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(180deg, rgba(244,242,238,0), var(--bg) 40%);
  padding: 16px 0 4px;
}
.btn-primary {
  background: var(--accent); color: #fff; border: none;
  border-radius: 9px; padding: 12px 22px; font: inherit; font-weight: 700;
  font-size: 14.5px; cursor: pointer; box-shadow: var(--shadow);
}
.btn-primary:hover { background: var(--accent-ink); }
.btn-secondary {
  background: #fff; color: var(--accent-ink); border: 1px solid var(--line-strong);
  border-radius: 9px; padding: 12px 18px; font: inherit; font-weight: 600;
  font-size: 14px; cursor: pointer;
}
.btn-secondary:hover { border-color: var(--accent); background: var(--accent-soft); }
.status { font-size: 13px; color: var(--muted); }
.status.ok { color: var(--accent-ink); font-weight: 600; }
.status.erro { color: var(--danger); font-weight: 600; }

/* -------- Revisões recebidas -------- */
.rev-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.rev-topo h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.3px; }
.rev-sub { margin: 0; color: var(--muted); font-size: 13.5px; }
.import-lbl { white-space: nowrap; }
.rev-vazio { color: var(--muted); text-align: center; margin-top: 16vh; line-height: 1.7; }
.rev-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.ct-filtros { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.ct-fchip {
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  padding: 6px 12px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted);
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.ct-fchip:hover { border-color: var(--brand, var(--accent)); color: var(--text, var(--accent-ink)); }
.ct-fchip.on { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.ct-fn { font-size: 11px; opacity: .8; background: rgba(0,0,0,.08); border-radius: 10px; padding: 1px 7px; }
.ct-fchip.on .ct-fn { background: rgba(255,255,255,.22); }

/* barra: chips de situação + alternância de visualização */
.ct-barra { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ct-barra .ct-filtros { flex: 1; }
.ct-vista { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.ct-vbtn {
  background: var(--panel); border: none; padding: 7px 14px; font: inherit; font-size: 12.5px;
  font-weight: 600; color: var(--muted); cursor: pointer;
}
.ct-vbtn + .ct-vbtn { border-left: 1px solid var(--line); }
.ct-vbtn.on { background: var(--accent-ink); color: #fff; }

/* barra de seleção em massa */
.ct-selbar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 10px 14px;
  background: #eef2f0; border: 1px solid #cddcd5; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--accent-ink);
}
.ct-del, .btn-danger {
  background: #fff; color: #a3492f; border: 1px solid #e2b8ab; border-radius: 8px;
  padding: 7px 13px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.ct-del:hover, .btn-danger:hover { background: #fbe4dd; }
.btn-danger { padding: 10px 16px; font-size: 13px; }

/* tabela (visualização em lista) */
.ct-tabwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.ct-tab { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ct-tab th, .ct-tab td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.ct-tab thead th { background: #f6f4ef; white-space: nowrap; }
.ct-th {
  background: none; border: none; padding: 0; font: inherit; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--accent-ink); cursor: pointer; display: inline-flex; gap: 5px;
}
.ct-th:hover { text-decoration: underline; }
.ct-seta { font-size: 9px; }
.ct-filtrow td { padding: 6px 8px; background: #faf9f6; }
.ct-fin {
  width: 100%; min-width: 90px; border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 8px; font: inherit; font-size: 12.5px; background: #fff;
}
.ct-tr { cursor: pointer; }
.ct-tr:hover { background: #f6f8f7; }
.ct-tr.sel { background: #eef2f0; }
.ct-c1 { font-weight: 600; color: var(--text, #2b2b2b); }
.ct-num { text-align: right; white-space: nowrap; }
.ct-data { white-space: nowrap; color: var(--muted); }
.ct-cbox { width: 34px; text-align: center; }
.ct-acao { width: 78px; }
.ct-del-1 {
  background: none; border: none; padding: 4px 6px; font: inherit; font-size: 12px;
  color: #a3492f; cursor: pointer; text-decoration: underline;
}
.ct-badge { font-size: 11.5px; font-weight: 700; border-radius: 20px; padding: 3px 9px; background: #f0eee8; color: #8a8474; white-space: nowrap; }
.ct-badge.st-em_revisao, .ct-badge.st-em_analise { background: #e7f0ff; color: #2456b8; }
.ct-badge.st-aguardando_construtora { background: #fdf1dc; color: #8a6412; }
.ct-badge.st-pronta { background: #e3f3ea; color: #1f6f4f; }
.ct-badge.st-assinada { background: var(--accent-ink); color: #fff; }

/* atalho para o PDF assinado no card — o seletor precisa ser mais específico que
   ".rc-tags span" (que pinta as pílulas), senão o ícone ganha fundo e padding */
.rc-tags .rc-pdf {
  display:inline-flex; align-items:center; color: var(--muted); cursor:pointer;
  background: none; border-radius: 0; padding: 0; margin-left: auto;
}
.rc-tags .rc-pdf:hover { color: var(--accent-ink); }

/* seletores da tela Gerar: cliente -> modelo daquele cliente */
.gc-sel {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 18px;
}
.gc-sel-c { flex: 1 1 240px; min-width: 0; gap: 6px; }
.gc-sel-c > span {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 700;
}
.gc-sel-c select { width: 100%; }
.gc-sel-nota { flex-basis: 100%; margin: 0; font-size: 12px; color: var(--muted); }

/* retorno da construtora (o gatilho aoDecidirValidacao carimba no contrato) */
.ct-retorno {
  display: inline-block; margin-left: 6px; font-size: 10.5px; font-weight: 700;
  border-radius: 20px; padding: 2px 8px; background: #fdf1dc; color: #8a6412; white-space: nowrap;
}
.ct-retorno.ok { background: var(--accent-soft); color: var(--accent-ink); }
.rc-retorno { margin-top: 4px; }
.ct-aviso-retorno {
  margin: 12px 0 0; padding: 12px 14px; border-left: 3px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 8px 8px 0; font-size: 13px; line-height: 1.55;
}

/* responsável pelo contrato */
.ct-fmeus.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.ct-resp { color: var(--muted); }
.ct-resp.eu { color: var(--accent-ink); font-weight: 600; }
.ct-eu { font-size: 11.5px; color: var(--accent); font-weight: 600; }
.ct-resp-acoes { margin-left: 10px; display: inline-flex; gap: 6px; }
.ct-mini {
  background: #eef2f0; color: var(--accent-ink); border: 1px solid #cddcd5; border-radius: 7px;
  padding: 4px 9px; font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.ct-mini:hover { background: #e2ece7; }
/* [hidden] precisa vencer o display:flex (senão a caixa aparece vazia) */
.ct-passar[hidden] { display: none; }
.ct-passar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 8px 0 0; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
}
.ct-passar-l { font-size: 12.5px; color: var(--muted); }

/* lixeira */
.ct-flix { margin-left: 6px; }
.ct-flix.on { background: #8a8474; border-color: #8a8474; color: #fff; }
.ct-badge.ct-urgente { background: #fbe4dd; color: #a3492f; }
.ct-acao2 { white-space: nowrap; width: 190px; text-align: right; }
.ct-restaurar {
  background: #eef2f0; color: var(--accent-ink); border: 1px solid #cddcd5; border-radius: 7px;
  padding: 5px 10px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; margin-right: 6px;
}
.ct-restaurar:hover { background: #e2ece7; }
.rev-card {
  text-align: left; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 15px; cursor: pointer; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px;
}
.rev-card:hover { border-color: var(--accent); }
.rc-tit { font-weight: 700; font-size: 15px; }
.rc-sub { font-size: 12.5px; color: var(--muted); }
.rc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.rc-tags span { font-size: 11px; background: #f0eee8; color: #6a6459; border-radius: 20px; padding: 2px 9px; font-weight: 600; }
.rc-tags .pend { background: #fbe4dd; color: var(--danger); }
.rc-tags .ok { background: var(--accent-soft); color: var(--accent-ink); }
.rc-data { font-size: 11.5px; color: #a39c8f; margin-top: 2px; }

.link-back { background: none; border: none; color: var(--accent-ink); cursor: pointer; font: inherit; font-size: 13px; padding: 0 0 6px; }
.link-back:hover { text-decoration: underline; }

.rev-saida { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; box-shadow: var(--shadow); }
.rs-linha { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.rs-user { font-size: 13px; color: #4a463f; }
.rs-user .link-back { padding: 0; font-size: 12px; margin-left: 4px; }
.rs-selo { font-size: 12.5px; font-weight: 600; color: var(--accent-ink); background: var(--accent-soft); border-radius: 20px; padding: 3px 12px; }
.rs-selo.pend { color: #8a6d1f; background: #fbf3dd; }
.rs-botoes { display: flex; gap: 10px; flex-wrap: wrap; }
.rs-aviso { font-size: 13px; color: var(--danger); background: #fbe4dd; border-radius: 8px; padding: 10px 12px; }
.rev-saida .status { display: block; margin-top: 10px; }
.m-row2 { display: flex; justify-content: space-between; font-size: 13.5px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.m-row2 .k { color: var(--muted); }
.m-row2 .v { font-weight: 600; }
.ct-link { margin-top: 14px; background: var(--accent-soft); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.ct-link[hidden] { display: none; }
.ctl-t { font-size: 12.5px; font-weight: 600; color: var(--accent-ink); margin-bottom: 8px; }
.ctl-row { display: flex; gap: 8px; }
.ctl-row input { flex: 1; border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; background: #fff; }
.sec-t2 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--green-ink, var(--accent-ink)); font-weight: 700; margin: 22px 0 12px; }
.rt-step { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13.5px; }
.rt-dot { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: #f0eee8; color: #b3ada2; }
.rt-step.ok .rt-dot { background: var(--accent); color: #fff; }
.rt-l { font-weight: 600; color: #4a463f; }
.rt-step:not(.ok) .rt-l { color: var(--muted); font-weight: 500; }
.rt-w { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.rt-envios { margin: 0 0 6px 32px; display: flex; flex-direction: column; gap: 6px; }
.rt-envio { display: flex; align-items: center; gap: 10px; font-size: 13px; background: #f7f5f0; border-radius: 8px; padding: 7px 12px; }
.rt-envio .re-nome { font-weight: 600; color: #4a463f; }
.rt-envio .re-qt { color: var(--accent-ink); font-size: 12px; }
.rt-envio .re-em { margin-left: auto; color: var(--muted); font-size: 12px; }

.rev-itens { display: flex; flex-direction: column; gap: 12px; }
.rev-item { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.rev-item.st-aceita { border-left-color: var(--accent); }
.rev-item.st-rejeitada { border-left-color: var(--danger); }
.ri-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ri-badge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-radius: 20px; padding: 2px 9px; }
.b-sug { background: #fdf3d6; color: #9a7a1f; }
.b-com { background: #e7edff; color: #3a53a3; }
.ri-ref { font-size: 12.5px; color: #4a463f; font-weight: 600; }
.ri-meta { font-size: 12px; color: var(--muted); margin-left: auto; }
.ri-redline { font-size: 14px; line-height: 1.75; background: #faf9f5; border-radius: 6px; padding: 8px 10px; }
.ri-coment { font-size: 14px; background: #f7f9ff; border-radius: 6px; padding: 8px 10px; }
.ri-redline del, .ri-redline ins { border-radius: 2px; padding: 0 1px; }
.ri-redline del { color: var(--danger); text-decoration: line-through; background: #fbe4dd; }
.ri-redline ins { color: #1f6f4f; text-decoration: none; background: #dcefe4; }
.ri-acts { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.ri-status { font-size: 12px; font-weight: 700; margin-right: auto; }
.s-pendente { color: #a39c8f; } .s-aceita { color: var(--accent-ink); } .s-rejeitada { color: var(--danger); }
.mini { border: 1px solid var(--line-strong); background: #fff; border-radius: 6px; padding: 6px 12px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.mini.a:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.mini.e:hover { border-color: var(--amber, #a3822f); background: #fbf3dd; color: #8a6d1f; }
.mini.r:hover { border-color: var(--danger); background: #fbe4dd; color: var(--danger); }
.mini.g:hover { background: #f0eee8; }
.rev-item.st-escalada { border-left-color: #a3822f; }
.s-escalada { color: #8a6d1f; }
/* botão da decisão atual fica marcado */
.mini.a.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.mini.e.sel { background: #a3822f; border-color: #a3822f; color: #fff; }
.mini.r.sel { background: var(--danger); border-color: var(--danger); color: #fff; }
.mini.sel { font-weight: 700; }
.rs-resumo { font-size: 12.5px; color: var(--muted); margin: 4px 0 12px; }

/* Minhas alterações no contrato + resposta do comprador (detalhe do contrato) */
.al-lista { margin-top: 10px; }
.al-item { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; padding: 12px 15px; margin-bottom: 12px; }
.al-item .al-ref { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.al-item .al-red { font-size: 14px; line-height: 1.6; margin-bottom: 8px; }
.al-item .al-red del { color: var(--danger); text-decoration: line-through; background: #fbe4dd; border-radius: 2px; padding: 0 1px; }
.al-item .al-red ins { color: #1f6f4f; text-decoration: none; background: #dcefe4; border-radius: 2px; padding: 0 1px; }
.al-resp { font-size: 13px; }
.al-aguard { color: var(--muted); font-style: italic; }
.al-ok { color: #1f6f4f; font-weight: 600; }
.al-com { background: #fbf3dd; color: #8a6d1f; border-radius: 8px; padding: 8px 11px; }
.al-quem { color: #a08a3a; font-weight: 400; }

/* Editor do escritório */
.ed-ov { position: fixed; inset: 0; background: rgba(28,26,23,.5); display: none; align-items: flex-start; justify-content: center; padding: 24px; z-index: 60; }
.ed-ov.open { display: flex; }
.ed-modal { background: #fff; border-radius: 12px; max-width: 900px; width: 100%; max-height: calc(100vh - 48px); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.ed-top { flex: 0 0 auto; background: var(--green-ink, var(--accent-ink)); color: #fff; padding: 13px 20px; display: flex; align-items: center; gap: 14px; }
.ed-top #ed-titulo { font-weight: 700; font-size: 15px; }
.ed-hint { font-size: 12px; opacity: .9; margin-left: auto; max-width: 340px; }
.ed-x { background: #fff; color: var(--green-ink, var(--accent-ink)); border: none; border-radius: 8px; padding: 8px 16px; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.ed-body { flex: 1 1 auto; overflow: auto; padding: 40px 46px; font-size: 15px; line-height: 1.6; }

/* balão lateral com a observação do comprador */
.ed-balao { position: fixed; width: 300px; max-height: 70vh; overflow: auto; background: #fff; border: 1px solid var(--line-strong); border-left: 4px solid var(--accent); border-radius: 10px; box-shadow: 0 12px 34px rgba(0,0,0,.24); padding: 14px 16px; z-index: 70; display: none; }
.ed-balao.open { display: block; }
.ed-balao .eb-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ed-balao .eb-tit { font-weight: 700; font-size: 12.5px; color: var(--accent-ink); text-transform: uppercase; letter-spacing: .02em; }
.ed-balao .eb-x { margin-left: auto; background: none; border: none; font-size: 17px; line-height: 1; color: var(--muted); cursor: pointer; }
.ed-balao .eb-ref { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.ed-balao .eb-corpo { font-size: 13.5px; line-height: 1.5; }
.ed-balao .eb-corpo del { color: var(--danger); text-decoration: line-through; background: #fbe4dd; }
.ed-balao .eb-corpo ins { color: #1f6f4f; text-decoration: none; background: #dcefe4; }
.ed-balao .eb-nota { font-size: 12px; color: var(--muted); margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }

/* ícone de editar na observação do comprador */
.ri-edit { background: var(--accent); color: #fff; border: none; border-radius: 7px; width: 30px; height: 30px; font-size: 14px; cursor: pointer; margin-left: auto; flex: 0 0 auto; }
.ri-edit:hover { filter: brightness(1.08); }
.ed-body h1 { font-size: 15px; font-weight: 700; text-align: center; margin: 0 0 24px; }
.ed-body h2, .ed-body h3 { font-size: 15px; font-weight: 700; margin: 22px 0 8px; }
.ed-body p, .ed-body li { margin: 0 0 8px; text-align: justify; }
.ed-body ul { padding-left: 22px; }
.ed-body .tab { display: inline-block; width: 2.4em; }
.ed-body .campo { background: #fdf3d6; border-radius: 3px; padding: 0 2px; }
.ed-body .campo-bloco { display: block; background: #fdf8ea; border: 1px solid #ecdca6; border-radius: 6px; padding: 6px 10px; margin-bottom: 10px; }
.ed-clic { cursor: pointer; border-radius: 4px; transition: background .1s; }
.ed-clic:hover { background: #eef5f1; outline: 1px dashed #9fc3b4; }
.ed-mod { background: #f0f9f4; }
.ed-red del { color: var(--danger); text-decoration: line-through; background: #fbe4dd; border-radius: 2px; padding: 0 1px; }
.ed-red ins { color: #1f6f4f; text-decoration: none; background: #dcefe4; border-radius: 2px; padding: 0 1px; }
.ed-editor { margin: 8px 0; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; padding: 12px; text-align: left; cursor: auto; }
.ed-editor .ed-lbl { font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.ed-editor .ed-orig { font-size: 13px; color: #555; background: #f4f2ec; border-radius: 6px; padding: 6px 8px; margin-bottom: 8px; }
.ed-editor textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; padding: 8px; font: inherit; font-size: 14px; resize: vertical; }
.ed-acts { display: flex; gap: 8px; margin-top: 8px; }
.ed-editor .btn { border: none; border-radius: 6px; padding: 8px 14px; font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; background: #efece5; color: #4a463f; }
.ed-editor .btn-p { background: var(--accent); color: #fff; }
.ed-editor .ed-rm { background: #fbe4dd; color: var(--danger); }
.ri-fund { margin-top: 8px; }
.ri-fund input { width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; padding: 8px 10px; font: inherit; font-size: 13px; }

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--line); }
  .grid2, .grid3 { grid-template-columns: 1fr; }
}

/* ---------------- Configurações (equipe / clientes / modelos) ---------------- */
.cfg-abas { display: flex; gap: 8px; margin-bottom: 18px; }
.cfg-aba {
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  padding: 6px 14px; font: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--muted); cursor: pointer;
}
.cfg-aba.on { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.cfg-nota { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin: 0 0 14px; }
.cfg-sub {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); font-weight: 700; margin: 16px 0 8px;
}
.cfg-tab { width: 100%; border-collapse: collapse; font-size: 13.5px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cfg-tab th, .cfg-tab td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.cfg-tab thead th { background: #f6f4ef; font-size: 11px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); }
.cfg-tab tr:last-child td { border-bottom: none; }
.cfg-n { font-weight: 600; }
.cfg-desc { font-size: 11.5px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.cfg-eu { font-size: 10.5px; color: var(--accent); font-weight: 700; }
.cfg-vazio { color: var(--muted); font-size: 12.5px; padding: 4px 0; }
.cfg-falta { color: var(--danger); }
.cfg-acao { width: 40px; text-align: right; }
.cfg-x { background: none; border: none; color: var(--muted); cursor: pointer; padding: 2px 4px;
  display: inline-flex; align-items: center; margin-left: 8px; }
.cfg-x:hover { color: var(--danger); }
.cfg-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.cfg-add input { flex: 1 1 170px; min-width: 0; }
.cfg-cards { display: flex; flex-direction: column; gap: 14px; }
.cfg-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; }
.cfg-card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cfg-id { font-size: 11px; color: var(--muted); margin-left: 8px; }
.cfg-link { font-size: 12px; color: var(--accent-ink); }
.cfg-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.cfg-lista li { font-size: 13px; display: flex; align-items: center; gap: 4px; }
.cfg-emp { color: var(--muted); font-size: 12px; }
.cfg-novo { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
