/* =====================================================================
   WELLZAPP — THEME PREMIUM (skin visual)
   ---------------------------------------------------------------------
   ETAPA 1: camada visual premium aplicada SOBRE o WellZapp original.

   IMPORTANTE / SEGURANÇA:
   - Este arquivo é APENAS aparência. Não altera HTML, JS, payload,
     endpoints, rotas, modais funcionais nem lógica de envio.
   - Carregado DEPOIS de /css/style.css. Reaproveita as mesmas classes
     e os mesmos tokens (var(--...)) do original — só re-tematiza.
   - Estratégia: redefinir os tokens de :root (que o CSS original já
     consome em todo lugar) + refinamentos cirúrgicos de componentes.
   - Direção: SaaS premium, limpo, moderno — verde/grafite/branco.
     Esmeralda no lugar do verde-WhatsApp; grafite no lugar do marrom.
   ===================================================================== */

/* ---------------------------------------------------------------------
   1) TOKENS — re-tematização global via :root
   (o original usa var(--primary/--accent/--bg/...) em quase tudo)
   --------------------------------------------------------------------- */
:root {
  /* Canal-base neutro do Sneat (governa texto, bordas e sombras) = #22303E */
  --wz-base: 34 48 62;

  /* Grafite (sidebar no dark, botões escuros) */
  --primary: #1c2536;
  --primary-light: #2b3650;

  /* Accent = VERDE WhatsApp premium (identidade principal do WellZapp) */
  --accent: #10b981;
  --accent-dark: #059669;
  --accent-rgb: 16 185 129;

  /* Roxo Sneat — só apoio secundário pontual (gráficos/acessos) */
  --violet: #7c3aed;
  --violet-rgb: 124 58 237;

  /* Status semânticos (paleta Sneat) */
  --danger: #ff3e1d;
  --danger-dark: #e6381a;
  --warning: #ffab00;
  --info: #03c3ec;
  --success: #71dd37;

  /* Superfícies — fundo claro Sneat + cards brancos */
  --bg: #f5f5f9;
  --bg-card: #ffffff;
  --bg-white: #ffffff;
  --bg-soft: #f6f7fb;               /* linhas/hover claros */

  /* Tipografia / cinzas (Sneat = alphas do canal-base) */
  --text: rgb(var(--wz-base) / 0.9);
  --text-light: rgb(var(--wz-base) / 0.68);
  --text-muted: rgb(var(--wz-base) / 0.45);
  --text-dark: rgb(var(--wz-base) / 0.9);

  /* Bordas e raios (Sneat = 6px, apertado/premium) */
  --border: rgb(var(--wz-base) / 0.12);
  --border-strong: rgb(var(--wz-base) / 0.22);   /* borda de input */
  --radius: 6px;
  --radius-sm: 4px;
  --radius-lg: 8px;
  --radius-xl: 10px;

  /* Sombras (customShadows do Sneat, modo claro) */
  --shadow-sm: 0 2px 6px rgb(var(--wz-base) / 0.08);
  --shadow: 0 3px 8px rgb(var(--wz-base) / 0.10);
  --shadow-lg: 0 4px 12px rgb(var(--wz-base) / 0.14);
  --shadow-xl: 0 5px 22px rgb(var(--wz-base) / 0.18);

  /* Tints auxiliares (verde) — usados em estados ativos/hover */
  --tp-accent-soft: rgb(var(--accent-rgb) / 0.14);
  --tp-accent-ring: rgb(var(--accent-rgb) / 0.16);
  --tp-sidebar-grad: linear-gradient(180deg, #20293c 0%, #1a2233 100%);
}

/* ---------------------------------------------------------------------
   2) BASE / TIPOGRAFIA
   --------------------------------------------------------------------- */
body {
  background: var(--bg);
  font-family: "Public Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;                 /* densidade Sneat (base ~15px) */
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: normal;
}

.page-title {
  letter-spacing: -0.3px;
  font-weight: 700;
  color: var(--text);
}

/* Numerais alinhados em métricas */
.stat-card .stat-value,
.dashboard-summary-value,
.history-summary-n {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

/* Scrollbar discreta (premium, opcional) */
* {
  scrollbar-width: thin;
  scrollbar-color: #cbd3e1 transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: #cbd3e1;
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: #aab4c6; background-clip: padding-box; }

/* ---------------------------------------------------------------------
   3) SIDEBAR (menu lateral grafite premium)
   --------------------------------------------------------------------- */
/* Sidebar clara estilo Sneat (branca, sombra suave à direita) */
.sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.sidebar-header {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-header .logo {
  color: var(--accent);            /* marca verde WellZapp */
  letter-spacing: -0.6px;
  font-size: 24px;
  font-weight: 800;
}

.sidebar-nav { padding: 10px 0; }

/* Itens do menu — Sneat: cantos 6px, texto neutro, ativo verde-tint */
.sidebar-nav li a {
  margin: 2px 12px;
  padding: 9px 14px;
  border-radius: var(--radius);
  color: var(--text-light);
  font-weight: 500;
  font-size: 0.9rem;
  position: relative;
  transition: background .16s ease, color .16s ease;
}
.sidebar-nav li a:hover {
  background: rgb(var(--wz-base) / 0.06);
  color: var(--text);
}
.sidebar-nav li a.active {
  background: var(--tp-accent-soft);
  color: var(--accent-dark);
  font-weight: 600;
}
/* Indicador na borda direita (padrão Sneat) */
.sidebar-nav li a.active::before {
  content: "";
  position: absolute;
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 38px;
  border-radius: 6px 0 0 6px;
  background: var(--accent);
}
.sidebar-nav li a.active .nav-icon { color: var(--accent-dark); }
.sidebar-nav li a .nav-icon {
  font-size: 1.2rem;
  width: 22px;
  text-align: center;
  transition: color .16s ease;
}

/* Submenu da sidebar (Sneat) — ex.: Lead Manager → Contatos/Pipeline/Conversas/Etapas */
.wz-sub-parent { cursor: pointer; }
.wz-sub-caret { margin-left: auto; font-size: 0.66rem; color: var(--text-muted); transition: transform .2s ease; }
.wz-has-sub.open > .wz-sub-parent .wz-sub-caret { transform: rotate(180deg); }
.wz-submenu { list-style: none; margin: 1px 0 4px; padding: 0; overflow: hidden; max-height: 0; transition: max-height .22s ease; }
.wz-has-sub.open > .wz-submenu { max-height: 320px; }
.wz-submenu li a {
  display: flex; align-items: center; gap: 10px;
  margin: 1px 12px; padding: 8px 12px 8px 30px; border-radius: var(--radius);
  color: var(--text-light); font-weight: 500; font-size: 0.85rem;
}
.wz-submenu li a .nav-icon { font-size: 0.92rem; width: 20px; text-align: center; }
.wz-submenu li a:hover { background: rgb(var(--wz-base) / 0.06); color: var(--text); }
.wz-submenu li a.active { background: var(--tp-accent-soft); color: var(--accent-dark); font-weight: 600; }
.wz-submenu li a.active .nav-icon { color: var(--accent-dark); }

/* ---------------------------------------------------------------------
   4) TOP BAR (header do app)
   --------------------------------------------------------------------- */
.top-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 11px 28px;
}
.btn-menu,
.btn-logout {
  background: var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn-menu:hover,
.btn-logout:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.top-bar-email { color: var(--text-light); }

/* Mais respiro no conteúdo em desktop */
@media (min-width: 769px) {
  .content-area { padding: 26px 32px; }
}

/* Busca rápida da topbar (quick-nav real — filtra e navega) */
.wz-search { position: relative; display: inline-flex; align-items: center; }
.wz-search > i {
  position: absolute; left: 12px; color: var(--text-muted);
  font-size: 0.86rem; pointer-events: none;
}
.wz-search input {
  width: 232px; max-width: 42vw; height: 38px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text); font-size: 0.86rem; font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.wz-search input::placeholder { color: var(--text-muted); }
.wz-search input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--tp-accent-ring); background: var(--bg-card);
}
.wz-search-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 240px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 6px; display: none; z-index: 3000; max-height: 340px; overflow-y: auto;
}
.wz-search-menu.open { display: block; animation: fadeIn .14s ease; }
.wz-search-item {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px;
  border-radius: var(--radius); cursor: pointer; font-size: 0.86rem; color: var(--text);
}
.wz-search-item i { width: 18px; text-align: center; color: var(--text-muted); font-size: 0.9rem; }
.wz-search-item:hover,
.wz-search-item.sel { background: var(--tp-accent-soft); color: var(--accent-dark); }
.wz-search-item:hover i,
.wz-search-item.sel i { color: var(--accent-dark); }
.wz-search-empty { padding: 14px; text-align: center; color: var(--text-muted); font-size: 0.82rem; }
@media (max-width: 860px) { .wz-search { display: none; } }

/* ---------------------------------------------------------------------
   5) CARDS / SEÇÕES
   --------------------------------------------------------------------- */
/* Cards Sneat: brancos, limpos (sem barra lateral), 6px, sombra md */
.page-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.stat-card,
.dashboard-summary-card,
.plan-feature,
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.stat-card:hover,
.dashboard-summary-card:hover,
.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.stat-card .stat-icon {
  opacity: 1;
  color: var(--accent);
}
.stat-card .stat-value { color: var(--text); }
.dashboard-summary-title { color: var(--text-light); font-weight: 600; }

/* ---------------------------------------------------------------------
   6) BOTÕES
   --------------------------------------------------------------------- */
/* Botões Sneat: cantos 6px (sem pílula), peso 500, texto normal-case */
.btn-primary, .btn-secondary, .btn-danger, .btn-warning,
.btn-info, .btn-pink, .btn-sm, .btn-cta, .btn-enter {
  border-radius: var(--radius);
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
}
.btn-primary {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
  box-shadow: 0 2px 4px rgb(var(--accent-rgb) / 0.4);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn-primary:hover {
  filter: brightness(1.02);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgb(var(--accent-rgb) / 0.42);
}
.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text);
  box-shadow: none;
}
.btn-secondary:hover { background: rgb(var(--wz-base) / 0.04); border-color: var(--text-muted); }
.btn-danger,
.btn-warning,
.btn-info { box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease; }
.btn-danger:hover,
.btn-warning:hover,
.btn-info:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

/* Botão "tonal" Sneat (fundo tint + texto na cor) — helper opcional */
.btn-tonal {
  background: var(--tp-accent-soft); color: var(--accent-dark);
  border: none; border-radius: var(--radius); font-weight: 600;
  padding: 9px 18px; cursor: pointer; transition: background .15s ease, color .15s ease;
}
.btn-tonal:hover { background: var(--accent); color: #fff; }

/* ---------------------------------------------------------------------
   7) FORMULÁRIOS / INPUTS
   --------------------------------------------------------------------- */
.form-group label { color: var(--text); font-weight: 500; font-size: 0.8125rem; }
.form-group input,
.form-group textarea,
.form-group select {
  background: var(--bg-white);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--tp-accent-ring);   /* anel verde WellZapp */
}

/* ---------------------------------------------------------------------
   8) TABELAS (mais legíveis)
   --------------------------------------------------------------------- */
.table-container,
.history-items-table-wrap { border-radius: var(--radius); }

/* Cabeçalho de tabela Sneat: uppercase leve, peso 500, tracking 0.2px */
th {
  background: var(--bg-soft);
  color: var(--text-light);
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  border-bottom: 1px solid var(--border);
}
td { border-bottom: 1px solid var(--border); }
tr:hover td { background: var(--bg-soft); }

/* Tabela "card" de dispositivos e histórico herdam o visual premium */
.dev-table,
.history-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.dev-table-header,
.history-table-main th {
  background: var(--bg-soft);
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.2px;
  font-size: 0.8125rem;
  font-weight: 500;
}
.dev-table-row:hover,
.history-table-main tbody tr:hover { background: var(--bg-soft); }

/* ---------------------------------------------------------------------
   9) BADGES / STATUS (cantos mais suaves, leitura premium)
   --------------------------------------------------------------------- */
.badge {
  border-radius: var(--radius-sm);
  letter-spacing: normal;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 4px 10px;
}

/* ---------------------------------------------------------------------
   10) MODAIS (mais profissionais)
   --------------------------------------------------------------------- */
.modal { backdrop-filter: blur(3px); background: rgb(var(--wz-base) / 0.5); }
.modal-content {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}
.modal-header {
  border-bottom: 1px solid var(--border);
  padding: 20px 24px;
}
.modal-header h2 { color: var(--text); letter-spacing: -0.3px; }
.modal-body { padding: 24px; }
.modal-footer { border-top: 1px solid var(--border); }
.modal-close { border-radius: var(--radius); transition: background .15s ease, color .15s ease; }
.modal-close:hover { background: rgb(var(--wz-base) / 0.06); color: var(--text); }

/* Selects nativos como dropdowns Sneat (menu = sombra lg via UA; refinamos o gatilho) */
select { border-radius: var(--radius); }

/* QR / sucesso já são modernos no original — só alinhamos o raio */
.qr-modal-box,
.success-modal-box { box-shadow: var(--shadow-lg); }

/* ---------------------------------------------------------------------
   11) AUTH / LOGIN (primeira impressão premium)
   --------------------------------------------------------------------- */
.auth-page {
  background: radial-gradient(1200px 600px at 15% 10%, #233047 0%, rgba(35,48,71,0) 55%),
              linear-gradient(135deg, #1a2233 0%, #11324a 55%, #0e3b34 100%);
}
.auth-card {
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(8,15,30,0.45);
}
.auth-card h3 { color: var(--text); letter-spacing: -0.3px; }

/* ---------------------------------------------------------------------
   12) ABAS / TABS / TOGGLES (consistência com o esmeralda)
   --------------------------------------------------------------------- */
.tab-btn.active,
.media-tab.active { background: var(--accent); border-color: var(--accent); }
.tab-btn { border-radius: 10px 10px 0 0; }

/* ---------------------------------------------------------------------
   13) BANNERS / INFO
   --------------------------------------------------------------------- */
.info-banner { border-radius: var(--radius-sm); }
.page-section.no-border { border-left: none; }   /* respeita variação original */

/* ---------------------------------------------------------------------
   14) LANDING (toque leve, herdado dos tokens)
   --------------------------------------------------------------------- */
.btn-cta { box-shadow: 0 6px 20px rgba(16,185,129,0.32); }
.feature-card { border-radius: var(--radius); }

/* =====================================================================
   LEAD MANAGER PREMIUM / CRM (ETAPA 2) — somente aparência
   ===================================================================== */
/* Abas do topo do Lead Manager escondidas — navegação virou submenu da sidebar.
   Escopo só em .crm-wrap; o Marketplace tem .crm-tabs próprio e não é afetado. */
.crm-wrap > .crm-tabs { display: none; }

.crm-tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 2px solid var(--border); margin: 4px 0 20px; }
.crm-tab {
  background: transparent; border: none; padding: 10px 16px; cursor: pointer;
  font-size: 0.92rem; font-weight: 600; color: var(--text-light);
  border-bottom: 2px solid transparent; margin-bottom: -2px; border-radius: 8px 8px 0 0;
  transition: color .15s ease, background .15s ease;
}
.crm-tab:hover { background: #f1f4f9; color: var(--text); }
.crm-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.crm-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.crm-filters input, .crm-filters select {
  padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.92rem; background: var(--bg-white);
}
.crm-filters input { flex: 1; min-width: 220px; }

.crm-stage-badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; color: #fff; letter-spacing: 0.2px; }
.crm-color-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ---- Kanban ---- */
/* Kanban rolável com BARRA PRÓPRIA sempre visível + fade de borda.
   macOS esconde a scrollbar nativa (overlay); a barra abaixo é custom e some quando cabe tudo. */
.crm-kanban-scroll { position: relative; }
.crm-kanban { display: flex; gap: 16px; overflow-x: auto; overflow-y: hidden; padding: 4px 2px 4px; align-items: flex-start; scrollbar-width: none; }
.crm-kanban::-webkit-scrollbar { height: 0; width: 0; }
/* Barra custom: STICKY no rodapé (sempre visível, mesmo com a página rolada) +
   área de clique/arraste GRANDE. Trilho fino via ::before; polegar mais grosso;
   clicar no trilho também rola (não precisa mirar o polegar). */
.crm-kanban-bar { display: none; position: sticky; bottom: 12px; z-index: 6; height: 20px; margin: 8px 2px 0; padding: 6px 0; cursor: pointer; }
.crm-kanban-scroll.scrollable .crm-kanban-bar { display: block; }
.crm-kanban-bar::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); height: 8px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px; }
.crm-kanban-thumb { position: absolute; top: 50%; transform: translateY(-50%); left: 0; height: 13px; min-width: 64px; width: 90px; background: #9aa6bd; border-radius: 999px; cursor: grab; box-shadow: 0 1px 2px rgba(34,48,62,0.20); transition: background .15s ease; }
.crm-kanban-thumb:hover { background: #7e8ba1; }
.crm-kanban-thumb:active { cursor: grabbing; background: #6b7688; }
html[data-theme="dark"] .crm-kanban-thumb { background: #3a4760; }
html[data-theme="dark"] .crm-kanban-thumb:hover { background: #4a5a78; }
html[data-theme="dark"] .crm-kanban-thumb:active { background: #5a6a88; }
/* Fade na borda direita indicando "há mais colunas →" */
.crm-kanban-scroll::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 24px; width: 40px;
  pointer-events: none; background: linear-gradient(90deg, transparent, var(--bg-card) 90%);
  opacity: 0; transition: opacity .2s ease;
}
.crm-kanban-scroll.has-more::after { opacity: 1; }
.crm-kanban-col {
  flex: 0 0 280px; max-width: 280px; background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius-lg); display: flex; flex-direction: column; max-height: 70vh;
  transition: background .15s ease, box-shadow .15s ease;
}
.crm-kanban-col.dragover { background: var(--tp-accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.crm-kanban-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 8px 12px 16px; font-weight: 700; font-size: 0.9rem;
  color: var(--text); border-bottom: 1px solid var(--border);
}
.crm-kanban-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-kanban-badge { background: #fff; border: 1px solid var(--border); color: var(--text-light); border-radius: 999px; padding: 1px 9px; font-size: 0.78rem; font-weight: 700; flex-shrink: 0; }
.crm-kanban-menu-btn { border: none; background: transparent; color: var(--text-muted); cursor: pointer; width: 26px; height: 26px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.9rem; }
.crm-kanban-menu-btn:hover { background: rgb(var(--wz-base) / 0.08); color: var(--text); }
.crm-kanban-body { flex: 1; min-height: 0; padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.crm-kanban-empty { color: var(--text-muted); font-size: 0.82rem; text-align: center; padding: 16px 8px; border: 1px dashed var(--border); border-radius: 10px; }
.crm-kanban-add { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 0 12px 12px; padding: 8px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: transparent; color: var(--text-light); font-size: 0.82rem; font-weight: 600; cursor: pointer; flex-shrink: 0; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.crm-kanban-add:hover { background: var(--tp-accent-soft); color: var(--accent-dark); border-color: transparent; }
/* Menu ⋮ flutuante da coluna */
.crm-col-menu { position: fixed; z-index: 4000; min-width: 200px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 5px; animation: fadeIn .12s ease; }
.crm-col-menu button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border: none; background: transparent; border-radius: var(--radius); cursor: pointer; font-size: 0.86rem; color: var(--text); font-family: inherit; }
.crm-col-menu button i { width: 16px; text-align: center; color: var(--text-muted); }
.crm-col-menu button:hover { background: var(--tp-accent-soft); color: var(--accent-dark); }
.crm-col-menu button:hover i { color: var(--accent-dark); }
.crm-col-menu button:disabled { opacity: .4; cursor: not-allowed; }
.crm-col-menu button.danger { color: var(--danger); }
.crm-col-menu button.danger i { color: var(--danger); }
.crm-col-menu button.danger:hover { background: rgb(255 62 29 / 0.10); color: var(--danger); }
/* Coluna "Nova coluna" */
.crm-kanban-newcol { background: transparent; border: 2px dashed var(--border); justify-content: flex-start; padding: 12px; }
.crm-kanban-newcol-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px; border: none; background: transparent; color: var(--text-light); font-weight: 600; font-size: 0.88rem; cursor: pointer; border-radius: var(--radius); }
.crm-kanban-newcol-btn:hover { background: var(--tp-accent-soft); color: var(--accent-dark); }
.crm-kanban-newcol.editing .crm-kanban-newcol-btn { display: none; }
.crm-kanban-newcol-form { display: none; flex-direction: column; gap: 10px; }
.crm-kanban-newcol.editing .crm-kanban-newcol-form { display: flex; }
.crm-kanban-newcol-form input { padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); font-size: 0.88rem; background: var(--bg-card); color: var(--text); }
.crm-newcol-actions { display: flex; gap: 8px; }

/* Planos: uso de dispositivos (disparo 1-5 + atendimento fixo 1) */
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
@media (max-width: 720px){ .plan-grid { grid-template-columns: 1fr; } }
.plan-usage { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
.plan-usage.over { border-color: rgba(239,68,68,.4); background: rgba(239,68,68,.05); }
.plan-usage-head { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.plan-usage-t { font-weight: 600; font-size: 0.92rem; color: var(--text); }
.plan-usage-s { font-size: 0.76rem; color: var(--text-muted); margin-top: 1px; }
.plan-usage-n { font-size: 1.6rem; font-weight: 800; color: var(--text); letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.plan-usage-n span { font-size: 1rem; font-weight: 600; color: var(--text-muted); }
.plan-usebar { height: 8px; background: var(--bg-soft); border-radius: 6px; overflow: hidden; margin: 10px 0 8px; }
.plan-usebar-f { height: 100%; border-radius: 6px; transition: width .5s ease; }
.plan-usage-f { font-size: 0.78rem; color: var(--text-muted); }
.plan-rules { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; }
.plan-rules li { display: flex; align-items: flex-start; gap: 10px; font-size: 0.88rem; color: var(--text-light); }
.plan-rules li i { color: var(--accent); margin-top: 3px; flex-shrink: 0; width: 16px; text-align: center; }

/* Ajustes: seletor de tema (claro/escuro) */
.aj-theme { display: inline-flex; gap: 10px; flex-wrap: wrap; }
.aj-theme-opt { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg-card); color: var(--text); font-weight: 600; font-size: 0.88rem; cursor: pointer; font-family: inherit; transition: border-color .15s ease, background .15s ease, color .15s ease; }
.aj-theme-opt:hover { border-color: var(--accent); }
.aj-theme-opt.active { border-color: var(--accent); background: var(--tp-accent-soft); color: var(--accent-dark); }

/* Ajustes: pagina com abas (Conta / Seguranca / Planos & Cobranca) estilo Sneat */
.acct-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.acct-tab { display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border: none; background: transparent; color: var(--text-muted); font-weight: 600; font-size: 0.9rem; cursor: pointer; font-family: inherit; border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: var(--radius) var(--radius) 0 0; transition: color .15s ease, background .15s ease, border-color .15s ease; }
.acct-tab:hover { color: var(--text); background: var(--tp-accent-soft); }
.acct-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.acct-tab i { font-size: 0.88rem; }
.acct-panel { display: none; }
.acct-panel.active { display: flex; flex-direction: column; gap: 22px; }

/* Ajustes: grade de dados read-only da aba Conta */
.acct-info { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 26px; margin-bottom: 14px; }
.acct-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.acct-label { font-size: 0.71rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 700; }
.acct-label i { width: 14px; text-align: center; opacity: .8; }
.acct-value { font-size: 0.93rem; color: var(--text); font-weight: 600; word-break: break-word; }
@media (max-width: 640px) { .acct-info { grid-template-columns: 1fr; } }

/* Separador dentro do dropdown de perfil */
.tp-pm-sep { height: 1px; background: var(--border); margin: 6px 0; }

/* Badges honestos no menu/telas: Beta / Em breve (warn) e Prévia (info) */
.nav-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; border-radius: 10px; line-height: 1.6; vertical-align: middle; background: rgba(245,158,11,.18); color: #b45309; }
.nav-badge.warn { background: rgba(245,158,11,.18); color: #b45309; }
.nav-badge.info { background: rgba(59,130,246,.16); color: #1d4ed8; }
[data-theme="dark"] .nav-badge.warn { background: rgba(245,158,11,.20); color: #fbbf24; }
[data-theme="dark"] .nav-badge.info { background: rgba(59,130,246,.22); color: #93c5fd; }

/* P1 Fase 2: banner brando de verificação de e-mail (não bloqueia nada) */
.verify-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 24px 0; padding: 10px 14px; border-radius: var(--radius); background: rgba(245,158,11,.14); border: 1px solid rgba(245,158,11,.35); color: var(--text); font-size: 0.88rem; }
.verify-banner-msg i { color: #b45309; margin-right: 6px; }
.verify-banner-actions { display: inline-flex; align-items: center; gap: 8px; }
.verify-banner-btn { border: 1px solid var(--accent); background: var(--accent); color: #fff; font-weight: 600; font-size: 0.82rem; padding: 6px 12px; border-radius: var(--radius); cursor: pointer; font-family: inherit; }
.verify-banner-btn:hover { filter: brightness(.96); }
.verify-banner-x { border: none; background: transparent; color: var(--text-muted); font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 0 4px; }
[data-theme="dark"] .verify-banner-msg i { color: #fbbf24; }
.crm-card {
  background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 11px;
  cursor: grab; box-shadow: var(--shadow-sm); transition: transform .12s ease, box-shadow .12s ease;
}
.crm-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.crm-card.dragging { opacity: 0.5; cursor: grabbing; }
.crm-card-name { font-weight: 600; font-size: 0.84rem; color: var(--text); }
.crm-card-meta { font-size: 0.74rem; color: var(--text-light); margin-top: 1px; }
.crm-card-tags { margin-top: 6px; }
.crm-src { font-size: 0.72rem; font-weight: 600; color: var(--accent-dark); background: var(--tp-accent-soft); padding: 2px 8px; border-radius: 6px; }

/* ---- Conversas ---- */
.crm-conv-banner { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; border-radius: var(--radius-sm); padding: 12px 16px; font-size: 0.86rem; margin-bottom: 14px; }
.crm-conv-layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; }
@media (max-width: 760px) { .crm-conv-layout { grid-template-columns: 1fr; } }
.crm-conv-list { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; max-height: 70vh; overflow-y: auto; background: var(--bg-white); }
.crm-conv-item { display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s ease; }
.crm-conv-item:last-child { border-bottom: none; }
.crm-conv-item:hover { background: var(--bg-soft); }
.crm-conv-item.active { background: var(--tp-accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.crm-conv-avatar { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.95rem; color: #fff; background: linear-gradient(180deg, var(--accent), var(--accent-dark)); }
.crm-conv-main { flex: 1; min-width: 0; }
.crm-conv-name { font-weight: 600; font-size: 0.9rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-conv-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-conv-time { font-size: 0.7rem; color: var(--text-muted); flex-shrink: 0; align-self: flex-start; margin-top: 3px; }
.crm-conv-detail { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; background: var(--bg-white); box-shadow: var(--shadow); min-height: 200px; }

/* Inbox (prévia): cabeçalho + thread de bolhas estilo chat */
.crm-inbox-detail { display: flex; flex-direction: column; }
.crm-inbox-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 14px; flex-wrap: wrap; }
.crm-inbox-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crm-inbox-thread { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 4px 2px; }
.crm-bubble { max-width: 78%; padding: 8px 12px; border-radius: 12px; }
.crm-bubble-t { font-size: 0.88rem; color: var(--text); line-height: 1.4; }
.crm-bubble-tm { font-size: 0.66rem; color: var(--text-muted); margin-top: 3px; text-align: right; }
.crm-bubble.them { align-self: flex-start; background: var(--bg-soft); border-bottom-left-radius: 4px; }
.crm-bubble.me { align-self: flex-end; background: var(--tp-accent-soft); border-bottom-right-radius: 4px; }
.crm-inbox-foot { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.crm-lead-saved { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 600; color: var(--accent-dark); background: var(--tp-accent-soft); padding: 5px 11px; border-radius: 999px; }

/* Barra "Qualificar etapa" no modal do lead */
.crm-qualify-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 14px; margin-bottom: 14px; }
.crm-qualify-stage { display: flex; flex-direction: column; gap: 5px; }
.crm-qualify-stage label { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px; }
.crm-qualify-stage select { padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg-card); min-width: 180px; }
.crm-qualify-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crm-qualify-actions a { text-decoration: none; }
.crm-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.crm-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.crm-detail-actions a { text-decoration: none; }
.crm-detail-info { font-size: 0.86rem; color: var(--text-light); padding: 12px 14px; background: #f7f9fc; border-radius: 10px; margin-bottom: 16px; }
.crm-followup h4 { margin: 0 0 10px; font-size: 0.95rem; }
.crm-note-add { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 14px; }
.crm-note-add textarea { flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-family: inherit; font-size: 0.9rem; resize: vertical; }
.crm-note-list { display: flex; flex-direction: column; gap: 8px; }
.crm-note { border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 8px; padding: 10px 12px; background: var(--bg-white); }
.crm-note-body { font-size: 0.88rem; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.crm-note-meta { font-size: 0.74rem; color: var(--text-muted); margin-top: 6px; display: flex; align-items: center; gap: 8px; }
.crm-note-del { border: none; background: transparent; color: var(--danger); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 4px; }

/* ---- Etapas ---- */
.crm-new-stage { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px; background: #f7f9fc; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 16px; }
.crm-new-stage input[type=text] { flex: 1; min-width: 200px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.crm-new-stage input[type=color], .crm-stage-row input[type=color] { width: 40px; height: 38px; border: 1px solid var(--border); border-radius: 8px; background: none; cursor: pointer; padding: 2px; }
.crm-stage-list { display: flex; flex-direction: column; gap: 8px; }
.crm-stage-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-white); }
.crm-stage-name-input { flex: 1; min-width: 160px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-weight: 600; }
.crm-stage-count { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }
.crm-stage-active { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--text-light); white-space: nowrap; }

/* =====================================================================
   ETAPA 3 — tipo de device, follow-up, listas (somente aparência)
   ===================================================================== */
.dev-col-name { flex-wrap: wrap; }
.dev-role-select {
  font-size: 0.72rem; padding: 2px 7px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--bg-white); color: var(--text-light); cursor: pointer;
}
.dev-role-select:hover { border-color: var(--accent); }

/* Follow-up (lembretes com data/hora) */
.crm-fu-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.crm-fu-add input[type=datetime-local] { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; }
.crm-fu-add input[type=text] { flex: 1; min-width: 180px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; }
.crm-fu-list { display: flex; flex-direction: column; gap: 8px; }
.crm-fu { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--border); border-left: 3px solid var(--warning); border-radius: 8px; padding: 10px 12px; background: var(--bg-white); }
.crm-fu.done { border-left-color: var(--accent); opacity: 0.65; }
.crm-fu.done .crm-fu-when, .crm-fu.done .crm-fu-body { text-decoration: line-through; }
.crm-fu-main { flex: 1; }
.crm-fu-when { font-weight: 700; font-size: 0.85rem; color: var(--text); }
.crm-fu-body { font-size: 0.85rem; color: var(--text-light); margin-top: 2px; }
.crm-fu-check { display: flex; align-items: center; padding-top: 2px; }

/* Minhas Listas */
.lists-links { border-top: 1px dashed var(--border); padding-top: 12px; margin-top: 4px; }
.lists-link-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.lists-link-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #f7f9fc; }
.lists-link-url { flex: 1; font-size: 0.82rem; color: var(--text); word-break: break-all; font-family: ui-monospace, monospace; }
.lists-link-status { font-size: 0.72rem; font-weight: 700; color: var(--text-light); background: var(--bg-white); border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }

/* =====================================================================
   TEMA ESCURO (ETAPA 4) — ativado por html[data-theme="dark"]
   Estratégia: sobrescrever os tokens :root + alvos hardcoded claros.
   ===================================================================== */
html[data-theme="dark"] {
  --wz-base: 230 234 242;              /* canal claro no dark → hovers/overlays/borda ficam corretos */
  --primary: #161e2c;
  --primary-light: #243049;
  --bg: #0f1623;
  --bg-card: #1a2434;
  --bg-white: #1a2434;
  --bg-soft: #131d2c;                  /* superfície "soft" (headers de tabela, colunas kanban) */
  --text: #e6eaf2;
  --text-light: #aab4c6;
  --text-muted: #7e8ba1;
  --text-dark: #e6eaf2;
  --border: #2a3447;
  --border-strong: #3a4760;           /* borda de input no dark */
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.35);
  --shadow: 0 3px 8px rgba(0,0,0,0.42);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-xl: 0 6px 24px rgba(0,0,0,0.62);
  --tp-sidebar-grad: linear-gradient(180deg, #161e2c 0%, #10161f 100%);
}
/* Inputs/areas: no claro herdavam texto escuro sobre fundo branco; no escuro o
   fundo vira escuro, então forçamos a cor do texto e do placeholder. */
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  color: var(--text);
  background: var(--bg-white);
  border-color: var(--border);
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: var(--text-muted); }
html[data-theme="dark"] .dev-role-select { background: var(--bg-white); color: var(--text-light); }
/* Superfícies "soft" que eram hardcoded claras (#f7f9fc/#eef1f7/#fff) → escuras */
html[data-theme="dark"] th,
html[data-theme="dark"] .dev-table-header,
html[data-theme="dark"] .history-table-main th,
html[data-theme="dark"] .btn-secondary:hover,
html[data-theme="dark"] .crm-conv-item:hover,
html[data-theme="dark"] .crm-detail-info,
html[data-theme="dark"] .crm-new-stage,
html[data-theme="dark"] .lists-link-row,
html[data-theme="dark"] .crm-tab:hover,
html[data-theme="dark"] .modal-close:hover { background: #131d2c; }
html[data-theme="dark"] tr:hover td,
html[data-theme="dark"] .dev-table-row:hover,
html[data-theme="dark"] .history-table-main tbody tr:hover { background: rgba(255,255,255,0.03); }
html[data-theme="dark"] .crm-kanban-col { background: #131c2b; }
html[data-theme="dark"] .crm-kanban-badge { background: #1a2434; color: var(--text-light); border-color: var(--border); }
html[data-theme="dark"] .crm-conv-banner { background: #12233a; border-color: #1e3a5f; color: #9ec5ff; }
html[data-theme="dark"] .crm-card,
html[data-theme="dark"] .crm-conv-list,
html[data-theme="dark"] .crm-conv-detail,
html[data-theme="dark"] .crm-note,
html[data-theme="dark"] .crm-stage-row,
html[data-theme="dark"] .crm-fu { background: var(--bg-card); }
html[data-theme="dark"] * { scrollbar-color: #3a4760 transparent; }
html[data-theme="dark"] *::-webkit-scrollbar-thumb { background: #3a4760; background-clip: padding-box; }
html[data-theme="dark"] .top-bar { background: var(--bg-card); }
html[data-theme="dark"] code { background: #11192633; }

/* =====================================================================
   ETAPA 4 — controles do topo (tema + profile) e Marketplace
   ===================================================================== */
.tp-topbar-controls { display: inline-flex; align-items: center; gap: 10px; }
.tp-theme-btn {
  width: 38px; height: 38px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text); cursor: pointer; font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center; box-shadow: none;
}
.tp-theme-btn:hover { background: rgb(var(--wz-base) / 0.06); }
.tp-theme-btn:hover { border-color: var(--accent); }
.tp-profile { position: relative; }
.tp-profile-btn {
  display: inline-flex; align-items: center; gap: 9px; padding: 5px 10px 5px 5px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--bg-card);
  cursor: pointer; box-shadow: var(--shadow-sm); color: var(--text);
}
.tp-profile-btn:hover { border-color: var(--accent); }
.tp-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff; font-weight: 700; font-size: 0.85rem; display: inline-flex; align-items: center; justify-content: center;
}
.tp-profile-name { font-size: 0.85rem; font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .tp-profile-name { display: none; } }
.tp-profile-menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 268px; z-index: 3000;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 14px; display: none;
}
.tp-profile-menu.open { display: block; animation: fadeIn .15s ease; }
.tp-pm-head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.tp-pm-email { font-size: 0.8rem; color: var(--text-light); word-break: break-all; }
.tp-pm-name { font-weight: 700; font-size: 0.92rem; }
.tp-role-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; margin-top: 3px; }
.tp-role-pill.master { background: #fef3c7; color: #b45309; }
.tp-role-pill.admin { background: #ede9fe; color: #6d28d9; }
.tp-role-pill.user { background: var(--tp-accent-soft); color: var(--accent-dark); }
.tp-pm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.tp-pm-stat { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.tp-pm-stat .l { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px; }
.tp-pm-stat .v { font-size: 1rem; font-weight: 700; color: var(--text); }
.tp-pm-actions { display: flex; flex-direction: column; gap: 6px; }
.tp-pm-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 11px; border: none; background: transparent; border-radius: 9px;
  cursor: pointer; font-size: 0.88rem; color: var(--text); font-family: inherit;
}
.tp-pm-item:hover { background: var(--tp-accent-soft); }
.tp-pm-item.danger { color: var(--danger); }
.tp-pm-item.danger:hover { background: rgba(239,68,68,0.10); }

/* Marketplace */
.mp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.mp-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; transition: transform .16s ease, box-shadow .16s ease; }
.mp-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.mp-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.mp-card-name { font-weight: 700; font-size: 1.05rem; color: var(--text); }
.mp-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.mp-tag { font-size: 0.72rem; font-weight: 600; padding: 3px 9px; border-radius: var(--radius-sm); background: var(--tp-accent-soft); color: var(--accent-dark); }
.mp-tag.region { background: #e0f2fe; color: #075985; }
.mp-quota { font-size: 0.85rem; color: var(--text-light); }
.mp-desc { font-size: 0.85rem; color: var(--text-light); flex: 1; }
.mp-price { font-size: 1.3rem; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }
.mp-order-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-card); margin-bottom: 10px; box-shadow: var(--shadow-sm); }
.mp-order-main { flex: 1; min-width: 180px; }
.mp-order-name { font-weight: 700; color: var(--text); }
.mp-order-sub { font-size: 0.8rem; color: var(--text-muted); }
.mp-badge { font-size: 0.72rem; font-weight: 600; padding: 3px 10px; border-radius: var(--radius-sm); white-space: nowrap; }
.mp-badge.comprado { background: #dbeafe; color: #1d4ed8; }
.mp-badge.processando { background: #fef3c7; color: #92400e; }
.mp-badge.concluido { background: #d1fae5; color: #065f46; }
.mp-report { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 10px; }
.mp-report-cell { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; text-align: center; }
.mp-report-cell .n { font-size: 1.4rem; font-weight: 800; color: var(--text); }
.mp-report-cell .l { font-size: 0.72rem; color: var(--text-muted); }
.mp-note { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 10px; padding: 12px 14px; font-size: 0.85rem; margin-top: 12px; }
html[data-theme="dark"] .mp-tag.region { background: #0c2a3a; color: #7dd3fc; }
html[data-theme="dark"] .mp-note { background: #3a2410; border-color: #5c3a16; color: #fdba74; }
html[data-theme="dark"] .mp-badge.comprado { background: #16263f; color: #93c5fd; }

/* =====================================================================
   DASHBOARD — padrão Sneat CRM (ETAPA 4.2): fundo claro, cards brancos
   pequenos, radius 8px, sombra suave, ícone em caixinha, grid variado.
   ===================================================================== */
.sx { display: flex; flex-direction: column; gap: 22px; }
.sx-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.sx-card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.sx-h-title { font-size: 1.02rem; font-weight: 700; color: var(--text); margin: 0; }
.sx-h-sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.sx-h-link { font-size: 0.78rem; font-weight: 600; color: var(--accent); cursor: pointer; background: none; border: none; padding: 0; }
/* Ponto "AO VIVO" pulsante */
.sx-live { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-left: 7px; vertical-align: middle; animation: sxLivePulse 1.8s ease-out infinite; }
@keyframes sxLivePulse { 0% { box-shadow: 0 0 0 0 rgba(16,185,129,0.45); } 70% { box-shadow: 0 0 0 7px rgba(16,185,129,0); } 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); } }

/* Greeting compacto (claro, sem bloco dark gigante) */
.sx-greet { position: relative; overflow: hidden; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.sx-greet-l { position: relative; z-index: 1; }
.sx-greet h1 { font-size: 1.32rem; font-weight: 800; margin: 0; color: var(--text); letter-spacing: -0.4px; }
.sx-greet-sub { color: var(--text-light); font-size: 0.86rem; margin-top: 5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sx-plan { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; background: var(--tp-accent-soft); color: var(--accent-dark); }
.sx-greet-actions { display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; }
.sx-greet-emoji { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); font-size: 5.4rem; opacity: 0.10; pointer-events: none; }

/* Top row: stat cards pequenos */
.sx-stats { display: grid; grid-template-columns: 1fr 1fr 1fr 1.7fr; gap: 20px; }
@media (max-width: 980px){ .sx-stats { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px){ .sx-stats { grid-template-columns: 1fr; } }
/* stat cards agora são clicáveis (navegam) — reset de <button> */
.sx-stat { display: block; width: 100%; text-align: left; font: inherit; color: inherit; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px 18px; cursor: pointer; transition: box-shadow .16s ease, transform .16s ease, border-color .16s ease; }
.sx-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--tp-accent-ring); }
.sx-stat:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--tp-accent-ring); }
/* Card maior de Follow-ups (pendentes + vencidos lado a lado) */
.sx-stat-fu { display: flex; flex-direction: column; gap: 14px; }
.sx-fu-head { display: flex; align-items: center; gap: 10px; }
.sx-fu-head .sx-stat-l { margin-top: 0; font-weight: 600; color: var(--text-light); }
.sx-fu-body { display: flex; align-items: center; gap: 22px; padding-left: 2px; }
.sx-fu-item { display: flex; flex-direction: column; }
.sx-fu-n { font-size: 1.9rem; font-weight: 800; letter-spacing: -.5px; color: var(--text); line-height: 1; font-variant-numeric: tabular-nums; }
.sx-fu-n.red { color: #dc2626; }
.sx-fu-t { font-size: 0.76rem; color: var(--text-muted); margin-top: 4px; }
.sx-fu-sep { width: 1px; align-self: stretch; min-height: 34px; background: var(--border); }
.sx-ic { width: 40px; height: 40px; border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.sx-ic.green { background: rgba(16,185,129,.14); color: #059669; }
.sx-ic.blue { background: rgba(59,130,246,.14); color: #2563eb; }
.sx-ic.amber { background: rgba(245,158,11,.16); color: #b45309; }
.sx-ic.red { background: rgba(239,68,68,.14); color: #dc2626; }
.sx-ic.violet { background: rgba(139,92,246,.16); color: #7c3aed; }
.sx-ic.cyan { background: rgba(6,182,212,.16); color: #0891b2; }
.sx-stat-v { font-size: 1.5rem; font-weight: 800; letter-spacing: -.5px; color: var(--text); margin-top: 12px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.sx-stat-l { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* Grid variado (tamanhos diferentes) */
.sx-grid { display: grid; gap: 22px; }
.sx-grid.g84 { grid-template-columns: 1.7fr 1fr; }
.sx-grid.g66 { grid-template-columns: 1fr 1fr; }
.sx-grid.g57 { grid-template-columns: 1fr 1.5fr; }
@media (max-width: 920px){ .sx-grid.g84, .sx-grid.g66, .sx-grid.g57 { grid-template-columns: 1fr; } }

/* Listas Sneat: icon box + nome/sub + valor + chip */
.sx-list { display: flex; flex-direction: column; }
.sx-row { display: flex; align-items: center; gap: 13px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.sx-row:last-child { border-bottom: none; }
.sx-row-main { flex: 1; min-width: 0; }
.sx-row-name { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.sx-row-sub { font-size: 0.76rem; color: var(--text-muted); margin-top: 1px; }
.sx-row-val { font-weight: 700; font-size: 0.95rem; color: var(--text); font-variant-numeric: tabular-nums; }
.sx-chip { font-size: 0.7rem; font-weight: 700; padding: 2px 9px; border-radius: 6px; white-space: nowrap; }
.sx-chip.green { background: rgba(16,185,129,.14); color: #059669; }
.sx-chip.red { background: rgba(239,68,68,.14); color: #dc2626; }
.sx-chip.blue { background: rgba(59,130,246,.14); color: #2563eb; }
.sx-chip.amber { background: rgba(245,158,11,.16); color: #b45309; }
.sx-chip.muted { background: var(--bg); color: var(--text-muted); }

/* Donut */
.sx-donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.sx-donut { width: 130px; height: 130px; flex-shrink: 0; }
.sx-donut-n { font-size: 24px; font-weight: 800; fill: var(--text); }
.sx-donut-s { font-size: 9px; fill: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.sx-legend { display: flex; flex-direction: column; gap: 9px; flex: 1; min-width: 130px; }
.sx-leg { display: flex; align-items: center; gap: 9px; font-size: 0.85rem; }
.sx-leg .dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.sx-leg .nm { color: var(--text-light); flex: 1; }
.sx-leg .vl { font-weight: 700; color: var(--text); }

/* Barras */
.sx-bars { display: flex; flex-direction: column; gap: 13px; }
.sx-bar { display: flex; align-items: center; gap: 12px; }
.sx-bar-n { width: 96px; font-size: 0.82rem; color: var(--text-light); flex-shrink: 0; }
.sx-bar-t { flex: 1; height: 8px; background: var(--bg); border-radius: 6px; overflow: hidden; }
.sx-bar-f { height: 100%; border-radius: 6px; min-width: 3px; transition: width .5s ease; }
.sx-bar-v { width: 30px; text-align: right; font-weight: 700; font-size: 0.82rem; color: var(--text); }

/* Gráfico de área/linha (Atividade) */
.sx-area-wrap { width: 100%; }
.sx-area { width: 100%; height: 188px; display: block; overflow: visible; }
.sx-area-grid { stroke: var(--border); stroke-width: 1; }
.sx-area-x { display: flex; justify-content: space-between; margin-top: 8px; padding: 0 2px; }
.sx-area-x span { font-size: 0.72rem; color: var(--text-muted); }
.sx-area-legend { display: flex; gap: 18px; margin-bottom: 10px; flex-wrap: wrap; }
.sx-area-legend .sx-leg { display: inline-flex; align-items: center; gap: 7px; font-size: 0.82rem; }
.sx-area-legend .sx-leg .dot { width: 10px; height: 10px; border-radius: 3px; }
.sx-area-legend .sx-leg .nm { color: var(--text-light); }
.sx-area-legend .sx-leg .vl { font-weight: 700; color: var(--text); }

/* Gauge de uso (anel + info) */
.sx-gauge-c { flex-shrink: 0; }
.sx-gauge-info { min-width: 130px; }
.sx-gauge-v { font-size: 1.35rem; font-weight: 800; color: var(--text); letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.sx-gauge-l { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

/* Atalhos rápidos */
.sx-quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; }
.sx-qtile { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--border); cursor: pointer; transition: background .15s ease, transform .15s ease, border-color .15s ease; }
.sx-qtile:hover { transform: translateY(-2px); background: var(--tp-accent-soft); border-color: transparent; }
.sx-qtile .t { font-size: 0.82rem; font-weight: 600; color: var(--text); }

/* Empty state premium */
.sx-empty { text-align: center; padding: 20px 14px; color: var(--text-muted); }
.sx-empty .ic { font-size: 1.9rem; margin-bottom: 6px; opacity: .85; }
.sx-empty .cta { margin-top: 12px; }

/* Dark */
html[data-theme="dark"] .sx-card, html[data-theme="dark"] .sx-stat, html[data-theme="dark"] .sx-greet { box-shadow: 0 2px 10px rgba(0,0,0,0.35); }
html[data-theme="dark"] .sx-qtile { background: #131d2c; }
