/* Makro · marca LogDoc (navy, índigo, peri, ice) com acabamento de app da Apple: superfícies claras, cantos
   generosos, sombras suaves em camadas, barra translúcida, controles com resposta ao toque. */
:root {
  --navy: #001133;
  --navy-2: #0a1d45;
  --indigo: #201f9f;
  --indigo-2: #2d2cb8;
  --peri: #8ea7dd;
  --ice: #cee5fd;
  --gelo: #f3f7fd;
  --fundo: #f4f6fb;
  --linha: #dde4f0;
  --linha-2: rgba(0, 17, 51, 0.08);
  --texto: #0b1a33;
  --suave: #56637d;
  --alerta: #b4232a;
  --alerta-fundo: #fdf1f1;
  --ok: #17703c;
  --ok-fundo: #eef8f1;
  --raio: 14px;
  --raio-ctl: 10px;
  --sombra-1: 0 1px 2px rgba(0, 17, 51, 0.05), 0 2px 8px rgba(0, 17, 51, 0.04);
  --sombra-2: 0 1px 2px rgba(0, 17, 51, 0.06), 0 8px 24px rgba(0, 17, 51, 0.08);
  --anel: 0 0 0 4px rgba(32, 31, 159, 0.22);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fonte: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--fonte);
  font-size: 14px;
  line-height: 1.5;
  color: var(--texto);
  background: var(--fundo);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
::selection { background: rgba(32, 31, 159, 0.18); color: var(--navy); }
input, textarea { caret-color: var(--indigo); }
:focus-visible { outline: none; box-shadow: var(--anel); border-radius: 6px; }
* { scrollbar-color: rgba(0, 17, 51, 0.22) transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(0, 17, 51, 0.2); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }

a { color: var(--indigo); text-decoration: none; text-underline-offset: 3px; transition: color 150ms var(--ease); }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--fonte); color: var(--navy); margin: 0 0 12px; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: 26px; font-weight: 700; line-height: 1.2; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 10px; }
small { font-size: 12px; }

/* ── barra do topo: translúcida, fixa ao rolar ─────────────────────────── */
.topo {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 22px;
  height: 56px; padding: 0 24px;
  color: #fff;
  background: rgba(0, 17, 51, 0.86);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid rgba(206, 229, 253, 0.08);
}
.marca { display: inline-flex; align-items: center; color: #fff; flex: none; }
.marca:hover { text-decoration: none; opacity: 0.9; }
.marca .marca-svg { height: 20px; width: auto; display: block; }
.topo nav { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.topo nav::-webkit-scrollbar { display: none; }
.topo nav a {
  color: rgba(255, 255, 255, 0.72); font-weight: 500; white-space: nowrap;
  padding: 7px 12px; border-radius: 999px;
  transition: background-color 180ms var(--ease), color 180ms var(--ease);
}
.topo nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); text-decoration: none; }
.topo nav a.ativo { color: #fff; background: rgba(206, 229, 253, 0.16); }
.topo .quem { display: flex; gap: 12px; align-items: center; color: var(--peri); flex: none; }
.quem-nome { display: flex; flex-direction: column; line-height: 1.15; font-size: 13px; color: #fff; text-align: right; }
.quem-nome small { color: var(--peri); font-size: 11px; }
.topo .sair {
  background: transparent; border: 1px solid rgba(142, 167, 221, 0.45); color: var(--ice);
  padding: 5px 12px; border-radius: 999px; font-weight: 500; box-shadow: none;
}
.topo .sair:hover { background: rgba(255, 255, 255, 0.08); filter: none; }

main { max-width: 1180px; margin: 0 auto; padding: 30px 24px 72px; }

/* ── superfícies ────────────────────────────────────────────────────────── */
.grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 18px; }
.cartao {
  background: #fff; border: 1px solid var(--linha-2); border-radius: var(--raio);
  padding: 20px 22px; box-shadow: var(--sombra-1);
}
.cartao.escuro {
  background: linear-gradient(160deg, var(--navy-2), var(--navy));
  color: #fff; border-color: transparent; box-shadow: var(--sombra-2);
}
.cartao.escuro h2 { color: var(--ice); }
.cartao.escuro a { color: var(--ice); }
details.cartao > summary { list-style: none; }
details.cartao > summary::-webkit-details-marker { display: none; }
.rotulo { font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--suave); margin: 0 0 8px; }
.cartao.escuro .rotulo { color: var(--peri); }
.numero { font-size: 34px; font-weight: 700; color: var(--navy); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.suave { color: var(--suave); }
.cabeca-conta { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.partes { display: flex; gap: 16px; flex-wrap: wrap; }
.partes div { min-width: 90px; }

/* ── tabelas e listas ───────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; background: transparent; font-variant-numeric: tabular-nums; }
th {
  text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--suave); padding: 8px 10px; border-bottom: 1px solid var(--linha);
}
td { padding: 11px 10px; border-bottom: 1px solid var(--linha); vertical-align: top; }
tbody tr { transition: background-color 150ms var(--ease); }
tbody tr:hover { background: rgba(206, 229, 253, 0.22); }
tbody tr:last-child td { border-bottom: none; }
td.v, th.v { text-align: right; }
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { padding: 11px 0; border-bottom: 1px solid var(--linha); display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.lista li:last-child { border-bottom: none; }
.cartao.escuro .lista li { border-color: rgba(206, 229, 253, 0.16); }
.lista li > .selo { align-self: flex-start; white-space: nowrap; }

/* ── selos ──────────────────────────────────────────────────────────────── */
.selo { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--gelo); color: var(--navy); border: 1px solid var(--linha); }
.selo.A { background: var(--navy); color: var(--ice); border-color: var(--navy); }
.selo.B { background: var(--indigo); color: #fff; border-color: var(--indigo); }
.selo.C { background: #eef1f6; color: var(--suave); border-color: transparent; }
.selo.alerta { background: var(--alerta-fundo); color: var(--alerta); border-color: #f3cfd1; }

/* ── controles ──────────────────────────────────────────────────────────── */
input, select, textarea {
  font: inherit; color: var(--texto);
  padding: 8px 12px; min-height: 38px;
  border: 1px solid #cfd8e8; border-radius: var(--raio-ctl); background: #fff;
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
textarea { width: 100%; line-height: 1.5; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #b8c4da; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--indigo); box-shadow: var(--anel); }
input[type=checkbox], input[type=radio] { min-height: 0; accent-color: var(--indigo); width: 16px; height: 16px; }
input:disabled, select:disabled, textarea:disabled { background: #f1f4f9; color: var(--suave); }
input::placeholder, textarea::placeholder { color: #7d89a1; }
label { color: var(--suave); }

button, .botao {
  font: inherit; font-weight: 600; line-height: 1.2;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 8px 16px;
  border-radius: var(--raio-ctl); border: 1px solid var(--indigo);
  background: var(--indigo); color: #fff; cursor: pointer; text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 17, 51, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: transform 120ms var(--ease), filter 150ms var(--ease), background-color 150ms var(--ease), box-shadow 150ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}
button:hover, .botao:hover { filter: brightness(1.12); text-decoration: none; }
button:active, .botao:active { transform: scale(0.97); filter: brightness(0.96); }
button:focus-visible, .botao:focus-visible { box-shadow: var(--anel); }
button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; filter: none; }
button.leve, .botao.leve { background: #fff; color: var(--indigo); border-color: #cfd8e8; box-shadow: 0 1px 2px rgba(0, 17, 51, 0.05); }
button.leve:hover, .botao.leve:hover { filter: none; background: #f6f8fd; border-color: #b8c4da; }
button.link { background: none; border: 0; padding: 0 4px; min-height: 0; color: var(--alerta); font-size: 12px; font-weight: 500; box-shadow: none; }

.acoes { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.acoes form { margin: 0; }
td .acoes { flex-wrap: nowrap; margin: 0; }
.filtros { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.form-linha { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); gap: 12px; margin-bottom: 12px; align-items: end; }
.form-linha label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 500; }
.form-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.form-resposta { display: flex; flex-direction: column; gap: 10px; }
.form-resposta input { width: 100%; }
.form-resposta label, .form-inline label { display: flex; gap: 6px; align-items: center; }
.form-resposta label { flex-direction: column; align-items: stretch; gap: 5px; font-size: 13px; font-weight: 500; }
.form-resposta div label { flex-direction: row; align-items: center; }
.form-resposta label:has(input[type=checkbox]) { flex-direction: row; align-items: center; color: var(--texto); }
.form-resposta label input[type=checkbox], .form-inline label input[type=checkbox] { width: 16px; }

details summary { cursor: pointer; color: var(--indigo); font-weight: 500; }
details.editar { flex: 1 1 100%; order: 9; }
details.editar summary { display: inline-block; list-style: none; }
details.editar form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

/* ── mensagens ──────────────────────────────────────────────────────────── */
.aviso {
  background: var(--alerta-fundo); border: 1px solid #f3cfd1; color: var(--alerta);
  padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; animation: entra 260ms var(--ease);
}
.aviso.ok { background: var(--ok-fundo); border-color: #c4e6d0; color: var(--ok); }
.alerta-texto { color: var(--alerta); font-size: 13px; }
.pendencias { margin-bottom: 16px; }
.pendencias ul { margin: 10px 0 0; padding-left: 18px; color: var(--suave); }
.mensagem { margin-bottom: 14px; }
.mensagem.bloqueada { border-color: #f3cfd1; }
.cabeca-msg { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.assunto { font-weight: 600; margin: 8px 0 4px; }
pre.corpo {
  white-space: pre-wrap; font-family: var(--fonte); font-size: 14px; line-height: 1.55;
  background: var(--gelo); border: 1px solid #e3ebf7; border-radius: 12px; padding: 14px 16px; margin: 0 0 10px;
}
.rascunho { border-top: 1px solid var(--linha); margin-top: 14px; padding-top: 14px; }
.barras { display: flex; gap: 4px; }
.barras span { width: 36px; height: 8px; background: var(--linha); border-radius: 4px; overflow: hidden; display: inline-block; }
.barras i { display: block; height: 100%; background: var(--indigo); }

/* ── oportunidades ──────────────────────────────────────────────────────── */
.funil { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 12px; margin-top: 16px; overflow-x: auto; padding-bottom: 6px; }
.coluna { background: #eef2f9; border: 1px solid var(--linha-2); border-radius: var(--raio); padding: 12px; min-height: 160px; }
.cartao-op {
  display: flex; flex-direction: column; gap: 3px; background: #fff;
  border: 1px solid var(--linha-2); border-radius: 12px; padding: 11px 12px; margin-top: 8px;
  color: var(--texto); font-size: 13px; box-shadow: var(--sombra-1);
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease);
}
.cartao-op:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--sombra-2); }
.trilha { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.trilha span { font-size: 12px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--linha); color: var(--suave); background: #fff; }
.trilha span.feito { color: var(--navy); border-color: var(--peri); }
.trilha span.atual { background: var(--navy); color: #fff; border-color: var(--navy); }
.trilha span.perdida { background: var(--alerta); border-color: var(--alerta); color: #fff; }
.caixa-passos { border: 1px solid #c9d6f2; border-radius: var(--raio); background: #f5f8ff; padding: 14px 18px; margin-top: 12px; }
.caixa-passos ol { margin: 6px 0 10px; padding-left: 20px; }
.fluxo-previa svg { width: 100%; height: auto; background: #fff; border: 1px solid var(--linha); border-radius: 12px; padding: 6px; }

@keyframes entra { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ── entrada: LOGDOC se desfaz, o símbolo fica, MAKRO é desenhado ───────── */
body.tela-entrar { background: var(--navy); color: #fff; min-height: 100vh; min-height: 100dvh; }
body.tela-entrar main { max-width: none; padding: 0; }
.entrada {
  position: relative; min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center; align-content: center; gap: 44px; padding: 48px 24px 88px;
  background:
    linear-gradient(rgba(142, 167, 221, 0.07) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(142, 167, 221, 0.07) 1px, transparent 1px) 0 0 / 32px 32px,
    radial-gradient(ellipse at 50% 38%, #0b2152 0%, var(--navy) 62%);
  overflow: hidden;
}
.entrada-palco { width: min(560px, 86vw); color: #fff; }
.entrada-marca { width: 100%; height: auto; display: block; overflow: visible; }
.entrada-marca .marca-logdoc { animation: logdoc-sai 900ms var(--ease) 700ms both; transform-box: fill-box; transform-origin: left center; }
.entrada-marca .marca-makro path {
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: traco 820ms var(--ease) both;
}
.entrada-marca .marca-makro path:nth-child(1), .entrada-marca .marca-makro path:nth-child(2) { animation-delay: 1250ms; }
.entrada-marca .marca-makro path:nth-child(3), .entrada-marca .marca-makro path:nth-child(4) { animation-delay: 1370ms; }
.entrada-marca .marca-makro path:nth-child(5), .entrada-marca .marca-makro path:nth-child(6), .entrada-marca .marca-makro path:nth-child(7) { animation-delay: 1490ms; }
.entrada-marca .marca-makro path:nth-child(8), .entrada-marca .marca-makro path:nth-child(9) { animation-delay: 1610ms; }
.entrada-marca .marca-makro path:nth-child(10) { animation-delay: 1730ms; }
@keyframes logdoc-sai {
  0% { opacity: 1; filter: blur(0); transform: none; }
  100% { opacity: 0; filter: blur(10px); transform: translateX(-24px); }
}
@keyframes traco { to { stroke-dashoffset: 0; } }
.entrada-acesso {
  width: min(420px, 100%); text-align: center;
  padding: 30px 28px 26px; border-radius: 22px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(206, 229, 253, 0.12);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  animation: acesso 640ms var(--ease) 2300ms both;
}
.entrada-acesso h1 { color: #fff; font-size: 24px; margin-bottom: 6px; }
.entrada-acesso p { color: rgba(206, 229, 253, 0.82); margin-bottom: 22px; }
.entrada-acesso .entrada-nota { margin: 14px 0 0; font-size: 12.5px; color: rgba(142, 167, 221, 0.9); }
@keyframes acesso { from { opacity: 0; transform: translateY(14px) scale(0.98); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.botao-google {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%;
  min-height: 48px; padding: 12px 18px; border-radius: 14px;
  background: #fff; color: #1f1f1f; font-weight: 600; font-size: 15px; text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 22px rgba(0, 0, 0, 0.18);
  transition: transform 140ms var(--ease), box-shadow 200ms var(--ease), background-color 150ms var(--ease);
}
.botao-google:hover { text-decoration: none; background: #f7f9fc; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 12px 28px rgba(0, 0, 0, 0.24); }
.botao-google:active { transform: scale(0.98); }
.botao-google:focus-visible { box-shadow: 0 0 0 4px rgba(206, 229, 253, 0.5); }
.entrada-rodape { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; font-size: 12px; color: rgba(142, 167, 221, 0.75); margin: 0; letter-spacing: 0.02em; }
@media (prefers-reduced-motion: reduce) {
  .entrada-marca .marca-logdoc { animation: none; opacity: 0; }
  .entrada-marca .marca-makro path { animation: none; stroke-dashoffset: 0; }
  .entrada-acesso, .aviso { animation: none; }
}

/* ── retorno de clique: símbolo da LogDoc girando ───────────────────────── */
.gira { display: inline-flex; width: 16px; height: 16px; flex: none; }
.gira svg, .processo-simbolo svg { width: 100%; height: 100%; display: block; animation: gira 1.15s cubic-bezier(0.55, 0.1, 0.35, 0.95) infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
button.carregando, .botao.carregando { cursor: progress; opacity: 1; filter: none; transform: none; }
button.carregando:disabled { opacity: 0.92; cursor: progress; }
button.leve.carregando { color: var(--indigo); }

.processo {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px;
  background: rgba(244, 246, 251, 0.55);
  -webkit-backdrop-filter: blur(10px) saturate(140%); backdrop-filter: blur(10px) saturate(140%);
  opacity: 0; transition: opacity 220ms var(--ease);
}
.processo[hidden] { display: none; }
.processo.aberto { opacity: 1; }
.processo-cartao {
  width: min(420px, 100%); text-align: center; background: #fff; border-radius: 22px; padding: 30px 28px 24px;
  border: 1px solid var(--linha-2); box-shadow: 0 2px 6px rgba(0, 17, 51, 0.06), 0 24px 60px rgba(0, 17, 51, 0.16);
  transform: translateY(8px) scale(0.98); transition: transform 320ms var(--ease);
}
.processo.aberto .processo-cartao { transform: none; }
.processo-simbolo { width: 54px; height: 54px; margin: 0 auto 18px; color: var(--navy); }
.processo-titulo { font-size: 17px; font-weight: 650; color: var(--navy); letter-spacing: -0.01em; margin: 0 0 6px; text-wrap: balance; }
.processo-etapa { color: var(--suave); min-height: 21px; margin: 0 0 18px; }
.processo-etapa.troca { animation: etapa 380ms var(--ease); }
@keyframes etapa { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.processo-barra { height: 4px; border-radius: 4px; background: #e8edf6; overflow: hidden; }
.processo-barra i { display: block; height: 100%; background: var(--indigo); border-radius: 4px; transform-origin: left; transform: scaleX(0); transition: transform 250ms linear; }
.processo-tempo { font-size: 12.5px; color: var(--suave); margin: 10px 0 0; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) {
  .gira svg, .processo-simbolo svg { animation-duration: 2.4s; }
  .processo-etapa.troca { animation: none; }
}

/* ── celular e tablet ───────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .topo { flex-wrap: wrap; height: auto; padding: 10px 16px 0; gap: 10px 14px; }
  .topo nav { order: 3; flex: 1 0 100%; margin: 0 -16px; padding: 4px 12px 8px; }
  .quem-nome { display: none; }
  main { padding: 20px 14px 56px; }
  h1 { font-size: 22px; }
  .cartao { padding: 16px; border-radius: 12px; }
  .cabeca-conta { margin-bottom: 16px; }
  .topo .quem { margin-left: auto; }
  /* tabela larga (5+ colunas) rola de lado; as pequenas ocupam a largura e quebram linha */
  table:has(th:nth-child(5)) { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table:has(th:nth-child(5)) th, table:has(th:nth-child(5)) td { white-space: nowrap; }
  th, td { padding-left: 8px; padding-right: 8px; }
  .numero { font-size: 28px; }
  .funil { grid-template-columns: repeat(5, minmax(240px, 82vw)); scroll-snap-type: x mandatory; }
  .coluna { scroll-snap-align: start; }
  .acoes > * { flex: 0 1 auto; }
  input, select, textarea { font-size: 16px; } /* evita o zoom automático do iPhone ao tocar no campo */
}
