:root {
  --tinta: #12243a;
  --tinta-fraca: #5a6b7f;
  --linha: #dde3ea;
  --fundo: #f4f6f9;
  --azul: #14487a;
  --azul-escuro: #0e3358;
  --verde: #1d6f42;
  --vermelho: #9b1c1c;
  --ambar: #8a5a00;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--fundo);
  color: var(--tinta);
  font-size: 14px;
}

.topo {
  background: var(--azul-escuro);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topo h1 { font-size: 18px; letter-spacing: 1.5px; margin: 0; font-weight: 700; }
.link { background: none; border: 1px solid rgba(255,255,255,.5); color: #fff; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 12px; }
.link:hover { background: rgba(255,255,255,.12); }

main { max-width: 1500px; margin: 20px auto; padding: 0 20px 60px; }

.cartao {
  background: #fff;
  border: 1px solid var(--linha);
  border-radius: 6px;
  padding: 18px 20px;
  margin-bottom: 16px;
}
.cartao h2 { font-size: 13px; letter-spacing: 1.2px; margin: 0 0 14px; color: var(--azul); }

.linha { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.campo { display: flex; flex-direction: column; min-width: 180px; flex: 1; }
.campo.curto { max-width: 90px; flex: 0 0 90px; }
.campo.largo { flex: 2 1 340px; }
label { font-size: 11px; letter-spacing: .6px; color: var(--tinta-fraca); margin-bottom: 5px; font-weight: 600; }

input, select, textarea {
  border: 1px solid var(--linha);
  border-radius: 4px;
  padding: 9px 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--tinta);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #b9d2ea; border-color: var(--azul); }
textarea { resize: vertical; font-family: "Consolas", monospace; }

.abas { display: flex; gap: 0; }
.aba {
  border: 1px solid var(--linha); background: #fff; padding: 9px 16px; cursor: pointer;
  font-size: 12px; font-weight: 600; letter-spacing: .5px; color: var(--tinta-fraca);
}
.aba:first-child { border-radius: 4px 0 0 4px; }
.aba:last-child { border-radius: 0 4px 4px 0; border-left: none; }
.aba.ativa { background: var(--azul); border-color: var(--azul); color: #fff; }

.acoes { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
button.principal, button.secundario, button.excel {
  border-radius: 4px; padding: 11px 20px; font-size: 13px; font-weight: 700;
  letter-spacing: .8px; cursor: pointer; border: 1px solid transparent;
}
button.principal { background: var(--azul); color: #fff; }
button.principal:hover { background: var(--azul-escuro); }
button.secundario { background: #fff; color: var(--tinta); border-color: var(--linha); }
button.secundario:hover { background: #eef2f6; }
button.excel { background: var(--verde); color: #fff; padding: 14px 28px; font-size: 14px; }
button.excel:hover { filter: brightness(1.1); }
button:disabled { opacity: .55; cursor: not-allowed; }

.oculto { display: none !important; }

.avisos { border-left: 4px solid var(--vermelho); background: #fdf2f2; padding: 10px 14px; color: var(--vermelho); border-radius: 4px; }
.avisos ul { margin: 0; padding-left: 18px; }

.progresso { border-left: 4px solid var(--azul); font-size: 14px; }
.progresso div { margin-top: 6px; color: var(--tinta-fraca); }

.pendencia { border-left: 4px solid var(--ambar); }
.pendencia h2 { color: var(--ambar); }
.detalhes {
  margin-top: 12px; background: #1d2734; color: #e6edf3; padding: 12px;
  border-radius: 4px; max-height: 320px; overflow: auto; font-size: 12px; white-space: pre-wrap;
}

.cabecalhoResultado { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.cabecalhoResultado h2 { margin: 0; }

.tabelaBox { overflow: auto; max-height: 68vh; border: 1px solid var(--linha); border-radius: 4px; }
table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
th {
  position: sticky; top: 0; background: #eef2f6; text-align: left; padding: 9px 8px;
  border-bottom: 2px solid var(--linha); font-size: 11px; letter-spacing: .5px; white-space: nowrap;
}
td { padding: 8px; border-bottom: 1px solid var(--linha); vertical-align: top; }
tr:hover td { background: #f8fafc; }
td.cnj { font-family: Consolas, monospace; white-space: nowrap; }

.tag { display: inline-block; padding: 2px 7px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.tag.ALTA { background: #e3f4ea; color: var(--verde); }
.tag.CONFIAVEL { background: #e8f0f9; color: var(--azul); }
.tag.REVISAR { background: #fdf4e3; color: var(--ambar); }
.tag.OBRIGATORIA { background: #fdeaea; color: var(--vermelho); }

button.ver { border: 1px solid var(--linha); background: #fff; border-radius: 4px; padding: 4px 10px; cursor: pointer; font-size: 11px; font-weight: 700; }
button.ver:hover { background: #eef2f6; }

dialog {
  border: none; border-radius: 6px; padding: 20px; max-width: 900px; width: 90%;
  box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog h3 { margin: 0 0 12px; font-size: 13px; letter-spacing: 1px; color: var(--azul); }
dialog pre { white-space: pre-wrap; max-height: 60vh; overflow: auto; background: #f6f8fa; padding: 14px; border-radius: 4px; font-family: inherit; font-size: 13px; line-height: 1.5; }
