/* Belico — sistema de despachante bélico.
   Design próprio, sem framework. Desktop e celular desde o primeiro dia.
   Tema claro/escuro por atributo no <html>, trocado por localStorage. */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface2: #fafbfc;
  --line: #e2e5ea;
  --text: #16191d;
  --muted: #6b7280;
  --accent: #1f4b8e;
  --accent-soft: #e8eefa;
  --good: #17794a;
  --good-soft: #e3f5ec;
  --warn: #9a6200;
  --warn-soft: #fdf1dc;
  --crit: #a51f1f;
  --crit-soft: #fbe9e9;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-tema="escuro"] {
  --bg: #0f1216;
  --surface: #171b21;
  --surface2: #1d222a;
  --line: #2a313b;
  --text: #e6e9ee;
  --muted: #939ba8;
  --accent: #6f9ae8;
  --accent-soft: #1b2740;
  --good: #5fd39b;
  --good-soft: #12291f;
  --warn: #e8b45f;
  --warn-soft: #2c2416;
  --crit: #f28b8b;
  --crit-soft: #2e1a1a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ----------------------------------------------------------- estrutura */

.app { display: flex; min-height: 100vh; }

.side {
  width: 232px;
  flex: 0 0 232px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.marca {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px 16px;
  font-weight: 700; font-size: 17px; letter-spacing: -.02em;
}
.marca span { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px;
  color: var(--text); font-size: 14px; font-weight: 500;
}
.nav-item:hover { background: var(--surface2); text-decoration: none; }
.nav-item.ativo { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-sep { margin: 12px 10px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }

.main { flex: 1; min-width: 0; padding: 22px clamp(16px, 3vw, 32px) 60px; }

.topo {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}
h1 { font-size: 22px; margin: 0 0 3px; letter-spacing: -.02em; }
.sub { color: var(--muted); font-size: 13.5px; margin: 0; }

/* ------------------------------------------------------------- blocos */

.painel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  overflow: hidden;
}
.painel-h {
  padding: 13px 16px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-weight: 600; font-size: 14.5px; background: var(--surface2);
}
.painel-c { padding: 16px; }
.painel-c.sem-pad { padding: 0; }

.grade { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.cartao { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px; box-shadow: var(--shadow); }
.cartao .n { font-size: 27px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.cartao .r { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.cartao.alerta { border-color: color-mix(in srgb, var(--crit) 40%, var(--line)); }
.cartao.alerta .n { color: var(--crit); }
.cartao.aviso .n { color: var(--warn); }

/* ------------------------------------------------------------ tabelas */

.rolo { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; padding: 10px 14px; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); font-weight: 600;
  border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface2);
}
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface2); }

/* --------------------------------------------------------------- selo */

.selo {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: var(--surface2); color: var(--muted); border: 1px solid var(--line);
}
.selo.ok { background: var(--good-soft); color: var(--good); border-color: transparent; }
.selo.atencao { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.selo.grave { background: var(--crit-soft); color: var(--crit); border-color: transparent; }
.selo.info { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.ponto { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }

/* ------------------------------------------------------------- botões */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; white-space: nowrap; min-height: 40px;
}
.btn:hover { background: var(--surface2); text-decoration: none; }
.btn.primario { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primario:hover { filter: brightness(1.08); }
.btn.pequeno { padding: 6px 11px; font-size: 13px; min-height: 34px; }
.btn.perigo { color: var(--crit); border-color: color-mix(in srgb, var(--crit) 35%, var(--line)); }

/* ----------------------------------------------------------- formulário */

.campo { margin-bottom: 14px; }
.campo label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.campo .dica { font-size: 12px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=tel], input[type=number], input[type=month], select, textarea {
  width: 100%; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 16px; /* 16px evita o zoom do iOS */
  min-height: 42px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.linha { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.check { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 7px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); }

/* ------------------------------------------------------------- avisos */

.aviso {
  padding: 11px 14px; border-radius: 8px; font-size: 13.5px;
  margin-bottom: 16px; border: 1px solid transparent;
}
.aviso.ok { background: var(--good-soft); color: var(--good); }
.aviso.atencao { background: var(--warn-soft); color: var(--warn); }
.aviso.grave { background: var(--crit-soft); color: var(--crit); }
.aviso.info { background: var(--accent-soft); color: var(--accent); }

.vazio { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 14px; }

.mono { font-family: var(--mono); font-size: 12.5px; }
.mudo { color: var(--muted); }
.peq { font-size: 12.5px; }

/* ---------------------------------------------------------- checklist */

.item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 16px; border-bottom: 1px solid var(--line);
}
.item:last-child { border-bottom: 0; }
.item .marca-status { flex: 0 0 auto; margin-top: 2px; }
.item .corpo { flex: 1; min-width: 0; }
.item .t { font-weight: 600; font-size: 14px; }
.item .f { font-size: 12px; color: var(--muted); margin-top: 3px; font-family: var(--mono); }
.item .i { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.item .acao { flex: 0 0 auto; }
.item.impedimento { background: var(--crit-soft); }

/* ------------------------------------------------------------ celular */

.menu-btn { display: none; }

@media (max-width: 860px) {
  .app { display: block; }
  .side {
    width: auto; flex: none; border-right: 0; border-bottom: 1px solid var(--line);
    flex-direction: row; flex-wrap: wrap; align-items: center;
    padding: 10px 14px; gap: 6px;
    position: sticky; top: 0; z-index: 30;
  }
  .marca { padding: 0; margin-right: auto; font-size: 15px; }
  .marca span { display: none; }
  .nav-sep { display: none; }
  .nav { display: none; width: 100%; flex-direction: column; gap: 2px; padding-top: 8px; }
  .nav.aberto { display: flex; }
  .menu-btn { display: inline-flex; }
  .main { padding: 16px 14px 50px; }
  h1 { font-size: 19px; }
  .grade { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .cartao .n { font-size: 23px; }
  .item { flex-wrap: wrap; }
  .item .acao { width: 100%; padding-left: 24px; }
  /* tabela vira lista no celular */
  table.responsiva thead { display: none; }
  table.responsiva tr { display: block; border-bottom: 1px solid var(--line); padding: 10px 0; }
  table.responsiva td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 14px; }
  table.responsiva td::before {
    content: attr(data-r); font-size: 11.5px; text-transform: uppercase;
    letter-spacing: .04em; color: var(--muted); font-weight: 600; flex: 0 0 auto;
  }
}

/* -------------------------------------------------------------- login */

.entrada {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: var(--bg);
}
.entrada-caixa {
  width: 100%; max-width: 380px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 28px; box-shadow: var(--shadow);
}
.entrada-caixa h1 { font-size: 20px; margin-bottom: 4px; }

/* ------------------------------------------------- escolher arquivo
   O botão nativo do <input type=file> vem em inglês e não se traduz.
   Some com ele e usa um <label> no lugar, que aceita clique igual. */
.arq { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.arq input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.arq .escolher {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border: 1px dashed var(--line); border-radius: 8px;
  background: var(--surface2); color: var(--text);
  font-size: 13.5px; font-weight: 600; cursor: pointer; min-height: 38px;
}
.arq .escolher:hover { border-color: var(--accent); color: var(--accent); }
.arq .nome { font-size: 12.5px; color: var(--muted); flex: 1; min-width: 90px; word-break: break-all; }
.arq.tem .escolher { border-style: solid; border-color: var(--good); color: var(--good); }

/* no portal do cliente o botão ocupa a linha toda, para acertar com o dedo */
.env .arq { display: block; }
.env .arq .escolher { width: 100%; justify-content: center; padding: 13px; font-size: 15px; min-height: 48px; }
.env .arq .nome { display: block; margin-top: 6px; text-align: center; }

/* ------------------------------------------------ coluna de ações da tabela
   No desktop os botões encostam à direita sem quebrar a linha. No celular a
   tabela vira lista (o td já é flex), então o rótulo fica à esquerda e o par de
   botões à direita — por isso eles vão dentro de .grupo-acoes: soltos, o
   space-between do td espalharia um em cada canto. */
td.acoes { white-space: nowrap; text-align: right; }
.grupo-acoes { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

@media (max-width: 860px) {
  td.acoes { padding-top: 8px; }
  .grupo-acoes .btn { min-height: 38px; }   /* alvo confortável para o dedo */
}

/* ------------------------------------------------ transferência: duas partes */

/* [hidden] precisa vencer as classes com display próprio (.linha é grid) — senão o bloco não some */
[hidden] { display: none !important; }

.transf { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface2); padding: 14px 16px 4px; margin-bottom: 16px; }
.transf-h { font-weight: 700; font-size: 14.5px; margin-bottom: 4px; }
.papeis { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.papel { display: flex !important; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; margin: 0 !important; font-weight: 400 !important; }
.papel input { width: 18px; height: 18px; min-height: 0; margin-top: 2px; accent-color: var(--accent); flex: 0 0 auto; }
.papel strong { display: block; font-size: 14px; }
.papel small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.papel:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.parte-cab { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; padding: 12px 16px; background: var(--surface2); border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); }
.parte-cab:first-child { border-top: 0; }
.parte-cab strong { font-size: 14px; }
.parte-cab .quem { font-size: 13.5px; }
.parte-cab .conta { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.partes-links { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.parte-link { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: var(--surface2); min-width: 0; }
.parte-link h4 { margin: 0 0 2px; font-size: 14px; }
@media (max-width: 860px) {
  .parte-cab .conta { margin-left: 0; width: 100%; }
}
.direcao { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; padding: 9px 12px; border-radius: 8px; background: var(--accent-soft); font-size: 14px; }
.direcao form { margin: 0; }

/* aviso de documento novo (atualização ao vivo do processo) */
.aviso-vivo { position: fixed; right: 16px; bottom: 16px; z-index: 40; display: flex; align-items: center; gap: 12px; max-width: calc(100% - 32px); padding: 12px 14px 12px 16px; border-radius: 12px; background: var(--good); color: #fff; font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: aviso-sobe .3s ease-out; }
.aviso-vivo .btn { background: rgba(255,255,255,.18); border-color: transparent; color: #fff; }
@keyframes aviso-sobe { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 860px) { .aviso-vivo { left: 16px; right: 16px; bottom: 12px; } }
@media (prefers-reduced-motion: reduce) { .aviso-vivo { animation: none; } }

/* ------------------------------------------------ andamento do processo */
.etapas { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.etapas li { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface2); min-width: 0; }
.etapas li strong { display: block; font-size: 13.5px; }
.etapas li small { display: block; font-size: 12px; color: var(--muted); }
.etapas .bola { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; background: var(--line); color: var(--muted); }
.etapas li.feita { background: var(--good-soft); border-color: transparent; }
.etapas li.feita .bola { background: var(--good); color: #fff; }
.etapas li.atual { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.etapas li.atual .bola { background: var(--accent); color: #fff; }
.passos { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.passo-f { flex: 0 0 auto; }
.passo-f[open] { flex: 1 1 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 0; background: var(--surface2); }
.passo-f > summary { list-style: none; }
.passo-f > summary::-webkit-details-marker { display: none; }
.passo-f[open] > summary { margin-bottom: 10px; }
@media (max-width: 860px) {
  .etapas { grid-template-columns: 1fr; }
  .passo-f { flex: 1 1 100%; }
  .passo-f > summary { width: 100%; }
}

/* ficha por link */
.ficha-dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.ficha-dl dt { color: var(--muted); font-weight: 600; }
.ficha-dl dd { margin: 0; }
@media (max-width: 860px) { .ficha-dl { grid-template-columns: 1fr; gap: 2px; } .ficha-dl dd { margin-bottom: 8px; } }

/* acompanhamento do cliente: linha do tempo do processo */
.trilha { list-style: none; margin: 0; padding: 0; position: relative; }
.trilha li { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 0 0 16px; }
.trilha li:last-child { padding-bottom: 0; }
.trilha li::before { content: ""; position: absolute; left: 17px; top: 36px; bottom: 0; width: 2px; background: var(--line); }
.trilha li:last-child::before { display: none; }
.trilha li.feita::before { background: var(--good); }
.trilha .bola { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; background: var(--surface2); border: 2px solid var(--line); position: relative; z-index: 1; }
.trilha li.feita .bola { background: var(--good); border-color: var(--good); color: #fff; font-weight: 700; }
.trilha li.negada .bola { background: var(--crit); border-color: var(--crit); }
.trilha li.atual .bola { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); animation: pulsa 1.8s ease-in-out infinite; }
@keyframes pulsa { 50% { box-shadow: 0 0 0 7px var(--accent-soft); } }
.trilha .txt { padding-top: 6px; min-width: 0; }
.trilha .txt strong { display: block; font-size: 14.5px; }
.trilha .txt small { display: block; font-size: 12.5px; color: var(--muted); }
.trilha li.atual .txt strong { color: var(--accent); }
.novidades { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.novidades summary { cursor: pointer; margin-bottom: 6px; }
.novidades div { padding: 3px 0; }
@media (prefers-reduced-motion: reduce) { .trilha li.atual .bola { animation: none; } }

/* janela (modal) do painel: anexar documentos ao cofre do cliente */
.jan-fundo { position: fixed; inset: 0; z-index: 50; background: rgba(12, 16, 24, .58); display: flex; align-items: center; justify-content: center; padding: 16px; backdrop-filter: blur(3px); }
.jan-fundo .jan { width: 100%; max-width: 380px; max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); color: var(--text); border-radius: 16px; padding: 22px 20px 18px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.jan-fundo .jan.jan-larga { max-width: 560px; }
.jan-fundo .acoes-jan { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.cofre-lista { display: grid; gap: 8px; margin-top: 12px; }
.cofre-linha { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface2); }
.cofre-linha .n { font-weight: 600; font-size: 13.5px; word-break: break-all; margin-bottom: 6px; }
.cofre-linha .prog { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin-bottom: 6px; }
.cofre-linha .prog i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.cofre-linha.lendo .prog i { background: linear-gradient(90deg, var(--accent) 0 40%, var(--accent-soft) 50%, var(--accent) 60% 100%); background-size: 200% 100%; animation: brilho-c 1.1s linear infinite; }
.cofre-linha.ok { border-color: color-mix(in srgb, var(--good) 40%, var(--line)); background: var(--good-soft); }
.cofre-linha.ok .prog i { background: var(--good); animation: none; }
.cofre-linha.aviso-l { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); background: var(--warn-soft); }
.cofre-linha.aviso-l .prog i { background: var(--warn); animation: none; }
.cofre-linha .ok-txt { color: var(--good); } .cofre-linha .warn-txt { color: var(--warn); }
@keyframes brilho-c { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .cofre-linha.lendo .prog i { animation: none; } }
.area-arq { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 20px 14px; border: 2px dashed var(--line); border-radius: 12px; background: var(--surface2); text-align: center; cursor: pointer; }
.area-arq:hover, .area-arq:focus-within { border-color: var(--accent); }
.area-arq input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.area-arq .ic { font-size: 26px; }
.area-arq small { color: var(--muted); font-size: 12.5px; word-break: break-all; }
.area-arq.tem { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }

/* cofre do cliente em cards (19/09/2026: "em vez de lista, card um do lado do outro") */
.cofre-grupo { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 4px 0 8px; }
.cofre-grupo span { font-weight: 600; background: var(--surface2); border: 1px solid var(--line); border-radius: 20px; padding: 0 7px; margin-left: 4px; }
.cofre-grade { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); margin-bottom: 16px; }
.doc-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 10px; background: var(--surface); }
.doc-card.ok { border-left-color: var(--good); }
.doc-card.atencao { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn-soft) 45%, var(--surface)); }
.doc-card.grave { border-left-color: var(--crit); background: color-mix(in srgb, var(--crit-soft) 45%, var(--surface)); }
.doc-card.lendo { border-left-color: var(--accent); }
.doc-topo { display: flex; gap: 8px; align-items: flex-start; }
.doc-ic { flex: 0 0 auto; font-size: 15px; line-height: 1.3; }
.doc-tit { min-width: 0; }
.doc-tit strong { display: block; font-size: 13.5px; line-height: 1.3; }
.doc-tit .mono { display: block; font-size: 12px; color: var(--muted); word-break: break-all; }
.doc-arma { font-size: 12.5px; color: var(--muted); }
.doc-validade { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.doc-validade small { font-size: 11.5px; color: var(--muted); }
.doc-arq { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-mais summary { font-size: 12px; color: var(--muted); cursor: pointer; }
.doc-mais p { font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.doc-acoes { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; margin-top: auto; padding-top: 4px; }
.doc-acoes form { margin: 0; }
.doc-corrigir > summary { list-style: none; }
.doc-corrigir > summary::-webkit-details-marker { display: none; }
.doc-corrigir[open] { flex: 1 1 100%; order: 9; }
.doc-corrigir form { display: grid; gap: 4px; margin-top: 8px; }
.doc-corrigir label { font-size: 11.5px; font-weight: 600; margin-top: 4px; }
.doc-corrigir input, .doc-corrigir select { font-size: 14px; min-height: 36px; padding: 6px 8px; }
.doc-datas { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.doc-corrigir .btn { margin-top: 6px; }
@media (max-width: 860px) { .cofre-grade { grid-template-columns: 1fr; } }
/* cards do cofre, versão compacta: uma grade só, grupo como etiqueta, ações numa linha */
.cofre-grade { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-bottom: 0; }
.doc-card { gap: 5px; padding: 10px 11px; }
.doc-grupo { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.doc-acoes { align-items: center; gap: 4px; padding-top: 2px; }
.doc-acoes .doc-arq { flex: 1 1 100%; margin-bottom: 2px; }
.doc-acoes .btn.pequeno { min-height: 30px; padding: 4px 9px; }
.doc-dobra > summary { list-style: none; }
.doc-dobra > summary::-webkit-details-marker { display: none; }
.doc-dobra[open] { flex: 1 1 100%; order: 9; }
.doc-dobra p { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.doc-form { display: grid; gap: 4px; margin-top: 8px; }
.doc-form label { font-size: 11.5px; font-weight: 600; margin-top: 4px; }
.doc-form input, .doc-form select { font-size: 14px; min-height: 36px; padding: 6px 8px; }
.doc-form .btn { margin-top: 6px; }

/* Modalidade da transferência (posse/porte de origem e de destino) */
.modalidade { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.modalidade label { font-size: .82rem; color: var(--mudo); margin: 0; }
.modalidade select { padding: 5px 8px; font-size: .86rem; border: 1px solid var(--linha); border-radius: 8px; background: #fff; }
@media (max-width: 560px) { .modalidade { width: 100%; } .modalidade select { flex: 1; min-width: 0; } }

/* =====================================================================
   Visual "Renova": barra escura no topo, fundo creme, dourado.
   Fica por último de propósito: sobrescreve a barra lateral antiga.
   ===================================================================== */

:root {
  --bg: #f3efe7;
  --surface: #ffffff;
  --surface2: #faf7f1;
  --line: #e6e0d3;
  --text: #1f2a30;
  --muted: #667075;
  --accent: #b98a2e;          /* dourado */
  --accent-soft: #f6ecd5;
  --barra: #1f2a30;
  --barra-txt: #c8cfd3;
  --radius: 14px;
}
[data-tema="escuro"] {
  --bg: #12171a; --surface: #1b2327; --surface2: #222c31; --line: #2d3a40;
  --text: #e9ecee; --muted: #9aa5ab; --accent: #d4a84a; --accent-soft: #2e2917;
  --barra: #0c1013; --barra-txt: #b4bdc2;
}

.app { display: block; min-height: 100vh; }

.topbar { background: var(--barra); position: sticky; top: 0; z-index: 40; }
.topbar-in {
  max-width: 1180px; margin: 0 auto; height: 64px; padding: 0 20px;
  display: flex; align-items: center; gap: 28px;
}
.topbar .marca { display: flex; align-items: center; gap: 10px; padding: 0; color: #fff; text-decoration: none; margin-right: 0; font-size: 15px; }
.marca-ico { font-size: 24px; line-height: 1; }
.marca-t { display: flex; flex-direction: column; line-height: 1.1; }
.marca-t b { font-size: 18px; font-weight: 800; letter-spacing: .02em; color: #fff; }
.marca-t small { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 700; }

.topbar .nav { display: flex; flex-direction: row; gap: 2px; padding: 0; width: auto; flex: 1; align-items: stretch; height: 100%; }
.topbar .nav-item {
  display: flex; align-items: center; padding: 0 14px; height: 100%;
  border-radius: 0; color: var(--barra-txt); font-weight: 600; font-size: 14.5px;
  border-bottom: 3px solid transparent; background: none;
}
.topbar .nav-item:hover { color: #fff; background: none; text-decoration: none; }
.topbar .nav-item.ativo { color: var(--accent); background: none; border-bottom-color: var(--accent); }
.nav-so-celular { display: none; }
.topbar-dir { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.icone-btn { color: #fff; font-size: 18px; padding: 6px 8px; border-radius: 8px; text-decoration: none; }
.icone-btn:hover { background: rgba(255,255,255,.1); text-decoration: none; }
.sair-btn {
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px; padding: 7px 16px; font: 600 13.5px var(--sans); cursor: pointer;
}
.sair-btn:hover { background: rgba(255,255,255,.1); }

.main { max-width: 1180px; margin: 0 auto; padding: 32px 20px 70px; }
h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }

/* botão principal dourado, como no Renova */
.btn { border-radius: 12px; }
.btn.primario { background: var(--accent); border-color: var(--accent); color: #fff; }
.painel, .cartao { border-radius: var(--radius); box-shadow: none; }
.painel-h { background: var(--surface); }
a { color: #9a6f17; }
[data-tema="escuro"] a { color: var(--accent); }

/* ---------------- início: cartões de ícone + coluna lateral ---------------- */
.inicio { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; margin-bottom: 8px; }
.inicio h1 { margin-bottom: 8px; }
.inicio .sub { font-size: 15.5px; margin-bottom: 20px; }
.atalhos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.atalho {
  display: flex; flex-direction: column; justify-content: space-between; gap: 22px;
  min-height: 128px; padding: 20px 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 18px;
  color: var(--text); font-weight: 700; font-size: 15px; line-height: 1.25; text-decoration: none;
  transition: transform .12s, border-color .12s;
}
.atalho:hover { transform: translateY(-2px); border-color: var(--accent); text-decoration: none; }
.atalho .ico {
  width: 40px; height: 40px; border-radius: 12px; background: var(--barra); color: var(--accent);
  display: grid; place-items: center;
}
.atalho .ico svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.atalho small { display: block; font-weight: 500; color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.lateral { display: flex; flex-direction: column; gap: 12px; }
.saldo { background: var(--barra); color: #fff; border-radius: 20px; padding: 20px; }
.saldo .rot { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--barra-txt); font-weight: 700; }
.saldo .num { font-size: 44px; font-weight: 800; color: var(--accent); line-height: 1.1; margin: 6px 0 2px; }
.saldo .leg { font-size: 13px; color: var(--barra-txt); }
.saldo .dupla { display: flex; gap: 18px; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.14); }
.saldo .dupla b { display: block; font-size: 20px; color: #fff; }
.saldo .dupla span { font-size: 12px; color: var(--barra-txt); }
.btn-ouro {
  display: flex; align-items: center; justify-content: center; min-height: 48px;
  background: var(--accent); color: #fff; border-radius: 14px; font-weight: 800; font-size: 15.5px; text-decoration: none;
}
.btn-ouro:hover { filter: brightness(1.07); text-decoration: none; color: #fff; }
.vencendo-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; font-size: 14px; }
.vencendo-card .rot { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.vencendo-card .num-v { font-weight: 800; font-size: 15px; }
.vencendo-card .linha { display: flex; justify-content: space-between; padding: 3px 0; }

/* ----------------------------- celular ----------------------------- */
@media (max-width: 960px) {
  .inicio { grid-template-columns: 1fr; gap: 20px; }
  .lateral { order: -1; }
  .atalhos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .topbar-in { height: 56px; padding: 0 14px; gap: 10px; flex-wrap: wrap; }
  .topbar .marca { margin-right: auto; }
  .marca-t b { font-size: 16px; }
  .menu-btn {
    display: inline-flex; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.28);
    border-radius: 999px; padding: 7px 14px; font: 600 13.5px var(--sans); cursor: pointer; min-height: 36px; align-items: center;
  }
  .topbar-dir { display: none; }
  .topbar .nav { display: none; position: absolute; left: 0; right: 0; top: 56px; background: var(--barra);
    flex-direction: column; height: auto; padding: 6px 14px 14px; border-top: 1px solid rgba(255,255,255,.1); gap: 0; }
  .topbar .nav.aberto { display: flex; }
  .topbar .nav-item { height: 48px; border-bottom: 1px solid rgba(255,255,255,.08); width: 100%; }
  .topbar .nav-item.ativo { border-bottom-color: rgba(255,255,255,.08); }
  .nav-so-celular { display: block; }
  .nav-btn { width: 100%; border: 0; border-bottom: 1px solid rgba(255,255,255,.08) !important; cursor: pointer; font-family: inherit; text-align: left; }
  .main { padding: 20px 14px 60px; }
  h1 { font-size: 24px; }
  .atalho { min-height: 108px; padding: 16px 14px; }
}

/* marca UseCAC */
.marca-img { width: 38px; height: 38px; border-radius: 10px; display: block; }
.marca-t b i { font-style: normal; color: var(--accent); }
:root { --barra: #2c3a2a; }
[data-tema="escuro"] { --barra: #1c261b; }

/* visualizador de arquivo em janela (modal) */
.vis { position: fixed; inset: 0; z-index: 100; background: rgba(15,20,18,.72); display: flex; align-items: center; justify-content: center; padding: 20px; }
.vis[hidden] { display: none; }
.vis-caixa { width: min(1000px, 100%); height: min(92vh, 900px); background: var(--surface); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.vis-topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.vis-topo b { font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.vis-acoes { display: flex; gap: 8px; }
#vis-frame { flex: 1; width: 100%; border: 0; background: #fff; }
@media (max-width: 860px) { .vis { padding: 0; } .vis-caixa { height: 100%; border-radius: 0; } }

/* ajustes finos da barra */
.topbar .marca .marca-t { display: flex !important; flex-direction: column; }
.topbar .nav .nav-so-celular { display: none; }
.topbar .nav-item { white-space: nowrap; }
@media (max-width: 860px) { .topbar .nav .nav-so-celular { display: flex; } .topbar .nav form.nav-so-celular { display: block; } }
@media (max-width: 1100px) { .topbar-in { gap: 14px; } .topbar .nav-item { padding: 0 9px; font-size: 14px; } }

/* seleção em lote na lista de clientes */
.col-sel { width: 44px; text-align: center; }
.col-sel input { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); cursor: pointer; }
tr.marcada { background: var(--accent-soft); }
.barra-lote { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; background: var(--accent-soft); border-bottom: 1px solid var(--line); position: sticky; top: 64px; z-index: 20; }
.barra-lote[hidden] { display: none; }
@media (max-width: 860px) {
  .barra-lote { top: 56px; }
  table.responsiva td.col-sel { display: flex; justify-content: flex-start; padding: 8px 12px 0; }
  table.responsiva td.col-sel::before { content: "Selecionar"; font-size: 12px; color: var(--muted); margin-right: 8px; }
  table.responsiva thead .col-sel { display: none; }
}

/* paginação */
.pag { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 18px 0 0; font-size: 13.5px; color: var(--muted); }
.pag-lista { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.pag-b { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px; text-decoration: none; }
a.pag-b:hover { border-color: var(--accent); text-decoration: none; }
.pag-b.atual { background: var(--accent); border-color: var(--accent); color: #fff; }
.pag-b.off { opacity: .45; cursor: default; }
@media (max-width: 860px) { .pag { justify-content: center; } .pag-info { width: 100%; text-align: center; } .pag-n { display: none; } .pag-n:has(.atual) { display: block; } }

/* lista: CPF numa linha só e botões lado a lado */
td.mono, .mono { white-space: nowrap; }
.grupo-acoes { display: inline-flex; gap: 6px; flex-wrap: nowrap; }
td.acoes { text-align: right; white-space: nowrap; }

/* referência (anotação sob o nome) */
.ref { margin-top: 3px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.ref-txt { color: var(--text); }
.ref-btn { background: none; border: 0; padding: 0; font: 600 12.5px var(--sans); color: #9a6f17; cursor: pointer; text-decoration: underline; }
[data-tema="escuro"] .ref-btn { color: var(--accent); }
.ref-form { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; max-width: 420px; }
.ref-form input { flex: 1; min-width: 160px; min-height: 36px; padding: 6px 10px; }

/* seção que abre e fecha (Certidões) */
details.painel > summary { list-style: none; }
details.painel > summary::-webkit-details-marker { display: none; }

/* novo atendimento: serviço em quadrados */
.servicos-grade { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.servicos-grade.pequena { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.srv { position: relative; display: block; cursor: pointer; margin: 0; }
.srv input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; min-height: 0; }
.srv-in { display: flex; flex-direction: column; justify-content: center; gap: 4px; min-height: 124px; padding: 16px 14px; border: 2px solid var(--line); border-radius: 18px; background: var(--surface); transition: border-color .12s, background .12s, transform .12s; }
.servicos-grade.pequena .srv-in { min-height: 64px; padding: 12px 14px; border-radius: 14px; }
.srv-ico { font-size: 28px; line-height: 1; margin-bottom: 4px; }
.srv-in strong { font-size: 15px; line-height: 1.2; }
.srv-in small { color: var(--muted); font-size: 12.5px; line-height: 1.25; }
.srv:hover .srv-in { border-color: var(--accent); transform: translateY(-2px); }
.srv input:checked + .srv-in { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.srv input:focus-visible + .srv-in { outline: 3px solid var(--accent); outline-offset: 2px; }
.srv-opcoes[hidden] { display: none; }
@media (max-width: 960px) { .servicos-grade { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .servicos-grade { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .srv-in { min-height: 108px; padding: 14px 12px; } .servicos-grade.pequena { grid-template-columns: 1fr; } }

/* link do cliente: pequenos ajustes de mobile */
@media (max-width: 640px) { .env .linha { grid-template-columns: 1fr; } }

/* painel "Para assinar" */
.assinar-linha { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--line); }
.assinar-linha:last-child { border-bottom: 0; }
.assinar-acoes { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
#btnContinuar { white-space: normal; line-height: 1.25; }
