/* cache-bust 2026-07-02: muda o BOOT_ID -> nova URL ?v= dos CSS, furando o cache
   Akamai envenenado no canary (telas sem estilo / iframe pequeno). Ver a regra
   de setHeaders em src/index.ts (só cacheia forte quando ?v= == BOOT_ID). */
:root {
  /* Cores Stone (via stone-cores.css vendorada). Lib canônica: stone-cores/. */
  /* Verde Stone (#00d700) é vivo demais p/ texto ou fundo c/ texto branco;
     fica como accent (--green-vivid). Ramp interativo usa verdes escuros legíveis. */
  --green-900: var(--stone-verde-escuro);    /* #00461e */
  --green-700: var(--stone-verde-escuro);    /* #00461e — hover/dark */
  --green-500: var(--stone-verde-escuro-2);  /* #007d00 — verde interativo */
  --green-50:  var(--stone-cinza-0);         /* #f5fff5 */
  --green-vivid: var(--stone-verde);         /* #00d700 — Verde Stone (accent) */
  --gray-900: var(--stone-preto);            /* #1e281e */
  --gray-700: var(--stone-cinza-3);          /* #505a50 */
  --gray-600: var(--stone-cinza-3);          /* #505a50 — texto muted legível */
  --gray-400: var(--stone-cinza-2);          /* #96a096 */
  --gray-300: var(--stone-cinza-1);          /* #c8d2c8 */
  --gray-200: var(--stone-cinza-1);          /* #c8d2c8 */
  --gray-100: var(--stone-cinza-0);          /* #f5fff5 */
  --gray-50:  var(--stone-cinza-0);          /* #f5fff5 */
  --red-600: var(--stone-vermelho);          /* #f54141 */
  --red-50: #fef2f2;                          /* tint funcional de erro (fora da paleta) */
  --amber-100: #fef3c7;                       /* tint funcional de alerta */
  --amber-800: #92400e;                       /* texto de alerta (contraste) */
  --topbar-height: 56px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Ícones de linha (lucide-style) */
.ic { width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em; flex-shrink: 0; }
.nav-icon .ic { width: 18px; height: 18px; }
.stage-icon .ic { width: 20px; height: 20px; }
.v-header-icon .ic { width: 24px; height: 24px; }
.k-col-title .ic { width: 16px; height: 16px; }
.flame .ic { width: 12px; height: 12px; vertical-align: -0.12em; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.5;
}

.hidden { display: none !important; }
.muted { color: var(--gray-600); font-size: 14px; }
.warn { color: var(--red-600); font-size: 12px; }

/* Loading + Auth */
.loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  color: var(--gray-600);
}

.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  padding: 48px 40px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.auth-brand {
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--green-500);
  margin-bottom: 24px;
  font-size: 14px;
}

.auth-card h1 {
  font-size: 24px;
  margin-bottom: 12px;
}

.auth-card p {
  color: var(--gray-600);
  margin-bottom: 24px;
}

/* ===================== Tela de login roma (marca pública) =====================
   Espelha a arte de marca: fundo branco, moldura verde fina com cantos em arco,
   o símbolo do arco (pino em negativo), wordmark serifado (Cinzel) e a tag. */
/* Fundo da tela de entrada. É a ÚNICA tela do app sem nenhum dado, e por isso a
   única onde gradiente é permitido (ver DESIGN.md > regra 8): aqui ele não
   compete com informação nenhuma, é a marca. Três camadas: dois brilhos radiais
   (o de cima puxando o verde vivo da marca, o de baixo o verde escuro) sobre a
   base sólida — quem não suportar radial-gradient cai no verde chapado. */
.roma-auth {
  background: var(--stone-verde-escuro);
  background:
    radial-gradient(120% 90% at 12% 0%, rgba(55, 254, 75, .22), transparent 55%),
    radial-gradient(100% 80% at 100% 100%, rgba(0, 218, 0, .16), transparent 60%),
    linear-gradient(160deg, #00461e 0%, #003605 45%, #00220a 100%);
  position: relative;
  overflow: hidden;
}
/* Arco gigante em marca d'água: o mesmo símbolo do logo, virando textura. */
.roma-auth::before {
  content: "";
  position: absolute; inset: auto -10% -35% auto;
  width: min(70vw, 720px); aspect-ratio: 1;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.07), transparent 62%);
  pointer-events: none;
}
.roma-frame {
  position: relative;
  max-width: 460px;
  width: 100%;
  margin: 24px;
  padding: 56px 40px 48px;
  text-align: center;
  background: rgba(255, 255, 255, .97);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 34, 10, .45);
  z-index: 1;
}
/* Os antigos arcos de canto saíram: eles ecoavam a moldura de cantos
   assimétricos e, com raio uniforme, viravam dois riscos soltos. O cartão fica
   limpo; quem carrega a marca é o símbolo do arco e o wordmark. */
.roma-arch { display: block; height: 118px; width: auto; margin: 0 auto 16px; }
.roma-word {
  font-family: 'Cinzel', Georgia, 'Times New Roman', serif;
  font-weight: 600;
  font-size: 44px;
  line-height: 1;
  letter-spacing: 10px;
  text-indent: 10px;
  color: var(--stone-verde-escuro);
}
.roma-tag {
  font-family: 'Cinzel', Georgia, serif;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 11px;
  margin-top: 10px;
  color: var(--stone-verde-escuro-2);
}
.roma-cta {
  display: inline-block;
  margin-top: 36px;
  padding: 13px 30px;
  border-radius: 8px;
  background: var(--stone-verde-escuro);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .3px;
  text-decoration: none;
  transition: background .15s ease, transform .15s ease;
}
.roma-cta:hover { background: var(--stone-verde-escuro-2); transform: translateY(-1px); }
.roma-cta:focus-visible { outline: 3px solid var(--stone-verde); outline-offset: 2px; }
@media (max-width: 420px) {
  .roma-frame { padding: 44px 24px 36px; }
  .roma-word { font-size: 34px; letter-spacing: 7px; text-indent: 7px; }
  .roma-arch { height: 96px; }
}

/* App shell — topbar fixa em cima, conteudo abaixo (sem sidebar lateral). */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.topbar {
  height: var(--topbar-height);
  background: var(--stone-verde-escuro); /* verde escuro Stone (era preto #1e281e) */
  border-bottom: 1px solid rgba(0, 215, 0, .12);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.topbar-brand {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 32px;
  text-decoration: none;
  color: inherit;
  padding: 0 4px;
  border-radius: 6px;
}
.topbar-brand img {
  height: 22px; width: auto; display: block;
  filter: brightness(0) invert(1);
}
.topbar-brand:hover { background: #2a2a2a; }

.topbar-nav {
  display: flex;
  flex-direction: row;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;            /* pode encolher abaixo do conteudo: evita empurrar a pagina (scroll horizontal) */
  overflow-x: auto;        /* se nao couber, rola DENTRO do nav, nao a pagina toda */
  scrollbar-width: none;   /* Firefox: sem barra visivel */
}
.topbar-nav::-webkit-scrollbar { display: none; } /* WebKit: sem barra visivel */

.nav-item {
  display: inline-flex;
  flex: 0 0 auto;          /* mantem o tamanho (nao espreme o label); overflow do nav rola */
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  color: var(--gray-300);
  text-decoration: none;
  border-radius: 8px;
  font-size: 13px;
  transition: background .12s, color .12s;
  line-height: 1;
}
.nav-item:hover { background: #2a2a2a; color: white; }
.nav-item.active { background: var(--green-500); color: white; }
.nav-icon { font-size: 15px; display: inline-flex; }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
.topbar-user .btn-ghost {
  color: rgba(255,255,255,.75);
  border-color: rgba(255,255,255,.12);
  background: transparent;
}
.topbar-user .btn-ghost:hover {
  background: rgba(255,255,255,.08);
  color: white;
  border-color: rgba(255,255,255,.2);
}

/* Theme switcher (Atual / macOS / macOS Inter) — capsula transparente com borda
   verde sutil sobre topbar verde escuro Stone. */
.theme-switcher {
  display: inline-flex;
  background: rgba(255, 255, 255, 0);
  border: 1px solid rgba(0, 215, 0, .1);
  border-radius: 32px;
  padding: 2px;
  gap: 2px;
  box-shadow: none;
}
.theme-opt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  color: #dae2dd;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 999px;
  border: 0;
  transition: background .15s ease, color .15s ease;
}
.theme-opt:hover { color: white; background: rgba(0, 215, 0, .08); }
.theme-opt.active { background: var(--stone-verde); color: var(--stone-verde-escuro); }

/* Tweaks de cores Stone — 4 swatches circulares pra permutar paleta de accent.
   Cor ativa ganha anel branco translucido. */
.tweak-swatches {
  display: inline-flex;
  gap: 6px;
  padding: 4px 6px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
}
.tweak-sw {
  width: 16px; height: 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  cursor: pointer;
  padding: 0;
  transition: transform .12s ease, box-shadow .15s ease;
}
.tweak-sw:hover { transform: scale(1.12); }
.tweak-sw.active {
  box-shadow: 0 0 0 2px var(--gray-900), 0 0 0 4px rgba(255,255,255,.9);
}

/* O email do usuario mora no dropdown do menu de perfil (.usermenu-email,
   design-system.css); a antiga .user-email da topbar saiu junto com o botao Sair. */

.content {
  flex: 1;
  padding: 32px 24px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

/* Page */
.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 700;
}

.page-subtitle {
  color: var(--gray-600);
  font-size: 14px;
  margin-top: 4px;
}

/* Metrics */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 20px;
}

.metric-label {
  font-size: 12px;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 8px;
}

.metric-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.metric-sub {
  font-size: 12px;
  color: var(--gray-600);
}

/* Card */
.card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.btn-primary {
  background: var(--green-500);
  color: white;
}

.btn-primary:hover {
  background: var(--green-700);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}

.btn-ghost:hover {
  background: var(--gray-100);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

/* Editor visual: modo edicao, outline em hover, painel lateral, modal de export. */
body.ve-mode { cursor: crosshair; }
body.ve-mode .ve-hovering {
  outline: 2px dashed #3b82f6 !important;
  outline-offset: 2px !important;
}
body.ve-mode .ve-selected {
  outline: 2px solid var(--stone-verde) !important;
  outline-offset: 2px !important;
}
body.ve-mode #visual-editor,
body.ve-mode #visual-editor *,
body.ve-mode #ve-export-modal,
body.ve-mode #ve-export-modal *,
body.ve-mode #editor-toggle { cursor: default !important; }

.visual-editor {
  position: fixed;
  top: 72px; right: 16px;
  width: 320px;
  max-height: calc(100vh - 100px);
  background: #ffffff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,.18);
  z-index: 9000;
  display: flex; flex-direction: column;
  font-size: 13px;
  overflow: hidden;
}
.visual-editor .ve-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}
.visual-editor .ve-head strong { font-size: 13px; }
.visual-editor .ve-close {
  background: transparent; border: none; cursor: pointer;
  font-size: 22px; line-height: 1; color: var(--gray-600); padding: 0 4px;
}
.visual-editor .ve-hint {
  padding: 24px 14px; color: var(--gray-600); font-size: 12px; text-align: center;
}
.visual-editor .ve-target { padding: 12px 14px; overflow-y: auto; flex: 1; }
.visual-editor .ve-target-row {
  display: flex; align-items: center; gap: 6px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 6px 8px;
  margin-bottom: 12px;
}
.visual-editor .ve-target-row code {
  flex: 1; font-size: 12px; color: var(--green-700);
  background: transparent; padding: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.visual-editor .ve-step {
  width: 22px; height: 22px;
  border: 1px solid var(--gray-300);
  background: white; border-radius: 6px; cursor: pointer;
  font-size: 12px; color: var(--gray-700);
}
.visual-editor .ve-step:hover { color: var(--green-700); }
.visual-editor .ve-props { display: flex; flex-direction: column; gap: 10px; }
.visual-editor .ve-row {
  display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 10px;
}
.visual-editor .ve-row > span:first-child {
  font-size: 11px; color: var(--gray-600); font-weight: 600;
  text-transform: uppercase; letter-spacing: .4px;
}
.visual-editor .ve-color-wrap { display: flex; align-items: center; gap: 6px; }
.visual-editor .ve-color-wrap input[type="color"] {
  width: 28px; height: 28px; padding: 0; border: 1px solid var(--gray-200); border-radius: 6px; cursor: pointer;
}
.visual-editor .ve-color-wrap input[type="range"],
.visual-editor .ve-range-wrap input[type="range"] { flex: 1; height: 16px; }
.visual-editor .ve-range-wrap { display: flex; align-items: center; gap: 8px; }
.visual-editor .ve-range-wrap output { font-size: 11px; color: var(--gray-700); min-width: 36px; }
.visual-editor .ve-shadow-wrap { display: flex; align-items: center; gap: 6px; }
.visual-editor .ve-actions {
  display: flex; gap: 6px; margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--gray-200);
}
.visual-editor .ve-foot {
  padding: 10px 14px;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
  text-align: right;
}

#editor-toggle.active {
  background: var(--stone-verde);
  color: var(--stone-verde-escuro);
  border-color: var(--stone-verde);
}

/* Modal de exportacao do CSS. */
.ve-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  z-index: 9100; display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.ve-modal-content {
  background: white; border-radius: 12px; padding: 20px;
  max-width: 720px; width: 100%; max-height: 80vh; display: flex; flex-direction: column;
}
.ve-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ve-modal-head h3 { font-size: 16px; }
.ve-modal textarea {
  flex: 1; min-height: 280px; width: 100%;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px;
  padding: 12px; border: 1px solid var(--gray-200); border-radius: 8px;
  background: #f8fafc; color: #0f172a; resize: vertical;
}
.ve-modal-foot { display: flex; justify-content: flex-end; margin-top: 12px; }

/* Botao discreto de filtro no header da tabela Resumo (ao lado do nome da coluna).
   Quase invisivel em estado idle; ganha cor no hover ou quando ha filtro ativo. */
.th-filter-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px;
  padding: 0; margin-left: 4px;
  background: transparent; border: none;
  color: var(--gray-300);
  cursor: pointer;
  vertical-align: -3px;
  position: relative;
  transition: color .12s ease;
}
.th-filter-btn .ic { width: 11px; height: 11px; }
.th-filter-btn:hover { color: var(--gray-700); }
.th-filter-btn.active { color: var(--green-700); }
.th-filter-badge {
  position: absolute; top: -3px; right: -6px;
  background: var(--stone-verde);
  color: var(--stone-verde-escuro);
  font-size: 9px; font-weight: 700;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 999px;
  min-width: 10px;
  text-align: center;
}
/* Popover do filtro de header: input de busca + lista scroll. */
.row-filter-pop {
  width: 240px; max-height: 320px;
  display: flex; flex-direction: column;
}
.row-filter-pop .fp-search {
  padding: 6px 10px;
  border-bottom: 1px solid var(--gray-100);
}
.row-filter-pop .fp-search input {
  width: 100%; height: 28px;
  padding: 0 8px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 13px;
}
.row-filter-pop .fp-list {
  overflow-y: auto; max-height: 220px; padding: 4px 0;
}

/* Celula com count + TPV lado a lado: "2 | 195K". Nao quebra linha. */
td.cell-ct { padding: 6px 8px; line-height: 1.2; white-space: nowrap; }
td.cell-ct .ct-n {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
td.cell-ct .ct-sep {
  display: inline-block;
  margin: 0 5px;
  color: var(--gray-300);
  font-weight: 400;
}
td.cell-ct .ct-tpv {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--gray-600);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

/* Celulas clicaveis com numero (drill-down pro modal de leads). */
td.cell-num { cursor: pointer; position: relative; }
td.cell-num:hover { background: rgba(0, 70, 30, .06); }
td.cell-num.muted:hover { background: transparent; cursor: default; }

/* =========================== Modal de lista de leads ==========================
   Drill-down a partir do Resumo. Backdrop blur + container centralizado.
   Hierarquia: eyebrow + titulo grande > 3 stats > tabela > footer.
*/
.leads-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 18, .42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9200;
  display: flex; align-items: center; justify-content: center;
  padding: 32px 24px;
  animation: lmFade .18s ease-out;
}
@keyframes lmFade { from { opacity: 0; } to { opacity: 1; } }

.leads-modal {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(15, 23, 18, .22), 0 0 0 1px rgba(0,0,0,.04);
  width: 100%; max-width: 880px;
  max-height: calc(100vh - 64px);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: lmSlide .22s cubic-bezier(.2,.7,.3,1);
}
@keyframes lmSlide { from { transform: translateY(8px) scale(.99); } to { transform: none; } }

.leads-modal-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px;
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--gray-100);
}
.leads-modal-eyebrow {
  display: inline-block;
  font-size: 11px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--green-700);
  margin-bottom: 6px;
}
.leads-modal-title h2 {
  font-size: 20px; font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--gray-900);
  line-height: 1.25;
  margin: 0;
}
.leads-modal-close {
  width: 32px; height: 32px;
  border: none; background: transparent; color: var(--gray-600);
  font-size: 22px; line-height: 1;
  border-radius: 8px; cursor: pointer; flex-shrink: 0;
  transition: background .12s ease, color .12s ease;
}
.leads-modal-close:hover { background: var(--gray-100); color: var(--gray-900); }

.leads-modal-summary {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  padding: 18px 28px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
}
.leads-summary-stat { display: flex; flex-direction: column; gap: 2px; }
.lss-label {
  font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase;
  color: var(--gray-600);
}
.lss-value {
  font-size: 20px; font-weight: 700;
  color: var(--gray-900);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
}
.leads-modal-loading {
  grid-column: 1 / -1;
  text-align: center; color: var(--gray-600); font-size: 13px; padding: 6px 0;
}
.leads-modal-loading .dots::after {
  content: '';
  animation: lmDots 1.2s steps(4, end) infinite;
}
@keyframes lmDots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } 100% { content: ''; } }
.leads-modal-error {
  grid-column: 1 / -1;
  color: var(--red-600); font-size: 13px; padding: 6px 0;
}

.leads-modal-body { flex: 1; overflow-y: auto; }
.leads-table-wrap { padding: 0; }
.leads-table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.leads-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: #ffffff;
  text-align: left; padding: 10px 16px;
  font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: var(--gray-600);
  border-bottom: 1px solid var(--gray-200);
}
.leads-table thead th.r { text-align: right; }
.leads-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
/* Separador vertical entre colunas: mesmo cinza-claro das linhas (quase
   imperceptivel), so pra dar descanso visual. Ultima coluna nao leva. */
.leads-table thead th:not(:last-child),
.leads-table tbody td:not(:last-child) { border-right: 1px solid var(--gray-100); }
.leads-row { cursor: pointer; transition: background .12s ease; }
.leads-row:hover { background: var(--gray-50); }
.leads-row:last-child td { border-bottom: 0; }
.leads-col-name { width: 38%; }
.leads-col-tpv {
  width: 18%; text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700; color: var(--green-700);
  letter-spacing: -0.01em;
}
.leads-col-stage { width: 18%; }
.leads-col-esp { width: 26%; }
.leads-name {
  font-weight: 600; color: var(--gray-900);
  display: flex; align-items: center; gap: 6px;
}
.leads-esp-name { color: var(--gray-900); font-weight: 500; }
.leads-sub { font-size: var(--fs-sm); color: var(--gray-600); margin-top: 2px; }
.leads-fire, .leads-cal {
  display: inline-flex; align-items: center;
  width: 14px; height: 14px;
}
.leads-fire { color: var(--stone-laranja-escuro); }
.leads-cal { color: var(--stone-azul, #235096); }
.leads-fire .ic, .leads-cal .ic { width: 14px; height: 14px; }

/* Barra de filtros + colunas/dados extras da lista de leads. */
.leads-table-wrap { overflow-x: auto; }
.leads-summary { padding: var(--sp-2) var(--sp-4) 0; font-size: var(--fs-sm); color: var(--gray-600); }
.leads-summary b { color: var(--gray-900); font-variant-numeric: tabular-nums; }
.leads-table thead th.leads-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.leads-table thead th.leads-sortable:hover { color: var(--gray-900); }
.leads-table thead th.sort-asc, .leads-table thead th.sort-desc { color: var(--green-700); }
.leads-days { font-size: var(--fs-xs); color: var(--gray-500); margin-top: 3px; }
.leads-days.parado { color: var(--red-600); font-weight: var(--fw-medium); }

.leads-empty {
  text-align: center; padding: 56px 24px; color: var(--gray-600);
}
.leads-empty-icon {
  display: inline-flex;
  margin: 0 auto 12px;
  color: var(--gray-400);
}
.leads-empty-icon .ic { width: 40px; height: 40px; }
.leads-empty p { font-size: 14px; }

.leads-modal-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
}
.leads-modal-hint { font-size: 12px; }

@media (max-width: 720px) {
  .leads-modal-summary { grid-template-columns: repeat(2, 1fr); }
  .leads-col-esp { display: none; }
  .leads-modal-head, .leads-modal-foot { padding-left: 20px; padding-right: 20px; }
  .leads-modal-summary { padding-left: 20px; padding-right: 20px; }
}

/* Drill-down inline na tabela Resumo: chevron + indentacao por depth. */
.row-label-wrap {
  display: inline-flex; align-items: center; gap: 6px;
}
.row-chevron {
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; cursor: pointer; padding: 0;
  color: var(--gray-400);
  transition: transform .15s cubic-bezier(.2,.7,.3,1), color .15s ease;
}
.row-chevron .ic { width: 14px; height: 14px; }
.row-chevron:hover { color: var(--green-700); }
.row-chevron.open { transform: rotate(90deg); color: var(--green-700); }
.row-chevron-spacer { display: inline-block; width: 18px; }

tr.child-row { background: rgba(0,70,30,.025); }
tr.child-row:hover { background: rgba(0,70,30,.05); }
tr.depth-1 td:first-child { padding-left: 28px; }
tr.depth-2 td:first-child { padding-left: 52px; }
tr.depth-1 td:first-child strong,
tr.depth-2 td:first-child strong { font-weight: 500; color: var(--gray-700); }

/* Group de controles no header do card (ex: filtro + seg de modo). */
.header-controls { display: inline-flex; align-items: center; gap: 10px; }

/* Wrap do filtro: botao + popover ancorado. */
.filter-wrap { position: relative; display: inline-block; }
.filter-wrap .icon-btn { position: relative; }
.filter-wrap .icon-btn.active {
  color: var(--green-700); border-color: var(--green-500); background: var(--green-50);
}
.filter-wrap .icon-btn:disabled,
.filter-wrap .icon-btn.muted { opacity: .35; cursor: not-allowed; }
.filter-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--stone-verde); color: var(--stone-verde-escuro);
  border-radius: 999px;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}
.filter-pop {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 220px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.10);
  padding: 8px 0;
  z-index: 200;
}
.filter-pop .fp-head {
  padding: 6px 14px 8px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--gray-600);
  border-bottom: 1px solid var(--gray-100);
}
.filter-pop .fp-list { display: flex; flex-direction: column; padding: 6px 0; }
.filter-pop .fp-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px; cursor: pointer;
  font-size: 13px; color: var(--gray-900);
}
.filter-pop .fp-row:hover { background: var(--gray-50); }
.filter-pop .fp-row input[type="checkbox"] {
  width: 14px; height: 14px; margin: 0; accent-color: var(--green-500); cursor: pointer;
}
.filter-pop .fp-foot {
  border-top: 1px solid var(--gray-100);
  padding: 6px 10px 0;
  display: flex; justify-content: flex-end;
}

/* Botao apenas-icone, discreto. Usado pra acoes auxiliares como "atualizar". */
.icon-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  color: var(--gray-600);
  cursor: pointer;
  padding: 0;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.icon-btn:hover { color: var(--green-700); border-color: var(--gray-300); background: var(--gray-50); }
.icon-btn:active { transform: scale(.96); }
.icon-btn .ic { width: 16px; height: 16px; }
/* Olho de mostrar/ocultar perdidos: realce verde sutil quando esta ocultando. */
#k-lost-toggle.active { color: var(--green-700); border-color: var(--green-500); }

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 8px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-600);
  font-weight: 600;
}

td:nth-child(2),
td:nth-child(3),
td:nth-child(4),
th:nth-child(2),
th:nth-child(3),
th:nth-child(4) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

tbody tr:last-child td {
  border-bottom: none;
}

.error-box {
  background: var(--red-50);
  color: var(--red-600);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
}

.info-box {
  background: var(--green-50);
  color: var(--green-900);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--green-500);
}

.badge-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-status.pending { background: var(--gray-100); color: var(--gray-700); }
.badge-status.found { background: var(--green-50); color: var(--green-900); }
.badge-status.not-found { background: var(--amber-100); color: var(--amber-800); }
.badge-status.error { background: var(--red-50); color: var(--red-600); }
.badge-status.skip { background: var(--gray-100); color: var(--gray-600); }

.card-header > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Tree (hierarquia) */
.tree {
  font-size: 14px;
}

.tree-header {
  display: grid;
  grid-template-columns: 1fr 120px 160px;
  gap: 12px;
  padding: 14px 12px;
  background: var(--green-50);
  border: 1px solid var(--green-500);
  border-radius: 8px;
  margin-bottom: 12px;
  align-items: center;
}

.tree-columns {
  display: grid;
  grid-template-columns: 1fr 120px 160px;
  gap: 12px;
  padding: 8px 12px;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--gray-600);
  font-weight: 600;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--gray-200);
}

.tree-col-num { text-align: right; }

.tree-row {
  display: grid;
  grid-template-columns: 1fr 120px 160px;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-200);
  align-items: center;
}

.tree-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tree-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.tree-toggle {
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
}

.tree-toggle:hover {
  background: var(--gray-50);
}

.tree-caret {
  display: inline-block;
  width: 14px;
  color: var(--gray-600);
  font-size: 10px;
  text-align: center;
}

.tree-icon {
  display: inline-block;
  width: 18px;
  text-align: center;
}

.tree-count {
  color: var(--gray-600);
  font-size: 12px;
  font-weight: normal;
}

.tree-level-1 {
  background: white;
  font-weight: 600;
}

.tree-level-2 {
  padding-left: 36px;
  background: var(--gray-50);
}

.tree-level-3 {
  padding-left: 60px;
  background: white;
  font-size: 13px;
  color: var(--gray-700);
}

.tree-children {
  margin: 0;
}

/* Linhas de lead clicáveis */
.lead-row {
  cursor: pointer;
  transition: background 0.1s;
}
.lead-row:hover {
  background: var(--gray-50);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  z-index: 100;
  overflow-y: auto;
}

/* O form de lead tambem abre por cima do drill-down do Resumo (overlay 9200),
   via lapis da lista (feedback #40); fica acima dele e abaixo do toast (9999). */
#lead-form.modal-overlay { z-index: 9300; }

.modal {
  position: relative;
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 640px;
  padding: 28px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--gray-100);
  color: var(--gray-700);
  border-radius: 8px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s;
}
.modal-close:hover {
  background: var(--gray-200);
}

/* Modal de feedback do dash */
#feedback-btn .ic { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; }
#feedback-modal .modal { max-width: 520px; }
.fb-label { display: block; font-size: 12px; font-weight: 600; color: var(--gray-600); margin: 0 0 6px; }
.fb-field { width: 100%; min-width: 0; box-sizing: border-box; margin-bottom: 16px; }
.fb-textarea {
  border: 1px solid var(--gray-300); border-radius: 10px; padding: 10px 12px;
  font-size: 14px; font-family: inherit; resize: vertical; min-height: 110px; background: white;
}
.fb-textarea:focus, #feedback-modal .v-select:focus { outline: none; border-color: var(--green-700); }
.fb-field-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 6px; }
.fb-mic {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px;
  border: 1px solid var(--gray-300); border-radius: 999px; background: white;
  font-size: 12px; font-weight: 600; color: var(--gray-700);
  font-family: inherit; cursor: pointer; transition: all .12s ease;
}
.fb-mic:hover { border-color: var(--gray-400); color: var(--gray-900); }
.fb-mic .ic { width: 14px; height: 14px; }
.fb-mic.rec { background: #fdecea; border-color: #f3b4ac; color: #b42318; }
.fb-mic.rec .fb-mic-ic { position: relative; }
.fb-mic.rec .fb-mic-ic::after {
  content: ''; position: absolute; top: -2px; right: -3px;
  width: 6px; height: 6px; border-radius: 50%; background: #d92d20;
  animation: fb-pulse 1s ease-in-out infinite;
}
@keyframes fb-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.fb-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.fb-status { font-size: 13px; margin: 0 0 12px; }
.fb-status.fb-ok { color: var(--green-700); }
.fb-status.fb-err { color: #b42318; }

.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-right: 40px;
  margin-bottom: 24px;
}
.modal-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
}

.modal-section {
  margin-bottom: 24px;
}
.modal-section:last-child {
  margin-bottom: 0;
}
.modal-section h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-600);
  font-weight: 600;
  margin-bottom: 12px;
}
.mp-tasks-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-600);
  font-weight: 600;
  margin: 16px 0 10px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 24px;
}
.info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 14px;
}
.info-label {
  color: var(--gray-600);
}
.info-value {
  color: var(--gray-900);
  font-weight: 500;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.unit-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; padding: 2px 8px;
  background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 999px;
  margin-left: 4px;
}
.unit-pill code { background: transparent; padding: 0; }

/* Ações no modal + form de lead */
.modal-actions { display: flex; gap: 8px; margin-bottom: 18px; }
.btn.danger { color: var(--red-600); border-color: #f3c0c0; }
.btn.danger:hover { background: var(--red-50); }
/* Hover dos botões Credenciar/Perder do lead: leve elevação + cor mais viva. */
.k-close-actions .btn { transition: transform .14s ease, box-shadow .14s ease, filter .14s ease; }
.k-close-actions .btn:hover { transform: translateY(-2px); box-shadow: 0 5px 16px rgba(0,0,0,.10); filter: saturate(1.4) brightness(1.03); }
.k-close-actions .btn:active { transform: translateY(0); box-shadow: none; }
/* Rótulos dos grupos de controle do Kanban (Agrupar / Fechados) */
.ctrl-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--gray-600); font-weight: 700; align-self: center; white-space: nowrap; }
/* View-switcher (formato Kanban/Lista): encapsulado, é a escolha principal */
.seg-view { padding: 3px; }
.seg-view .seg-btn { display: inline-flex; align-items: center; }
.lf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
.lf-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.lf-field.lf-full { grid-column: 1 / -1; }
.lf-field > span { color: var(--gray-600); font-weight: 600; font-size: 12px; }
.lf-field input, .lf-field select {
  height: 36px; border: 1px solid var(--gray-300); border-radius: 8px;
  padding: 0 10px; font-size: 14px; font-family: inherit; background: white;
}
.lf-field input:focus, .lf-field select:focus { outline: 2px solid var(--green-vivid); border-color: var(--green-vivid); }
/* Checkbox alinhada lado a lado com o label. */
.lf-field.lf-checkbox {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding-top: 18px;
}
.lf-field.lf-checkbox input[type="checkbox"] {
  width: 16px; height: 16px;
  margin: 0; padding: 0;
  accent-color: var(--green-500);
  cursor: pointer;
}
.lf-field.lf-checkbox > span {
  font-size: 13px;
  color: var(--gray-900);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}
.lf-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* Form Admin como painel lateral (drawer): a lista de pessoas fica visivel atras. */
#adm-drawer-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .18); z-index: 55; }
#adm-form-card {
  position: fixed; top: 0; right: 0; height: 100vh; width: 460px; max-width: 92vw;
  margin: 0 !important; border-radius: 0; z-index: 56;
  box-shadow: -10px 0 28px rgba(0, 0, 0, .18);
  display: flex !important; flex-direction: column; overflow-y: auto;
  transform: translateX(0); transition: transform .22s ease;
}
#adm-form-card.hidden { transform: translateX(100%); pointer-events: none; box-shadow: none; }
#adm-form-card .card-header { display: flex; align-items: center; justify-content: space-between; }
#adm-form-card .lf-grid { grid-template-columns: 1fr; gap: 14px; }
.adm-drawer-close { border: 0; background: none; cursor: pointer; font-size: 22px; line-height: 1; color: var(--gray-500); padding: 0 4px; }
.adm-drawer-close:hover { color: var(--gray-900); }

.lf-units-wrap { margin-top: 14px; padding: 12px; background: var(--gray-50); border-radius: 10px; border: 1px solid var(--gray-200); }
.lf-units-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.lf-units-title { font-size: 12px; font-weight: 600; color: var(--gray-700); text-transform: uppercase; letter-spacing: .3px; }
.lf-units-title .muted { text-transform: none; font-weight: 400; font-size: 12px; }
.lf-unit-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.lf-unit-row:last-child { margin-bottom: 0; }
.lf-unit-idx { width: 28px; font-size: 12px; color: var(--gray-600); font-weight: 600; flex: 0 0 28px; }
.lf-unit-cnpj { flex: 1; height: 34px; border: 1px solid var(--gray-300); border-radius: 8px; padding: 0 10px; font-size: 13px; font-family: inherit; background: white; }
.lf-unit-cnpj:focus { outline: 2px solid var(--green-vivid); border-color: var(--green-vivid); }
.lf-unit-rm {
  width: 28px; height: 28px; flex: 0 0 28px;
  background: transparent; border: 1px solid var(--gray-200); border-radius: 6px;
  color: var(--gray-600); cursor: pointer; font-size: 16px; line-height: 1; padding: 0;
}
.lf-unit-rm:hover { background: #fef2f2; border-color: #fca5a5; color: var(--red-600); }

/* Timeline de tarefas */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.timeline-item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  padding: 12px 0;
  border-left: 2px solid var(--gray-200);
  margin-left: 6px;
  padding-left: 16px;
  position: relative;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 18px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green-500);
  border: 2px solid white;
}
.timeline-date {
  font-size: 13px;
  color: var(--gray-600);
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}
.timeline-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.timeline-type {
  font-weight: 600;
  font-size: 14px;
  color: var(--gray-900);
}
.timeline-owner {
  display: block;
  font-size: 12px;
  color: var(--gray-600);
  margin-top: 2px;
}

/* ===================== FUNIL DE VENDAS ===================== */
.v-header {
  background: linear-gradient(90deg, var(--green-50), white 40%);
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.v-header-title { display: flex; align-items: center; gap: 14px; }
.v-header-icon {
  width: 48px; height: 48px; border-radius: 14px;
  background: var(--green-500); color: white;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.v-header-title h1 { font-size: 22px; font-weight: 700; }
/* Distrito acima do nome (cabecalho do funil): bem sutil, altura minima. */
.k-eyebrow { font-size: var(--fs-xs); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: .04em; color: var(--gray-400); line-height: 1.1; margin-bottom: 2px; }
.k-eyebrow:empty { display: none; }
.v-header-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* Toolbar do kanban em 2 linhas: linha 1 = config da visao (NUNCA quebra, rola
   internamente se faltar largura); linha 2 = acoes a esquerda + busca a direita. */
/* Cabecalho do kanban: nome A ESQUERDA e a barra A DIREITA na MESMA faixa (nao
   empilha). O default do .v-header e' wrap; quando a barra fica larga ela quebra
   pra baixo do nome. Aqui travamos em 1 linha e deixamos a barra encolher
   (min-width:0) -> a linha 1 rola internamente (overflow-x) em vez de empilhar. */
#page-kanban .v-header { flex-wrap: nowrap; }
/* Nome nunca encolhe nem quebra em 2 linhas: fica fixo a esquerda, 1 linha; a
   barra a direita e' quem absorve a falta de largura (encolhendo/rolando). */
#page-kanban .v-header-title { flex-shrink: 0; }
#page-kanban .v-header-title h1 { white-space: nowrap; }
.k-toolbar { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 10px; min-width: 0; }
.k-toolbar-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.k-row1 { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.k-row1::-webkit-scrollbar { display: none; }
/* Linha 2 em 1 linha so: a busca encolhe (nao quebra pra uma 3a linha). Em tela
   larga a busca fica no tamanho normal (margin-left:auto empurra pra direita);
   quando aperta, encolhe ate o minimo em vez de cair pra baixo. */
.k-row2 { flex-wrap: nowrap; }
#page-kanban #k-search { flex: 0 1 220px; }

/* Menu do icone de compartilhar (importar em massa / baixar Excel). */
.k-menu-wrap { position: relative; display: inline-flex; }
.menu-pop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
  background: #fff; border: 1px solid var(--gray-200); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .12);
  padding: 6px; min-width: 210px; display: flex; flex-direction: column; gap: 2px;
}
.menu-pop.hidden { display: none; }
.menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: none; background: transparent; cursor: pointer; text-align: left;
  padding: 8px 10px; border-radius: 8px; font-size: var(--fs-base); font-weight: 500;
  color: var(--gray-700); font-family: inherit;
}
.menu-item:hover { background: var(--gray-100); color: var(--green-700); }
.menu-item .mi-ic { display: inline-flex; width: 16px; height: 16px; color: var(--gray-400); flex: 0 0 auto; }
.menu-item:hover .mi-ic { color: var(--green-700); }
.menu-item .mi-ic svg { width: 16px; height: 16px; }

/* Botao Filtros em verde; a quantidade de filtros escolhidos em vermelho. */
#k-filters-btn { color: var(--green-500); border-color: var(--green-500); background: var(--green-50); font-weight: 600; }
#k-filters-btn:hover { background: var(--green-50); border-color: var(--green-700); color: var(--green-700); }
#k-filters-btn.active { background: var(--green-50); border-color: var(--green-500); color: var(--green-500); }
#k-filters-btn .k-filt-count { color: var(--red-600); font-weight: 700; margin-left: 3px; }
/* Chip "Hoje" (#64): atalho do filtro Follow-up=Hoje; aceso = mesmo visual do Filtros ativo. */
#k-today.active { background: var(--green-50); border-color: var(--green-500); color: var(--green-500); font-weight: 600; }

/* Tour guiado das novidades (coach-marks). scrim bloqueia cliques; spot recorta
   o alvo (box-shadow gigante escurece o resto); pop e' o balao com os controles. */
.tour-scrim { position: fixed; inset: 0; z-index: 9997; background: transparent; }
.tour-spot {
  position: fixed; z-index: 9998; border-radius: 10px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(16, 24, 40, .55), 0 0 0 3px var(--green-500);
  transition: top .18s ease, left .18s ease, width .18s ease, height .18s ease;
}
.tour-pop {
  position: fixed; z-index: 9999; width: 300px; max-width: calc(100vw - 16px);
  background: #fff; border: 1px solid var(--gray-200); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, .2); padding: 14px 16px;
}
.tour-pop h3 { margin: 0 0 6px; font-size: var(--fs-md); font-weight: 700; color: var(--gray-900); }
.tour-pop p { margin: 0 0 12px; font-size: var(--fs-base); color: var(--gray-700); line-height: 1.5; }
.tour-foot { display: flex; align-items: center; gap: 8px; }
.tour-step-n { font-size: var(--fs-xs); color: var(--gray-400); margin-right: auto; }
.tour-dont { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; font-size: var(--fs-sm); color: var(--gray-600); cursor: pointer; }
.tour-dont input { cursor: pointer; }

/* Drawer lateral (desliza da direita), usado pelo filtro do funil. SEM backdrop
   escuro e com pointer-events:none no scrim -> o board segue visivel e clicavel,
   entao os resultados atualizam em tempo real enquanto se filtra. Fecha no X ou Esc. */
.drawer-scrim {
  position: fixed; top: var(--topbar-height, 56px); left: 0; right: 0; bottom: 0; z-index: 200;
  display: flex; justify-content: flex-end;
  pointer-events: none; background: transparent;
}
.drawer-scrim.hidden { display: none; }
.drawer {
  pointer-events: auto;
  width: 340px; max-width: 90vw;
  background: #fff; border-left: 1px solid var(--gray-200);
  box-shadow: -10px 0 30px rgba(16, 24, 40, .12);
  display: flex; flex-direction: column;
  animation: drawer-slide-in .2s ease;
}
@keyframes drawer-slide-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-3, 12px) var(--sp-4, 16px); border-bottom: 1px solid var(--gray-200); flex-shrink: 0;
}
.drawer-head h2 { margin: 0; font-size: var(--fs-lg, 15px); font-weight: 700; color: var(--gray-900); }
.drawer-close {
  border: none; background: transparent; cursor: pointer; font-size: 22px; line-height: 1;
  color: var(--gray-600); padding: 0 6px; border-radius: var(--radius-sm, 6px);
}
.drawer-close:hover { background: var(--gray-100); color: var(--gray-900); }
.drawer-body { flex: 1; overflow-y: auto; padding: var(--sp-4, 16px); display: flex; flex-direction: column; gap: var(--sp-4, 16px); }
.k-filter-facet { display: flex; flex-direction: column; gap: 6px; }

.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--gray-100); border-radius: 10px; }
.seg-btn {
  border: none; background: transparent; cursor: pointer;
  padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600;
  color: var(--gray-700); font-family: inherit; transition: all .12s;
}
.seg-btn:hover { color: var(--gray-900); }
.seg-btn.active { background: white; color: var(--green-700); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* Seletor de Visão (GVR/GV/Especialista) — controle primário */
.seg-role { background: var(--green-100, #d6f3e2); }
.seg-role .seg-btn { color: var(--green-700); }
.seg-role .seg-btn.active { background: var(--green-500); color: white; box-shadow: 0 1px 4px rgba(0,168,104,.4); }

.v-select {
  height: 36px; border: 1px solid var(--gray-300); border-radius: 10px;
  padding: 0 12px; font-size: 13px; font-family: inherit; background: white; cursor: pointer;
  min-width: 180px;
}

/* Picker hierarquico (regional > distrito > especialista) com busca. */
.h-picker { position: relative; display: inline-block; }
.h-picker-btn {
  height: 36px; min-width: 200px; max-width: 280px;
  border: 1px solid var(--gray-300); border-radius: 10px; background: white;
  padding: 0 30px 0 11px; font-size: 13px; font-family: inherit; cursor: pointer;
  text-align: left; color: var(--gray-900);
  display: inline-flex; align-items: center; gap: 8px;
  position: relative;
}
.h-picker-btn:hover { border-color: var(--gray-400); }
.h-picker-btn:hover .h-picker-ic { color: var(--green-vivid, #00a868); }
.h-picker-ic { color: var(--gray-500, #6b7280); flex-shrink: 0; }
.h-picker-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.h-picker-btn::after {
  content: ""; position: absolute; right: 12px; top: 50%;
  width: 6px; height: 6px; border-right: 1.5px solid var(--gray-600); border-bottom: 1.5px solid var(--gray-600);
  transform: translateY(-75%) rotate(45deg);
}
.h-picker-panel {
  position: absolute; z-index: 50; top: calc(100% + 6px); left: 0;
  min-width: 320px; max-width: 380px;
  background: white; border: 1px solid var(--gray-200); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.02);
  display: none; overflow: hidden;
}
.h-picker.open .h-picker-panel { display: block; }
.h-picker-search {
  border-bottom: 1px solid var(--gray-200); padding: 8px 10px; background: var(--gray-50);
}
.h-picker-search input {
  width: 100%; border: none; outline: none; background: transparent;
  font-size: 13px; font-family: inherit; color: var(--gray-900);
}
.h-picker-search input::placeholder { color: var(--gray-400); }
.h-picker-list { max-height: 380px; overflow-y: auto; padding: 4px 0; }
.h-picker-row {
  display: flex; align-items: stretch; width: 100%;
}
.h-picker-row:hover { background: var(--green-50); }
.h-picker-row.lvl-regional { padding-left: 4px; }
.h-picker-row.lvl-distrito { padding-left: 20px; }
.h-picker-row.lvl-especialista { padding-left: 40px; }
.h-picker-row.lvl-all { padding-left: 4px; }

.h-picker-chev-btn, .h-picker-chev-spacer {
  width: 22px; flex: 0 0 22px; display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; cursor: pointer; padding: 0;
  color: var(--gray-600);
}
.h-picker-chev-btn:hover { color: var(--gray-900); }
.h-picker-chev {
  display: inline-block; width: 0; height: 0;
  border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  border-left: 5px solid currentColor;
  transition: transform .12s ease;
}
.h-picker-chev.open { transform: rotate(90deg); }

.h-picker-item {
  flex: 1 1 auto;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 4px; font-size: 13px; cursor: pointer; color: var(--gray-900);
  border: none; background: transparent; text-align: left;
  font-family: inherit;
}
.h-picker-item:hover { background: transparent; }
.h-picker-row:hover .h-picker-item { background: transparent; }
.h-picker-item.active { background: var(--green-50); font-weight: 600; color: var(--green-700); border-radius: 6px; }
.lvl-regional .h-picker-item { font-weight: 600; color: var(--green-700); font-size: 12px; text-transform: uppercase; letter-spacing: .3px; }
.lvl-distrito .h-picker-item { color: var(--gray-900); }
.lvl-especialista .h-picker-item { color: var(--gray-700); font-size: 12.5px; }
.lvl-all .h-picker-item { font-weight: 600; }

.h-picker-empty { padding: 16px; text-align: center; color: var(--gray-400); font-size: 13px; }
.h-picker-tag {
  margin-left: auto; font-size: 11px; color: var(--gray-400);
  background: var(--gray-100); border-radius: 6px; padding: 1px 6px;
}

.badge-pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: var(--gray-100); color: var(--gray-700);
  font-size: 12px; font-weight: 600; margin-left: 6px;
}

.v-card-emerald {
  background: linear-gradient(90deg, var(--green-50), white 50%);
  box-shadow: 0 0 0 1px rgba(0,168,104,.2), 0 2px 8px rgba(0,0,0,.04);
}

/* Stage cards */
.stage-cards {
  display: flex; flex-wrap: nowrap;
  gap: 10px; margin-bottom: 20px;
}
.stage-card {
  display: flex; align-items: center; gap: 10px;
  background: white;
  border: 1px solid var(--green-500);
  border-radius: 12px; padding: 12px 14px;
  flex: 1 1 0; min-width: 0;
}
/* Cada card e' um box branco com moldura verde fina; sem o gradiente dos sc-*. */
.stage-cards .stage-card { background: white; }
/* Faixa: o icone vira GLIFO colorido pequeno (sem o quadrado de fundo). A cor por
   metrica e' informacao/hierarquia; o que poluia era o quadrado preenchido. */
.stage-icon {
  width: 22px; height: 22px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.stage-body { min-width: 0; flex: 1; }
.stage-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-orange .stage-icon { background: #fff1e6; color: #ea580c; }
.sc-purple .stage-icon { background: #f3e8ff; color: #9333ea; }
.sc-amber .stage-icon { background: #fef3c7; color: #d97706; }
.sc-emerald .stage-icon { background: var(--green-50); color: var(--green-700); }
.sc-orange { background: linear-gradient(135deg, #fff7f0, white); }
.sc-purple { background: linear-gradient(135deg, #faf5ff, white); }
.sc-amber { background: linear-gradient(135deg, #fffbeb, white); }
.sc-emerald { background: linear-gradient(135deg, var(--green-50), white); }
.sc-blue .stage-icon { background: #dbeafe; color: #2563eb; }
.sc-blue { background: linear-gradient(135deg, #eff6ff, white); }
.sc-red .stage-icon { background: #fee2e2; color: #dc2626; }
/* Na faixa, mantem so a COR do glifo e tira o quadrado de fundo dos sc-*. */
.stage-cards .stage-icon { background: transparent; }
.sc-red { background: linear-gradient(135deg, #fef2f2, white); }
.stage-label { font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--gray-600); }
.stage-value { font-size: 22px; font-weight: 700; color: var(--gray-900); line-height: 1.1; margin: 2px 0; font-variant-numeric: tabular-nums; }
/* Funil (canal /vendas e kanban): 7 cards numa linha nowrap -> valor menor pra caber em 100vw. */
#v-stage-cards .stage-value, #k-stats .stage-value { font-size: 18px; }
/* Funil: cards so com texto (sem icone), pedido do Joabe. */
#v-stage-cards .stage-icon, #k-stats .stage-icon { display: none; }
/* Texto alinhado ao topo (os cards esticam pra mesma altura; sem isto o texto centraliza). */
#v-stage-cards .stage-card, #k-stats .stage-card { align-items: flex-start; }
/* Rotulo + botao "i" sempre na mesma linha (nao deixa o "i" quebrar pra baixo). */
#v-stage-cards .stage-label, #k-stats .stage-label { white-space: nowrap; }
.stage-sub { font-size: 12px; color: var(--gray-600); }

/* Giro do funil: sparkline + delta */
.giro-spark { margin-top: 4px; color: #2563eb; line-height: 0; }
.giro-delta {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 1px 6px; border-radius: 6px; margin-left: 4px;
}
.giro-delta.up { background: var(--green-50); color: var(--green-700); }
.giro-delta.down { background: #fef2f2; color: #b91c1c; }
.giro-delta.neutral { background: var(--gray-100); color: var(--gray-600); }

/* Tables (vendas) */
.table-wrap { overflow-x: auto; }
#v-district-table, #v-vend-table, #rv-table { width: 100%; border-collapse: collapse; font-size: 13px; }
#v-district-table th, #v-vend-table th, #rv-table th {
  font-size: 12px; text-transform: none; letter-spacing: 0;
  color: var(--gray-700); font-weight: 600; padding: 10px 8px;
  border-bottom: 1px solid var(--gray-200); text-align: left; white-space: nowrap;
}
#v-district-table td, #v-vend-table td, #rv-table td { padding: 9px 8px; border-bottom: 1px solid var(--gray-100); }
#v-district-table th.c, #v-vend-table th.c, #rv-table th.c, td.c { text-align: center; }
#v-district-table th.r, #v-vend-table th.r, #rv-table th.r, td.r { text-align: right; }

/* Treeview da /resultados-venda: caret e indent por profundidade. */
#rv-table .rv-toggle { display: inline-block; width: 16px; text-align: center; cursor: pointer; user-select: none; color: var(--gray-500); font-size: 10px; margin-right: 6px; vertical-align: middle; transition: transform .12s; }
#rv-table .rv-toggle:hover { color: var(--gray-900); }
#rv-table .rv-toggle.leaf { visibility: hidden; }
#rv-table .rv-toggle.open { transform: rotate(90deg); }
#rv-table tr.depth-1 td:first-child { padding-left: 30px; }
#rv-table tr.depth-2 td:first-child { padding-left: 54px; color: var(--gray-700); }
#rv-table tr.depth-3 td:first-child { padding-left: 78px; color: var(--gray-600); }
#rv-table tr.rv-loading td { font-style: italic; color: var(--gray-500); }
td.b, .b { font-weight: 700; font-variant-numeric: tabular-nums; }
td.emerald, .emerald { color: var(--green-700); }
td.green, .green { color: #16a34a; }
td.orange, .orange { color: #ea580c; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--gray-900); }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--green-50); }
tr.totals { background: var(--gray-50); border-top: 2px solid var(--gray-200); font-weight: 700; }
tr.totals td { border-bottom: none; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.st-blue { background: #3b82f6; } .st-yellow { background: #eab308; }
.st-purple { background: #a855f7; } .st-orange { background: #f97316; }
.st-emerald { background: var(--green-500); } .st-slate { background: #94a3b8; }
.st-amber { background: #f59e0b; } .st-cyan { background: #06b6d4; }

/* Celulas tier/etapa na tabela Resumo por Regional/Distrito: tons lavados (vidro)
   pra reduzir saturacao e evitar visual ludico. Os dots no header (.dot.st-*)
   herdam das regras acima e continuam saturados, dando o sinal de cor sem competir. */
td.st-slate   { background: rgba(148,163,184,.10); color: #475569; }
td.st-amber   { background: rgba(245,158,11,.10);  color: #b45309; }
td.st-orange  { background: rgba(249,115,22,.10);  color: #c2410c; }
td.st-purple  { background: rgba(168,85,247,.10);  color: #7e22ce; }
td.st-blue    { background: rgba(59,130,246,.10);  color: #1d4ed8; }
td.st-yellow  { background: rgba(234,179,8,.10);   color: #a16207; }
td.st-emerald { background: rgba(0,125,0,.08);     color: var(--stone-verde-escuro); }
td.st-cyan    { background: rgba(6,182,212,.10);   color: #0e7490; }
.st-indigo { background: #6366f1; } .st-pink { background: #ec4899; }

.cell-pill { display: inline-block; padding: 3px 8px; border-radius: 8px; font-size: 13px; line-height: 1.3; }
.cell-pill.st-blue { background: #eff6ff; color: #2563eb; }
.cell-pill.st-yellow { background: #fefce8; color: #ca8a04; }
.cell-pill.st-purple { background: #faf5ff; color: #9333ea; }
.cell-pill.st-orange { background: #fff7ed; color: #ea580c; }
.cell-pill.st-emerald { background: var(--green-50); color: var(--green-700); }
.cell-pill.st-cyan { background: #ecfeff; color: #0891b2; }
.cell-pill.st-indigo { background: #eef2ff; color: #4f46e5; }
.cell-pill.st-pink { background: #fdf2f8; color: #db2777; }
.cell-pill.st-amber { background: #fffbeb; color: #d97706; }
.cell-pill .avg { display: block; font-size: 10px; color: var(--gray-400); }
.flame { font-size: 11px; color: var(--red-600); font-weight: 600; }

/* Segments */
.seg-row { display: grid; grid-template-columns: 180px 1fr 160px; gap: 12px; align-items: center; padding: 5px 0; }
.seg-name { font-size: 13px; color: var(--gray-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg-bar-wrap { background: var(--gray-100); border-radius: 6px; height: 14px; overflow: hidden; }
.seg-bar { height: 100%; background: var(--green-500); border-radius: 6px; }
.seg-num { font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }

/* ===================== KANBAN ===================== */
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  border: 1px solid var(--gray-300); background: white; cursor: pointer;
  font-size: 18px; color: var(--gray-700); transition: background .12s;
}
.icon-btn:hover { background: var(--gray-100); }

.kanban-board {
  display: grid; gap: 14px; overflow-x: auto; padding-bottom: 8px;
  /* stretch: toda coluna tem a altura do quadro inteiro -> da pra SOLTAR o card
     em qualquer altura da coluna vizinha (feedbacks 02/jul: "so aceita no titulo"
     / "a caixa fica la em cima"). O corpo cresce junto (flex: 1). */
  align-items: stretch;
}
.k-col {
  background: var(--gray-50); border: 1px solid var(--gray-200);
  border-radius: 12px; display: flex; flex-direction: column; min-width: 0;
  /* Coluna nunca passa da viewport: a lista de cada etapa rola DENTRO da coluna
     (feedback 09/jul: "rolar a lista dentro de cada etapa, sem descer a pagina
     inteira"). O clamp preserva o stretch: coluna curta segue com a altura da
     mais alta (drop em qualquer ponto continua valendo). */
  max-height: calc(100vh - var(--sp-6));
  min-height: 0;
}
.k-col.drop-over { outline: 2px solid var(--green-500); background: var(--green-50); }
.k-col-head {
  padding: 10px 12px; border-bottom: 1px solid var(--gray-200);
  border-left: 4px solid var(--gray-300); border-radius: 12px 12px 0 0; background: white;
}
.st-blue-head { border-left-color: #3b82f6; }
.st-yellow-head { border-left-color: #eab308; }
.st-orange-head { border-left-color: #f97316; }
.st-red-head { border-left-color: #ef4444; }
.st-slate-head { border-left-color: #94a3b8; }
.st-amber-head { border-left-color: #f59e0b; }
.st-purple-head { border-left-color: #a855f7; }
.st-indigo-head { border-left-color: #6366f1; }
.k-col-title { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.k-col-count {
  margin-left: auto; background: var(--gray-100); color: var(--gray-700);
  border-radius: 999px; padding: 1px 9px; font-size: 13px; font-variant-numeric: tabular-nums;
}
.k-col-sub { font-size: 12px; color: var(--gray-600); margin-top: 4px; }
/* Botao de minimizar no header (chevron aponta pra esquerda). */
.k-col-collapse {
  border: none; background: transparent; cursor: pointer; padding: 2px; margin-left: 4px;
  color: var(--gray-400); display: inline-flex; align-items: center; border-radius: 6px; flex-shrink: 0;
}
.k-col-collapse:hover { color: var(--gray-700); background: var(--gray-100); }
.k-col-collapse .ic { width: 15px; height: 15px; transform: rotate(180deg); }
/* Coluna colapsada: faixa vertical estreita e clicavel (contagem + titulo girado). */
.k-col.collapsed {
  align-items: center; padding: 10px 2px; gap: 8px; cursor: pointer;
  border-left-width: 4px; border-left-style: solid; overflow: hidden; /* cor vem da classe *-head da etapa */
}
.k-col.collapsed:hover { background: var(--gray-100); }
.k-col.collapsed .k-col-count { margin: 0; }
.k-col-expand-ic { display: inline-flex; color: var(--gray-400); }
.k-col-expand-ic .ic { width: 16px; height: 16px; }
.k-col-vtitle {
  writing-mode: vertical-rl; font-weight: 600; font-size: 13px; color: var(--gray-700);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-height: 240px; margin-top: 2px;
}
.k-col-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; min-height: 80px; flex: 1; overflow-y: auto; }

.k-card {
  background: white; border: 1px solid var(--gray-200); border-radius: 10px;
  padding: 8px 10px; cursor: pointer; transition: box-shadow .12s, transform .12s;
}
.k-card[draggable="true"] { cursor: grab; }
.k-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.k-card.dragging { opacity: .4; }

/* Situação do lead no funil, na tela Mercado (já é cliente / congelado / em negociação). */
.mkt-fstatus {
  display: block; font-size: 11px; line-height: 1.3; margin-bottom: 2px;
  color: var(--gray-600); font-weight: 600;
}
.mkt-fstatus.ok { color: var(--green-700); }
.mkt-fstatus.warn { color: var(--stone-laranja-escuro); }

/* Linha de segmento clicável na Análise (abre a lista de clientes do segmento). */
.an-seg-row { cursor: pointer; border-radius: 6px; }
.an-seg-row:hover { background: var(--gray-50); }
.an-seg-row:focus-visible { outline: 2px solid var(--green-500); outline-offset: 1px; }

/* Trocar de especialista sem voltar pra lista (setas + select no cabeçalho). */
.k-esp-nav { display: flex; align-items: center; gap: 4px; margin-left: var(--sp-3); }
.k-esp-nav .v-select { max-width: 220px; }
.k-esp-nav .icon-btn:disabled { opacity: .35; cursor: default; }
@media (max-width: 760px) {
  .k-esp-nav { width: 100%; margin: var(--sp-2) 0 0; }
  .k-esp-nav .v-select { flex: 1; max-width: none; }
}

/* ---- Seleção múltipla (ações em massa: follow-up, etapa, tirar do funil) ---- */
.k-card.sel { border-color: var(--green-500); background: var(--green-50); }
.k-card-check { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--green-500); cursor: pointer; }
/* Barra fixa no rodapé: some do fluxo quando não há seleção. */
.k-massa {
  position: sticky; bottom: 0; z-index: 30;
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
  margin-top: var(--sp-3); padding: var(--sp-3) var(--sp-4);
  background: white; border: 1px solid var(--gray-200); border-radius: 10px;
  box-shadow: 0 -4px 16px rgba(0,0,0,.08);
}
.k-massa-cnt { font-size: var(--fs-sm); color: var(--gray-600); }
.k-massa-cnt b { font-size: var(--fs-lg); color: var(--gray-900); }
.k-massa-acts { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-left: auto; }
.k-massa .v-select { min-width: 130px; }
@media (max-width: 760px) {
  .k-massa { flex-direction: column; align-items: stretch; gap: var(--sp-2); }
  .k-massa-acts { margin-left: 0; }
  .k-massa .v-select { min-width: 0; flex: 1; }
}
/* Linha 1 do card: nome (prioridade, ocupa o espaco) + acoes editar/visita a direita. */
.k-card-name-row { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
/* Ultima linha do card: foguinho + badges (baleia/estagio/reuniao), abaixo do resto.
   margin-top = respiro de ~1 linha inteira entre a linha de follow-up/atraso e os icones. */
.k-card-meta { display: flex; align-items: center; gap: 6px; margin-top: 20px; }
.k-card-badges { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0; flex: 1; }
.k-card-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; flex-shrink: 0; }

/* Foguinho clicavel: minimalista. So o icone, cinza claro quando off, laranja preenchido quando on. */
.k-flame {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; cursor: pointer; padding: 0; margin: -1px 0 0 -1px;
  color: var(--gray-300);
  transition: color .12s, transform .1s;
}
.k-flame:hover { color: var(--stone-laranja-escuro); }
.k-flame:active { transform: scale(.9); }
.k-flame.on { color: var(--stone-laranja-escuro); }
.k-flame .ic { width: 16px; height: 16px; }
.k-flame.on .ic { fill: currentColor; }

/* Indicador de reuniao agendada (so visual, nao clicavel). Sinaliza quando
   ha follow_up_date no lead. Cinza sobrio, igual aos demais icones do card. */
.k-cal {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--gray-400);
}
.k-cal .ic { width: 16px; height: 16px; }

/* Botao de edicao no card lead - mesmo padrao minimalista do foguinho. */
.k-edit {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; cursor: pointer; padding: 0; margin: -1px -1px 0 0;
  color: var(--gray-300);
  transition: color .12s, transform .1s;
}
/* Anotacao livre do lead (feedbacks #50/#39): composer acima do historico. */
.k-note-add { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.k-note-add .input { flex: 1; min-width: 0; }

/* Linhas de preco perdidas (perda por Preço): checkbox + taxa da concorrencia
   opcional ao lado (feedback #52). */
.loss-lines { display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-1) 0; }
.loss-line { display: flex; align-items: center; gap: var(--sp-2); }
.loss-line label {
  display: flex; align-items: center; gap: var(--sp-2); flex: 1; min-width: 0;
  font-weight: var(--fw-normal); font-size: var(--fs-base); cursor: pointer;
}
.loss-line label input { margin: 0; width: auto; }
.loss-line .loss-rate {
  flex: 0 0 76px; width: 76px; padding: 2px var(--sp-2);
  border: 1px solid var(--gray-300); border-radius: var(--radius-sm);
  font-size: var(--fs-sm); text-align: right;
}
.loss-line .loss-rate:focus { outline: none; border-color: var(--green-500); }

/* Possivel duplicado por nome (feedback #30): aviso discreto, nao bloqueia. */
.k-dup {
  display: inline-flex; align-items: center;
  background: var(--amber-100); color: var(--amber-800);
  border-radius: var(--radius-pill); padding: 0 var(--sp-2);
  font-size: var(--fs-xs); font-weight: var(--fw-semibold); white-space: nowrap;
}
.k-list-name .k-dup { margin-left: var(--sp-2); }

.k-edit:hover { color: var(--green-700); }
.k-edit:active { transform: scale(.9); }
.k-edit .ic { width: 14px; height: 14px; }

/* Registrar visita/tarefa direto do card. Discreto (so o icone), mas em verde
   Stone pra "saltar" entre os icones cinza - acao positiva, sempre presente. */
.k-visit {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; cursor: pointer; padding: 0; margin: -1px 1px 0 0;
  color: var(--green-700, #15803d);
  transition: color .12s, transform .1s;
}
.k-visit:hover { color: var(--green-900, #14532d); transform: scale(1.12); }
.k-visit:active { transform: scale(.9); }
.k-visit .ic { width: 15px; height: 15px; }

/* Toast simples (feedback de acao, ex: tarefa registrada). */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(10px);
  background: var(--gray-900, #1a1a1a); color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 13px; font-weight: 500; box-shadow: 0 6px 24px rgba(0,0,0,.22);
  z-index: 9999; opacity: 0; transition: opacity .18s, transform .18s; pointer-events: none; max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--red-600, #c0392b); }

/* Dialog "Registrar tarefa" — só os específicos. O resto vem do design-system.css
   (stack / section-label / input / actions / note). */
.vf-name { margin: 0 0 var(--sp-1); font-weight: var(--fw-bold); font-size: 16px; color: var(--gray-900); }
.vf-row2 { display: grid; grid-template-columns: 1fr 150px; gap: var(--sp-4); align-items: start; }
#visit-form .vf-types { display: flex; width: 100%; }
#visit-form .vf-types .seg-btn { flex: 1; }
#visit-form .seg { display: inline-flex; }
/* Nome do lead: titulo do card, SEMPRE em uma unica linha (corta com reticencias;
   nome completo no title/hover). Ocupa a linha 1 inteira, sem disputar espaco. */
.k-card-name-txt {
  flex: 1; min-width: 0;
  font-weight: 600; font-size: 13.5px; line-height: 1.3; color: var(--gray-900);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.baleia-badge {
  display: inline-block; margin-right: 6px; font-size: 13px; vertical-align: -1px;
}

.cnpj-flag {
  display: inline-block;
  margin-left: 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--gray-600);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  padding: 0 4px;
  vertical-align: 1.5px;
}
.k-badge { flex-shrink: 0; font-size: 10px !important; padding: 1px 6px !important; }
.k-card-tpv { font-weight: 700; font-size: 14px; color: var(--gray-900); margin: 3px 0 2px; font-variant-numeric: tabular-nums; }
.k-days { color: var(--gray-400); flex-shrink: 0; font-size: 11px; margin-left: auto; }
.k-days.stuck { color: var(--red-600); font-weight: 600; }
.k-followup {
  display: inline-flex; align-items: center; gap: 4px;
  margin: 2px 0 4px; padding: 1px 6px; border-radius: 6px;
  font-size: 11px; font-weight: 600; line-height: 1.4;
}
.k-followup span { font-size: 10px; }
.fu-overdue { background: #fee2e2; color: #b91c1c; }
.fu-today   { background: #ecfdf5; color: #047857; }
.fu-soon    { background: #fef9c3; color: #854d0e; }
.fu-future  { background: #fef3c7; color: #92400e; }
.cell-pill.fu-overdue { background: #fee2e2; color: #b91c1c; }
.cell-pill.fu-today   { background: #ecfdf5; color: #047857; }
.cell-pill.fu-soon    { background: #fef9c3; color: #854d0e; }
.cell-pill.fu-future  { background: #fef3c7; color: #92400e; }

/* Autocomplete do follow de gestão */
.gf-ac { position: absolute; top: 100%; left: 0; right: 0; margin-top: 2px; background: #fff; border: 1px solid var(--gray-300, #d1d5db); border-radius: 8px; box-shadow: 0 4px 12px rgba(16,24,40,.12); max-height: 200px; overflow: auto; z-index: 5; }
.gf-ac-item { padding: 8px 10px; cursor: pointer; font-size: 13px; border-bottom: 1px solid var(--gray-100, #f3f4f6); }
.gf-ac-item:last-child { border-bottom: 0; }
.gf-ac-item:hover { background: #ecfdf5; }

/* Vista Lista do kanban (alternativa tabular). */
.k-list-wrap { background: var(--white); border-radius: 12px; overflow: auto; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.k-list { width: 100%; border-collapse: collapse; font-size: 13px; }
.k-list th, .k-list td { padding: 10px 12px; text-align: left; vertical-align: middle; }
.k-list thead th { background: var(--gray-50); color: var(--gray-600); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; border-bottom: 1px solid var(--gray-200); position: sticky; top: 0; z-index: 1; }
.k-list th.right, .k-list td.right { text-align: right; }
.k-list-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.k-list-sort:hover { color: var(--gray-900); }
.k-list-sort .sort-arr { margin-left: 4px; color: var(--green-700); font-size: 10px; vertical-align: 1px; }
.k-list thead th .th-filter-btn { vertical-align: middle; }
/* Popover de filtro por coluna do modo lista (reusa .filter-pop / .row-filter-pop). */
.klist-filter-pop { width: 240px; }
.klist-filter-pop .fp-range { display: flex; gap: 10px; padding: 10px 12px; }
.klist-filter-pop .fp-range label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--gray-500); }
.klist-filter-pop .fp-range input { width: 92px; height: 28px; padding: 0 8px; border: 1px solid var(--gray-200); border-radius: 6px; font-size: 13px; }
.k-list tbody tr { border-bottom: 1px solid var(--gray-100); transition: background .1s; }
.k-list tbody tr.k-list-row:hover { background: var(--gray-50); cursor: pointer; }
.k-list .k-list-name { font-weight: 600; color: var(--gray-900); }
.k-list .muted { color: var(--gray-400); }
.k-list .k-flame, .k-list .k-edit { margin: 0; }
.k-badge-fora {
  display: inline-block; margin-top: 6px; font-size: 10px; font-weight: 600;
  color: var(--amber-800); background: var(--amber-100); padding: 1px 6px; border-radius: 6px;
}
.k-empty { text-align: center; padding: 24px 8px; font-size: 13px; color: var(--gray-400); }

.cp-st-blue { background: #eff6ff; color: #2563eb; }
.cp-st-yellow { background: #fefce8; color: #ca8a04; }
.cp-st-orange { background: #fff7ed; color: #ea580c; }
.cp-st-red { background: #fef2f2; color: #dc2626; }
.cp-st-slate { background: #f1f5f9; color: #475569; }
.cp-st-amber { background: #fffbeb; color: #d97706; }
.cp-st-purple { background: #faf5ff; color: #9333ea; }
.cp-st-emerald { background: var(--green-50); color: var(--green-700); }

/* Responsive */
@media (max-width: 720px) {
  .info-grid { grid-template-columns: 1fr; }
  .seg-row { grid-template-columns: 110px 1fr 120px; }
  .topbar { padding: 0 12px; gap: 12px; }
  .usermenu-label { display: none; } /* só o avatar cabe no mobile */
  .nav-item { padding: 8px 10px; }
  .nav-label { display: none; }
}

/* ===== Importar em massa: grade tipo planilha ===== */
#bulk-modal .modal { max-width: 920px; width: 96vw; }
.bulk-toolbar { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.bulk-spacer { flex: 1; }
.bulk-save { font-size: 12px; color: var(--gray-600, #6b7280); min-width: 60px; }
.bulk-grid-wrap { max-height: 52vh; overflow: auto; border: 1px solid var(--gray-200, #e5e7eb); border-radius: 10px; }
.bulk-grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.bulk-grid thead th {
  position: sticky; top: 0; z-index: 1; text-align: left; white-space: nowrap;
  background: var(--gray-50, #f9fafb); color: var(--gray-600, #6b7280);
  padding: 7px 8px; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
}
.bulk-grid td { padding: 3px 6px; border-bottom: 1px solid var(--gray-100, #f3f4f6); }
.bulk-grid th.bulk-idx, .bulk-grid td.bulk-idx { width: 30px; text-align: center; color: var(--gray-400, #9ca3af); font-size: 11px; }
.bulk-grid td.bcell {
  padding: 6px 8px; min-width: 72px; max-width: 240px; cursor: cell; outline: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: none;
}
.bulk-grid td.bcell.active { box-shadow: inset 0 0 0 2px var(--green-500, #10b981); border-radius: 3px; }
.bulk-grid td.bcell:has(.bcell-edit) { padding: 0; overflow: visible; }
.bcell-edit {
  width: 100%; box-sizing: border-box; border: 1px solid var(--green-500, #10b981);
  border-radius: 3px; outline: none; font: inherit; font-size: 13px; padding: 4px 6px; background: #fff; color: inherit;
}
select.bcell-edit { cursor: pointer; }
.bulk-del {
  border: none; background: transparent; color: var(--gray-400, #9ca3af); font-size: 17px; line-height: 1;
  cursor: pointer; border-radius: 6px; width: 26px; height: 26px; transition: background .12s ease, color .12s ease;
}
.bulk-del:hover { background: var(--red-50, #fef2f2); color: var(--red-600, #dc2626); }
.bulk-st { white-space: nowrap; }
.bulk-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 500px; }
.bulk-badge.new { background: var(--green-50, #ecfdf5); color: var(--green-900, #065f46); }
.bulk-badge.exists { background: var(--amber-100, #fef3c7); color: var(--amber-800, #92400e); }
.bulk-badge.upd { background: #eff6ff; color: #1d4ed8; }
.bulk-badge.skip { background: var(--gray-100, #f3f4f6); color: var(--gray-600, #6b7280); }
.bulk-badge.err { background: var(--red-50, #fef2f2); color: var(--red-600, #dc2626); }
.bulk-policy { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.bulk-result {
  margin-top: 10px; font-size: 13px; color: var(--gray-700, #374151);
  background: var(--gray-50, #f9fafb); border: 1px solid var(--gray-200, #e5e7eb); border-radius: 8px; padding: 8px 12px;
}
.bulk-result.warn { background: var(--red-50, #fef2f2); border-color: #fecaca; color: var(--red-600, #b91c1c); }

/* ===== Distribuição do funil: dois gráficos lado a lado (funil) + cross-filter ===== */
.charts-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.chart-col { min-width: 0; border: 1px solid var(--gray-200, #e5e7eb); border-radius: 12px; padding: 18px 16px 20px; }
.chart-col.col-stage { background: var(--gray-50, #f9fafb); }
.chart-col.col-tier { background: #f4faf7; border-color: #d8efe4; }
.chart-title { text-align: center; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--gray-700, #374151); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--gray-200, #e5e7eb); }
.col-tier .chart-title { border-bottom-color: #d8efe4; }
.hbars { display: flex; flex-direction: column; gap: 16px; max-width: 100%; }
.hbar-row { cursor: pointer; }
.hbar-cap { text-align: center; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--gray-500, #9ca3af); margin-bottom: 6px; }
.hbar-bar {
  position: relative; overflow: hidden;
  height: 30px; border-radius: 8px; margin: 0 auto; min-width: 56px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
  transition: width .35s ease, filter .12s ease, transform .12s ease;
}
.hbar-hot { position: absolute; left: 0; top: 0; bottom: 0; background: #f97316; transition: width .35s ease; }
.hbar-row:hover .hbar-bar { filter: brightness(1.06); transform: translateY(-1px); }
.hbar-row.on .hbar-cap { color: var(--gray-900, #111827); }
.hbar-row.on .hbar-bar { outline: 2px solid var(--gray-900, #111827); outline-offset: 2px; }
.hbar-row:focus-visible { outline: none; }
.hbar-row:focus-visible .hbar-bar { outline: 2px solid var(--gray-900, #111827); outline-offset: 2px; }
.hbar-in { position: relative; z-index: 1; color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; text-shadow: 0 1px 1px rgba(0,0,0,.25); }
.stack-total { margin-top: 16px; font-size: 13px; color: var(--gray-600, #6b7280); text-align: center; }
.stack-empty { padding: 40px; text-align: center; }
/* Legenda (tooltip) das barras */
.chart-tip { position: fixed; z-index: 9100; pointer-events: none; background: var(--gray-900, #111827); color: #fff; border-radius: 8px; padding: 9px 11px; font-size: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.28); min-width: 150px; }
.chart-tip.hidden { display: none; }
.chart-tip .tip-title { font-weight: 700; margin-bottom: 6px; }
.chart-tip .tip-row { display: flex; justify-content: space-between; gap: 16px; line-height: 1.6; }
.chart-tip .tip-row span { color: #cbd5e1; }
.chart-tip .tip-hot b { color: #fb923c; }
@media (max-width: 760px) { .charts-2col { grid-template-columns: 1fr; gap: 24px; } }
.chart-filter-tag { font-size: 12px; color: var(--gray-700, #374151); display: inline-flex; align-items: center; gap: 6px; }
.chart-clear { border: none; background: var(--gray-100, #f3f4f6); color: var(--gray-700, #374151); border-radius: 500px; padding: 2px 10px; font-size: 11px; font-weight: 600; cursor: pointer; }
.chart-clear:hover { background: var(--gray-200, #e5e7eb); }

/* Badge "perdido em DD/MM" no card do kanban (pendência de retrabalho em Mapeado) */
.k-lost { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 600; color: var(--red-600, #dc2626); background: var(--red-50, #fef2f2); border-radius: 6px; padding: 1px 7px; }
.k-lost-reason { font-size: 10px; color: var(--gray-600, #6b7280); margin-top: 3px; line-height: 1.3; }

/* ===== Análise de Perdas: árvore de motivos ===== */
.perda-node { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; cursor: pointer; transition: background .12s ease; }
.perda-node:hover { background: var(--gray-50, #f9fafb); }
.perda-node.active { background: var(--red-50, #fef2f2); box-shadow: inset 2px 0 0 var(--red-600, #dc2626); }
.perda-node.lvl1 { font-weight: 700; font-size: 14px; margin-top: 8px; }
.perda-node.lvl2 { padding-left: 28px; font-size: 13px; }
.perda-node.lvl3 { padding-left: 48px; font-size: 12px; color: var(--gray-700, #374151); }
.perda-node-label { flex: 0 0 42%; max-width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perda-node-bar-wrap { flex: 1; height: 8px; background: var(--gray-100, #f3f4f6); border-radius: 4px; overflow: hidden; }
.perda-node-bar { display: block; height: 100%; background: linear-gradient(90deg, #ef6c00, #f59e0b); border-radius: 4px; transition: width .3s ease; }
.perda-node.lvl1 .perda-node-bar { background: linear-gradient(90deg, #dc2626, #ef6c00); }
.perda-node-val { flex: 0 0 auto; font-weight: 600; color: var(--gray-700, #374151); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ===== Perdas 2.0: KPIs, insights, tendência e barras com benchmark ===== */
.perdas-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--sp-2, 8px); }
@media (max-width: 900px) { .perdas-kpis { grid-template-columns: repeat(2, 1fr); } }
.an-kpi.perdas-kpi-late { background: color-mix(in srgb, var(--red-600, #dc2626) 6%, white); border-color: color-mix(in srgb, var(--red-600, #dc2626) 25%, transparent); }
.an-kpi.perdas-kpi-late .an-kpi-value { color: var(--red-600, #dc2626); }
.an-insight.atencao { background: var(--amber-100, #fef3c7); border-color: color-mix(in srgb, var(--amber-800, #92400e) 25%, transparent); color: var(--amber-800, #92400e); }
/* paleta categórica dos motivos N1 (validada pra daltonismo em fundo claro);
   a cor segue o MOTIVO, nunca a posição no ranking */
.pcat-preco   { background: #3b6fb5; }
.pcat-vinculo { background: #b26a00; }
.pcat-produto { background: #2e8560; }
.pcat-contato { background: #a04879; }
.pcat-outros  { background: #7c6bd6; }
.pcat-sem     { background: var(--gray-400, #9ca3af); }
/* tendência semanal (colunas) */
.pt-cols { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: var(--sp-4, 16px); }
.pt-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; position: relative; min-width: 0; }
.pt-bar { display: block; background: var(--stone-verde-escuro-2, #007d00); border-radius: 3px 3px 0 0; min-height: 2px; transition: filter .12s ease; }
.pt-col:hover .pt-bar { filter: brightness(.75); }
.pt-col.peak .pt-bar { background: var(--red-600, #dc2626); }
.pt-dl { position: absolute; bottom: 100%; width: 100%; text-align: center; font-size: 10px; font-weight: 700; color: var(--gray-600, #4b5563); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pt-base { border-top: 1px solid var(--gray-200, #e5e7eb); }
.pt-axis { display: flex; gap: 6px; margin-top: 4px; }
.pt-x { flex: 1; text-align: center; font-size: 10px; color: var(--gray-600, #4b5563); white-space: nowrap; min-width: 0; }
/* barra horizontal com trilha e marcador de benchmark */
.pbar-row { display: grid; grid-template-columns: minmax(110px, 34%) 1fr auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; font-size: var(--fs-base, 13px); }
.pbar-row.clickable { cursor: pointer; transition: background .12s ease; }
.pbar-row.clickable:hover { background: var(--gray-50, #f9fafb); }
.pbar-row.active { background: var(--red-50, #fef2f2); box-shadow: inset 2px 0 0 var(--red-600, #dc2626); }
.pbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--gray-700, #374151); }
.pbar-track { position: relative; height: 12px; background: var(--gray-100, #f3f4f6); border-radius: 6px; }
.pbar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; min-width: 2px; transition: width .3s ease; }
.pbar-fill.neutral { background: color-mix(in srgb, var(--stone-verde-escuro-2, #007d00) 45%, white); }
.pbar-fill.late { background: var(--red-600, #dc2626); }
.pbar-bench { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--gray-900, #111827); border-radius: 2px; }
.pbar-val { font-weight: 600; font-size: var(--fs-sm, 12px); color: var(--gray-700, #374151); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pbar-flag { font-size: 10px; font-weight: 700; color: var(--red-600, #dc2626); background: var(--red-50, #fef2f2); border-radius: 999px; padding: 1px 6px; margin-left: 6px; }
.pbench-sw { display: inline-block; width: 2px; height: 10px; background: var(--gray-900, #111827); vertical-align: -1px; margin-right: 4px; border-radius: 2px; }

/* Saudação no login: overlay de tela inteira, bem breve */
.welcome-screen {
  position: fixed; inset: 0; z-index: 9300; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0b6e4f 0%, #15a878 60%, #38c293 100%);
  animation: wsFade .55s ease forwards 1.2s; /* segura ~1.2s e some */
}
.welcome-screen-msg {
  color: #fff; font-weight: 800; text-align: center; padding: 0 24px;
  font-size: clamp(26px, 5.5vw, 48px); letter-spacing: -.02em; line-height: 1.15;
  text-shadow: 0 2px 16px rgba(0,0,0,.18);
  opacity: 0; transform: translateY(16px) scale(.94);
  animation: wsMsgIn .5s cubic-bezier(.18,.9,.32,1.2) forwards;
}
@keyframes wsMsgIn { to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes wsFade { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) {
  .welcome-screen { animation-delay: .9s; }
  .welcome-screen-msg { animation: none; opacity: 1; transform: none; }
}

/* ===================== Tela Análise (inteligência do funil) ===================== */
.an-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4, 16px); }
@media (max-width: 900px) { .an-grid-2 { grid-template-columns: 1fr; } }
/* Barras verdes (conversão/segmento = positivo); vermelho fica só nas perdas */
#an-funnel-side .perda-node-bar, #an-oportunidades .perda-node-bar, #an-segmentos .perda-node-bar, #an-segconv .perda-node-bar { background: linear-gradient(90deg, var(--stone-verde-escuro-2, #007d00), var(--stone-verde-claro, #00d700)); }
#an-funnel-side .perda-node, #an-oportunidades .perda-node, #an-segmentos .perda-node, #an-perdas .perda-node { cursor: default; }
.an-insight { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--radius-md, 10px); font-size: var(--fs-sm, 13px); font-weight: 600; border: 1px solid transparent; }
.an-insight.alerta { background: color-mix(in srgb, var(--red-600, #dc2626) 8%, white); border-color: color-mix(in srgb, var(--red-600, #dc2626) 25%, transparent); color: var(--red-700, #b91c1c); }
.an-insight.oportunidade { background: color-mix(in srgb, var(--stone-verde-escuro-2, #007d00) 8%, white); border-color: color-mix(in srgb, var(--stone-verde-escuro-2, #007d00) 25%, transparent); color: var(--stone-verde-escuro, #00461e); }
.an-insight.ok { background: var(--gray-50, #f9fafb); border-color: var(--gray-200, #e5e7eb); color: var(--gray-700, #374151); }
.an-progress-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: var(--fs-sm, 13px); }
.an-progress-row > span:first-child { flex: 0 0 42%; }
.an-progress-bar { background: linear-gradient(90deg, var(--stone-laranja, #ef6c00), var(--amber-500, #f59e0b)); }
.an-progress-bar.full { background: linear-gradient(90deg, var(--stone-verde-escuro-2, #007d00), var(--stone-verde-claro, #00d700)); }

/* Análise: hero (placar do período) */
.an-hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--sp-5, 24px); align-items: start; }
@media (max-width: 900px) { .an-hero-grid { grid-template-columns: 1fr; } }
.an-hero-num { font-size: 34px; font-weight: 800; letter-spacing: -.02em; color: var(--stone-verde-escuro, #00461e); line-height: 1.1; font-variant-numeric: tabular-nums; }
.an-hero-story { margin-top: var(--sp-3, 12px); padding-top: var(--sp-3, 12px); border-top: 1px solid var(--gray-100, #f3f4f6); font-size: var(--fs-md, 14px); color: var(--gray-700, #374151); }
.an-hero-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2, 8px); }
.an-kpi { background: var(--gray-50, #f9fafb); border: 1px solid var(--gray-100, #f3f4f6); border-radius: var(--radius-md, 8px); padding: 10px 12px; }
.an-kpi-label { font-size: var(--fs-xs, 11px); color: var(--gray-600, #4b5563); font-weight: var(--fw-semibold, 600); text-transform: uppercase; letter-spacing: .03em; }
.an-kpi-value { font-size: var(--fs-xl, 18px); font-weight: var(--fw-bold, 700); font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.an-kpi-sub { font-size: var(--fs-xs, 11px); color: var(--gray-600, #4b5563); }
.an-delta { font-size: var(--fs-xs, 11px); font-weight: var(--fw-bold, 700); padding: 1px 6px; border-radius: var(--radius-pill, 999px); }
.an-delta.good { color: var(--stone-verde-escuro-2, #007d00); background: color-mix(in srgb, var(--stone-verde-claro, #00d700) 14%, transparent); }
.an-delta.bad { color: var(--red-600, #dc2626); background: var(--red-50, #fef2f2); }
.an-delta.flat { color: var(--gray-600, #4b5563); background: var(--gray-100, #f3f4f6); }

/* Análise: bullet chart (meta do mês) */
.an-bullet-wrap { margin-top: var(--sp-3, 12px); }
.an-bullet-head { display: flex; justify-content: space-between; font-size: var(--fs-sm, 12px); color: var(--gray-700, #374151); margin-bottom: 4px; }
.an-bullet { position: relative; height: 14px; background: var(--gray-100, #f3f4f6); border-radius: var(--radius-pill, 999px); overflow: visible; }
.an-bullet-real { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--stone-verde-escuro-2, #007d00), var(--stone-verde-claro, #00d700)); border-radius: var(--radius-pill, 999px); }
.an-bullet-proj { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--stone-verde-escuro-2, #007d00) 22%, transparent); border-radius: var(--radius-pill, 999px); }
.an-bullet-meta { position: absolute; top: -3px; bottom: -3px; width: 3px; background: var(--gray-900, #111827); border-radius: 2px; }
.an-bullet-legend { display: flex; gap: var(--sp-3, 12px); font-size: var(--fs-xs, 11px); color: var(--gray-600, #4b5563); margin-top: 4px; }
.an-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.an-dot.real { background: var(--stone-verde-escuro-2, #007d00); }
.an-dot.proj { background: color-mix(in srgb, var(--stone-verde-escuro-2, #007d00) 30%, white); }
.an-dot.meta { background: var(--gray-900, #111827); border-radius: 2px; }

/* Análise: gráfico de funil (barras afuniladas centradas) */
.an-funnel { padding: var(--sp-2, 8px) 0; }
.an-funnel-row { display: flex; justify-content: center; }
.an-funnel-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2, 8px); min-width: 130px; height: 34px; padding: 0 12px; border-radius: var(--radius-md, 8px); color: #fff; font-size: var(--fs-sm, 12px); background: linear-gradient(90deg, var(--stone-verde-escuro, #00461e), var(--stone-verde-escuro-2, #007d00)); transition: width .3s ease; }
.an-funnel-bar b { font-variant-numeric: tabular-nums; }
.an-funnel-bar.gargalo { background: linear-gradient(90deg, var(--stone-laranja-escuro, #c2410c), var(--stone-laranja, #ef6c00)); }
.an-funnel-bar.final { background: var(--stone-verde-claro, #00d700); color: var(--stone-verde-escuro, #00461e); font-weight: var(--fw-bold, 700); }
.an-funnel-bar.final.ativado { background: var(--stone-verde-escuro-2, #007d00); color: #fff; }
/* Selo "BQ": marca que o número vem do BigQuery (dado oficial), não do funil. */
.an-fonte-bq { display: inline-block; font-size: 9px; font-weight: var(--fw-bold, 700); letter-spacing: .04em; vertical-align: middle; padding: 1px 4px; border-radius: 4px; background: rgba(255,255,255,.28); color: inherit; }
.an-funnel-conv .an-fonte-bq { background: var(--gray-200, #e5e7eb); color: var(--gray-700, #374151); }
.an-funnel-conv { text-align: center; font-size: var(--fs-xs, 11px); color: var(--gray-600, #4b5563); padding: 3px 0; }
.an-funnel-conv.bad { color: var(--stone-laranja-escuro, #c2410c); font-weight: var(--fw-semibold, 600); }
.bad { color: var(--red-600, #dc2626); }

/* Análise: gráfico de linha SVG */
.an-line { width: 100%; height: auto; display: block; margin-top: var(--sp-2, 8px); }
.an-line-grid { stroke: var(--gray-200, #e5e7eb); stroke-width: 1; stroke-dasharray: 3 3; }
.an-line-tick { font-size: 10px; fill: var(--gray-600, #4b5563); }
.an-line-path { fill: none; stroke-width: 2; stroke-linejoin: round; }
.an-line-path.l1 { stroke: var(--stone-verde-escuro-2, #007d00); }
.an-line-path.l2 { stroke: color-mix(in srgb, var(--stone-verde-escuro-2, #007d00) 35%, white); }
.an-line-area { fill: color-mix(in srgb, var(--stone-verde-claro, #00d700) 10%, transparent); }
.an-line-dot.l1 { fill: var(--stone-verde-escuro-2, #007d00); }
.an-line-dot.l2 { fill: color-mix(in srgb, var(--stone-verde-escuro-2, #007d00) 35%, white); }

/* Análise: funil de atividade em passos */
.an-steps { display: flex; align-items: stretch; gap: var(--sp-2, 8px); flex-wrap: wrap; }
.an-step { flex: 1; min-width: 110px; background: var(--gray-50, #f9fafb); border: 1px solid var(--gray-100, #f3f4f6); border-radius: var(--radius-md, 8px); padding: 10px 12px; text-align: center; }
.an-step-n { font-size: var(--fs-xl, 18px); font-weight: var(--fw-bold, 700); font-variant-numeric: tabular-nums; }
.an-step-l { font-size: var(--fs-xs, 11px); color: var(--gray-600, #4b5563); font-weight: var(--fw-semibold, 600); text-transform: uppercase; letter-spacing: .03em; }
.an-step-s { font-size: var(--fs-xs, 11px); color: var(--gray-600, #4b5563); margin-top: 2px; }
.an-step-arrow { display: flex; flex-direction: column; justify-content: center; align-items: center; color: var(--gray-400, #9ca3af); font-size: var(--fs-md, 14px); }
.an-step-arrow span { font-size: var(--fs-xs, 11px); font-weight: var(--fw-bold, 700); color: var(--stone-verde-escuro-2, #007d00); }

/* Análise: plano de ação (conclusão) */
.an-plan-item { display: flex; align-items: flex-start; gap: var(--sp-3, 12px); padding: 10px 14px; border-radius: var(--radius-md, 8px); font-size: var(--fs-md, 14px); border: 1px solid var(--gray-100, #f3f4f6); background: var(--gray-50, #f9fafb); }
.an-plan-item.alerta { border-color: color-mix(in srgb, var(--red-600, #dc2626) 20%, transparent); background: color-mix(in srgb, var(--red-600, #dc2626) 5%, white); }
.an-plan-item.oportunidade { border-color: color-mix(in srgb, var(--stone-verde-escuro-2, #007d00) 22%, transparent); background: color-mix(in srgb, var(--stone-verde-escuro-2, #007d00) 5%, white); }
.an-plan-num { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; background: var(--stone-verde-escuro, #00461e); color: #fff; font-size: var(--fs-xs, 11px); font-weight: var(--fw-bold, 700); display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.an-plan-item.alerta .an-plan-num { background: var(--red-600, #dc2626); }

/* Análise: a conta da meta (Meta ÷ Conversão = Funil necessário) */
.an-eq { display: flex; align-items: stretch; gap: var(--sp-2, 8px); flex-wrap: wrap; }
.an-eq-box { flex: 1; min-width: 150px; background: var(--gray-50, #f9fafb); border: 1px solid var(--gray-100, #f3f4f6); border-radius: var(--radius-md, 8px); padding: 12px 14px; }
.an-eq-box.hl { background: color-mix(in srgb, var(--stone-verde-escuro-2, #007d00) 6%, white); border-color: color-mix(in srgb, var(--stone-verde-escuro-2, #007d00) 25%, transparent); }
.an-eq-l { font-size: var(--fs-xs, 11px); color: var(--gray-600, #4b5563); font-weight: var(--fw-semibold, 600); text-transform: uppercase; letter-spacing: .03em; }
.an-eq-v { font-size: 22px; font-weight: var(--fw-bold, 700); font-variant-numeric: tabular-nums; color: var(--gray-900, #111827); }
.an-eq-box.hl .an-eq-v { color: var(--stone-verde-escuro, #00461e); }
.an-eq-s { font-size: var(--fs-xs, 11px); color: var(--gray-600, #4b5563); margin-top: 2px; }
.an-eq-op { display: flex; align-items: center; font-size: 20px; font-weight: var(--fw-bold, 700); color: var(--gray-400, #9ca3af); }

/* Análise: barras de cobertura da meta */
.an-goal-bars { margin-top: var(--sp-4, 16px); display: grid; gap: var(--sp-3, 12px); }
.an-goal-head { display: flex; justify-content: space-between; align-items: center; font-size: var(--fs-sm, 12px); font-weight: var(--fw-semibold, 600); color: var(--gray-700, #374151); margin-bottom: 4px; }
.an-goal-chip { font-size: var(--fs-xs, 11px); font-weight: var(--fw-bold, 700); padding: 2px 8px; border-radius: var(--radius-pill, 999px); }
.an-goal-chip.falta { color: var(--red-600, #dc2626); background: var(--red-50, #fef2f2); }
.an-goal-chip.ok { color: var(--stone-verde-escuro-2, #007d00); background: color-mix(in srgb, var(--stone-verde-claro, #00d700) 14%, transparent); }
.an-goal-nums { font-weight: var(--fw-normal, 400); color: var(--gray-600, #4b5563); display: flex; align-items: center; gap: 6px; }
.an-goal-bar { position: relative; height: 18px; background: var(--gray-100, #f3f4f6); border-radius: var(--radius-pill, 999px); overflow: hidden; }
.an-goal-fill { height: 100%; border-radius: var(--radius-pill, 999px); background: linear-gradient(90deg, var(--stone-laranja-escuro, #c2410c), var(--stone-laranja, #ef6c00)); transition: width .3s ease; }
.an-goal-fill.ok { background: linear-gradient(90deg, var(--stone-verde-escuro-2, #007d00), var(--stone-verde-claro, #00d700)); }
.an-goal-pct { position: absolute; right: 8px; top: 0; bottom: 0; display: flex; align-items: center; font-size: var(--fs-xs, 11px); font-weight: var(--fw-bold, 700); color: var(--gray-700, #374151); }

/* Análise: mini barra de cobertura na tabela do time */
.an-cover { position: relative; height: 16px; background: var(--gray-100, #f3f4f6); border-radius: var(--radius-pill, 999px); overflow: hidden; min-width: 120px; }
.an-cover-fill { height: 100%; border-radius: var(--radius-pill, 999px); background: var(--stone-laranja, #ef6c00); }
.an-cover-fill.ok { background: var(--stone-verde-escuro-2, #007d00); }
.an-cover-fill.low { background: var(--red-600, #dc2626); }
.an-cover-pct { position: absolute; right: 6px; top: 0; bottom: 0; display: flex; align-items: center; font-size: var(--fs-xs, 11px); font-weight: var(--fw-bold, 700); color: var(--gray-700, #374151); }

/* Novidades: badge "Novo" no menu + passos do mini tutorial */
.nav-new { margin-left: 6px; padding: 1px 7px; border-radius: var(--radius-pill, 999px); font-size: 10px; font-weight: var(--fw-bold, 700); text-transform: uppercase; letter-spacing: .04em; color: #fff; background: var(--red-600, #dc2626); animation: navNewPulse 2s ease-in-out infinite; }
@keyframes navNewPulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--red-600, #dc2626) 45%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }
@media (prefers-reduced-motion: reduce) { .nav-new { animation: none; } }
.news-modal { max-width: 460px; }
.news-step { display: flex; align-items: flex-start; gap: var(--sp-3, 12px); padding: 8px 10px; border-radius: var(--radius-md, 8px); background: var(--gray-50, #f9fafb); font-size: var(--fs-md, 14px); }
.news-step-emoji { font-size: 20px; line-height: 1.2; }

/* Tabela de Resultados (home): células de 2 linhas, sem rolagem lateral */
.rv-table th { white-space: nowrap; }
.rv-table td { vertical-align: middle; }
/* Marca no cabeçalho: "· mês" (coluna sempre mensal) e "· período" (coluna que
   responde ao intervalo do filtro, em verde Stone). Não muda a rolagem. */
.rv-colnote { font-size: 10px; font-weight: var(--fw-normal, 400); opacity: .6; }
.rv-colnote-per { color: var(--green-600, #1a7a4c); opacity: .85; }
.rv-sub { display: block; font-size: var(--fs-xs, 11px); color: var(--gray-600, #4b5563); font-weight: var(--fw-normal, 400); margin-top: 1px; }
.rv-unit { font-size: var(--fs-xs, 11px); color: var(--gray-600, #4b5563); font-weight: var(--fw-normal, 400); }
.rv-hier { white-space: nowrap; }
.rv-hier > span { display: inline-block; vertical-align: middle; }
.rv-table tbody tr:hover { background: var(--gray-50, #f9fafb); }
.rv-table .rv-na td, .rv-table .rv-na .rv-sub { color: var(--gray-400, #9ca3af); }
.rv-atg { max-width: 190px; }
.rv-atg-td { min-width: 150px; }
.an-cover-fill.mid { background: var(--stone-laranja, #ef6c00); }
/* Ordenação da tabela de Resultados */
#rv-table th[data-rv-sort] { cursor: pointer; user-select: none; }
#rv-table th[data-rv-sort]:hover { color: var(--stone-verde-escuro, #00461e); }
#rv-table th.rv-sorted::after { content: ' ▼'; font-size: 9px; color: var(--stone-verde-escuro-2, #007d00); }
#rv-table th.rv-sorted.rv-sorted-asc::after { content: ' ▲'; }
/* Filtro local da tabela de Resultados (discreto) */
.rv-viewbar { position: relative; display: flex; align-items: center; gap: var(--sp-2, 8px); margin-left: auto; }
.rv-mini { font-size: var(--fs-xs, 11px); color: var(--gray-600, #4b5563); background: var(--gray-50, #f9fafb); border: 1px solid var(--gray-200, #e5e7eb); border-radius: var(--radius-pill, 999px); padding: 3px 10px; cursor: pointer; }
.rv-mini:hover { border-color: var(--stone-verde-escuro-2, #007d00); color: var(--stone-verde-escuro, #00461e); }
.rv-pop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 60; min-width: 230px; max-height: 300px; overflow-y: auto; background: #fff; border: 1px solid var(--gray-200, #e5e7eb); border-radius: var(--radius-md, 8px); box-shadow: var(--shadow-lg, 0 10px 30px rgba(0,0,0,.12)); padding: 6px; }
.rv-pop-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px; font-size: var(--fs-xs, 11px); font-weight: var(--fw-bold, 700); color: var(--gray-600, #4b5563); text-transform: uppercase; letter-spacing: .03em; }
.rv-pop-item { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: var(--radius-sm, 6px); font-size: var(--fs-sm, 12px); cursor: pointer; }
.rv-pop-item:hover { background: var(--gray-50, #f9fafb); }
/* Breadcrumb e drill da tabela de Resultados */
.rv-crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: var(--fs-sm, 12px); color: var(--gray-700, #374151); padding: 2px 0 10px; }
.rv-crumb { background: none; border: none; padding: 2px 4px; font-size: var(--fs-sm, 12px); color: var(--stone-verde-escuro-2, #007d00); cursor: pointer; border-radius: var(--radius-sm, 6px); }
.rv-crumb:hover { background: var(--gray-50, #f9fafb); text-decoration: underline; }
.rv-crumb-sep { color: var(--gray-400, #9ca3af); }
.rv-chip { display: inline-block; padding: 1px 8px; border-radius: var(--radius-pill, 999px); font-size: var(--fs-xs, 11px); font-weight: var(--fw-semibold, 600); background: var(--gray-100, #f3f4f6); color: var(--gray-700, #374151); white-space: nowrap; }
.rv-chip.ok { background: color-mix(in srgb, var(--stone-verde-claro, #00d700) 15%, transparent); color: var(--stone-verde-escuro, #00461e); }
.rv-chip.cred { background: color-mix(in srgb, var(--stone-verde-escuro-2, #007d00) 10%, transparent); color: var(--stone-verde-escuro-2, #007d00); }
.rv-chip.pisc { background: color-mix(in srgb, var(--stone-laranja, #ef6c00) 12%, transparent); color: var(--stone-laranja-escuro, #c2410c); }
.rv-chip.m1 { background: color-mix(in srgb, var(--stone-azul, #0ea5e9) 12%, transparent); color: var(--stone-azul-escuro, #0369a1); }
#rv-table .rv-toggle { color: var(--stone-verde-escuro-2, #007d00); font-weight: 700; margin-right: 6px; }

/* Gestão dos Especialistas (iframe por rota): página full-bleed — abaixo da
   topbar, TUDO é o iframe (o .content perde padding/max-width via :has só
   quando esta página está visível); o iframe estica na altura útil. */
body:has(#page-gestao-espec:not(.hidden)) .content { max-width: none; padding: 0; margin: 0; }
.ge-wrap { display: flex; flex-direction: column; height: calc(100vh - var(--topbar-height, 56px)); }
.ge-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: var(--sp-2) var(--sp-4); }
.ge-body { position: relative; flex: 1; min-height: 0; }
.ge-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.iframe-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
/* Botão flutuante "abrir em nova aba" do iframe embedado (app Resultados). */
.ferr-float { position: absolute; right: 16px; bottom: 16px; z-index: 5; padding: 6px 14px; border-radius: var(--radius-pill, 999px); background: var(--stone-verde-escuro, #00461e); color: #fff; font-size: var(--fs-sm, 12px); font-weight: var(--fw-semibold, 600); text-decoration: none; opacity: .55; box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,.15)); }
.ferr-float:hover { opacity: 1; }

.k-lost-proof { display: inline-block; margin-top: 2px; font-size: var(--fs-xs, 11px); color: var(--stone-verde-escuro-2, #007d00); text-decoration: none; }
.k-lost-proof:hover { text-decoration: underline; }

/* Tela /batizar: campanha do nome do novo dash (form + mural de sugestões).
   Nasce responsiva: coluna única com largura máxima, cards empilham no celular. */
.bat-wrap { max-width: 720px; margin: 0 auto; padding: var(--sp-6, 32px) var(--sp-4, 16px); }
.bat-hero { text-align: center; }
.bat-eyebrow {
  /* align-self: o .stack é flex-column e esticaria o selo na largura toda. */
  display: inline-block; align-self: center; padding: 4px 12px; border-radius: var(--radius-pill, 999px);
  background: var(--green-50, #e6f4ea); color: var(--stone-verde-escuro-2, #007d00);
  font-size: var(--fs-xs, 11px); font-weight: var(--fw-bold, 700);
  text-transform: uppercase; letter-spacing: .06em;
}
.bat-title { margin: 0; font-size: 28px; line-height: 1.2; color: var(--stone-verde-escuro, #00461e); }
.bat-lead { margin: 0; color: var(--gray-700); font-size: var(--fs-md, 14px); line-height: 1.55; }
.bat-card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg, 10px);
  padding: var(--sp-5, 24px); box-shadow: var(--shadow-sm, 0 1px 3px rgba(16,24,40,.08));
}
.bat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-3, 12px); }
.bat-item {
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg, 10px);
  padding: var(--sp-3, 12px) var(--sp-4, 16px);
}
.bat-item.mine { border-color: var(--stone-verde-escuro-2, #007d00); background: var(--green-50, #e6f4ea); }
.bat-item-name { font-weight: var(--fw-bold, 700); color: var(--stone-verde-escuro, #00461e); font-size: var(--fs-lg, 16px); }
.bat-item-reason { margin-top: 4px; color: var(--gray-700); font-size: var(--fs-sm, 12px); line-height: 1.45; }
.bat-item-by { margin-top: var(--sp-2, 8px); color: var(--gray-600); font-size: var(--fs-xs, 11px); }
.bat-tag {
  margin-left: 6px; padding: 1px 7px; border-radius: var(--radius-pill, 999px);
  background: var(--stone-verde-escuro-2, #007d00); color: #fff;
  font-size: var(--fs-xs, 11px); font-weight: var(--fw-semibold, 600); vertical-align: middle;
}
@media (max-width: 760px) {
  .bat-wrap { padding: var(--sp-5, 24px) var(--sp-3, 12px); }
  .bat-title { font-size: 23px; }
  .bat-list { grid-template-columns: 1fr; }
}

/* Modal de abertura: peça de convite pra votação do nome do próximo dash.
   Fundo verde escuro da marca com brilho verde vibrante; o CTA leva pra
   votação em nova aba (login Google não roda embedado). */
.ritual-modal {
  max-width: 560px; width: min(92vw, 560px); padding: 0; overflow: hidden;
  background: var(--stone-verde-escuro, #00461e);
  background-image:
    radial-gradient(120% 90% at 12% -10%, rgba(165, 250, 0, .28), transparent 60%),
    radial-gradient(90% 80% at 100% 0%, rgba(0, 215, 0, .30), transparent 55%);
  color: #fff;
}
/* Fundo claro do .modal-close/.btn-ghost (styles-macos usa !important) não serve
   sobre a peça verde: aqui os dois viram vidro claro sobre o verde. */
.ritual-modal .modal-close { background: rgba(255, 255, 255, .14); color: rgba(255, 255, 255, .85); }
.ritual-modal .modal-close:hover { background: rgba(255, 255, 255, .26); color: #fff; }
.ritual-hero { padding: var(--sp-6, 32px) var(--sp-5, 24px) var(--sp-5, 24px); text-align: center; }
.ritual-eyebrow {
  display: inline-block; padding: 4px 12px; border-radius: var(--radius-pill, 999px);
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(165, 250, 0, .45);
  color: var(--stone-verde-claro-2, #87ff4b);
  font-size: var(--fs-xs, 11px); font-weight: var(--fw-bold, 700);
  text-transform: uppercase; letter-spacing: .06em;
}
.ritual-hero h2 {
  margin: var(--sp-4, 16px) 0 0; color: #fff;
  font-size: 26px; line-height: 1.2; font-weight: var(--fw-bold, 700);
}
.ritual-sub {
  margin: var(--sp-3, 12px) 0 0; color: rgba(255, 255, 255, .82);
  font-size: var(--fs-md, 14px); line-height: 1.55;
}
.ritual-cta {
  display: inline-flex; margin-top: var(--sp-5, 24px); padding: 12px 28px;
  background: var(--stone-verde, #00d700); color: var(--stone-verde-escuro, #00461e);
  border: 0; border-radius: var(--radius-pill, 999px);
  font-size: var(--fs-lg, 16px); font-weight: var(--fw-bold, 700); text-decoration: none;
  box-shadow: 0 6px 20px rgba(0, 215, 0, .35);
}
.ritual-cta:hover { background: var(--stone-verde-claro-2, #87ff4b); color: var(--stone-verde-escuro, #00461e); }
.ritual-hint { margin-top: var(--sp-3, 12px); font-size: var(--fs-xs, 11px); color: rgba(255, 255, 255, .6); }
.ritual-foot {
  display: flex; justify-content: center; padding: var(--sp-3, 12px);
  border-top: 1px solid rgba(255, 255, 255, .12); background: rgba(0, 0, 0, .16);
}
.ritual-modal .ritual-foot .btn {
  background: transparent !important; border: 1px solid transparent !important;
  color: rgba(255, 255, 255, .7) !important;
}
.ritual-modal .ritual-foot .btn:hover {
  background: rgba(255, 255, 255, .14) !important; color: #fff !important;
}
@media (max-width: 760px) {
  /* Override global deixa .modal em tela cheia: o hero ocupa a sobra e
     centraliza (senão o texto cola no topo e fica um vazio no meio). */
  .ritual-modal { padding: 0 !important; display: flex; flex-direction: column; }
  .ritual-hero {
    flex: 1; display: flex; flex-direction: column; justify-content: center;
    padding: var(--sp-6, 32px) var(--sp-4, 16px);
  }
  .ritual-hero h2 { font-size: 23px; }
  .ritual-eyebrow, .ritual-cta { align-self: center; }
}

/* ===== Prospecção: dashboard de território (adaptado do TAM Leads) ===== */
.pt-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--sp-2); }
.pt-kpi { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: var(--sp-3); text-align: center; }
.pt-kpi .v { font-size: var(--fs-xl); font-weight: var(--fw-bold); line-height: 1.1; }
.pt-kpi .l { font-size: var(--fs-xs); color: var(--gray-600); text-transform: uppercase; letter-spacing: .02em; margin-top: 2px; }
.pt-kpi.total { background: var(--green-50); border-color: var(--green-100); }
.pt-kpi.total .v { color: var(--green-700); }
.pt-kpi.warn { background: var(--amber-100); border-color: var(--amber-100); }
.pt-kpi.warn .v { color: var(--amber-800); }
.pt-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: var(--sp-4); box-shadow: var(--shadow-sm); }
.pt-map-ph { display: flex; align-items: center; gap: var(--sp-3); background: var(--gray-50); border: 1px dashed var(--gray-300); border-radius: var(--radius-md); padding: var(--sp-5); margin-top: var(--sp-2); }
.pt-map-ph-ic { font-size: 28px; line-height: 1; }
.pt-list-head { display: flex; flex-direction: column; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.pt-filters { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: flex-end; }
.pt-fgroup { display: flex; flex-direction: column; gap: 4px; }
.pt-fgrow { flex: 1; min-width: 160px; }
.pt-flabel { font-size: var(--fs-xs); color: var(--gray-500); text-transform: uppercase; letter-spacing: .02em; }
.pt-seg .seg-btn { font-size: var(--fs-xs); padding: 4px 10px; }
.pt-table-wrap { overflow-x: auto; border: 1px solid var(--gray-200); border-radius: var(--radius-md); }
.pt-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.pt-table thead th { position: sticky; top: 0; background: var(--stone-verde-escuro, #00461e); color: #fff; text-align: left; font-size: var(--fs-xs); font-weight: var(--fw-semibold); padding: var(--sp-2) var(--sp-3); white-space: nowrap; cursor: pointer; }
.pt-table tbody td { padding: var(--sp-2) var(--sp-3); border-top: 1px solid var(--gray-100); vertical-align: middle; }
.pt-table tbody tr:hover { background: var(--gray-50); }
.pt-name { font-weight: var(--fw-semibold); max-width: 220px; }
.pt-name .doc { display: block; font-size: var(--fs-xs); color: var(--gray-500); font-weight: var(--fw-normal); }
.pt-addr { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--gray-600); }
.pt-badge { display: inline-block; font-size: var(--fs-xs); font-weight: var(--fw-semibold); padding: 2px 8px; border-radius: var(--radius-pill); white-space: nowrap; }
.pt-badge.tier-md { background: var(--amber-100); color: var(--amber-800); }
.pt-badge.tier-sm { background: var(--green-100); color: var(--green-700); }
.pt-badge.ex { background: var(--amber-100); color: var(--amber-800); }
.pt-badge.lead { background: var(--gray-100); color: var(--gray-700); }
.pt-conc { display: inline-block; font-size: var(--fs-xs); color: var(--red-700); background: var(--red-50); border-radius: var(--radius-sm); padding: 1px 6px; margin: 0 2px 2px 0; }
.pt-act { cursor: pointer; white-space: nowrap; }
.pt-act .n { font-weight: var(--fw-semibold); }
.pt-act .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gray-300); margin-right: 4px; }
.pt-act.on .dot { background: var(--green-500); }
.pt-act .ago { display: block; font-size: var(--fs-xs); color: var(--gray-500); }
.pt-see { padding: 3px 12px; }
.pt-modal { max-width: 720px; }
.pt-m-meta { display: flex; gap: var(--sp-2); align-items: center; margin-top: 4px; }
.pt-tabs { margin: var(--sp-3) 0; display: inline-flex; }
.pt-m-body { min-height: 220px; }
.pt-pane { display: none; }
.pt-pane.active { display: block; }
.pt-contact { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) 0; border-top: 1px solid var(--gray-100); }
.pt-contact:first-child { border-top: 0; }
.pt-contact .av { width: 36px; height: 36px; border-radius: 50%; background: var(--gray-100); color: var(--gray-500); display: flex; align-items: center; justify-content: center; font-weight: var(--fw-semibold); flex: none; }
.pt-contact .nm { font-weight: var(--fw-semibold); }
.pt-contact .ph { font-size: var(--fs-sm); color: var(--gray-600); }
.pt-wa { margin-left: auto; width: 38px; height: 38px; border-radius: 50%; background: #25D366; color: #fff; display: flex; align-items: center; justify-content: center; text-decoration: none; flex: none; }
.pt-wa:hover { filter: brightness(0.95); }
.pt-task { padding: var(--sp-2) 0; border-top: 1px solid var(--gray-100); }
.pt-task:first-child { border-top: 0; }
.pt-task .dt { font-size: var(--fs-xs); color: var(--gray-500); }
.pt-task .desc { font-size: var(--fs-sm); }
.pt-empty { text-align: center; color: var(--gray-500); padding: var(--sp-5); }

/* Tela Mercado (pool enriquecido). Reusa .pt-* (card/kpis/table/conc); so o que falta. */
.mkt-empty { text-align: center; color: var(--gray-500); padding: var(--sp-5); }
.mkt-pager { display: flex; gap: var(--sp-2); align-items: center; justify-content: center; padding: var(--sp-3) 0 0; flex-wrap: wrap; }
.mkt-pager .btn { min-width: 34px; }
.mkt-pager .mkt-pageinfo { font-size: var(--fs-sm); color: var(--gray-600); }
.mkt-sz { display: inline-flex; align-items: center; gap: 4px; font-weight: var(--fw-semibold); }
.mkt-sz .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gray-300); }
.mkt-sz.on .dot { background: #25D366; }
.mkt-name { font-weight: var(--fw-semibold); }
.mkt-name .doc { display: block; font-size: var(--fs-xs); color: var(--gray-500); font-weight: var(--fw-normal); }
/* Segunda linha da celula de telefone: o contato do Super Zap (nome + numero),
   que costuma ser o celular de quem atende, ao lado do fixo da Receita. */
.mkt-tel-sz { display: block; font-size: var(--fs-xs); color: var(--gray-500); }
.mkt-esp-name { font-size: var(--fs-lg); font-weight: var(--fw-semibold); color: var(--green-700); }
#mkt-ov-tbody tr:hover { background: var(--green-50); }
@media (max-width: 760px) {
  .pt-kpis { grid-template-columns: repeat(2, 1fr); }
  .pt-fgrow { min-width: 100%; }
}

/* Cabeçalho de grupo da lista: era style inline no JS (fundo/peso/padding).
   Virou classe pra o visual novo poder re-tematizar sem duplicar o markup. */
.k-list-group td { background: var(--gray-100); font-weight: 600; font-size: 13px; padding: 8px 12px; }
.k-list-group-rot { font-weight: 600; }
.k-list-group-meta { color: var(--gray-600); font-weight: 400; margin-left: 6px; }

/* Grupo dentro de menu suspenso (hoje: "Resumo executivo" nas 8 telas do app de
   Resultados). Fechado por padrão: o menu abria com 15 linhas e as 5 telas do
   dia a dia ficavam soterradas pelas 8 do resumo. */
.menu-grupo { justify-content: flex-start; }
.menu-grupo .menu-grupo-caret { margin-left: auto; opacity: .6; transition: transform .15s; }
.menu-grupo[aria-expanded="true"] .menu-grupo-caret { transform: rotate(180deg); }
.menu-grupo.active { color: var(--green-700); font-weight: 600; }
.menu-grupo-itens { display: flex; flex-direction: column; gap: 2px; }
.menu-grupo-itens.hidden { display: none; }
/* Recuo: o filho do grupo tem que parecer filho. */
.menu-grupo-itens .menu-item { padding-left: 26px; }
/* Brilho suave atrás do cartão: separa a moldura do fundo sem sombra pesada. */
.roma-auth::after {
  content: "";
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(80vw, 900px); height: min(80vw, 900px); border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 218, 0, .10), transparent 60%);
  pointer-events: none;
}
.roma-cta {
  background: linear-gradient(180deg, #017f1c, #00551a);
  box-shadow: 0 8px 22px rgba(0, 34, 10, .35);
}
.roma-cta:hover { background: linear-gradient(180deg, #01a024, #017f1c); }
.k-list-group-in { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
