/* ============================================================
   Convertiz — Sistema Interno · UI clean/minimalista (light-first)
   Estilo software interno profissional. Tokens semânticos + tema
   claro (padrão) e escuro. Nomes de classe preservados do app.js.
   ============================================================ */

:root, html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f2f3f5;
  --surface-3: #eceef1;
  --overlay: #ffffff;
  --border: #e6e8ec;
  --border-strong: #d6d9df;
  --text: #14171c;          /* títulos / forte */
  --text-2: #3f454e;        /* corpo */
  --muted: #7b818c;         /* secundário */
  --faint: #a8adb6;
  --accent: #1515ec;
  --accent-text: #1515ec;
  --accent-weak: rgba(21, 21, 236, .07);
  --accent-line: rgba(21, 21, 236, .28);
  --positive: #0e9f6e; --positive-bg: rgba(14, 159, 110, .10);
  --negative: #e02424; --negative-bg: rgba(224, 36, 36, .09);
  --warning: #c27803; --warning-bg: rgba(194, 120, 3, .10);
  --info: #1c64f2;    --info-bg: rgba(28, 100, 242, .10);
  --violeta-ui: #7c3aed;
  --barra-funil: #1515ec;
  --chart-bar: rgba(21, 21, 236, .22);
  --shadow-sm: 0 1px 2px rgba(16, 19, 26, .04);
  --shadow: 0 1px 3px rgba(16, 19, 26, .06), 0 1px 2px rgba(16, 19, 26, .04);
  --shadow-lg: 0 12px 40px -12px rgba(16, 19, 26, .22);
  --raio: 12px; --raio-sm: 8px;
  --app-lateral: 244px; --app-topo: 60px;
  --font-display: "GT America", "Helvetica Neue", Arial, sans-serif;
  --font-body: "GT America", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "GT America Mono", "SFMono-Regular", Menlo, monospace;
  --body: var(--text-2); --heading: var(--text);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0e16;
  --surface: #111725;
  --surface-2: #0e1420;
  --surface-3: #172033;
  --overlay: #131a2e;
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .16);
  --text: #f3f5f8;
  --text-2: rgba(255, 255, 255, .74);
  --muted: rgba(255, 255, 255, .48);
  --faint: rgba(255, 255, 255, .32);
  --accent: #6b7bff;
  --accent-text: #93a1ff;
  --accent-weak: rgba(107, 123, 255, .14);
  --accent-line: rgba(107, 123, 255, .35);
  --positive: #3ddc97; --positive-bg: rgba(61, 220, 151, .12);
  --negative: #ff6b6b; --negative-bg: rgba(255, 107, 107, .12);
  --warning: #e0a458; --warning-bg: rgba(224, 164, 88, .12);
  --info: #5b9bff; --info-bg: rgba(91, 155, 255, .14);
  --barra-funil: #6b7bff;
  --chart-bar: rgba(107, 123, 255, .3);
  --shadow-sm: none; --shadow: none; --shadow-lg: 0 20px 50px rgba(0,0,0,.5);
  --body: var(--text-2); --heading: var(--text);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }   /* respeita o atributo hidden (modal/menus/login) */
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--text-2);
  font-family: var(--font-body); font-size: 14px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-weak); }
h1, h2, h3, h4 { color: var(--text); font-weight: 500; letter-spacing: -0.015em; }
.num, .num-col { font-variant-numeric: tabular-nums; }

/* ---------- Kicker (rótulo mono) ---------- */
.kicker {
  display: inline-block; font-family: var(--font-mono); font-size: 11px;
  font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}

/* ---------- LOGIN ---------- */
.login-tela {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px; padding: 24px; background: var(--bg);
}
.login-cartao {
  width: 100%; max-width: 380px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 16px; padding: 36px 32px;
  box-shadow: var(--shadow); text-align: center;
}
.login-marca { display: flex; justify-content: center; margin-bottom: 22px; }
.login-marca .marca-logo { height: 26px; }
.login-titulo { font-size: 22px; margin-bottom: 6px; }
.login-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 24px; }
.login-form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.login-form label { font-size: 12.5px; color: var(--text-2); display: flex; flex-direction: column; gap: 6px; font-weight: 500; }
.login-form input {
  width: 100%; height: 42px; padding: 0 14px; border: 1px solid var(--border-strong);
  border-radius: 10px; background: var(--surface); color: var(--text); font-size: 14px; outline: none;
}
.login-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.login-botao {
  height: 44px; margin-top: 6px; border: none; border-radius: 10px; cursor: pointer;
  background: var(--accent); color: #fff; font-size: 14.5px; font-weight: 500; transition: filter .15s;
}
.login-botao:hover { filter: brightness(1.08); }
.login-status { font-size: 12.5px; color: var(--negative); min-height: 16px; text-align: center; }
.login-status.ok { color: var(--positive); }
.login-rodape { font-family: var(--font-mono); font-size: 11px; color: var(--faint); }

/* ---------- APP SHELL ---------- */
.app { display: grid; grid-template-columns: var(--app-lateral) minmax(0, 1fr); min-height: 100vh; }
.lateral {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border); padding: 20px 14px 16px;
}
.marca { display: flex; align-items: center; padding: 4px 8px 20px; }
.marca .marca-logo { height: 22px; }
.lateral nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px;
  color: var(--muted); font-size: 13.5px; font-weight: 500; transition: background .12s, color .12s;
}
.nav-item svg { width: 17px; height: 17px; opacity: .85; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.ativo { background: var(--accent-weak); color: var(--accent-text); }
.nav-item.ativo svg { opacity: 1; }
.lateral-rodape { font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); padding: 12px 10px 0; line-height: 1.5; }

.principal { min-width: 0; display: flex; flex-direction: column; }
.topo {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  height: var(--app-topo); padding: 0 24px; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.conteudo { padding: 26px 28px 60px; max-width: 1360px; width: 100%; }

/* seletor de período */
.seletor-periodo { position: relative; }
.periodo-botao {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 9px;
  color: var(--text-2); font-size: 13px;
}
.periodo-botao:hover { background: var(--surface-2); }
.periodo-menu {
  position: absolute; top: 40px; left: 0; z-index: 30; min-width: 190px; padding: 6px;
  background: var(--overlay); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 2px;
}
.periodo-menu button {
  text-align: left; padding: 8px 10px; border: none; background: none; border-radius: 7px;
  color: var(--text-2); font-size: 13px; cursor: pointer;
}
.periodo-menu button:hover { background: var(--surface-2); }
.periodo-menu button.selecionado { color: var(--accent-text); background: var(--accent-weak); font-weight: 500; }

.busca-global { flex: 1; max-width: 420px; display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 12px; background: var(--surface-2); border: 1px solid transparent; border-radius: 9px; color: var(--muted); }
.busca-global:focus-within { background: var(--surface); border-color: var(--accent); }
.busca-global input { flex: 1; border: none; background: none; outline: none; color: var(--text); font-size: 13.5px; }

.tema-botao, .sair-botao {
  display: grid; place-items: center; width: 34px; height: 34px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 9px; color: var(--muted);
}
.tema-botao:hover, .sair-botao:hover { background: var(--surface-2); color: var(--text); }
html[data-theme="light"] .icone-sol { display: none; }
html[data-theme="dark"] .icone-lua { display: none; }
.usuario { display: flex; align-items: center; gap: 10px; }
.usuario-info { text-align: right; line-height: 1.2; }
.usuario-info strong { display: block; font-size: 13px; color: var(--text); font-weight: 500; }
.usuario-info span { font-size: 11px; color: var(--muted); }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 500; }

/* ---------- Cabeçalho de página ---------- */
.pagina-topo { margin-bottom: 22px; }
.pagina-topo.com-acoes { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.pagina-titulo { font-size: 22px; margin: 6px 0 2px; }
.pagina-sub { color: var(--muted); font-size: 13.5px; }
.pagina-acoes { display: flex; gap: 10px; }

/* ---------- Botões ---------- */
.btn-primario, .btn-secundario, .crm-apply {
  height: 38px; padding: 0 16px; border-radius: 9px; font-size: 13.5px; font-weight: 500;
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: filter .15s, background .15s;
}
.btn-primario { background: var(--accent); color: #fff; border: none; }
.btn-primario:hover { filter: brightness(1.08); }
.btn-primario:disabled { opacity: .55; cursor: not-allowed; }
.btn-secundario { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.btn-secundario:hover { background: var(--surface-2); }
.link-excluir, .link-perigo { background: none; border: none; color: var(--negative); font-size: 12.5px; cursor: pointer; padding: 0; }
.link-perigo:hover, .link-excluir:hover { text-decoration: underline; }
.link-ver { color: var(--accent-text); font-size: 12.5px; }
.voltar, .conv-voltar { display: inline-block; font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.voltar:hover { color: var(--text); }

/* ---------- Grades ---------- */
.grade { display: grid; gap: 14px; margin-bottom: 16px; }
.grade-kpi { grid-template-columns: repeat(5, 1fr); }
.grade-2 { grid-template-columns: 1fr 1fr; }
.grade-3 { grid-template-columns: repeat(3, 1fr); }
.grade-webinar { grid-template-columns: 1fr 1fr; }
.grade-lead { grid-template-columns: 1.2fr 1fr; align-items: start; }
.grade-disparo { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1100px) { .grade-kpi { grid-template-columns: repeat(3, 1fr); } .grade-2, .grade-3, .grade-webinar, .grade-lead, .grade-disparo { grid-template-columns: 1fr; } }

/* ---------- Painel (card) ---------- */
.painel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--raio);
  padding: 18px; box-shadow: var(--shadow-sm); }
.painel-topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.painel-titulo { font-size: 14px; font-weight: 500; color: var(--text); }
.painel-meta { font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }

/* ---------- KPI ---------- */
.kpi { display: flex; flex-direction: column; gap: 6px; }
.kpi-rotulo { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.kpi-valor { font-size: 27px; font-weight: 500; color: var(--text); letter-spacing: -0.02em; line-height: 1; }
.kpi-variacao { font-size: 12px; }
.kpi-variacao.neutro small, .kpi-variacao small { color: var(--muted); }
.kpi-variacao.positivo { color: var(--positive); }
.kpi-variacao.negativo { color: var(--negative); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 9999px;
  font-size: 11px; font-weight: 600; letter-spacing: .01em; line-height: 1.5; }
.badge-cinza { background: var(--surface-3); color: var(--muted); }
.badge-indigo { background: var(--accent-weak); color: var(--accent-text); }
.badge-ciano { background: var(--info-bg); color: var(--info); }
.badge-violeta { background: rgba(124, 58, 237, .12); color: var(--violeta-ui); }
.badge-ambar { background: var(--warning-bg); color: var(--warning); }
.badge-verde { background: var(--positive-bg); color: var(--positive); }

/* ---------- Tabelas ---------- */
.tabela-scroll { overflow-x: auto; margin: 0 -18px -18px; }
.tabela { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabela th { text-align: left; padding: 10px 14px; font-size: 11px; font-weight: 500; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.tabela td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text-2); }
.tabela tbody tr:last-child td, .tabela tr:last-child td { border-bottom: none; }
.tabela .num-col { text-align: right; }
.celula-nome { color: var(--text); font-weight: 500; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.celula-vazia { text-align: center; color: var(--muted); padding: 28px !important; }
tr.clicavel { cursor: pointer; }
tr.clicavel:hover td { background: var(--surface-2); }
.linha-alerta td { background: var(--negative-bg); }
.cpl-estourado { color: var(--negative); font-weight: 500; }

/* listas de ferramentas / busca */
.lista-ferramentas { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.busca-lista { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; color: var(--muted); }
.busca-lista input { flex: 1; border: none; background: none; outline: none; color: var(--text); font-size: 13.5px; }
.contagem-resultados { font-size: 12.5px; color: var(--muted); font-family: var(--font-mono); }

/* subnav */
.subnav { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: 10px; margin-bottom: 18px; }
.subnav a { padding: 7px 14px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--muted); }
.subnav a:hover { color: var(--text); }
.subnav a.ativo { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- Listas (visão geral) ---------- */
.lista { display: flex; flex-direction: column; }
.lista-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.lista-item:last-child { border-bottom: none; }
.cresce { flex: 1; color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apoio { color: var(--muted); font-size: 12.5px; }
.checkbox-falso { width: 15px; height: 15px; border: 1.5px solid var(--border-strong); border-radius: 5px; flex: none; }
.venda-valor { color: var(--positive); font-weight: 600; }
.pilula-pessoa { font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 9999px; background: var(--surface-3); color: var(--text-2); }
.pilula-pessoa.marcus { background: var(--accent-weak); color: var(--accent-text); }
.pilula-pessoa.arthur { background: var(--info-bg); color: var(--info); }
.tela-aviso { color: var(--muted); font-size: 13px; padding: 8px 0; }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(180px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.kanban-tarefas { grid-template-columns: repeat(3, minmax(220px, 1fr)); }
.kanban-coluna { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--raio); padding: 12px; min-height: 120px; }
.kanban-cabeca { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.kanban-contagem { font-family: var(--font-mono); font-size: 11px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); padding: 1px 8px; border-radius: 9999px; }
.kanban-cartoes { display: flex; flex-direction: column; gap: 8px; }
.cartao-lead, .cartao-tarefa {
  display: flex; flex-direction: column; gap: 6px; padding: 12px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-sm);
  transition: border-color .12s, transform .08s;
}
.cartao-lead:hover, .cartao-tarefa:hover { border-color: var(--accent-line); }
.cartao-lead:active, .cartao-tarefa:active { transform: scale(.995); }
.cartao-lead strong, .cartao-tarefa strong { font-size: 13.5px; font-weight: 500; color: var(--text); }
.cartao-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.cartao-campanha { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cartao-tempo { flex: none; font-family: var(--font-mono); font-size: 11px; color: var(--faint); }
.cartao-tempo.atrasada { color: var(--negative); }
.cartao-tarefa-topo { display: flex; align-items: center; gap: 8px; }
.prio-ponto { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.prio-baixa { background: var(--muted); } .prio-media { background: var(--warning); } .prio-alta { background: var(--negative); }
.kanban-mais { margin-top: 8px; font-size: 12px; color: var(--muted); text-align: center; }
.kanban-vazio { color: var(--faint); font-size: 12px; text-align: center; padding: 10px; }

/* ---------- Funil ---------- */
.funil { display: flex; flex-direction: column; }
.funil-linha { display: grid; grid-template-columns: 130px 1fr 70px; align-items: center; gap: 12px; padding: 5px 0; }
.funil-rotulo { font-size: 13px; color: var(--text-2); }
.funil-barra-area { height: 26px; background: var(--surface-2); border-radius: 7px; overflow: hidden; }
.funil-barra { height: 100%; background: var(--barra-funil); border-radius: 7px; }
.funil-numeros { text-align: right; }
.funil-valor { font-size: 14px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.funil-conversao { padding: 2px 0 2px 142px; font-size: 12px; color: var(--muted); }
.funil-conversao.conv-baixa { color: var(--warning); }
.funil-conversao.vazamento { color: var(--negative); }
.seta { font-size: 11px; }
.tag-vazamento { font-size: 10px; background: var(--negative-bg); color: var(--negative); padding: 1px 7px; border-radius: 9999px; margin-left: 6px; }

/* ---------- Canais ---------- */
.canais { display: flex; flex-direction: column; gap: 10px; }
.canal-linha { display: grid; grid-template-columns: 150px 1fr 80px; align-items: center; gap: 12px; }
.canal-nome { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.canal-ponto { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.canal-barra-area { height: 8px; background: var(--surface-2); border-radius: 9999px; overflow: hidden; }
.canal-barra { height: 100%; border-radius: 9999px; }
.canal-num { text-align: right; font-size: 12.5px; }
.canal-num strong { color: var(--text); } .canal-num small { color: var(--muted); margin-left: 4px; }
.cor-indigo { background: var(--accent); color: var(--accent-text); }
.cor-ciano { background: var(--info); color: var(--info); }
.cor-verde { background: var(--positive); color: var(--positive); }
.cor-violeta { background: var(--violeta-ui); color: var(--violeta-ui); }
.cor-cinza { background: var(--faint); color: var(--muted); }
.canal-barra.cor-indigo { background: var(--accent); } .canal-barra.cor-ciano { background: var(--info); }
.canal-barra.cor-verde { background: var(--positive); } .canal-barra.cor-violeta { background: var(--violeta-ui); } .canal-barra.cor-cinza { background: var(--faint); }
.canal-ponto.cor-indigo { background: var(--accent); } .canal-ponto.cor-ciano { background: var(--info); }
.canal-ponto.cor-verde { background: var(--positive); } .canal-ponto.cor-violeta { background: var(--violeta-ui); } .canal-ponto.cor-cinza { background: var(--faint); }

/* ---------- Gráfico ---------- */
.grafico-svg { width: 100%; height: 210px; }
.g-barra { fill: var(--chart-bar); } .g-linha { stroke: var(--accent); fill: none; }
.g-ponto { fill: var(--accent); } .g-venda { fill: var(--positive); }
.g-grade { stroke: var(--border); } .g-eixo { stroke: var(--border-strong); } .g-rotulo { fill: var(--faint); }
.grafico-legenda { display: flex; gap: 18px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.legenda-cor { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.legenda-cor.barra { background: var(--chart-bar); } .legenda-cor.linha { background: var(--accent); } .legenda-cor.ponto { background: var(--positive); }

/* ---------- Webinar / pipeline card + alertas ---------- */
.webinar-nome { font-size: 19px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.webinar-quando { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.webinar-contagem { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--accent-text);
  background: var(--accent-weak); padding: 4px 10px; border-radius: 9999px; }
.ponto-pulso { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent-line); animation: pulso 2s infinite; }
@keyframes pulso { 0% { box-shadow: 0 0 0 0 var(--accent-line); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.webinar-numeros { display: flex; gap: 28px; margin-top: 16px; }
.webinar-numeros div span { display: block; font-size: 20px; font-weight: 500; color: var(--text); }
.webinar-numeros div small { font-size: 12px; color: var(--muted); }
.painel-alerta { border-color: var(--warning-bg); }
.alerta-cabeca { display: flex; align-items: center; gap: 8px; color: var(--warning); margin-bottom: 12px; }
.alerta-titulo { font-weight: 500; font-size: 13px; }
.alerta-campanha { font-size: 15px; font-weight: 500; color: var(--text); margin-bottom: 12px; }
.alerta-valores { display: flex; gap: 24px; }
.alerta-valores span { display: block; font-size: 18px; font-weight: 500; }
.alerta-valores .estourado span { color: var(--negative); } .alerta-valores small { font-size: 11px; color: var(--muted); }
.alerta-detalhe { font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.aviso-meta { font-size: 12px; color: var(--muted); } .aviso-meta b { color: var(--text); }

/* ---------- Ficha do lead ---------- */
.lead-cabecalho { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.lead-avatar { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent-weak); color: var(--accent-text); font-size: 18px; font-weight: 500; flex: none; }
.lead-cabecalho h2 { font-size: 19px; } .lead-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.lead-cabecalho .badge { margin-left: auto; }
.dados-lead { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dado { border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; background: var(--surface-2); }
.dado span { display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.dado strong { font-size: 13.5px; font-weight: 500; color: var(--text); }
.timeline { display: flex; flex-direction: column; }
.timeline-item { position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--border); margin-left: 5px; }
.timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline-ponto { position: absolute; left: -6px; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.timeline-item.concluido-verde .timeline-ponto { background: var(--positive); }
.timeline-titulo { font-size: 13px; font-weight: 500; color: var(--text); text-transform: capitalize; }
.timeline-detalhe { font-size: 12px; color: var(--muted); }
.timeline-data { font-family: var(--font-mono); font-size: 11px; color: var(--faint); margin-top: 2px; }
.venda-associada { display: flex; align-items: center; justify-content: space-between; padding: 12px; background: var(--surface-2); border-radius: 9px; }
.venda-info strong { display: block; color: var(--text); } .venda-info span { font-size: 12px; color: var(--muted); }
.selo-pago { font-size: 11px; font-weight: 600; color: var(--positive); background: var(--positive-bg); padding: 3px 9px; border-radius: 9999px; }
.bloco-notas { font-size: 13px; color: var(--muted); } .bloco-notas.vazio { padding: 14px; text-align: center; }

/* ---------- Formulários ---------- */
.form-grade { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grade .full { grid-column: 1 / -1; }
.form-grade label, .checkbox-label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.form-grade input, .form-grade select, .form-grade textarea {
  height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 9px;
  background: var(--surface); color: var(--text); font-size: 14px; font-family: inherit; outline: none; width: 100%;
}
.form-grade textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; }
.form-grade input:focus, .form-grade select:focus, .form-grade textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.checkbox-label { flex-direction: row; align-items: center; gap: 8px; }
.checkbox-label input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-status { font-size: 12.5px; color: var(--muted); grid-column: 1 / -1; }
.modal-acoes { display: flex; justify-content: flex-end; gap: 10px; grid-column: 1 / -1; margin-top: 4px; }

/* ---------- Modal ---------- */
.modal-fundo { position: fixed; inset: 0; z-index: 60; background: rgba(16, 19, 26, .45); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px; }
.modal { position: relative; width: 100%; max-width: 540px; max-height: 88vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px; box-shadow: var(--shadow-lg); }
.modal h2 { font-size: 19px; margin-bottom: 4px; }
.modal-sub { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.modal-fechar { position: absolute; top: 16px; right: 18px; background: none; border: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; }
.modal-fechar:hover { color: var(--text); }
.modal-cartao { display: flex; flex-direction: column; gap: 12px; }
.modal-cartao h3 { font-size: 17px; margin-bottom: 6px; }
.modal-cartao label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.modal-cartao input, .modal-cartao select, .modal-cartao textarea { height: 40px; padding: 0 12px; border: 1px solid var(--border-strong);
  border-radius: 9px; background: var(--surface); color: var(--text); font-size: 14px; outline: none; }
.modal-cartao textarea { height: auto; min-height: 70px; padding: 10px 12px; }

/* ---------- Financeiro ---------- */
.fin-linhas { display: flex; flex-direction: column; }
.fin-linha { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.fin-linha:last-child { border-bottom: none; } .fin-linha.total { font-weight: 600; }
.fin-linha .pos { color: var(--positive); } .fin-linha .neg { color: var(--negative); }
.fin-nota { font-size: 11.5px; color: var(--faint); margin-top: 12px; line-height: 1.5; }
.tag-recorrente { font-size: 10px; background: var(--info-bg); color: var(--info); padding: 1px 6px; border-radius: 9999px; margin-left: 6px; }

/* ---------- Estado "em breve" / conectar integração ---------- */
.em-breve { display: grid; place-items: center; padding: 48px 24px; }
.em-breve-conteudo { max-width: 420px; text-align: center; }
.em-breve-icone { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 16px; border-radius: 14px; background: var(--accent-weak); color: var(--accent-text); }
.em-breve h2 { font-size: 18px; margin-bottom: 8px; } .em-breve p { font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.selo-fase, .selo-breve { display: inline-block; margin-top: 16px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); background: var(--surface-2); padding: 5px 12px; border-radius: 9999px; }
.aviso-google { padding: 12px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; }
.aviso-google.ok { background: var(--positive-bg); color: var(--positive); } .aviso-google.erro { background: var(--negative-bg); color: var(--negative); }
.transcricao { font-size: 13px; color: var(--text-2); line-height: 1.7; white-space: pre-wrap; }

/* ---------- Disparo ---------- */
.disparo-resumo { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.disparo-kpi { display: flex; flex-direction: column; gap: 4px; } .disparo-kpi .kpi-valor { font-size: 22px; }
.cartao-disparo { display: flex; flex-direction: column; gap: 10px; }
.disparo-template { font-family: var(--font-mono); font-size: 12px; color: var(--accent-text); background: var(--accent-weak); padding: 6px 10px; border-radius: 7px; }
.disparo-desc { font-size: 12.5px; color: var(--muted); } .disparo-aviso { color: var(--warning); }
.disparo-alvo { font-size: 12.5px; color: var(--text-2); } .disparo-alvo strong { color: var(--text); }
.disparo-link { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-2); }
.disparo-link input { height: 38px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface); color: var(--text); }
.disparo-stats { display: flex; gap: 16px; } .disparo-stat { display: flex; flex-direction: column; gap: 3px; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.disparo-stat-num { font-family: var(--font-mono); font-size: 15px; font-weight: 600; }
.disparo-botao { margin-top: 4px; }

/* ---------- Conversas (WhatsApp) ---------- */
.wa { display: grid; grid-template-columns: 320px 1fr; gap: 14px; height: calc(100vh - 130px); }
.wa-lista { background: var(--surface); border: 1px solid var(--border); border-radius: var(--raio); display: flex; flex-direction: column; overflow: hidden; }
.wa-lista-topo { padding: 14px 16px; border-bottom: 1px solid var(--border); } .wa-lista-sub { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.wa-itens { flex: 1; overflow-y: auto; }
.wa-item { width: 100%; display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; background: none; border-left: 2px solid transparent; text-align: left; }
.wa-item:hover { background: var(--surface-2); } .wa-item.wa-item-ativo { background: var(--accent-weak); border-left-color: var(--accent); }
.conv-avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); font-size: 13px; font-weight: 500; flex: none; }
.conv-item-corpo { flex: 1; min-width: 0; } .conv-item-topo { display: flex; justify-content: space-between; gap: 8px; }
.conv-item-topo strong { font-size: 13.5px; color: var(--text); } .conv-hora { font-family: var(--font-mono); font-size: 10px; color: var(--faint); }
.conv-linha2 { display: flex; justify-content: space-between; gap: 8px; margin-top: 2px; } .conv-preview { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-badge { font-family: var(--font-mono); font-size: 9px; letter-spacing: .05em; text-transform: uppercase; padding: 2px 7px; border-radius: 9999px; flex: none; }
.conv-aberta { background: var(--positive-bg); color: var(--positive); } .conv-fechada { background: var(--surface-3); color: var(--muted); }
.conv-lido { background: var(--info-bg); color: var(--info); } .conv-entregue { background: var(--accent-weak); color: var(--accent-text); }
.conv-enviado { background: var(--surface-3); color: var(--muted); } .conv-falhou { background: var(--negative-bg); color: var(--negative); }
.wa-chat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--raio); display: flex; flex-direction: column; overflow: hidden; }
.wa-chat-vazio { display: grid; place-items: center; } .wa-vazio { text-align: center; color: var(--muted); } .wa-vazio-icone { font-size: 32px; display: block; margin-bottom: 8px; }
.wa-chat-topo { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.wa-chat-id strong { display: block; font-size: 14px; color: var(--text); } .wa-chat-phone { font-size: 12px; color: var(--muted); } .wa-chat-topo .conv-badge { margin-left: auto; }
.wa-voltar { display: none; font-size: 18px; color: var(--muted); }
.wa-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.wa-bolha { max-width: 76%; padding: 8px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.45; }
.wa-in { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.wa-out { align-self: flex-end; background: var(--accent-weak); border: 1px solid var(--accent-line); border-bottom-right-radius: 4px; }
.wa-modelo { display: block; font-size: 10px; color: var(--muted); margin-bottom: 3px; } .wa-txt { color: var(--text); white-space: pre-wrap; }
.wa-meta { display: block; font-family: var(--font-mono); font-size: 9px; color: var(--faint); text-align: right; margin-top: 3px; }
.wa-tick-lido { color: var(--info); } .wa-tick-falhou { color: var(--negative); }
.wa-sem-msg { text-align: center; color: var(--muted); font-size: 13px; margin: auto; }
.wa-rodape { display: flex; align-items: flex-end; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); }
.wa-rodape textarea { flex: 1; min-height: 40px; max-height: 120px; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text); font-family: inherit; font-size: 14px; resize: none; outline: none; }
.wa-enviar { width: 40px; height: 40px; border-radius: 10px; border: none; background: var(--accent); color: #fff; cursor: pointer; flex: none; }
.wa-rodape-bloqueado { display: block; padding: 14px 16px; } .wa-aviso-janela { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
@media (max-width: 900px) { .wa { grid-template-columns: 1fr; } .wa .wa-chat { display: none; } .wa.wa-mostra-chat .wa-lista { display: none; } .wa.wa-mostra-chat .wa-chat { display: flex; } .wa-voltar { display: inline; } }

/* ---------- utilidades ---------- */
.mono { font-family: var(--font-mono); }
.pos, .positivo { color: var(--positive); } .neg, .negativo { color: var(--negative); }
.marca-simbolo { display: none; }
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; } .lateral { display: none; }
  .grade-kpi { grid-template-columns: repeat(2, 1fr); } .conteudo { padding: 18px 16px 50px; }
}

/* Login com Google */
.google-btn { display: flex; justify-content: center; margin: 4px 0; min-height: 40px; }
.login-ou { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 11.5px; margin: 8px 0; }
.login-ou::before, .login-ou::after { content: ""; flex: 1; height: 1px; background: var(--border); }
