:root {
  --brand-50: #f0f7fb;
  --brand-100: #daebf5;
  --brand-200: #b8d9ec;
  --brand-400: #51a1cd;
  --brand-500: #2d86b8;
  --brand-600: #256b9a;
  --brand-800: #214a68;
  --brand-900: #203f57;
  --brand-950: #152838;
  --ink: #0b1020;
  --cream: #f7f5f0;
  --accent: #c5a059;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --warn: #8a5a14;
  --warn-soft: #f8f0e2;
  --danger: #8d3d34;
  --sombra: 0 20px 40px -28px rgba(15, 23, 42, 0.12);
  --sombra-hover: 0 28px 56px -28px rgba(15, 23, 42, 0.16);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  overflow-x: clip;
  background: #fff;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.625;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
a { color: var(--brand-800); }

.app {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
  background: #fff;
}

.topo {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 4.5rem;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.5);
  position: sticky;
  top: 0;
  z-index: 50;
}

.marca { min-width: 280px; }
.produto {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--slate-500);
}
.marca-barra {
  width: 40px;
  height: 1px;
  background: var(--accent);
  flex: none;
}
.topo h1 {
  margin-top: 2px;
  font-size: 1.25rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
}
.meta {
  color: var(--slate-500);
  font-size: 13px;
  flex: 1;
}
.vistas { display: flex; gap: 6px; }
.aba {
  border: 1px solid transparent;
  background: transparent;
  color: var(--slate-600);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.aba:hover { color: var(--ink); }
.aba.ativa {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}
.aba.ativa:hover { background: var(--brand-950); }

.corpo {
  display: grid;
  grid-template-columns: 250px minmax(280px, 380px) 1fr;
  min-height: 0;
}
.filtros, .lista-painel, .ficha {
  min-height: 0;
  overflow: auto;
}
.filtros {
  padding: 20px 16px 24px;
  border-right: 1px solid rgba(226, 232, 240, 0.8);
  background: color-mix(in srgb, var(--cream) 40%, white);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo > span,
.portes legend {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--slate-500);
}
.campo input,
.campo select,
.nota {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--slate-200);
  border-radius: 0;
  background: transparent;
  padding: 10px 0;
  color: var(--ink);
  outline: none;
}
.campo input::placeholder,
.nota::placeholder { color: var(--slate-400); }
.campo input:focus,
.campo select:focus,
.nota:focus { border-bottom-color: var(--brand-500); }
.campo select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--slate-500) 50%), linear-gradient(135deg, var(--slate-500) 50%, transparent 50%);
  background-position: calc(100% - 10px) calc(50% + 2px), calc(100% - 5px) calc(50% + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 22px;
}
.recorte { font-size: 13px; color: var(--slate-600); }
.link-botao {
  background: none;
  border: 0;
  padding: 0;
  color: var(--brand-800);
  text-align: left;
  font-size: 0.875rem;
  font-weight: 600;
  text-underline-offset: 4px;
}
.link-botao:hover { text-decoration: underline; }
.cobertura { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.cobertura-linha, .trilha-rotulo {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--slate-500);
}
.trilha { height: 4px; background: var(--slate-200); border-radius: 99px; overflow: hidden; }
.trilho { height: 100%; background: var(--brand-500); }
.trilho.warn { background: var(--warn); }
.baixar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  border: 1px solid var(--slate-300);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.baixar:hover {
  border-color: var(--brand-400);
  background: var(--brand-50);
  color: var(--ink);
}

.lista { list-style: none; margin: 0; padding: 0; }
.item {
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  background: transparent;
  padding: 14px 16px;
  display: grid;
  gap: 4px;
  transition: background 0.15s;
}
.item:hover { background: var(--brand-50); }
.item.ativo {
  background: var(--brand-50);
  box-shadow: inset 3px 0 0 var(--brand-600);
}
.item-nome { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; color: var(--ink); }
.item-meta { color: var(--slate-500); font-size: 12px; }
.item-status {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.item-status.apta { color: var(--brand-800); }
.item-status.revisar { color: var(--warn); }
.item-status.descartada { color: var(--danger); }
.vazio-lista { padding: 24px 16px; color: var(--slate-500); }

.ficha {
  padding: 28px 32px 40px;
  background: #fff;
  border-left: 1px solid rgba(226, 232, 240, 0.8);
}
.fantasia {
  font-weight: 300;
  font-size: clamp(1.75rem, 2.5vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.fantasia::after {
  content: "";
  display: block;
  width: 3rem;
  height: 0.25rem;
  margin-top: 1rem;
  border-radius: 999px;
  background: var(--accent);
}
.razao { margin-top: 10px; color: var(--slate-600); }
.cnpj { margin-top: 4px; color: var(--slate-600); font-variant-numeric: tabular-nums; }
.selos { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 8px; }
.selo {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: #fff;
  color: var(--slate-600);
}
.selo.vigilancia,
.selo.monitoramento {
  background: var(--brand-50);
  border-color: var(--brand-200);
  color: var(--brand-800);
}
.bloco { margin-top: 22px; }
.bloco h2,
.revisao h2 {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--slate-500);
}
.linhas { margin-top: 10px; display: grid; gap: 12px; }
.linhas a {
  color: var(--brand-800);
  font-size: 0.875rem;
  font-weight: 600;
  text-underline-offset: 4px;
  text-decoration: none;
}
.linhas a:hover { text-decoration: underline; }
.rotulo {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--slate-500);
}
.motivo { margin-top: 8px; line-height: 1.5; color: var(--slate-600); }
.fontes { margin-top: 8px; font-size: 13px; color: var(--slate-500); }
.fontes summary { cursor: pointer; color: var(--slate-600); }
.aviso {
  margin-top: 18px;
  padding: 12px 14px;
  background: var(--warn-soft);
  border-radius: 1rem;
  line-height: 1.45;
  font-size: 14px;
  color: var(--ink);
}
.revisao {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid rgba(226, 232, 240, 0.8);
}
.acoes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.acoes button {
  border: 1px solid var(--slate-300);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: border-color 0.15s, background 0.15s;
}
.acoes button:hover {
  border-color: var(--brand-400);
  background: var(--brand-50);
}
.acoes button.ligado.apta {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}
.acoes button.ligado.apta:hover { background: var(--brand-950); }
.acoes button.ligado.revisar {
  border-color: var(--warn);
  background: var(--warn);
  color: #fff;
}
.acoes button.ligado.descartada {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}
.nota { margin-top: 12px; min-height: 72px; resize: vertical; }
.gravacao { margin-top: 8px; font-size: 12px; color: var(--slate-500); }

.pesquisas {
  overflow: auto;
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(280px, 480px);
  gap: 32px;
  padding: 40px 24px 64px;
  background: color-mix(in srgb, var(--cream) 30%, white);
}
.pesquisas h2,
.roteiro > h2,
.passos h3 {
  font-weight: 300;
  letter-spacing: -0.028em;
  line-height: 1.12;
  color: var(--ink);
}
.pesquisas h2 { font-size: clamp(1.75rem, 2.5vw, 2.25rem); }
.nota-curta { margin-top: 8px; color: var(--slate-600); line-height: 1.5; }
.lista-pesquisas { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; }
.pesquisa-item {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: #fff;
  border-radius: 1rem;
  padding: 14px 16px;
  display: grid;
  gap: 4px;
  box-shadow: var(--sombra);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.pesquisa-item:hover {
  border-color: color-mix(in srgb, var(--brand-200) 80%, white);
  box-shadow: var(--sombra-hover);
}
.pesquisa-item.ativa { box-shadow: inset 3px 0 0 var(--brand-600), var(--sombra); }
.form-pesquisa {
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 1rem;
  padding: 0 0 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-self: start;
  box-shadow: 0 24px 48px -28px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}
.form-pesquisa > * { margin-left: 22px; margin-right: 22px; }
.form-pesquisa h2 {
  margin: 0;
  padding: 22px 22px 16px;
  background: rgba(248, 250, 252, 0.8);
  border-bottom: 1px solid var(--slate-100);
}
.portes { border: 0; margin: 0 22px; padding: 0; display: grid; gap: 6px; }
.portes label { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink); }
.portes input { accent-color: var(--brand-500); }
.sugestoes { list-style: none; margin: 0 22px; padding: 0; display: grid; gap: 6px; }
.escolhidos { display: grid; gap: 6px; }
.sugestao, .escolhido {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: var(--brand-50);
  border-radius: 0.75rem;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--ink);
}
.escolhido { display: flex; justify-content: space-between; gap: 8px; align-items: center; background: #fff; }
.primario {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 14px 32px;
  width: auto;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.15s;
}
.form-pesquisa .primario { width: calc(100% - 44px); }
.primario:hover { background: var(--brand-950); }
.primario:disabled { cursor: not-allowed; opacity: 0.6; }
.primario.na-ficha, #revalidacao .primario, #bricks .primario { width: auto; margin-top: 12px; }
.log {
  margin: 0 22px;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--slate-500);
  max-height: 180px;
  overflow: auto;
}

.roteiro {
  overflow: auto;
  padding: 48px 24px 64px;
  background: linear-gradient(180deg, var(--cream) 0%, #ffffff 45%, #f8fafc 100%);
}
.roteiro > h2 {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  max-width: 40rem;
  margin: 12px auto 0;
}
.passo-marca, .lede, .passos { max-width: 40rem; margin-left: auto; margin-right: auto; }
.passo-marca {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--slate-500);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.passo-marca::before {
  content: "";
  width: 40px;
  height: 1px;
  background: var(--accent);
}
.lede {
  margin-top: 16px;
  font-size: clamp(1.125rem, 1.8vw, 1.375rem);
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--slate-600);
}
.passos { list-style: none; padding: 0; margin-top: 32px; display: grid; gap: 0; }
.passos li { padding: 20px 0; border-top: 1px solid rgba(226, 232, 240, 0.8); }
.passos h3 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; }
.passos p { margin-top: 6px; line-height: 1.5; color: var(--slate-600); }

:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
}
.campo input:focus-visible,
.campo select:focus-visible,
.nota:focus-visible { outline: none; }

.acesso {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(180deg, var(--cream) 0%, #ffffff 45%, #f8fafc 100%);
}
.acesso-card {
  width: min(100%, 420px);
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 1rem;
  box-shadow: 0 24px 48px -28px rgba(15, 23, 42, 0.12);
  padding: 28px 28px 32px;
}
.acesso-card h1 {
  margin: 14px 0 22px;
  font-size: clamp(1.75rem, 2.5vw, 2.25rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.acesso-card form { display: grid; gap: 14px; }
.acesso-card .primario { width: 100%; }
#login-erro:not(:empty) { color: #8d3d34; }

@media (max-width: 980px) {
  .app { height: auto; }
  .topo { flex-wrap: wrap; align-items: flex-start; }
  .meta { flex: 1 1 100%; }
  .corpo { grid-template-columns: 1fr; }
  .lista-painel { max-height: 420px; border-bottom: 1px solid rgba(226, 232, 240, 0.8); }
  .ficha { border-left: 0; }
  .pesquisas { grid-template-columns: 1fr; }
}
