/* Memorial Quantitativo — a tela de revisão é o produto, o resto sai da frente. */

:root {
  --fundo: #fbfaf8;
  --papel: #ffffff;
  --tinta: #1c1a17;
  --tinta-fraca: #6b665e;
  --borda: #e3ded5;
  --realce: #8a5a2b;
  --realce-fraco: #f5ede2;
  --atencao: #a8590a;
  --atencao-fundo: #fdf4e7;
  --erro: #9c2b2b;
  --erro-fundo: #fbeeee;
  --ok: #3f6b47;
  --raio: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fundo: #161513;
    --papel: #1e1c1a;
    --tinta: #ece7de;
    --tinta-fraca: #9b948a;
    --borda: #322e29;
    --realce: #d09a5f;
    --realce-fraco: #2a231a;
    --atencao: #e0a458;
    --atencao-fundo: #2b2114;
    --erro: #e08585;
    --erro-fundo: #2e1a1a;
    --ok: #7fae87;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--fundo);
  color: var(--tinta);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main { max-width: 1180px; margin: 0 auto; padding: 28px 20px 80px; }

/* --- topo ------------------------------------------------------------------ */
.topo {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 20px;
  background: var(--papel); border-bottom: 1px solid var(--borda);
}
.marca { font-weight: 650; text-decoration: none; color: var(--tinta); letter-spacing: -.01em; }
.marca span { color: var(--tinta-fraca); font-weight: 400; margin-left: .35em; }
.topo nav { display: flex; align-items: center; gap: 18px; }
.topo nav a { color: var(--tinta-fraca); text-decoration: none; }
.topo nav a:hover { color: var(--tinta); }
.escritorio { color: var(--tinta-fraca); font-size: 13px; }
.topo form { margin: 0; }

/* --- blocos ---------------------------------------------------------------- */
h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.015em; }
h2 { font-size: 16px; margin: 28px 0 10px; letter-spacing: -.01em; }

.cartao {
  background: var(--papel); border: 1px solid var(--borda);
  border-radius: var(--raio); padding: 20px; margin-bottom: 24px;
}
.cartao.estreito { max-width: 420px; margin: 48px auto; }
.cartao h1, .cartao h2 { margin-top: 0; }

.nota, .secundario, .vazio { color: var(--tinta-fraca); font-size: 13.5px; }
.nota { margin: 4px 0 14px; }
.vazio { padding: 18px 0; }

.aviso {
  padding: 12px 14px; border-radius: var(--raio); margin-bottom: 20px;
  background: var(--atencao-fundo); border: 1px solid var(--atencao);
  color: var(--atencao); font-size: 14px;
}
.aviso.erro { background: var(--erro-fundo); border-color: var(--erro); color: var(--erro); }
.aviso a { color: inherit; }

/* --- formulários ----------------------------------------------------------- */
label { display: block; margin-bottom: 14px; font-size: 13.5px; color: var(--tinta-fraca); }
input[type=email], input[type=password], input[type=file], textarea {
  display: block; width: 100%; margin-top: 5px; padding: 9px 11px;
  font: inherit; color: var(--tinta);
  background: var(--fundo); border: 1px solid var(--borda); border-radius: var(--raio);
}
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
input:focus, textarea:focus { outline: 2px solid var(--realce); outline-offset: -1px; }

button, .botao {
  font: inherit; font-weight: 550; cursor: pointer;
  padding: 9px 16px; border-radius: var(--raio);
  background: var(--realce); color: #fff; border: 1px solid transparent;
  text-decoration: none; display: inline-block;
}
button:hover, .botao:hover { filter: brightness(1.08); }
button.link {
  background: none; color: var(--tinta-fraca); border: none; padding: 0; font-weight: 400;
}
button.link:hover { color: var(--tinta); text-decoration: underline; }

.upload { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.upload input[type=file] { flex: 1 1 260px; width: auto; margin: 0; }

/* --- tabela de projetos ---------------------------------------------------- */
table { width: 100%; border-collapse: collapse; }
.projetos { background: var(--papel); border: 1px solid var(--borda); border-radius: var(--raio); }
.projetos th, .projetos td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--borda); }
.projetos th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--tinta-fraca); font-weight: 550; }
.projetos tr:last-child td { border-bottom: none; }
.projetos a { color: var(--tinta); font-weight: 550; }

/* --- revisão --------------------------------------------------------------- */
.cabecalho-projeto {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 20px; flex-wrap: wrap; margin-bottom: 18px;
}
.cabecalho-projeto code { font-size: 12.5px; color: var(--tinta-fraca); }

.resumo {
  display: flex; flex-wrap: wrap; gap: 8px 20px;
  padding: 12px 16px; margin-bottom: 12px; font-size: 13.5px;
  background: var(--papel); border: 1px solid var(--borda); border-radius: var(--raio);
}
.marca-contada { color: var(--realce); }
.marca-revisar { color: var(--atencao); }
.marca-editado { color: var(--ok); }

.explicacao {
  font-size: 13.5px; color: var(--tinta-fraca);
  max-width: 74ch; margin: 0 0 26px;
}

.secao { margin-bottom: 34px; }
.itens { background: var(--papel); border: 1px solid var(--borda); border-radius: var(--raio); }
.itens th {
  text-align: left; padding: 8px 10px; font-size: 11.5px; font-weight: 550;
  text-transform: uppercase; letter-spacing: .06em; color: var(--tinta-fraca);
  border-bottom: 1px solid var(--borda);
}
.itens td { padding: 4px 6px; border-bottom: 1px solid var(--borda); vertical-align: top; }
.itens tr:last-child td { border-bottom: none; }
.itens .larga { width: 42%; }
.itens .quantidade { width: 24%; }
.itens .acoes { width: 34px; }

.itens input {
  width: 100%; padding: 6px 8px; font: inherit; font-size: 13.5px; color: var(--tinta);
  background: transparent; border: 1px solid transparent; border-radius: 4px;
}
.itens input:hover { border-color: var(--borda); }
.itens input:focus { background: var(--fundo); border-color: var(--realce); outline: none; }

/* Quantidade que veio de contagem: é a que erra, então é a que se vê. */
.itens input.contada {
  border-left: 2px solid var(--realce);
  border-radius: 0 4px 4px 0;
  background: var(--realce-fraco);
}
.fonte {
  display: block; padding: 0 8px 4px; font-size: 11.5px; line-height: 1.35;
  color: var(--tinta-fraca);
}

tr.revisar { background: var(--atencao-fundo); }
tr.editado td:first-child { box-shadow: inset 3px 0 0 var(--ok); }

.remover {
  background: none; color: var(--tinta-fraca); border: none;
  font-size: 17px; line-height: 1; padding: 6px 4px;
}
.remover:hover { color: var(--erro); }

.incluir {
  margin-top: 8px; background: none; color: var(--tinta-fraca);
  border: 1px dashed var(--borda); font-size: 13px; font-weight: 400;
}
.incluir:hover { color: var(--realce); border-color: var(--realce); }

.codigo {
  display: inline-block; margin-left: 8px; font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--tinta-fraca);
}

.perfil-efetivo {
  max-height: 340px; overflow: auto; padding: 12px;
  background: var(--fundo); border: 1px solid var(--borda); border-radius: var(--raio);
  font-size: 12px;
}
details summary { cursor: pointer; color: var(--tinta-fraca); font-size: 13.5px; margin-top: 14px; }

@media (max-width: 720px) {
  .itens .larga, .itens .quantidade { width: auto; }
  .cabecalho-projeto { flex-direction: column; }
}
