/* Casca da v5 no CRM Global (etapa 9.1): ícones, trilho (52px, 200px aberto), topo de 54px, menu do
   avatar e busca com Ctrl K. Regras: marca/solid/design-system-sistemas/README.md.
   Ao mexer aqui, subir o ?v= em todas as páginas. */
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.xs { width: 13px; height: 13px; }
/* Ícone pequeno no meio do texto (origem do lead, filtros): alinhado à linha */
svg.i.xs { vertical-align: -2px; margin-right: 4px; }
.trilho .nav-item-icone { display: grid; place-items: center; }

/* Trilho */
.trilho { position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar-largura-colapsada); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; border-right: 1px solid var(--line); background: var(--bg); overflow-y: auto; }
.trilho .rotulo { display: none; }
.marca-trilho { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; color: var(--fg); font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none; }
.marca-trilho .logo { width: 34px; height: 34px; border-radius: 10px; display: block; flex: none; }
.rb { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; border: 1px solid transparent; background: none; color: var(--fg2); cursor: pointer; position: relative; flex: none; text-decoration: none; padding: 0; font: inherit; }
.rb:hover { background: var(--hover); color: var(--fg); }
.rb[aria-current="page"] { background: var(--ac-soft); border-color: var(--ac-line); color: var(--ac-txt); }
.rb.em-breve { opacity: 0.42; cursor: default; }
.rb.em-breve:hover { background: none; color: var(--fg2); }
.rb.expandir { width: 28px; height: 24px; border-radius: 7px; margin-bottom: 2px; color: var(--fg3); }
.trilho .rb .nav-soon { display: none; }
.trilho .rb .nav-badge { position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--erro); color: #ffffff; font-size: 11px; font-weight: 600; line-height: 16px; text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.trilho .rb .nav-badge[hidden] { display: none; }
.trilho hr { width: 22px; border: 0; border-top: 1px solid var(--line2); margin: 6px 0; }
.trilho .pe-trilho { margin-top: auto; display: grid; gap: 4px; justify-items: center; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--s3); color: var(--fg); border: 0; cursor: pointer; flex: none; }

/* Trilho aberto: ícone e nome */
.trilho-aberto .trilho { width: var(--sidebar-largura); align-items: stretch; padding: 10px; }
.trilho-aberto .trilho .rotulo { display: inline; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trilho-aberto .rb { width: 100%; display: flex; justify-content: flex-start; gap: 10px; padding: 0 9px; font-size: 13px; }
.trilho-aberto .rb.expandir { height: 30px; font-size: 12px; }
.trilho-aberto .rb.expandir svg { transform: rotate(180deg); }
.trilho-aberto .trilho hr { width: 100%; }
.trilho-aberto .trilho .pe-trilho { justify-items: start; }
.trilho-aberto .trilho .rb .nav-badge { position: static; margin-left: auto; box-shadow: none; }

/* Topo */
.topo { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 0 16px; min-height: var(--h-topo); border-bottom: 1px solid var(--line); background: var(--bg); min-width: 0; }
.topo-titulo { margin: 0; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex-shrink: 0; }
.topo .contagem { color: var(--fg3); font-size: 12px; white-space: nowrap; }
.busca-topo { margin: 0 auto; flex: 0 1 380px; min-width: 130px; height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line2); background: var(--s1); color: var(--fg3); font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.busca-topo span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.busca-topo kbd { font: inherit; font-size: 11px; border: 1px solid var(--line2); border-radius: 6px; padding: 1px 6px; color: var(--fg3); }
.ambiente { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: 12px; font-weight: 600; white-space: nowrap; }
.ambiente::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.ambiente[hidden] { display: none; }
.topo-whatsapp { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 0; border-radius: 8px; background: color-mix(in srgb, var(--erro) 14%, transparent); color: var(--erro); font: inherit; font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.topo-whatsapp::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--erro); }
.topo-whatsapp[hidden] { display: none; }
.topo-acoes { display: flex; gap: 8px; align-items: center; flex: none; }
.topo .shell-novo-lead { display: inline-flex; align-items: center; gap: 6px; height: 34px; min-height: 34px; padding: 0 14px; border-radius: 9px; border: 0; background: var(--ac); color: var(--ac-fg); box-shadow: inset 0 0 0 1px var(--btn-edge); font: inherit; font-weight: 600; cursor: pointer; }
.topo .shell-novo-lead:hover { filter: brightness(1.12); }

/* Menu do avatar */
.menu-pop { position: fixed; left: 58px; bottom: 12px; z-index: 40; width: 240px; padding: 6px; background: var(--s1); border: 1px solid var(--line2); border-radius: 12px; box-shadow: var(--shadow); display: grid; gap: 2px; }
.trilho-aberto .menu-pop { left: calc(var(--sidebar-largura) + 6px); }
.menu-pop .quem { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: grid; gap: 2px; }
.menu-pop .quem b { font-weight: 600; }
.menu-pop .quem span { color: var(--fg3); font-size: 12px; }
.mi-pop { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; border: 0; background: none; color: var(--fg); cursor: pointer; font: inherit; text-align: left; }
.mi-pop:hover { background: var(--hover); }

/* Celular: sem trilho; topo compacto (título e Novo lead só com o ícone) e a barra de baixo de sempre (decisão 197) */
@media (max-width: 768px) {
  .trilho, .menu-pop { display: none; }
  .topo { padding: 0 12px; gap: 8px; }
  .busca-topo { flex: 0 0 34px; min-width: 34px; margin-left: auto; justify-content: center; padding: 0; }
  .busca-topo span, .busca-topo kbd, .topo .contagem, .topo-whatsapp span { display: none; }
  .topo .shell-novo-lead { width: 34px; padding: 0; justify-content: center; }
  .topo .shell-novo-lead-label { display: none; }
}

/* Busca (Ctrl K) */
.paleta-fundo { position: fixed; inset: 0; z-index: 55; background: var(--overlay); display: grid; justify-items: center; align-items: start; padding: 12vh 16px 16px; }
.paleta { width: min(560px, 100%); background: var(--s1); border: 1px solid var(--line2); border-radius: var(--r-janela); box-shadow: var(--shadow); overflow: hidden; display: grid; }
.paleta .entrada { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--fg3); }
.paleta input { flex: 1; height: 50px; border: 0; background: none; color: var(--fg); font: inherit; font-size: 15px; outline: none; min-height: 0; }
.paleta .resultados { max-height: 50vh; overflow-y: auto; padding: 6px; display: grid; gap: 2px; }
.res { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; border: 0; background: none; color: var(--fg); font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.res span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res small { margin-left: auto; color: var(--fg3); font-size: 12px; white-space: nowrap; }
.res[aria-selected="true"], .res:hover { background: var(--hover); }
.res[aria-selected="true"] { box-shadow: inset 0 0 0 1px var(--ac-line); }
.paleta .nada { padding: 18px; text-align: center; color: var(--fg3); }
