/* ==================================================================
   CRM IMPÉRIOS — identidade visual

   Preto puro (#000) e branco, como a logo. Nada de azul-marinho
   fingindo de preto.

   Regra que vale para o arquivo inteiro: NADA tem canto reto.
     16px  cartões e blocos
     12px  campos e botões
     999px pílulas e selos

   O destaque de "pedido alterado" é cinza, não amarelo — pedido do
   Jessé. O que avisa é o texto do motivo, não a cor gritando.
   ================================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --preto: #000000;
  --fundo: #E2E3E5;
  --papel: #FFFFFF;
  --tinta: #111111;
  --apagado: #555B63;
  --fraco: #737982;
  --linha: #DDE0E4;
  --realce: #F7F8F9;

  /* Sinal de estado, no texto. Eram usados em 5 telas sem existir aqui —
     variável CSS inexistente vira valor vazio, e o "verde" saía preto (24/09). */
  --verde: #065F46;
  --erro:  #991B1B;
  --atencao: #92400E;   /* âmbar: mesma cor do texto de .pilula.atencao */

  --sombra: 0 1px 3px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.06);
  --sombra-alta: 0 4px 12px rgba(0,0,0,.08), 0 16px 40px rgba(0,0,0,.12);

  --r-cartao: 16px;
  --r-campo: 12px;
  --r-pilula: 9999px;

  /* Menu lateral preto, área de trabalho clara e ícones coloridos. */
  --chrome-bg: #111315;
  --chrome-ink: #F4F5F6;
  --chrome-ink-dim: #B3B7BC;
  --chrome-linha: rgba(255,255,255,.13);
  --chrome-realce: rgba(255,255,255,.08);
  --chrome-realce-forte: rgba(255,255,255,.15);
  --rail-largura: 72px;
  --rail-largura-aberta: 264px;
}

body {
  font-family: Inter, "SF Pro Display", -apple-system, BlinkMacSystemFont,
               "Segoe UI", system-ui, Arial, sans-serif;
  background: var(--fundo);
  color: var(--tinta);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.mono { font-variant-numeric: tabular-nums;
        font-family: ui-monospace, "SF Mono", Consolas, monospace; }
.esconde { display: none !important; }
.num { text-align: right; }

/* ---------- Cabeçalho ---------- */

/* Header e nav são UM bloco sticky só. Antes o nav tinha top:62px fixo e, se
   o cabeçalho mudava de altura (no celular), a navegação cobria o conteúdo. */
header {
  position: sticky; top: 0; z-index: 30;
  background: var(--preto);
}
.topo-linha {
  max-width: 1000px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 20px;
}
.marca { display: flex; align-items: center; gap: 12px; min-width: 0; }
.marca img { height: 32px; width: auto; display: block; flex-shrink: 0; }
.marca .divisor { width: 1px; height: 22px; background: #374151; flex-shrink: 0; }
.marca h1 { color: #fff; font-size: 15px; font-weight: 600; letter-spacing: .2px;
  white-space: nowrap; }

.topo-acoes { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.icone-topo {
  background: none; border: none; color: var(--fraco);
  cursor: pointer; padding: 6px; font-size: 16px; line-height: 1;
  border-radius: var(--r-pilula); transition: all .2s ease; flex-shrink: 0;
}
.icone-topo:hover { color: #fff; background: rgba(255,255,255,.1); }

.selo-gestao {
  border: 1px solid #374151; color: var(--fraco); border-radius: var(--r-pilula);
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px; padding: 3px 10px;
  white-space: nowrap;
}

/* ---------- Navegação em pílulas (dentro do header) ---------- */

nav {
  background: var(--fundo);
  border-bottom: 1px solid var(--linha);
}
.nav-linha {
  max-width: 1000px; margin: 0 auto;
  display: flex; gap: 8px; padding: 12px 20px; overflow-x: auto;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.nav-linha::-webkit-scrollbar { height: 0; }
a.aba { text-decoration: none; }
.aba {
  background: var(--papel); border: 1px solid var(--linha); color: var(--apagado);
  border-radius: var(--r-pilula); cursor: pointer; white-space: nowrap;
  padding: 8px 16px; font-size: 13.5px; font-weight: 500; font-family: inherit;
  transition: all .2s ease; display: inline-flex; align-items: center; gap: 7px;
}
.aba:hover { background: var(--realce); color: var(--tinta); }
.aba.ativa { background: var(--preto); border-color: var(--preto); color: #fff; }
.aba .conta {
  background: var(--linha); color: var(--apagado); border-radius: var(--r-pilula);
  font-size: 11px; font-weight: 600; padding: 1px 7px; min-width: 20px; text-align: center;
}
.aba.ativa .conta { background: rgba(255,255,255,.2); color: #fff; }
.aba .conta.alerta { background: #DC2626; color: #fff; }

/* Sub-abas (Concluído / Cancelados dentro de Finalizado) */
.sub-abas { display: flex; gap: 8px; margin-bottom: 16px; }
.sub-aba {
  background: var(--papel); border: 1px solid var(--linha); color: var(--apagado);
  border-radius: var(--r-pilula); cursor: pointer; font-family: inherit;
  padding: 6px 14px; font-size: 13px; font-weight: 500; transition: all .2s ease;
  display: inline-flex; align-items: center; gap: 6px;
}
.sub-aba:hover { background: var(--realce); }
.sub-aba.ativa { background: var(--tinta); border-color: var(--tinta); color: #fff; }
.sub-aba .conta { font-size: 11px; opacity: .75; }

/* ---------- Barra lateral (substitui o cabeçalho antigo) ---------- */

body.app-shell { display: flex; align-items: flex-start; min-height: 100vh; }

.rail {
  position: sticky; top: 0; height: 100vh; flex-shrink: 0;
  width: var(--rail-largura);
  background: var(--chrome-bg);
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 0; gap: 4px; overflow: hidden;
  transition: width .22s ease;
  z-index: 30;
}
.rail.aberta { width: var(--rail-largura-aberta); align-items: stretch; padding: 16px 12px; }

.rail .marca {
  display: flex; align-items: center; gap: 10px;
  padding: 0 6px 16px; margin-bottom: 8px;
  border-bottom: 1px solid var(--chrome-linha);
  min-height: 38px; text-decoration: none;
}
.rail:not(.aberta) .marca { justify-content: center; padding: 0 0 16px; }
.marca-selo {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: transparent; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.marca-selo img { width: 100%; height: 100%; object-fit: contain; object-position: center; filter: invert(1) grayscale(1); opacity: .88; }
.marca-nome { font-weight: 700; font-size: 14px; letter-spacing: -.1px; white-space: nowrap; overflow: hidden; color: var(--chrome-ink); }
.marca-nome span { display: block; font-weight: 500; font-size: 10.5px; color: var(--chrome-ink-dim); }
.rail:not(.aberta) .marca-nome { display: none; }
.rail.aberta .marca { flex-wrap: wrap; gap: 5px; padding: 0 4px 14px; justify-content: center; }
.rail.aberta .marca-selo { width: 154px; height: 58px; border-radius: 0; margin: 0 auto; }
.rail.aberta .marca-nome { display: none; }
.rail:not(.aberta) .marca-selo { width: 46px; height: 32px; border-radius: 0; }

.rail-toggle {
  align-self: flex-end; margin: -4px 4px 4px 0;
  width: 24px; height: 24px; border-radius: var(--r-pilula);
  background: var(--chrome-realce); color: var(--chrome-ink-dim);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform .22s ease, color .15s ease;
}
.rail:not(.aberta) .rail-toggle { align-self: center; }
.rail-toggle:hover { color: var(--chrome-ink); }
.rail-toggle svg { width: 12px; height: 12px; }
.rail.aberta .rail-toggle { transform: rotate(180deg); }

/* A LISTA DE MÓDULOS ROLA.
   O menu foi desenhado quando o CRM tinha 11 telas e cabia numa tela de 1080px.
   Hoje um administrador vê 19, e as últimas ficavam ESCONDIDAS: o .rail tem
   altura fixa de 100vh com overflow hidden, então elas eram simplesmente
   cortadas — sem barra, sem sinal nenhum de que havia mais coisa embaixo.
   Foi o Wagner que percebeu, em 24/09, depois de virar admin.
   `min-height: 0` é o que faz isso funcionar: sem ele, um filho de flex se
   recusa a encolher abaixo do próprio conteúdo e nunca ganha rolagem. */
/* ---------- O botão do cérebro e o menu dos cérebros ---------- */
.cerebros-btn {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 9px 10px; margin-bottom: 6px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--chrome-linha); background: var(--chrome-realce);
  color: var(--chrome-ink); font: inherit; font-size: 13.5px; font-weight: 600; white-space: nowrap;
}
.cerebros-btn svg { flex-shrink: 0; width: 20px; height: 20px; }
.cerebros-btn:hover, .cerebros-btn[aria-expanded="true"], .cerebros-btn.ativo { background: var(--chrome-realce-forte); }
.rail:not(.aberta) .cerebros-btn { justify-content: center; padding: 10px; width: auto; align-self: center; }
.rail:not(.aberta) .cerebros-btn .rotulo-item { display: none; }

.menu-cerebros {
  position: fixed; z-index: 60; width: 300px; max-height: calc(100vh - 16px); overflow-y: auto;
  /* 02/10: o fundo era BRANCO com texto quase branco (a cor do menu escuro) — ilegível. Painel escuro, igual ao menu lateral. */
  background: var(--chrome-bg); color: var(--chrome-ink); border: 1px solid var(--chrome-linha);
  border-radius: 14px; box-shadow: var(--sombra-alta); padding: 8px;
}
.menu-cerebros[hidden] { display: none; }
.menu-cerebros-topo { padding: 8px 10px 10px; font-weight: 700; font-size: 14px; }
.menu-cerebros-topo span { display: block; font-weight: 500; font-size: 11.5px; color: var(--chrome-ink-dim); margin-top: 1px; }
.menu-cerebro {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px;
  color: var(--chrome-ink); text-decoration: none;
}
.menu-cerebro:hover, .menu-cerebro:focus-visible { background: var(--chrome-realce-forte); outline: none; }
.menu-cerebro.ativo { background: var(--chrome-realce); }
.menu-cerebro-n {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--chrome-realce-forte);
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--chrome-ink-dim);
}
.menu-cerebro:first-of-type .menu-cerebro-n { background: #fff; color: #000; }   /* o 1º manda: destaque */
.menu-cerebro-txt b { display: block; font-size: 13.5px; }
.menu-cerebro-txt small { display: block; font-size: 11.5px; color: var(--chrome-ink-dim); }

@media (max-width: 700px) {
  .cerebros-btn, .rail:not(.aberta) .cerebros-btn { width: auto; margin: 0 6px 0 0; padding: 9px; }
  .cerebros-btn .rotulo-item { display: none; }
  .menu-cerebros { width: min(300px, calc(100vw - 16px)); }
}

.nav-grupo {
  display: flex; flex-direction: column; gap: 2px; width: 100%;
  flex: 1; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--chrome-linha) transparent;
}
.nav-grupo::-webkit-scrollbar { width: 6px; }
.nav-grupo::-webkit-scrollbar-thumb { background: var(--chrome-linha); border-radius: 3px; }
.nav-grupo::-webkit-scrollbar-track { background: transparent; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: 10px;
  color: var(--chrome-ink-dim); text-decoration: none; cursor: pointer;
  font-size: 13.5px; font-weight: 500; white-space: nowrap; position: relative;
}
.rail:not(.aberta) .nav-item { justify-content: center; padding: 10px; }
.nav-item svg { flex-shrink: 0; width: 18px; height: 18px; }
.nav-item[data-modulo-nav="inicio"] svg { color: #2563EB; }
.nav-item[data-modulo-nav="tarefas"] svg { color: #D97706; }
.nav-item[data-modulo-nav="vendas"] svg { color: #059669; }
.nav-item[data-modulo-nav="pedidos"] svg { color: #7C3AED; }
.nav-item[data-modulo-nav="financeiro"] svg { color: #0D9488; }
.nav-item[data-modulo-nav="extrato"] svg { color: #0891B2; }
.nav-item[data-modulo-nav="clientes"] svg { color: #DB2777; }
.nav-item[data-modulo-nav="devolucoes"] svg { color: #EA580C; }
.nav-item[data-modulo-nav="respostas"] svg { color: #0284C7; }
.nav-item[data-modulo-nav="reclamacoes"] svg { color: #DC2626; }
.nav-item[data-modulo-nav="catalogo"] svg { color: #65A30D; }
.nav-item[data-modulo-nav="calculadora"] svg { color: #4F46E5; }
.nav-item[data-modulo-nav="contas"] svg { color: #16A34A; }
.nav-item[data-modulo-nav="criacao"] svg { color: #9333EA; }
.nav-item[data-modulo-nav="compras"] svg { color: #CA8A04; }
.nav-item[data-modulo-nav="usuarios"] svg { color: #C026D3; }
.nav-item[data-modulo-nav="saude"] svg { color: #0F766E; }
.nav-item[data-modulo-nav="mercado"] svg { color: #EA580C; }
.cerebros-btn svg { color: #7C3AED; }
.nav-item:hover { background: var(--chrome-realce); color: var(--chrome-ink); }
.nav-item.ativo { background: var(--chrome-realce-forte); color: var(--chrome-ink); }
.rail:not(.aberta) .nav-item .rotulo-item { display: none; }
.rail:not(.aberta) .nav-item::after {
  content: attr(data-dica);
  position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  background: var(--chrome-bg); color: var(--chrome-ink); font-size: 12px; font-weight: 600;
  padding: 5px 9px; border-radius: 7px; white-space: nowrap; border: 1px solid var(--chrome-linha);
  opacity: 0; pointer-events: none; transition: opacity .12s ease; box-shadow: var(--sombra-alta);
  z-index: 40;
}
.rail:not(.aberta) .nav-item:hover::after { opacity: 1; }

.bolinha-notif {
  position: absolute; top: 4px; left: 24px;
  min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px;
  background: #E11D48; color: #fff; font-size: 9.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1;
  box-shadow: 0 0 0 2px var(--chrome-bg); z-index: 1;
}
.rail:not(.aberta) .bolinha-notif { left: 22px; top: 2px; }
.bolinha-notif[hidden] { display: none; }

/* ---------- Alertas (linha com ponto colorido) — Início, Vendas, Catálogo... ---------- */
.caixa-alertas { margin-bottom: 16px; }
.alerta-linha { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-top: 1px solid var(--linha); font-size: 13px; }
.alerta-linha:first-of-type { border-top: none; }
.alerta-ponto { width: 9px; height: 9px; border-radius: var(--r-pilula); flex-shrink: 0; }
.a-erro    .alerta-ponto { background: #DC2626; }
.a-urgente .alerta-ponto { background: #EA580C; }
.a-atencao .alerta-ponto { background: #F59E0B; }
.alerta-linha .texto { flex: 1; min-width: 0; }
.alerta-linha a { font-size: 12px; font-weight: 600; white-space: nowrap; }

/* ---------- Topo (dentro do conteúdo, ao lado da barra) ---------- */

.conteudo-shell { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar-crm {
  position: sticky; top: 0; z-index: 20;
  height: 60px; flex-shrink: 0;
  background: #FFFFFF;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; gap: 16px;
}
.titulo-pagina { color: var(--tinta); font-size: 16px; font-weight: 700; letter-spacing: -.2px; }
.topbar-crm .top-acoes { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.icone-btn-topo {
  background: none; border: none; color: var(--apagado); cursor: pointer;
  width: 34px; height: 34px; border-radius: var(--r-pilula);
  display: flex; align-items: center; justify-content: center; transition: all .15s ease;
}
.icone-btn-topo svg { width: 17px; height: 17px; }
.icone-btn-topo:hover { color: var(--tinta); background: var(--realce); }

@media (max-width: 640px) {
  .rail.aberta { position: fixed; inset: 0 auto 0 0; box-shadow: var(--sombra-alta); width: 200px; }
  .topbar-crm { padding: 0 14px; }
  .topo-usuario { display: none; }
}

/* ---------- Corpo ---------- */

main { max-width: 1380px; margin: 0 auto; padding: 20px; padding-bottom: 80px; }
.secao { margin-bottom: 16px; }
/* TÍTULO DE SEÇÃO — deixou de ser etiqueta e virou título.
   Era 11px, maiúsculas, espaçado e cinza-claro: o desenho de legenda de
   painel de controle, não de um título que alguém lê. Somado ao rótulo de
   campo no mesmo formato, a tela inteira virava uma parede de letra
   miúda toda igual — sem nada dizendo o que vem primeiro. */
.titulo-secao {
  font-size: 15px; font-weight: 650; letter-spacing: -.15px;
  color: var(--tinta); margin-bottom: 10px;
}

.caixa {
  background: var(--papel); border-radius: var(--r-cartao);
  box-shadow: var(--sombra);
}
.caixa-corpo { padding: 20px 24px; }

/* ---------- Busca ---------- */

.busca { position: relative; margin-bottom: 16px; }
.busca input, .busca input[type="text"] {   /* repete o seletor para ganhar da regra genérica de input */
  padding-left: 42px; background: var(--papel);
  border-radius: var(--r-pilula); border: 1.5px solid transparent;
  box-shadow: var(--sombra); height: 46px;
}
.busca input:focus { border-color: var(--tinta); box-shadow: var(--sombra); }
.busca .lupa {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--fraco); pointer-events: none; font-size: 15px;
}

/* ---------- Formulários ---------- */

label.campo { display: block; margin-bottom: 16px; }
/* RÓTULO DE CAMPO — legível em vez de decorativo.
   Maiúsculas com espaçamento força o olho a soletrar, e "COMPRIMENTO (CM)"
   em 11px cinza-claro custa mais pra ler do que "Comprimento (cm)" em 12,5px
   escuro. Quem preenche o formulário lê o rótulo ANTES de saber o que está
   procurando — é o texto que menos pode brigar com a pessoa. */
label.campo > span.rotulo {
  display: block; margin-bottom: 7px;
  font-size: 12.5px; font-weight: 600; letter-spacing: -.05px;
  color: var(--tinta);
}
label.campo > span.dica {
  display: block; margin-top: 6px; font-size: 12.5px; color: var(--apagado);
}

/* `input:not([type])` É O QUE FALTAVA.
   Um <input> sem type É um campo de texto pro navegador, mas NÃO casa com
   `input[type=text]` no CSS. Então esses campos escapavam de todo o estilo e
   voltavam ao padrão do navegador: uns 170px de largura, no meio de vizinhos
   que ocupavam a linha inteira. O formulário da Criação ficou com metade dos
   campos curtos e metade largos — o Wagner olhou e disse, com razão, que
   parecia "um DOS melhorado".
   Consertar aqui e não nos HTMLs é de propósito: assim o próximo campo que
   alguém escrever sem type já nasce certo. */
input:not([type]),
input[type=text], input[type=date], input[type=email], input[type=number], input[type=password],
input[type=file], input[type=tel], input[type=url], input[type=search],
select, textarea {
  /* Campo com fundo levemente cinza: sobre o branco do cartão, a borda
     sozinha quase some e o formulário vira texto solto. O fundo é o que faz
     um campo VAZIO ainda parecer um campo. */
  width: 100%; padding: 12px 14px; font-size: 14px; font-family: inherit;
  color: var(--tinta); background: var(--realce);
  border: 1.5px solid var(--linha); border-radius: var(--r-campo);
  outline: none; transition: all .2s ease;
}
input::placeholder, textarea::placeholder { color: var(--fraco); }
input:hover:not([disabled]), select:hover:not([disabled]), textarea:hover { border-color: #D1D5DB; }
input:focus, select:focus, textarea:focus {
  background: var(--papel);
  border-color: var(--tinta); box-shadow: 0 0 0 3px rgba(17,24,39,.08);
}
textarea { resize: vertical; min-height: 76px; }
/* Desabilitado tem que ser DIFERENTE de vazio — se os dois forem cinza-claro,
   ninguém entende por que o campo não aceita o que está digitando. */
input[disabled], select[disabled], textarea[disabled] {
  background: var(--fundo); color: var(--fraco); border-style: dashed; cursor: not-allowed;
}
select { appearance: none; background-image:
  url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }

.grade { display: grid; gap: 16px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: 1fr 1fr 1fr; }
.g4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
@media (max-width: 640px) { .g2, .g3 { grid-template-columns: 1fr; } .g4 { grid-template-columns: 1fr 1fr; } }

/* ---------- Filtro de datas (Finalizado e Financeiro) ---------- */

.filtro-datas {
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
  margin-bottom: 16px;
}
.campo-inline { display: flex; flex-direction: column; gap: 4px; }
.campo-inline > span {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .8px; color: var(--apagado);
}
.campo-inline input[type=date] { width: auto; }
@media (max-width: 640px) {
  .campo-inline { flex: 1; min-width: 130px; }
  .campo-inline input[type=date] { width: 100%; }
}

/* ---------- Botões ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px solid var(--linha); background: var(--papel); color: var(--tinta);
  padding: 11px 18px; font-size: 14px; font-weight: 500; font-family: inherit;
  border-radius: var(--r-campo); cursor: pointer; transition: all .2s ease;
}
.btn:hover { background: var(--realce); border-color: #D1D5DB; }
.btn.principal { background: var(--preto); border-color: var(--preto); color: #fff; }
.btn.principal:hover { background: #1F2937; border-color: #1F2937; }
.btn.perigo { color: #DC2626; border-color: #FECACA; }
.btn.perigo:hover { background: #FEF2F2; border-color: #FCA5A5; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.largo { width: 100%; padding: 14px; }
.btn.pequeno { padding: 7px 13px; font-size: 12.5px; border-radius: 10px; }
.linha-btn { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Cartão de pedido ---------- */

.cartao {
  background: var(--papel); border-radius: var(--r-cartao);
  box-shadow: var(--sombra); margin-bottom: 12px; overflow: hidden;
  transition: all .2s ease;
}
.cartao:hover { box-shadow: var(--sombra-alta); }
.cartao.alterado { box-shadow: var(--sombra), inset 4px 0 0 var(--fraco); }

.cartao-clique {
  display: block; width: 100%; text-align: left; background: none;
  border: none; cursor: pointer; font: inherit; color: inherit;
  padding: 20px 24px; transition: background .2s ease;
}
.cartao-clique:hover { background: var(--realce); }

.cartao-topo {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.os { font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.os .rotulo-os { color: var(--fraco); font-weight: 500; font-size: 12px; margin-right: 3px; }

.selo {
  font-size: 11px; font-weight: 600; letter-spacing: .3px;
  padding: 4px 12px; border-radius: var(--r-pilula); white-space: nowrap;
}
.s-andamento  { color: #374151; background: #F3F4F6; }
.s-separacao  { color: #3F6212; background: #ECFCCB; }
.s-separado   { color: #6D28D9; background: #EDE9FE; }
.s-dar_entrada { color: #92400E; background: #FEF3C7; }
.s-finalizado { color: #047857; background: #D1FAE5; }
.s-cancelado  { color: #BE123C; background: #FFE4E6; }

.cartao-linha1 {
  display: flex; justify-content: space-between; gap: 16px; align-items: flex-start;
}
.cliente { font-weight: 600; font-size: 15px; overflow: hidden;
           text-overflow: ellipsis; white-space: nowrap; }
.meta { color: var(--apagado); font-size: 13px; margin-top: 2px; }
.total { font-weight: 700; font-size: 16px; white-space: nowrap; }

.linha-meta {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
}
.tag-meta {
  font-size: 12px; color: var(--apagado); background: var(--realce);
  border-radius: var(--r-pilula); padding: 3px 11px; white-space: nowrap;
}

.aviso-alterado {
  margin-top: 12px; padding: 12px 16px; font-size: 13px; border-radius: var(--r-campo);
  background: var(--realce); color: #374151;
}
.aviso-alterado b {
  display: block; text-transform: uppercase; font-size: 10.5px;
  letter-spacing: 1px; color: var(--fraco); margin-bottom: 3px;
}

.pg-atrasado { color: #DC2626; background: #FEF2F2; font-weight: 600; }
.pg-hoje     { color: #EA580C; background: #FFF7ED; font-weight: 600; }
.pg-semana   { color: #1D4ED8; background: #EFF6FF; font-weight: 500; }
.pg-pago     { color: #047857; background: #ECFDF5; font-weight: 500; }

.botao-acao {
  width: 100%; padding: 15px; background: var(--preto); color: #fff;
  border: none; font-size: 14.5px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: background .2s ease;
}
.botao-acao:hover { background: #1F2937; }

/* ---------- Estados ---------- */

.vazio {
  background: var(--papel); border-radius: var(--r-cartao); box-shadow: var(--sombra);
  padding: 56px 24px; text-align: center; color: var(--apagado);
}
.vazio b { display: block; color: var(--tinta); margin-bottom: 6px; font-size: 15px; }
.carregando { padding: 56px; text-align: center; color: var(--apagado); }

.aviso {
  padding: 14px 18px; font-size: 13.5px; margin-bottom: 16px;
  border-radius: var(--r-campo);
}
.aviso b { display: block; margin-bottom: 4px; }
.aviso.erro    { background: #FEF2F2; color: #991B1B; }
.aviso.ok      { background: #ECFDF5; color: #065F46; }
.aviso.atencao { background: var(--realce); color: #374151; }
.aviso code { background: rgba(0,0,0,.06); padding: 2px 6px; border-radius: 6px;
              font-size: 12.5px; word-break: break-all; }

/* ---------- Tabelas ---------- */

.tabela-rolagem { overflow-x: auto; border-radius: var(--r-cartao); }
table.dados {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
  background: var(--papel); border-radius: var(--r-cartao); overflow: hidden;
}
table.dados th {
  background: var(--realce); text-align: left; padding: 12px 16px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .8px;
  color: var(--fraco); font-weight: 600; white-space: nowrap;
}
table.dados td { padding: 13px 16px; border-top: 1px solid var(--linha); }
table.dados tbody tr { transition: background .2s ease; }
table.dados tbody tr:hover { background: var(--realce); }

/* ---------- Itens do pedido ---------- */

.item-linha {
  display: grid; grid-template-columns: 3fr 5fr 1.4fr 2fr auto;
  gap: 10px; margin-bottom: 10px; align-items: start;
}
@media (max-width: 700px) {
  .item-linha { grid-template-columns: 1fr 1fr; }
  .item-linha .item-desc { grid-column: 1 / -1; }
}
.btn-apagar {
  border: 1.5px solid var(--linha); background: var(--papel); color: #DC2626;
  cursor: pointer; padding: 11px 14px; font-size: 15px; line-height: 1;
  border-radius: var(--r-campo); transition: all .2s ease;
}
.btn-apagar:hover { background: #FEF2F2; border-color: #FCA5A5; }

.rodape-total {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 20px; border-top: 1px solid var(--linha); padding-top: 18px; margin-top: 8px;
}
.rodape-total .valor { font-size: 28px; font-weight: 700; letter-spacing: -.5px; }

/* ---------- Escolha em botões ---------- */

.escolhas { display: grid; gap: 10px; }
.escolhas.c3 { grid-template-columns: repeat(3, 1fr); }
.escolhas.c2 { grid-template-columns: repeat(2, 1fr); }
.escolha {
  border: 1.5px solid var(--linha); background: var(--papel); color: var(--tinta);
  padding: 14px 10px; font-size: 13.5px; font-weight: 500; font-family: inherit;
  cursor: pointer; text-align: center; border-radius: var(--r-campo);
  transition: all .2s ease;
}
.escolha:hover { background: var(--realce); border-color: #D1D5DB; }
.escolha.sel { background: var(--preto); border-color: var(--preto); color: #fff; }
/* PAC / SEDEX: o balconista dos Correios precisa enxergar de longe */
.escolha.grande { font-size: 22px; font-weight: 700; letter-spacing: 2px; padding: 20px 10px; }

.painel-condicional {
  background: var(--realce); border-radius: var(--r-cartao);
  padding: 18px 20px; margin-top: 16px;
}

/* ---------- Parcelas ---------- */

.parcela-linha {
  display: grid; grid-template-columns: auto 1fr 1.4fr; gap: 12px;
  align-items: center; padding: 10px 0; border-top: 1px solid var(--linha);
}
.parcela-linha:first-child { border-top: none; }
.parcela-num {
  background: var(--tinta); color: #fff; border-radius: var(--r-pilula);
  width: 30px; height: 30px; display: flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.parcela-valor { font-weight: 600; }
.parcela-linha input[type=date] { padding: 8px 12px; font-size: 13px; }

/* ---------- Gaveta ---------- */

.fundo-escuro {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0,0,0,.45); display: flex; justify-content: flex-end;
  backdrop-filter: blur(2px);
}
.gaveta {
  width: 100%; max-width: 580px; height: 100%;
  background: var(--fundo); overflow-y: auto;
}
.gaveta-topo {
  position: sticky; top: 0; z-index: 5; background: var(--preto);
  padding: 16px 24px; display: flex; align-items: center;
  justify-content: space-between; gap: 14px;
}
.gaveta-topo .os { color: #fff; font-size: 19px; }
.gaveta-topo .os .rotulo-os { color: var(--fraco); }
.gaveta-topo .sub { color: var(--fraco); font-size: 13px; }
.gaveta-corpo { padding: 20px; padding-bottom: 80px; }

.item-lista {
  display: flex; gap: 14px; align-items: baseline;
  padding: 12px 20px; border-top: 1px solid var(--linha); font-size: 13.5px;
}
.item-lista:first-child { border-top: none; }
.item-lista .qtd { font-weight: 700; width: 38px; flex-shrink: 0; }
.item-lista .desc { flex: 1; min-width: 0; }
.item-lista .desc .sku { color: var(--fraco); font-size: 12.5px; margin-right: 8px; }
.item-lista .val { flex-shrink: 0; color: var(--apagado); font-size: 13px; }

.par { display: flex; justify-content: space-between; gap: 16px;
       padding: 7px 0; font-size: 13.5px; }
.par > span:first-child { color: var(--apagado); }

.trilha { list-style: none; }
.trilha li { display: flex; gap: 14px; font-size: 12.5px; padding: 7px 0; }
.trilha .quando { color: var(--fraco); width: 106px; flex-shrink: 0; }
.trilha .detalhe { color: var(--apagado); }

/* ---------- Modal ---------- */

.modal-fundo {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(2px);
}
.modal {
  width: 100%; max-width: 500px; background: var(--papel);
  border-radius: var(--r-cartao); box-shadow: var(--sombra-alta);
  max-height: 92vh; display: flex; flex-direction: column; overflow: hidden;
}
.modal.largo { max-width: 720px; }
.modal-topo {
  background: var(--preto); padding: 16px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.modal-topo b { color: #fff; font-size: 15px; }
.modal-corpo { padding: 22px; overflow-y: auto; }
.modal-rodape {
  display: flex; gap: 10px; padding: 16px 22px;
  border-top: 1px solid var(--linha); background: var(--realce);
}
.modal-rodape .btn:last-child { flex: 1; }

/* ---------- KPIs e relatórios ---------- */

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
@media (max-width: 800px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi {
  background: var(--papel); border-radius: var(--r-cartao);
  box-shadow: var(--sombra); padding: 18px 20px;
}
.kpi .v { font-size: 22px; font-weight: 700; letter-spacing: -.4px; }
.kpi .r { font-size: 11px; text-transform: uppercase; letter-spacing: .8px;
          color: var(--fraco); margin-top: 3px; }
.kpi .obs { font-size: 12px; color: var(--apagado); margin-top: 6px; }
.kpi.k-atrasado .v { color: #DC2626; }
.kpi.k-hoje .v     { color: #EA580C; }
.kpi.k-semana .v   { color: #1D4ED8; }
.kpi.k-ok .v       { color: #047857; }

.grupo-titulo {
  margin: 24px 0 12px; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
}
.grupo-titulo .ponto { width: 9px; height: 9px; border-radius: var(--r-pilula);
                       background: var(--fraco); flex-shrink: 0; }
.grupo-titulo .qt { font-weight: 400; color: var(--apagado); font-size: 12.5px; }
.g-atrasado .ponto { background: #DC2626; }
.g-hoje .ponto     { background: #EA580C; }
.g-semana .ponto   { background: #1D4ED8; }

.fatura {
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
  padding: 16px 20px; border-top: 1px solid var(--linha); flex-wrap: wrap;
}
.fatura:first-child { border-top: none; }
.fatura-esq { min-width: 0; flex: 1; }
.fatura-dir { text-align: right; flex-shrink: 0; }
.selo-parcela {
  background: var(--tinta); color: #fff; border-radius: var(--r-pilula);
  font-size: 11px; font-weight: 600; padding: 2px 9px; margin-right: 8px;
}
.etiqueta-alerta {
  background: var(--realce); color: var(--apagado); border-radius: var(--r-pilula);
  font-size: 11.5px; padding: 2px 9px; margin-left: 6px; white-space: nowrap;
}

/* barras dos relatórios */
.barra-item { padding: 12px 20px; border-top: 1px solid var(--linha); }
.barra-item:first-child { border-top: none; }
.barra-topo { display: flex; justify-content: space-between; gap: 14px;
              align-items: baseline; margin-bottom: 7px; }
.barra-nome { font-weight: 500; overflow: hidden; text-overflow: ellipsis;
              white-space: nowrap; }
.barra-nome .sub { color: var(--fraco); font-size: 12px; font-weight: 400; }
.barra-num { color: var(--apagado); font-size: 12.5px; white-space: nowrap; }
.barra-trilho { height: 7px; background: var(--linha); border-radius: var(--r-pilula);
                overflow: hidden; }
.barra-trilho i { display: block; height: 100%; background: var(--preto);
                  border-radius: var(--r-pilula); transition: width .3s ease; }

.colunas-mes { display: flex; align-items: flex-end; gap: 8px; height: 150px;
               padding: 20px; }
.mes-col { flex: 1; display: flex; flex-direction: column; align-items: center;
           gap: 6px; height: 100%; justify-content: flex-end; }
.mes-barra { width: 100%; background: var(--preto); border-radius: 8px 8px 0 0;
             min-height: 4px; transition: height .3s ease; }
.mes-rot { font-size: 11px; color: var(--fraco); }
.mes-val { font-size: 11px; color: var(--apagado); font-weight: 500; }

/* ---------- Sugestão de preço ---------- */

.destaque-preco {
  background: var(--preto); color: #fff; border-radius: var(--r-cartao);
  padding: 22px 26px; margin-bottom: 16px;
  display: flex; flex-wrap: wrap; gap: 32px; align-items: baseline;
}
.destaque-preco .grande { font-size: 30px; font-weight: 700; letter-spacing: -.6px; }
.destaque-preco .r { font-size: 11px; text-transform: uppercase;
  letter-spacing: 1px; color: var(--fraco); display: block; margin-bottom: 2px; }
.linha-recente { background: var(--realce); font-weight: 600; }

/* ---------- Impressos ---------- */

.impresso-fundo { position: fixed; inset: 0; z-index: 60;
                  background: #E5E7EB; overflow-y: auto; }
.barra-impressao {
  position: sticky; top: 0; z-index: 5; background: var(--papel);
  border-bottom: 1px solid var(--linha); padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.barra-impressao .instrucao { font-size: 12.5px; color: var(--apagado); flex-basis: 100%; }
.area-folha { display: flex; justify-content: center; padding: 24px 12px 80px; }

.folha-etiqueta {
  width: 100mm; height: 150mm; padding: 4mm; background: #fff; color: #000;
  box-shadow: var(--sombra-alta); font-size: 10pt;
  display: flex; flex-direction: column;
}
.folha-a4 {
  width: 210mm; min-height: 297mm; padding: 14mm; background: #fff; color: #000;
  box-shadow: var(--sombra-alta);
}
/* Cada folha do recibo é uma coluna flex que preenche a página inteira. */
.recibo-folha { display: flex; flex-direction: column; margin-bottom: 16px; }
.recibo-folha .via-recibo { flex: 1 1 auto; display: flex; flex-direction: column; }
@media (max-width: 880px) { .folha-a4 { width: 100%; padding: 8mm; } }

/* O impresso é documento, não interface: canto reto e traço preto de propósito. */
.et-caixa { border: 1px solid #000; padding: 2mm; }
.et-caixa.forte { border-width: 2px; }
.et-rotulo { font-size: 7.5pt; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; }
.et-nome { font-size: 13pt; font-weight: bold; line-height: 1.15; }
.et-linha { font-size: 10pt; line-height: 1.3; }
.et-cep { font-size: 14pt; font-weight: bold; letter-spacing: 1px; margin-top: 1mm; }
.et-os { font-size: 21pt; font-weight: bold; line-height: 1; }
.et-mini { font-size: 8pt; line-height: 1.25; }

/* ---------- Ajustes de celular ---------- */

@media (max-width: 640px) {
  .topo-linha { padding: 10px 14px; gap: 8px; }
  .marca { gap: 8px; }
  .marca img { height: 26px; }
  .marca h1 { font-size: 14px; }
  .nav-linha { padding: 10px 14px; gap: 6px; }
  .aba { padding: 7px 13px; font-size: 13px; }

  main { padding: 14px; padding-bottom: 60px; }
  .caixa-corpo { padding: 16px; }
  .cartao-clique { padding: 16px; }

  /* itens do lançamento: em vez de 5 colunas espremidas, empilha em 2 */
  .item-linha { grid-template-columns: 1fr 1fr auto; gap: 8px; }
  .item-linha .item-desc { grid-column: 1 / -1; }

  .rodape-total { flex-direction: column; align-items: stretch; gap: 12px; }
  .rodape-total .num { text-align: left; }
  .destaque-preco { gap: 18px; }
  .gaveta { max-width: 100%; }
  .modal { max-width: 100%; }
  .escolhas.c3 { grid-template-columns: 1fr; }
  .linha-btn { gap: 8px; }
  .linha-btn .btn { flex: 1; }
}

@media (max-width: 400px) {
  .marca .divisor { display: none; }
  .selo-gestao { display: none; }   /* espaço apertado: o modo aparece na URL */
}

@media print {
  @page { margin: 0; }
  body { background: #fff; }

  /* Some TUDO que é tela. Antes daqui só o header e a nav sumiam, e o <main>
     continuava na folha — resultado: a impressão saía com a lista de pedidos
     junto da etiqueta, e o endereço da empresa aparecia duas vezes. */
  .sem-impressao, header, nav, main, .rail, .topbar-crm, #gaveta, #modal { display: none !important; }

  .impresso-fundo { position: static; background: #fff; overflow: visible; }
  .area-folha { padding: 0; display: block; }
  .folha-etiqueta, .folha-a4 { box-shadow: none; margin: 0; width: auto; }
  .folha-etiqueta { width: 100mm; height: 150mm; }

  /* Cada folha do recibo ocupa uma página inteira; a via da empresa cai na
     folha seguinte. A altura fixa faz o conteúdo (com o espaçador flex) se
     distribuir por toda a página, em vez de amontoar no topo. */
  .recibo-folha { height: 297mm; margin: 0; page-break-after: always; }
  .recibo-folha:last-child { page-break-after: auto; }
  .via-recibo { page-break-inside: avoid; }
}

/* ==================================================================
   CRM — complementos ao tema do Sistema de Pedidos
   ================================================================== */
.tela-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--fundo); }
.tela-login .caixa { width: 100%; max-width: 380px; }
.tela-login .marca-login { display: flex; justify-content: center; margin: 0 auto 22px; width: 100%; height: 108px; overflow: hidden; border-radius: 12px; background: #fff; }
.tela-login .marca-login img { width: 100%; height: 108px; object-fit: contain; object-position: center; }
.topo-usuario { color: var(--fraco); font-size: 13px; white-space: nowrap; }
.topo-usuario b { color: var(--tinta); font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--tinta); color: #fff; padding: 12px 20px; border-radius: var(--r-pilula);
  font-size: 13.5px; box-shadow: var(--sombra-alta); opacity: 0; transition: all .25s ease; z-index: 100; pointer-events: none; max-width: 90vw; }
.toast.mostra { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.erro { background: #991B1B; }
.dialogo-fundo { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.dialogo { background: var(--papel); border-radius: var(--r-cartao); width: 100%; max-width: 720px; max-height: 92vh; display: flex; flex-direction: column; box-shadow: var(--sombra-alta); }
.dialogo-topo { padding: 18px 24px; border-bottom: 1px solid var(--linha); display: flex; justify-content: space-between; align-items: center; }
.dialogo-topo h2 { font-size: 16px; font-weight: 600; }
.dialogo-corpo { padding: 20px 24px; overflow-y: auto; }
.dialogo-rodape { padding: 14px 24px; border-top: 1px solid var(--linha); display: flex; gap: 10px; justify-content: flex-end; }
.painel-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.painel-kpi { background: var(--papel); border-radius: var(--r-cartao); box-shadow: var(--sombra); padding: 16px 20px; }
.painel-kpi .rotulo { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: var(--apagado); }
.painel-kpi .valor { font-size: 22px; font-weight: 600; margin-top: 4px; }
.painel-kpi .sub { font-size: 12px; color: var(--apagado); margin-top: 2px; }
.pilula { display: inline-block; border-radius: var(--r-pilula); font-size: 11px; font-weight: 600; padding: 3px 10px; text-transform: uppercase; letter-spacing: .5px; background: var(--linha); color: var(--apagado); }
.pilula.ok { background: #ECFDF5; color: #065F46; }
.pilula.erro { background: #FEF2F2; color: #991B1B; }
.pilula.atencao { background: #FFFBEB; color: #92400E; }
.pilula.preta { background: var(--preto); color: #fff; }
.tabela-rolagem { overflow-x: auto; }
.lista-modulos { display: flex; flex-wrap: wrap; gap: 8px; }
.lista-modulos label { display: inline-flex; align-items: center; gap: 6px; background: var(--realce); border: 1px solid var(--linha); border-radius: var(--r-pilula); padding: 6px 12px; font-size: 13px; cursor: pointer; }
.linha-tel { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.menu-inicio { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.menu-inicio a { display: block; background: var(--papel); border-radius: var(--r-cartao); box-shadow: var(--sombra); padding: 20px; text-decoration: none; color: var(--tinta); transition: all .2s ease; }
.menu-inicio a:hover { box-shadow: var(--sombra-alta); transform: translateY(-1px); }
.menu-inicio a b { display: block; font-size: 15px; margin-bottom: 4px; }
.menu-inicio a span { font-size: 12.5px; color: var(--apagado); }
pre.detalhe { font-size: 11.5px; background: var(--realce); padding: 10px; border-radius: 10px; overflow-x: auto; white-space: pre-wrap; margin-top: 6px; }
.acao-link { background: none; border: none; color: var(--tinta); text-decoration: underline; cursor: pointer; font-family: inherit; font-size: 13px; padding: 0; }

/* ==================================================================
   CRM — Pedidos / Etiqueta / DANFE / Financeiro (complementos)
   ================================================================== */
/* Abas do módulo dentro do <main> (a nav do topo é dos módulos do CRM) */
.abas-pagina { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
/* 02/10: a faixa de abas cortava as últimas (a barra de rolagem é invisível) — o Wagner não achava aba nenhuma além da DANFE. Agora quebra a linha. */
.abas-pagina .nav-linha { flex: 1; min-width: 0; flex-wrap: wrap; overflow: visible; max-width: none; margin: 0; padding-left: 0; padding-right: 0; }
.abas-acoes { flex-shrink: 0; align-items: center; }
.icone-topo.escuro { color: var(--apagado); border: 1px solid var(--linha); background: var(--papel); padding: 7px 10px; }
.icone-topo.escuro:hover { color: var(--tinta); background: var(--realce); }

/* Sugestões de cliente na etiqueta (vem do Gerador) */
.suglista { background: var(--papel); border: 1px solid var(--linha); border-radius: var(--r-campo); box-shadow: var(--sombra); margin-top: -8px; margin-bottom: 16px; overflow: hidden; }
.sug-item { display: block; width: 100%; text-align: left; background: none; border: none; border-top: 1px solid var(--linha); cursor: pointer; font: inherit; color: inherit; padding: 11px 16px; transition: background .15s ease; }
.sug-item:first-child { border-top: none; }
.sug-item:hover { background: var(--realce); }
.sug-item b { display: block; font-size: 14px; }
.sug-item .sub { color: var(--apagado); font-size: 12.5px; margin-top: 2px; }
.sug-item .cod { color: var(--fraco); font-size: 11.5px; }

/* Selo do cliente vinculado à etiqueta */
.selo-vinculo { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--realce); border: 1px solid var(--linha); border-radius: var(--r-campo); padding: 12px 16px; margin-bottom: 16px; }
.selo-vinculo .quem b { font-size: 14px; }
.selo-vinculo .quem .sub { color: var(--apagado); font-size: 12.5px; }

/* Área de soltar / escolher o XML da NF-e (display:block: <label> inline quebra a borda tracejada) */
.dropzone { display: block; border: 2px dashed #D1D5DB; border-radius: var(--r-cartao); background: var(--papel); padding: 40px 24px; text-align: center; color: var(--apagado); cursor: pointer; transition: all .2s ease; }
.dropzone:hover, .dropzone.sobre { border-color: var(--preto); background: var(--realce); color: var(--tinta); }
.dropzone .icone { font-size: 34px; display: block; margin-bottom: 8px; }
.dropzone b { color: var(--tinta); }
.dropzone input[type=file] { display: none; }

/* Resumo dos dados lidos do XML */
.resumo-nf { margin-top: 16px; }
.resumo-nf .chave { font-size: 12px; word-break: break-all; color: var(--apagado); background: var(--realce); border-radius: 8px; padding: 8px 12px; margin-top: 8px; }

@media print { .abas-pagina { display: none !important; } }

/* ==================================================================
   CRM — Financeiro: Visão Geral (painel consolidado)
   ================================================================== */
.painel-filtros { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.painel-filtros select { width: auto; padding: 9px 38px 9px 14px; font-size: 13px; }
.chip-filtro { display: inline-flex; align-items: center; gap: 7px; background: var(--preto); color: #fff; border-radius: var(--r-pilula); padding: 7px 8px 7px 14px; font-size: 12.5px; font-weight: 600; }
.chip-filtro button { background: rgba(255,255,255,.18); border: none; color: #fff; cursor: pointer; font-size: 13px; line-height: 1; border-radius: var(--r-pilula); width: 20px; height: 20px; }

.kpis5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 1100px) { .kpis5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .kpis5 { grid-template-columns: repeat(2, 1fr); } }
.kpi-v2 { background: var(--papel); border-radius: var(--r-cartao); box-shadow: var(--sombra); padding: 16px 18px; }
.kpi-v2 .r { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: var(--fraco); }
.kpi-v2 .v { font-size: 19px; font-weight: 700; letter-spacing: -.4px; margin-top: 4px; white-space: nowrap; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; border-radius: var(--r-pilula); padding: 2px 8px; margin-top: 7px; }
.delta.sobe   { color: #047857; background: #ECFDF5; }
.delta.desce  { color: #DC2626; background: #FEF2F2; }
.delta.neutro { color: var(--apagado); background: var(--realce); }

.grade-visao { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; align-items: start; }
@media (max-width: 900px) { .grade-visao { grid-template-columns: 1fr; } }
.cartao-visao { background: var(--papel); border-radius: var(--r-cartao); box-shadow: var(--sombra); overflow: hidden; }
.cartao-visao-topo { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 16px 20px 6px; }
.cartao-visao-topo h3 { font-size: 13.5px; font-weight: 700; }
.cartao-visao-topo .sub { font-size: 11.5px; color: var(--fraco); white-space: nowrap; }
.cartao-visao-corpo { padding: 6px 20px 14px; }

.rank-linha { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-top: 1px solid var(--linha); background: none; border-left: none; border-right: none; border-bottom: none; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.rank-linha:hover { background: var(--realce); }
.rank-linha.sem-clique { cursor: default; }
.rank-pos { width: 22px; height: 22px; border-radius: var(--r-pilula); background: var(--realce); color: var(--apagado); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.rank-info { flex: 1; min-width: 0; }
.rank-nome { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-sub { display: block; font-size: 11.5px; color: var(--fraco); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-valor { text-align: right; flex-shrink: 0; }
.rank-valor b { font-size: 13px; white-space: nowrap; display: block; }
.rank-valor span { font-size: 11px; color: var(--fraco); white-space: nowrap; }
.rank-barra { display: block; height: 4px; border-radius: var(--r-pilula); background: var(--linha); margin-top: 6px; overflow: hidden; }
.rank-barra i { display: block; height: 100%; background: var(--preto); border-radius: var(--r-pilula); }

.btn-ver-mais { width: 100%; border: none; border-top: 1px solid var(--linha); background: var(--realce); padding: 11px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--apagado); cursor: pointer; }
.btn-ver-mais:hover { color: var(--tinta); }

.linha-resultado { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 13px; border-top: 1px solid var(--linha); align-items: baseline; }
.linha-resultado:first-child { border-top: none; }
.linha-resultado .neg { color: #DC2626; }
.linha-resultado .rotulo-res { color: var(--apagado); }
.linha-resultado.total-res { font-weight: 700; border-top: 2px solid var(--tinta); }

.nota-rodape { font-size: 11.5px; color: var(--fraco); padding: 10px 20px 14px; border-top: 1px dashed var(--linha); }

/* ==================================================================
   CRM — Rolagem lateral com setas (mouse) em toda .tabela-rolagem
   ================================================================== */
tr.linha-clique { cursor: pointer; }

.rolagem-wrap { position: relative; }
.seta-rolagem {
  display: none; position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 36px; height: 36px; border-radius: var(--r-pilula);
  border: 1px solid var(--linha); background: var(--papel); color: var(--tinta);
  box-shadow: var(--sombra-alta); cursor: pointer; font-size: 20px; line-height: 1;
  align-items: center; justify-content: center; padding-bottom: 3px;
}
.rolagem-wrap.tem-rolagem .seta-rolagem { display: flex; }
.seta-rolagem.esq { left: 8px; }
.seta-rolagem.dir { right: 8px; }
.seta-rolagem:hover { background: var(--realce); }
.seta-rolagem:disabled { opacity: .2; cursor: default; }

/* ==================================================================
   CELULAR — conserto de emergência (polimento completo fica pra depois):
   a barra lateral vira um menu de ícones FIXO NO TOPO e o conteúdo ocupa
   a tela toda, sem nada flutuando por cima.
   ================================================================== */
@media (max-width: 700px) {
  body.app-shell { display: block; padding-top: 56px; }
  .rail, .rail.aberta {
    position: fixed !important; inset: 0 0 auto 0 !important;
    height: 56px; width: 100% !important;
    flex-direction: row; align-items: center;
    padding: 0 10px !important; gap: 2px;
    overflow-x: auto; overflow-y: hidden;
    box-shadow: var(--sombra-alta);
  }
  .rail .marca, .rail.aberta .marca { border-bottom: none; padding: 0; margin: 0 8px 0 0; min-height: 0; width: 154px; height: 42px; flex: 0 0 154px; }
  .rail .marca-selo, .rail.aberta .marca-selo { width: 154px; height: 54px; border-radius: 0; }
  .marca-nome { display: none !important; }
  .rail-toggle { display: none !important; }
  /* No celular quem rola é a própria barra, na horizontal — a rolagem vertical
     do modo computador só criaria uma barrinha inútil de 56px de altura. */
  .nav-grupo { flex-direction: row; width: auto; gap: 2px; flex: none; overflow-y: visible; }
  .nav-item, .rail.aberta .nav-item { justify-content: center; padding: 9px !important; }
  .nav-item .rotulo-item { display: none !important; }
  .nav-item::after { display: none !important; }
  .conteudo-shell { min-height: auto; }
  .topbar-crm { position: static; height: 48px; padding: 0 14px; }
  main { padding: 12px !important; max-width: 100%; overflow-x: hidden; }
  .tabela-rolagem { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .gaveta { width: 100% !important; max-width: 100% !important; }
  .duas-colunas, .grade-conta { grid-template-columns: 1fr !important; }
}

/* Foto miniatura de produto (todas as telas, PC e celular) */
.foto-mini {
  width: 40px; height: 40px; border-radius: 8px; flex-shrink: 0;
  background: var(--realce); border: 1px solid var(--linha);
  object-fit: contain; display: inline-block; vertical-align: middle;
}
.foto-mini.grande { width: 56px; height: 56px; }

/* ==================================================================
   POLIMENTO v2 — visual mais moderno e profissional (todo o CRM)
   Mantém a paleta preto + cinza-claro; refina profundidade, movimento
   e tipografia. Aplicado por cima dos estilos existentes.
   ================================================================== */
:root {
  --sombra: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --sombra-alta: 0 12px 32px -8px rgba(16,24,40,.18), 0 4px 12px -4px rgba(16,24,40,.08);
  --r-cartao: 14px;
}

/* Cartões respiram e reagem ao mouse */
.caixa, .kpi, .kpi-v2, .cartao-visao, .cartao-nota, .cartao-criterios, .chat-cartao {
  border: 1px solid rgba(16,24,40,.055);
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.kpi-v2:hover, .cartao-visao:hover, .cartao-nota:hover, .cartao-criterios:hover {
  box-shadow: 0 8px 24px -6px rgba(16,24,40,.12), 0 2px 8px -2px rgba(16,24,40,.06);
  transform: translateY(-1px);
}

/* Tabelas: cabeçalho fixo elegante + linha viva no hover */
table.dados thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--papel);
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px;
  color: var(--fraco); border-bottom: 1px solid var(--linha);
  padding-top: 12px; padding-bottom: 12px;
}
table.dados tbody tr { transition: background .12s ease; }
table.dados tbody tr:hover { background: var(--realce); }
tr.linha-clique:hover td:first-child { box-shadow: inset 3px 0 0 var(--preto); }

/* Botões com peso e resposta */
.btn {
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, color .12s ease;
  border: 1px solid rgba(16,24,40,.08);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 10px -2px rgba(16,24,40,.14); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn.principal { border-color: transparent; box-shadow: 0 2px 6px -1px rgba(0,0,0,.3); }
.btn.principal:hover { box-shadow: 0 6px 16px -3px rgba(0,0,0,.35); }

/* KPIs com número que domina e rótulo discreto */
.kpi-v2 .v { font-size: 22px; letter-spacing: -.6px; }
.kpi-v2 { position: relative; overflow: hidden; }
.kpi-v2::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: linear-gradient(180deg, #111 0%, #555 100%);
  opacity: 0; transition: opacity .18s ease;
}
.kpi-v2:hover::before { opacity: 1; }

/* Menu lateral: item ativo com indicador */
.nav-item.ativo { box-shadow: inset 3px 0 0 var(--chrome-ink); }
.nav-item { transition: background .14s ease, color .14s ease; }

/* Gaveta e diálogo deslizam suave */
@keyframes deslizaGaveta { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes surgeFundo { from { opacity: 0; } to { opacity: 1; } }
.fundo-escuro, .dialogo-fundo { animation: surgeFundo .16s ease; backdrop-filter: blur(2px); }
.gaveta { animation: deslizaGaveta .2s ease; }
.dialogo { animation: deslizaGaveta .18s ease; }

/* Pilulas e selos mais definidos */
.pilula, .canal-selo, .selo-acao, .nota-pilula { letter-spacing: .3px; }

/* Barra de rolagem discreta (Chrome/Edge) */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(16,24,40,.18); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(16,24,40,.32); border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* Campos de formulário com foco visível */
input, select, textarea { transition: border-color .12s ease, box-shadow .12s ease; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--preto) !important;
  box-shadow: 0 0 0 3px rgba(17,17,17,.08);
}

/* Títulos de seção com filete */
.titulo-secao { display: flex; align-items: center; gap: 10px; }
.titulo-secao::after { content: ''; flex: 1; height: 1px; background: var(--linha); }

/* Vazios mais simpáticos */
.vazio { padding: 34px 20px; font-size: 13.5px; }

/* Conteúdo entra com fade sutil */
@keyframes surgeConteudo { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
main { animation: surgeConteudo .22s ease; }












