/* ===========================================================================
   CRM Anhanguera — linguagem visual.

   Um arquivo só, e as telas quase sem estilo próprio: os nomes de classe
   (`card`, `btn`, `badge`, `kpi`, `tabela`, `kanban-*`) são contrato com os
   templates, então repintar o sistema inteiro acontece aqui, sem tocar em
   nenhuma tela.

   Claro no conteúdo, escuro na navegação. O trabalho do consultor é ler
   tabela e formulário por horas — fundo claro cansa menos nessa leitura —,
   enquanto a coluna escura à esquerda separa "onde estou" de "o que estou
   fazendo" sem precisar de borda nem sombra.

   O fundo é creme, não branco: é o que faz o card branco da tabela
   sobressair. Numa tela toda branca, card e fundo viram a mesma coisa.
   =========================================================================== */

:root {
  /* ---- Superfícies ---- */
  --bg: #f5f4f1;
  --surface: #ffffff;
  --surface-alt: #faf9f7;
  --border: #e7e3dc;
  --border-soft: #f0eee9;      /* divisória interna: mais fraca que a do card */

  /* ---- Texto, em quatro níveis de presença ---- */
  --text: #1c1917;
  --text-2: #44403c;
  --muted: #78716c;
  --faint: #a8a29e;

  /* ---- Laranja da marca ---- */
  --primary: #c1440e;
  --primary-hover: #a63a0c;
  --primary-soft: #fdeee4;
  --primary-soft-border: #f6d4bf;
  --primary-soft-text: #9a3412;

  /* ---- Semânticas: sempre o par cor + fundo suave ---- */
  --danger: #be123c;
  --danger-soft: #fce8ec;
  --danger-soft-border: #f7ccd6;
  --success: #15803d;
  --success-soft: #e7f2ea;
  --success-soft-border: #c3e3d0;
  --warn: #b45309;
  --warn-soft: #fbf0dd;
  --warn-soft-border: #f0dcb4;
  --info: #1d4ed8;
  --info-soft: #e9edfb;
  --info-soft-border: #d4e0fb;
  --roxo: #6d28d9;             /* roxo = análise curricular */
  --roxo-soft: #f2ecfe;
  --roxo-soft-border: #e0d1fb;

  /* ---- Coluna escura: escala própria ---- */
  --side-bg: #1c1917;
  --side-hover: #292524;
  --side-text: #a8a29e;
  --side-text-forte: #ffffff;
  --side-border: #292524;

  --radius: 12px;
  --radius-sm: 9px;
  --radius-xs: 8px;
  --radius-pill: 999px;

  --shadow: 0 1px 2px rgba(28, 25, 23, .05);
  --shadow-md: 0 4px 16px rgba(28, 25, 23, .08);
  --shadow-lg: 0 12px 32px rgba(28, 25, 23, .14);

  --fonte: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --fonte-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --topbar-h: 60px;
  --transicao: .15s ease;

  --z-sticky: 50; --z-drawer: 90; --z-modal: 1000;
}

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

html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--fonte);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 700; letter-spacing: -.02em; line-height: 1.25; }
h1 { font-size: 26px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--text); color: var(--bg); }

::-webkit-scrollbar { height: 10px; width: 10px; }
::-webkit-scrollbar-thumb {
  background: #d6d3ce; border-radius: 8px; border: 2px solid var(--bg);
}
::-webkit-scrollbar-track { background: transparent; }

/* Números em tabular: alinham na coluna e não dançam ao atualizar. */
.num, .kpi-valor, .kanban-valor, .meta-num, .ranking-pontos, .extrato-pts,
td.num, .bonus-total, .serie-col b {
  font-family: var(--fonte-mono); font-variant-numeric: tabular-nums;
}

/* Foco visível só para quem navega por teclado. */
:where(a, button, [role="button"], input, select, textarea, summary,
       [tabindex]):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: var(--z-modal);
  transform: translateY(-160%); transition: transform var(--transicao);
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 600;
  box-shadow: var(--shadow-md);
}
.skip-link:focus { transform: translateY(0); text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; transition-duration: .001ms !important;
  }
}

/* ===========================================================================
   Barra de navegação no topo

   A navegação encosta na barra do sistema pelo alto, como no painel de
   matrículas que a equipe já usa: marca à esquerda, destinos no meio, usuário
   à direita, e um fio laranja embaixo separando a barra do conteúdo. Fundo
   claro (não a coluna escura de antes) para casar com esse painel.
   =========================================================================== */

.topbar {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: var(--surface);
  border-bottom: 2px solid var(--primary);
  box-shadow: var(--shadow);
}
.topbar-inner {
  max-width: 1440px; margin: 0 auto;
  display: flex; align-items: center; gap: 18px;
  padding: 0 24px; height: var(--topbar-h);
}

.topbar-marca { flex: none; }
.topbar-marca a {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  color: inherit; text-decoration: none;
}
.topbar-marca a:hover { text-decoration: none; }
/* Selo quadrado da marca — a logomarca completa não sobrevive a 30px.
   O símbolo da Anhanguera é laranja; dentro de um selo laranja ele
   desapareceria, então vai a branco pelo filtro. */
.marca-selo {
  width: 32px; height: 32px; flex: none;
  border-radius: var(--radius-xs);
  background: var(--primary);
  display: grid; place-items: center;
  overflow: hidden;
}
.marca-selo img {
  width: 22px; height: 22px; object-fit: contain;
  filter: brightness(0) invert(1);
}
.marca-texto { min-width: 0; line-height: 1.2; }
.marca-nome {
  display: block; font-size: 15px; font-weight: 800; color: var(--primary);
  letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.marca-polo {
  display: block; font-size: 10px; color: var(--muted); font-family: var(--fonte-mono);
  letter-spacing: .04em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---- Destinos ---- */
.topnav {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 2px;
  overflow-x: auto; scrollbar-width: none;
}
.topnav::-webkit-scrollbar { display: none; }

.snav-item {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  padding: 8px 13px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 13.5px; font-weight: 600;
  text-decoration: none; white-space: nowrap;
  transition: background var(--transicao), color var(--transicao);
}
.snav-item:hover {
  background: var(--surface-alt); color: var(--text); text-decoration: none;
}
.snav-item.ativo {
  background: var(--primary); color: #fff; font-weight: 700;
}
.snav-item.ativo:hover { background: var(--primary-hover); color: #fff; }
.snav-rotulo { min-width: 0; }

.pill-contador {
  flex: none; min-width: 19px; padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--primary); color: #fff;
  font-size: 11px; font-weight: 700; text-align: center;
  font-family: var(--fonte-mono);
}
/* No item ativo (fundo laranja) o contador inverte para não sumir. */
.snav-item.ativo .pill-contador { background: #fff; color: var(--primary); }

/* ---- Usuário, à direita ---- */
.topbar-user {
  flex: none; display: flex; align-items: center; gap: 11px;
  padding-left: 16px; margin-left: auto;
  border-left: 1px solid var(--border);
}
.avatar {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800;
}
.topbar-user-info { min-width: 0; line-height: 1.25; text-align: right; }
.topbar-user-nome {
  display: block; font-size: 13px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px;
}
.topbar-user-papel {
  display: block; font-size: 11px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-sair {
  flex: none; font-size: 13px; font-weight: 700; color: var(--primary);
}

/* Botão da gaveta: só no mobile. */
.nav-toggle {
  display: none;
  flex: none; width: 40px; height: 40px; place-items: center;
  background: none; border: 1px solid var(--border); border-radius: var(--radius-xs);
  cursor: pointer;
}
.nav-toggle-barras { display: grid; gap: 4px; }
.nav-toggle-barras span {
  display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--text);
}

/* ---- Conteúdo ---- */
.conteudo-area { min-height: 100vh; min-height: 100dvh; }
.container { max-width: 1440px; margin: 0 auto; padding: 24px 24px 72px; }
.container.estreito { max-width: 640px; }
.container.medio { max-width: 940px; }
.container.largo { max-width: none; }

.nav-scrim {
  position: fixed; inset: 0; z-index: calc(var(--z-drawer) - 1);
  background: rgba(28, 25, 23, .45);
}

/* No mobile a linha de destinos vira uma gaveta que desce sob a barra. */
@media (max-width: 1024px) {
  .topbar-inner { gap: 12px; padding: 0 14px; }
  .nav-toggle { display: grid; }
  .marca-polo { display: none; }

  .topnav {
    position: absolute; left: 0; right: 0; top: 100%;
    z-index: var(--z-drawer);
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 10px 12px; overflow-y: auto; max-height: calc(100dvh - var(--topbar-h));
    background: var(--surface); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: transform .18s ease, opacity .18s ease;
  }
  body.nav-aberta .topnav { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .snav-item { padding: 11px 13px; font-size: 14px; }

  .topbar-user { padding-left: 10px; }
  .topbar-user-info { display: none; }
  .container { padding: 18px 14px 64px; }
}

/* ===========================================================================
   Cabeçalho de página
   =========================================================================== */

.page-head { margin-bottom: 22px; }
.page-head h1 { margin-bottom: 5px; }
.page-head p { color: var(--muted); font-size: 13.5px; }
.page-acoes { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Alternador Lista / Kanban. */
.vista-toggle {
  display: inline-flex; background: var(--surface-alt);
  border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 3px;
}
.vista-btn {
  padding: 6px 15px; border-radius: var(--radius-pill);
  font-size: 12.5px; font-weight: 700; color: var(--muted); text-decoration: none;
}
.vista-btn:hover { color: var(--text); text-decoration: none; }
.vista-btn.ativo { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* Coluna de follow-up: botão + balão com as comunicações e o formulário. */
.followup-sum { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.followup-sum svg { width: 14px; height: 14px; }
.fu-count {
  font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums;
  background: var(--primary-soft); color: var(--primary-soft-text);
  border-radius: var(--radius-pill); padding: 0 6px;
}
.fu-pop { min-width: 244px; max-width: 300px; padding: 12px; gap: 0; }
.fu-titulo {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin-bottom: 8px;
}
.fu-lista { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; max-height: 190px; overflow-y: auto; }
.fu-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.fu-canal {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  border-radius: var(--radius-pill); padding: 2px 8px; white-space: nowrap;
}
.fu-canal--email { background: var(--info-soft); color: var(--info); }
.fu-canal--whatsapp { background: var(--success-soft); color: var(--success); }
.fu-data { font-family: var(--fonte-mono); font-variant-numeric: tabular-nums; color: var(--text-2); }
.fu-assunto { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fu-vazio { font-size: 12px; color: var(--faint); margin: 0 0 10px; }
.fu-form { display: grid; gap: 7px; border-top: 1px solid var(--border); padding-top: 10px; }
.fu-form-linha { display: flex; gap: 7px; }
.fu-form-linha .sel-inline { min-width: 0; flex: 1 1 auto; }
.fu-form-linha input[type="date"] { flex: 1 1 auto; min-width: 0; }
.fu-assunto-in {
  width: 100%; box-sizing: border-box; padding: 6px 9px; font: inherit; font-size: 13px;
  border: 1px solid var(--border); border-radius: var(--radius-xs);
}
.fu-titulo--sep { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 12px; }
/* Bolinha de situação da tarefa no botão de follow-up. */
.fu-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.fu-dot--erro { background: var(--danger); }
.fu-dot--aviso { background: var(--warn); }
.fu-dot--info { background: var(--info); }
.fu-tarefa { display: grid; gap: 6px; margin-bottom: 10px; }
.fu-tarefa-topo { display: flex; align-items: center; gap: 8px; }
.fu-tarefa-desc { font-size: 12.5px; color: var(--text); }

/* Seção "Tarefas Agendadas" (details recolhível). */
.tarefas-card { padding: 14px 16px; }
.tarefas-sum { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; }
.tarefas-sum::-webkit-details-marker { display: none; }
.tarefas-sum::marker { content: ""; }
.tarefas-sum::after { content: "▾"; color: var(--muted); font-size: 12px; transition: transform .18s ease; }
details[open] > .tarefas-sum::after { transform: rotate(180deg); }
.tarefas-resumo { display: inline-flex; align-items: center; gap: 10px; font-size: 12.5px; }

/* Selo de tarefa no cartão do kanban. */
.kanban-tarefa {
  display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em; border-radius: var(--radius-pill);
  padding: 2px 8px; border: 1px solid transparent;
}
.kanban-tarefa.erro { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-soft-border); }
.kanban-tarefa.aviso { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-soft-border); }
.kanban-tarefa.info { background: var(--info-soft); color: var(--info); border-color: var(--info-soft-border); }
.flex-between {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}

/* ===========================================================================
   Cartões
   =========================================================================== */

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
}
.titulo-card {
  font-size: 15px; font-weight: 700; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.card.destaque { border-color: var(--primary-soft-border); background: var(--primary-soft); }

.colunas { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }

/* ---- Indicadores ---- */
.kpis {
  display: grid; gap: 12px; margin-bottom: 20px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 15px 18px; box-shadow: var(--shadow);
}
.kpi-rotulo {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted);
}
.kpi-valor { font-size: 30px; font-weight: 700; line-height: 1.1; margin-top: 6px; letter-spacing: -.02em; }
.kpi-nota { font-size: 11.5px; color: var(--faint); margin-top: 3px; }
.kpi--destaque { border-color: var(--primary-soft-border); background: var(--primary-soft); }
.kpi--destaque .kpi-valor { color: var(--primary); }

/* ===========================================================================
   Tabelas
   =========================================================================== */

.tabela-wrap {
  overflow-x: auto; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
}
.tabela { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tabela thead th {
  text-align: left; padding: 11px 14px; white-space: nowrap;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}
.tabela tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.tabela tbody tr:last-child td { border-bottom: 0; }
.tabela tbody tr:hover { background: var(--surface-alt); }
.tabela .nowrap, td.nowrap, th.nowrap { white-space: nowrap; }
.tabela a { font-weight: 600; }
.linha-clicavel { cursor: pointer; }

/* ---- Lista do CRM (estilo painel de matrículas): controles na linha ---- */
.tabela-crm td { vertical-align: middle; }
.lista-nome { font-weight: 700; font-size: 13.5px; }
.lista-sub {
  font-size: 11.5px; color: var(--muted); margin-top: 2px;
  font-family: var(--fonte-mono); font-variant-numeric: tabular-nums;
}
.col-acoes { text-align: right; white-space: nowrap; }

/* Seletor compacto que muda a etapa/responsável sem sair da lista. */
.cel-form { margin: 0; display: inline-block; }
.sel-inline {
  width: auto; min-width: 132px; max-width: 190px;
  padding: 6px 26px 6px 9px; font-size: 12.5px;
  background-position: right 8px center;
}
/* Sem responsável: o "+ atribuir" pontilhado laranja, como no painel de matrículas. */
.sel-vazio {
  color: var(--primary); font-weight: 700;
  border-color: var(--primary-soft-border); border-style: dashed;
}

/* =============================================================
   Lista compacta do CRM: uma linha-resumo enxuta por contato e
   um painel que se abre embaixo (progressive disclosure) com o
   restante dos campos, todos editáveis. Sem rolagem lateral.
   ============================================================= */
.crm-lista td { vertical-align: middle; padding: 10px 12px; }
.crm-lista thead th { font-size: 10.5px; letter-spacing: .05em; }
.cel-forma { margin: 0; }

/* Bloco do aluno: dot de situação + nome e, abaixo, contato · cidade. */
.crm-aluno { display: flex; align-items: flex-start; gap: 9px; min-width: 200px; }
.crm-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--faint); }
.crm-dot.ok { background: var(--success); }
.crm-dot.aviso { background: var(--warn); }
.crm-dot.roxo { background: var(--roxo); }
.crm-dot.info { background: var(--info); }
.crm-dot.erro { background: var(--danger); }
.crm-nome-linha { display: flex; align-items: center; gap: 7px; }
.crm-nome { font-weight: 700; font-size: 13.5px; }

/* Indicador de observações: passar o mouse (title nativo) mostra tudo.
   Colorido quando há observações; apagado quando não há. */
.obs-ind { display: inline-flex; align-items: center; gap: 2px; cursor: help; }
.obs-ind svg { width: 14px; height: 14px; }
.obs-ind--tem { color: var(--primary); }
.obs-ind--vazio { color: var(--faint); opacity: .5; cursor: default; }
.obs-ind-num { font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.crm-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.crm-sub--mono { font-family: var(--fonte-mono); font-variant-numeric: tabular-nums; }
.crm-valor { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Medidor de pós-venda em segmentos (inspirado no termômetro). */
.medidor { display: inline-flex; flex-direction: column; gap: 4px; min-width: 88px; }
.medidor-rot { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.medidor-barra { display: flex; gap: 3px; }
.medidor-seg { width: 13px; height: 6px; border-radius: 2px; background: var(--border); cursor: help; }
.medidor-seg:hover, .medidor-seg:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.medidor-seg.on { background: var(--success); }

/* Botão de expandir a linha. */
.crm-exp {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; cursor: pointer; color: var(--muted);
  border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--surface);
  transition: background var(--transicao), color var(--transicao);
}
.crm-exp:hover { background: var(--surface-alt); color: var(--text); }
.crm-exp svg { width: 15px; height: 15px; transition: transform .18s ease; }
tr.aberta { background: var(--surface-alt); }
tr.aberta .crm-exp svg { transform: rotate(180deg); }

/* Painel de detalhe (linha que abre embaixo). */
.crm-detalhe > td { padding: 0; background: var(--surface-alt); border-bottom: 2px solid var(--border); }
.crm-detalhe-in {
  padding: 16px 18px 18px;
  display: grid; gap: 18px 26px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
.crm-grupo h4 {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin: 0 0 9px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.crm-campos { display: grid; gap: 8px; }
.crm-linha { display: grid; grid-template-columns: 118px 1fr; align-items: center; gap: 10px; }
.crm-linha > label { font-size: 12px; color: var(--text-2); }
.crm-checks { display: grid; gap: 9px; }
.crm-check-item { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.crm-detalhe-acoes {
  grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap;
  padding-top: 12px; border-top: 1px solid var(--border);
}

/* Campo que se disfarça de texto até receber foco (usado no painel). */
.cel-campo {
  width: 100%; min-width: 0; max-width: 100%;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--radius-xs); padding: 6px 9px;
  font: inherit; font-size: 13px; color: var(--text); box-sizing: border-box;
  transition: border-color var(--transicao), box-shadow var(--transicao);
}
.cel-campo::placeholder { color: var(--faint); }
.cel-campo:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
textarea.cel-campo { resize: vertical; min-height: 38px; line-height: 1.45; }

/* Select de status colorido pela situação atual. */
.sel-status {
  width: 100%; min-width: 120px; max-width: 168px;
  padding: 6px 26px 6px 10px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em;
  border-radius: var(--radius-pill); background-position: right 8px center;
}
.sel-status.ok   { color: var(--success); background-color: var(--success-soft); border-color: var(--success-soft-border); }
.sel-status.aviso{ color: var(--warn);    background-color: var(--warn-soft);    border-color: var(--warn-soft-border); }
.sel-status.roxo { color: var(--roxo);    background-color: var(--roxo-soft);    border-color: var(--roxo-soft-border); }
.sel-status.info { color: var(--info);    background-color: var(--info-soft);    border-color: var(--info-soft-border); }
.sel-status.erro { color: var(--danger);  background-color: var(--danger-soft);  border-color: var(--danger-soft-border); }
.sel-status.neutro { color: var(--text-2); }

/* Selects compactos na linha-resumo. */
.crm-lista .sel-inline { min-width: 116px; max-width: 160px; font-size: 12.5px; padding: 6px 24px 6px 9px; }

/* Checkbox de pós-venda no painel. */
.cel-check-box { width: 17px; height: 17px; cursor: pointer; accent-color: var(--primary); flex: none; }

/* Menu de ações: <details> nativo; o balão é reposicionado por JS (position
   fixed) para não ser cortado pela rolagem da tabela. */
.menu-acoes { position: relative; display: inline-block; }
.menu-acoes > summary {
  list-style: none; cursor: pointer;
}
.menu-acoes > summary::-webkit-details-marker { display: none; }
.menu-acoes > summary::marker { content: ""; }
.menu-pop {
  position: fixed; z-index: var(--z-modal);
  min-width: 190px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 1px;
}
.menu-pop form { margin: 0; }
.menu-item {
  display: block; width: 100%; text-align: left;
  padding: 8px 10px; border-radius: var(--radius-xs);
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--text); background: none; border: 0; cursor: pointer;
}
.menu-item:hover { background: var(--surface-alt); text-decoration: none; }
.menu-item--perigo { color: var(--danger); }
.menu-item--perigo:hover { background: var(--danger-soft); }

/* Edição em linha (cadastros do admin): campo que não parece campo até o foco. */
.tabela-edit input[type="text"], .tabela-edit input[type="number"], .tabela-edit select {
  padding: 6px 9px; font-size: 13px;
}

.vazio {
  padding: 34px 18px; text-align: center; color: var(--muted);
  background: var(--surface); border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.paginacao {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 16px; font-size: 13px; color: var(--muted); flex-wrap: wrap;
}

/* Tabela vira cartão no celular — o cabeçalho de cada célula é injetado em
   data-label pelo script da casca. */
@media (max-width: 760px) {
  .tabela-cards thead { display: none; }
  .tabela-cards tbody tr {
    display: block; padding: 12px 14px; border-bottom: 1px solid var(--border);
  }
  .tabela-cards tbody td {
    display: flex; justify-content: space-between; gap: 14px;
    padding: 4px 0; border: 0; text-align: right;
  }
  .tabela-cards tbody td::before {
    content: attr(data-label); flex: none; text-align: left;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; color: var(--muted);
  }
}

/* ===========================================================================
   Botões
   =========================================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: background var(--transicao), border-color var(--transicao), color var(--transicao);
}
.btn:hover { background: var(--surface-alt); border-color: #d6d3ce; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primario { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primario:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }

.btn-fantasma { background: transparent; }
.btn-fantasma:hover { background: var(--surface-alt); }

.btn-perigo { color: var(--danger); border-color: var(--danger-soft-border); background: var(--danger-soft); }
.btn-perigo:hover { background: #f9dae1; border-color: #f0b8c5; color: var(--danger); }

.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }

/* ===========================================================================
   Formulários
   =========================================================================== */

.campo { display: block; margin-bottom: 14px; }
.campo > label {
  display: block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); margin-bottom: 5px;
}
.campo small { display: block; margin-top: 4px; font-size: 11.5px; color: var(--faint); }

input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="number"], input[type="tel"], input[type="search"], input[type="file"],
select, textarea {
  width: 100%; padding: 9px 11px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 14px;   /* 14px+ evita o zoom automático no iOS */
  transition: border-color var(--transicao), box-shadow var(--transicao);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { resize: vertical; min-height: 76px; }
select {
  appearance: none; cursor: pointer; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2378716c' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
input[type="checkbox"], input[type="radio"] {
  width: auto; accent-color: var(--primary); cursor: pointer;
}

.chk-inline, .chk-lista label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; cursor: pointer; margin-bottom: 8px;
}
.chk-inline input, .chk-lista input { flex: none; }
.chk-lista { display: grid; gap: 2px; }

.filtros { margin-bottom: 16px; }
.busca-filtros {
  display: grid; gap: 12px; align-items: end;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.busca-filtros .campo { margin-bottom: 0; }
.busca-linha { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* Filtros numa única faixa horizontal: em vez de quebrar linha, os campos se
   estendem lateralmente e rolam na horizontal se faltar espaço. */
.filtros-linha {
  display: flex; gap: 10px; align-items: flex-end;
  flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px;
}
.filtros-linha .campo { flex: 0 0 auto; margin-bottom: 0; min-width: 148px; }
.filtros-linha .campo--busca { flex: 1 1 220px; min-width: 200px; }
.filtros-linha .campo input, .filtros-linha .campo select { width: 100%; }
.form-inline, .inline-form { display: inline-flex; gap: 8px; align-items: center; }
.inline-form select { min-width: 170px; }

/* ===========================================================================
   Selos e avisos
   =========================================================================== */

.badge, .selo-status, .pendencia-tag {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  box-sizing: border-box; min-height: 22px; line-height: 1;
  padding: 4px 10px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  border: 1px solid transparent; white-space: nowrap; vertical-align: middle;
}
.badge.ok, .selo-status.ok {
  background: var(--success-soft); color: var(--success); border-color: var(--success-soft-border);
}
.badge.erro, .selo-status.erro {
  background: var(--danger-soft); color: var(--danger); border-color: var(--danger-soft-border);
}
.badge.aviso, .selo-status.aviso {
  background: var(--warn-soft); color: var(--warn); border-color: var(--warn-soft-border);
}
.badge.info, .selo-status.info {
  background: var(--info-soft); color: var(--info); border-color: var(--info-soft-border);
}
.badge.roxo, .selo-status.roxo {
  background: var(--roxo-soft); color: var(--roxo); border-color: var(--roxo-soft-border);
}
.badge.neutro, .selo-status.neutro, .pendencia-tag {
  background: var(--surface-alt); color: var(--muted); border-color: var(--border);
}

/* Legenda das situações do lead: cards curtos que explicam cada badge da
   coluna Situação, para quem abre a tela sem conhecer os termos. */
.legenda {
  display: grid; gap: 12px; margin-bottom: 20px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.legenda-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
}
.legenda-item p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }

/* Filas por status no topo do CRM: pills horizontais (ponto colorido + rótulo
   + contagem), no estilo das "filas de hoje" do painel de alunos. */
.filas { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 20px; }
.filas-rot { font-size: 12px; color: var(--muted); font-weight: 600; margin-right: 2px; }
.fila-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-sizing: border-box; min-width: 148px; height: 38px;
  padding: 0 14px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-2); font-size: 13px; font-weight: 600; text-decoration: none;
  transition: border-color var(--transicao), background var(--transicao);
}
.fila-pill:hover { border-color: var(--primary-soft-border); text-decoration: none; }
.fila-pill.ativo { border-color: var(--primary); background: var(--primary-soft); color: var(--text); }
/* A contagem fica encostada à direita da pill, para todas alinharem igual. */
.fila-pill .fila-num { margin-left: auto; }
.fila-ponto { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--faint); }
.fila-ponto.ok { background: var(--success); }
.fila-ponto.aviso { background: var(--warn); }
.fila-ponto.info { background: var(--info); }
.fila-ponto.erro { background: var(--danger); }
.fila-ponto.roxo { background: var(--roxo); }
.fila-num {
  font-family: var(--fonte-mono); font-variant-numeric: tabular-nums;
  font-size: 12px; font-weight: 700; color: var(--muted);
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 1px 8px;
}

.dica { font-size: 12.5px; color: var(--muted); }
.dica-erro { color: var(--danger); }
.text-muted { color: var(--muted); }
.obs-box {
  background: var(--surface-alt); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 11px 13px;
  font-size: 13px; color: var(--text-2); white-space: pre-wrap;
}

/* Caixa de alerta/aviso (bloco de texto). Renomeada de .aviso para .alerta
   porque "aviso" também é o token de cor do status Frio (amarelo) — e a
   colisão fazia o ponto, o badge e o select do Frio virarem retângulo. */
.alerta {
  padding: 12px 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--info-soft-border); background: var(--info-soft);
  color: var(--info); font-size: 13.5px; margin-bottom: 14px;
}
.alerta.erro { border-color: var(--danger-soft-border); background: var(--danger-soft); color: var(--danger); }
.alerta.aviso { border-color: var(--warn-soft-border); background: var(--warn-soft); color: var(--warn); }
.alerta.ok { border-color: var(--success-soft-border); background: var(--success-soft); color: var(--success); }

/* Lista de possíveis cadastros duplicados no aviso de bloqueio do salvamento. */
.dup-lista { margin: 8px 0 6px; padding-left: 18px; display: grid; gap: 5px; }
.dup-lista li { line-height: 1.5; }
.dup-link { font-weight: 600; text-decoration: underline; }
.dup-tel { opacity: .85; }
.dup-motivo { font-size: 12px; opacity: .8; }
.dup-obs { display: block; margin-top: 6px; font-size: 12.5px; opacity: .9; }

/* Utilitário: linha que quebra e mantém respiro entre os itens. */
.flex-wrap-gap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Banner da importação do RD Conversas na tela de leads. */
.imp-rd { border-left: 4px solid var(--primary); }
.imp-rd-topo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.imp-rd-progresso { margin-top: 6px; font-size: 13.5px; }
.imp-rd-processados, .imp-rd-total, .imp-rd-novos, .imp-rd-ja { font-weight: 600; }

.flash-area { max-width: 1440px; margin: 16px auto -6px; padding: 0 24px; }
.flash {
  padding: 11px 15px; border-radius: var(--radius-sm); margin-bottom: 9px;
  font-size: 13.5px; font-weight: 500; border: 1px solid; box-shadow: var(--shadow);
}
.flash.ok { background: var(--success-soft); border-color: var(--success-soft-border); color: var(--success); }
.flash.error, .flash.erro { background: var(--danger-soft); border-color: var(--danger-soft-border); color: var(--danger); }
.flash.aviso { background: var(--warn-soft); border-color: var(--warn-soft-border); color: var(--warn); }
.flash.info { background: var(--info-soft); border-color: var(--info-soft-border); color: var(--info); }
@media (max-width: 1024px) { .flash-area { padding: 0 14px; } }

/* ===========================================================================
   Barra de mês e atalhos
   =========================================================================== */

.mes-barra {
  display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap;
}
.mes-atual {
  font-size: 15px; font-weight: 700; text-transform: capitalize;
  min-width: 175px; text-align: center;
}
.atalhos { display: flex; gap: 8px; flex-wrap: wrap; }
.atalho {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600;
  text-decoration: none;
}
.atalho:hover { background: var(--surface-alt); text-decoration: none; }

/* ===========================================================================
   Funil — barra de etapas e quadro
   =========================================================================== */

.funil { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.funil-item {
  flex: 1 1 116px; padding: 11px 13px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--muted); text-decoration: none;
  transition: border-color var(--transicao), background var(--transicao);
}
.funil-item:hover, .funil-item.ativo {
  border-color: var(--primary-soft-border); background: var(--primary-soft); text-decoration: none;
}
.funil-num {
  display: block; font-size: 20px; font-weight: 700; color: var(--text);
  font-family: var(--fonte-mono); font-variant-numeric: tabular-nums;
}
.funil-rot { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; }

/* Faixas topo / meio / fundo. Cada fase é um bloco com as suas colunas em
   linha; empilhar as fases (em vez de nove colunas num único rolamento
   horizontal) deixa o funil inteiro caber na tela, que é como a equipe gosta
   de trabalhar. */
.funil-quadro { display: flex; flex-direction: column; gap: 16px; }
.funil-fase {
  border: 1px solid var(--border); border-left: 3px solid var(--primary);
  border-radius: var(--radius); background: var(--surface-alt); padding: 12px 14px;
}
.funil-fase[data-fase="saida"] { border-left-color: var(--border); }
.funil-fase-cab {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 10px; padding: 0 2px;
}
.funil-fase-titulo {
  font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
}
.funil-fase-desc {
  display: block; font-size: 11.5px; color: var(--muted); font-weight: 500;
  text-transform: none; letter-spacing: 0; margin-top: 1px;
}
.funil-fase-total {
  font-family: var(--fonte-mono); font-variant-numeric: tabular-nums;
  font-weight: 700; font-size: 16px; color: var(--text);
}

.kanban {
  display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; padding-bottom: 2px;
}
.kanban-col {
  flex: 0 0 244px; background: var(--surface-alt);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 150px;
}
.kanban-col.sobre { border-color: var(--primary); background: var(--primary-soft); }
.kanban-topo {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 2px 5px 10px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-2);
}
.kanban-titulo { display: inline-flex; align-items: center; gap: 7px; }
/* padding/border zerados de propósito: a classe de cor (ex.: `aviso`) também
   casa com a caixa de alerta `.aviso`, que tem padding — sem isto o pontinho
   de 7px incharia para um oval. */
.kanban-ponto {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  padding: 0; border: 0; background: var(--faint);
}
.kanban-ponto.ok { background: var(--success); }
.kanban-ponto.erro { background: var(--danger); }
.kanban-ponto.aviso { background: var(--warn); }
.kanban-ponto.info { background: var(--info); }
.kanban-ponto.roxo { background: var(--roxo); }
.kanban-ponto.neutro { background: var(--faint); }

/* Indicador de follow-up no cartão do kanban (title nativo no hover). */
.kanban-fu {
  display: inline-flex; align-items: center; gap: 3px; cursor: help;
  color: var(--faint); font-size: 11px; font-weight: 700;
}
.kanban-fu svg { width: 14px; height: 14px; }
.kanban-fu--tem { color: var(--primary); }

/* Topo do cartão: nome + atalhos de contato (WhatsApp / e-mail). */
.kanban-card-topo { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.kanban-contatos { display: inline-flex; gap: 5px; flex: none; }
.kanban-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  transition: background var(--transicao), border-color var(--transicao), color var(--transicao);
}
.kanban-ic svg { width: 14px; height: 14px; }
.kanban-ic--wpp { color: #1fa855; }
.kanban-ic--wpp:hover { background: #e7f6ec; border-color: #bfe6cd; }
.kanban-ic--email { color: var(--info); }
.kanban-ic--email:hover { background: var(--info-soft); border-color: var(--info-soft-border); }

/* Etiquetas do cartão: status clicável + curso. */
.kanban-etiquetas { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.kanban-status-form { margin: 0; }
.sel-status--mini {
  min-width: 0; max-width: 150px; font-size: 10px;
  padding: 3px 20px 3px 8px; background-position: right 5px center;
}
.kanban-etq-curso {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  color: var(--text-2); background: var(--surface-alt);
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 3px 9px; max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.kanban-lista { display: flex; flex-direction: column; gap: 8px; }
.kanban-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 12px; cursor: grab;
  box-shadow: var(--shadow);
  transition: border-color var(--transicao), box-shadow var(--transicao), transform .1s ease;
}
.kanban-card:hover { border-color: #d6d3ce; box-shadow: var(--shadow-md); }
.kanban-card:active { cursor: grabbing; }
.kanban-card.arrastando { opacity: .45; transform: scale(.98); }
.kanban-nome { display: block; font-weight: 600; font-size: 13px; color: var(--text); line-height: 1.3; }
.kanban-nome:hover { color: var(--primary); }
.kanban-meta {
  font-size: 11px; color: var(--muted); margin-top: 3px; text-transform: uppercase;
  letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kanban-rodape { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; }
.kanban-valor { font-size: 12px; font-weight: 700; color: var(--primary); }
.kanban-data { font-size: 11px; color: var(--faint); font-family: var(--fonte-mono); }
.kanban-vazio { font-size: 12px; color: var(--faint); text-align: center; padding: 16px 0; }
.kanban-mais { display: block; text-align: center; font-size: 11.5px; padding: 8px; color: var(--muted); }
@media (max-width: 640px) { .kanban-col { flex-basis: 84vw; } }

/* ===========================================================================
   Ranking, extrato e bonificação
   =========================================================================== */

.ranking-lista { display: grid; gap: 8px; }
.ranking-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface);
}
.ranking-item.podio-1 { border-color: var(--primary-soft-border); background: var(--primary-soft); }
.ranking-pos {
  flex: none; width: 30px; text-align: center; font-size: 15px; font-weight: 700; color: var(--muted);
}
.podio-1 .ranking-pos, .podio-2 .ranking-pos, .podio-3 .ranking-pos { color: var(--text); }
.ranking-nome { flex: 1; min-width: 0; font-weight: 600; }
.ranking-sub { font-size: 11.5px; color: var(--muted); font-weight: 400; margin-top: 1px; }
.ranking-pontos { flex: none; font-size: 17px; font-weight: 700; color: var(--primary); }

.extrato-linha {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border-soft);
}
.extrato-linha:last-child { border-bottom: 0; }
.extrato-desc { flex: 1; min-width: 0; font-size: 13.5px; }
.extrato-nota { font-size: 11.5px; color: var(--faint); margin-top: 1px; }
.extrato-qtd { color: var(--muted); font-family: var(--fonte-mono); font-size: 13px; }
.extrato-pts { flex: none; min-width: 54px; text-align: right; font-weight: 700; color: var(--text); }
.extrato-pts.zero { color: var(--faint); font-weight: 400; }
.extrato-total {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px; margin-top: 6px; border-top: 2px solid var(--border);
  font-size: 15px; font-weight: 700;
}

.bonus-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.bonus-card { background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 17px; }
.bonus-linha {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 7px 0; border-bottom: 1px solid var(--border-soft); font-size: 13.5px;
}
.bonus-linha:last-child { border-bottom: 0; }
.bonus-total { font-size: 24px; font-weight: 700; color: var(--primary); }

.criterios { display: grid; gap: 8px; }
.criterio {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); font-size: 13.5px;
}
.criterio.atendido { border-color: var(--success-soft-border); background: var(--success-soft); }
.criterio.falhou { border-color: var(--danger-soft-border); background: var(--danger-soft); }
.criterio-marca { flex: none; font-size: 15px; line-height: 1.4; }
.criterio-rot { font-weight: 600; }
.criterio-detalhe { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ---- Metas ---- */
.progresso {
  height: 7px; border-radius: var(--radius-pill); background: var(--border);
  overflow: hidden; min-width: 90px;
}
.progresso-fill { height: 100%; border-radius: inherit; background: var(--primary); transition: width .3s ease; }
.progresso-fill.batida { background: var(--success); }
.meta-num { white-space: nowrap; }

/* ---- Série mensal (barras) ---- */
.serie { display: flex; align-items: flex-end; gap: 6px; height: 132px; padding-top: 10px; }
.serie-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.serie-barra {
  width: 100%; max-width: 30px; border-radius: 5px 5px 0 0;
  background: var(--primary); min-height: 3px;
}
.serie-rot {
  font-size: 10px; color: var(--muted); text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}

/* ===========================================================================
   Rotinas — escala e ordem do presencial
   =========================================================================== */

.escala-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.escala-dia {
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface);
}
/* Hoje é o dia que decide a ordem do atendimento presencial — destacado. */
.escala-dia.hoje { border-color: var(--primary); background: var(--primary-soft); }
/* Feriado não consome a vez de ninguém: fica visível, mas apagado. */
.escala-dia.nao-letivo { background: var(--surface-alt); opacity: .6; }
.escala-dia.nao-letivo .escala-nome { font-style: italic; font-weight: 500; }
.escala-data { font-size: 11px; color: var(--muted); font-family: var(--fonte-mono); }
.escala-nome { font-size: 13px; font-weight: 600; margin-top: 2px; }
.realizado, .dia-cumprido { color: var(--success); }

.ordem-fila { display: grid; gap: 7px; }
.ordem-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); font-size: 13.5px;
}
.ordem-item.primeiro { border-color: var(--primary-soft-border); background: var(--primary-soft); font-weight: 600; }
.ordem-num {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface-alt); border: 1px solid var(--border);
  display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--muted);
}
.ordem-item.primeiro .ordem-num { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---- Ficha: pares rótulo/valor ---- */
.ficha-linha {
  display: flex; gap: 14px; align-items: baseline;
  padding: 8px 0; border-bottom: 1px solid var(--border-soft);
}
.ficha-linha:last-child { border-bottom: 0; }
.ficha-rot {
  flex: 0 0 160px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted);
}
.ficha-val { flex: 1; min-width: 0; font-size: 13.5px; }
@media (max-width: 560px) {
  .ficha-linha { display: block; }
  .ficha-rot { display: block; margin-bottom: 2px; }
}

/* ===========================================================================
   Timeline e agenda
   =========================================================================== */

.form-atividade { padding-bottom: 16px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }

.timeline, .pend-lista { list-style: none; }
.tl-item, .pend-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border-soft);
}
.tl-item:last-child, .pend-item:last-child { border-bottom: 0; }
.tl-ic, .pend-ic {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px;
  background: var(--surface-alt); border: 1px solid var(--border);
}
.tl-pendente .tl-ic { border-color: var(--info-soft-border); background: var(--info-soft); }
.tl-atrasada .tl-ic, .pend-item.atrasada .pend-ic {
  border-color: var(--danger-soft-border); background: var(--danger-soft);
}
.tl-corpo, .pend-corpo { flex: 1; min-width: 0; }
.tl-desc { font-size: 13.5px; }
.tl-meta, .pend-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.tl-acao, .pend-acao { flex: none; }
.pend-nome { font-weight: 600; font-size: 14px; color: var(--text); }
.pend-nome:hover { color: var(--primary); }
.pend-desc { font-size: 13px; color: var(--text-2); margin-top: 1px; }

.agenda-hoje { border-left: 3px solid var(--primary); }

/* ===========================================================================
   Ofertas e registros de pós-venda
   =========================================================================== */

.ofertas-lista { list-style: none; }
.oferta-item {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 0; border-bottom: 1px solid var(--border-soft);
}
.oferta-item:last-child { border-bottom: 0; }
.oferta-ordem {
  flex: none; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted);
  background: var(--surface-alt); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: var(--radius-pill);
}
.oferta-valor { font-size: 15px; font-weight: 700; color: var(--primary); }
.oferta-obs { flex: 1; min-width: 120px; font-size: 12.5px; color: var(--text-2); }
.oferta-data { font-size: 11.5px; color: var(--faint); font-family: var(--fonte-mono); }
.oferta-remover { margin-left: auto; }

.oferta-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.oferta-form input[type="text"] { flex: 1; min-width: 140px; width: auto; }

.pv-registros { list-style: none; margin-bottom: 6px; }
.pv-registro {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 10px 0; border-bottom: 1px solid var(--border-soft);
}
.pv-registro:last-child { border-bottom: 0; }
.pv-ic {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px;
  background: var(--surface-alt); border: 1px solid var(--border);
}
.pv-corpo { flex: 1; min-width: 0; }
.pv-desc { font-size: 13.5px; }
.pv-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.pv-acoes { flex: none; }
.pv-acoes form { display: flex; gap: 6px; }

/* ===========================================================================
   Login
   =========================================================================== */

.login-wrap {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center; padding: 24px; background: var(--bg);
}
.login-card {
  width: 100%; max-width: 380px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px 30px; box-shadow: var(--shadow-md);
}
/* A logomarca completa, em laranja sobre o card branco — aqui há espaço para
   ela, ao contrário do selo de 30px da coluna. */
.login-logo { display: block; height: auto; max-width: 168px; margin-bottom: 20px; }
.login-card h1 { font-size: 21px; }
.login-card p { font-size: 13px; }

/* ===========================================================================
   Utilitários
   =========================================================================== */

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 18px; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.texto-erro { color: var(--danger); }
.linha-total th { border-top: 2px solid var(--borda); font-weight: 600; }

/* Relatórios ------------------------------------------------------------ */
.kpi-delta { margin-top: 4px; font-size: 12.5px; }
.delta { font-weight: 600; }
.delta-sobe { color: var(--success); }
.delta-cai { color: var(--danger); }
.delta-igual { color: var(--muted); }

.opcoes-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
}
.opcoes-rot { font-weight: 600; color: var(--muted); }
.opcoes-print { margin-left: auto; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.celula-lider { font-weight: 700; color: var(--primary); }

/* Impressão: só o relatório, sem menu, filtros nem botões. */
@media print {
  .topbar, .nav-scrim, .flash-area, .filtros, .opcoes-bar,
  .opcoes-print, .skip-link { display: none !important; }
  .conteudo-area, .container { margin: 0 !important; padding: 0 !important; max-width: none !important; }
  .card { break-inside: avoid; box-shadow: none; }
  body { background: #fff; }
}

@media print {
  .topbar, .nav-scrim, .page-acoes, .btn { display: none !important; }
  .card, .tabela-wrap { box-shadow: none; border-color: #ccc; }
}

/* ===========================================================================
   Redesenho do topo do funil
   =========================================================================== */

/* Aviso pequeno e vermelho: quantas tarefas vencem hoje. Cabe na navegação
   (junto de "Tarefas Agendadas") e no topo da lista do CRM. */
.aviso-hoje {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 7px; border-radius: var(--radius-pill);
  background: var(--danger-soft); color: var(--danger);
  border: 1px solid var(--danger-soft-border);
  font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums;
  cursor: help; white-space: nowrap; line-height: 1.5;
}
.aviso-hoje span[aria-hidden] { font-size: 10px; }
/* No item de navegação ativo (fundo laranja) o aviso mantém o vermelho legível
   sobre fundo claro próprio. */
.snav-item.ativo .aviso-hoje { background: #fff; }

/* Menu "Métricas" na navegação: o gatilho parece um item de destino; a setinha
   gira quando aberto. O balão reusa .menu-pop (posicionado como fixed). */
.snav-menu { flex: none; }
.snav-menu-sum { gap: 5px; }
.snav-menu-seta { font-size: 11px; color: var(--muted); transition: transform var(--transicao); }
.snav-menu[open] .snav-menu-seta { transform: rotate(180deg); }
.snav-menu-sum.ativo { background: var(--primary); color: #fff; }
.snav-menu-sum.ativo .snav-menu-seta { color: #fff; }

/* Emoji de tarefa na coluna Follow-up da lista: alerta (vence hoje/atrasada)
   ou simples (tem tarefa futura). O balão nativo (title) mostra a tarefa. */
.fu-emoji { display: inline-flex; align-items: center; font-size: 13px; cursor: help; line-height: 1; }
.fu-emoji--alerta { filter: none; }

/* Emoji de tarefa no cartão do kanban. */
.kanban-tarefa--alerta {
  background: var(--danger-soft); color: var(--danger);
  border-color: var(--danger-soft-border); font-weight: 700;
}

/* Última data de contato no cartão do kanban. */
.kanban-ultcontato {
  margin-top: 6px; font-size: 11px; color: var(--muted);
  font-family: var(--fonte-mono);
}
.kanban-ultcontato-rel { color: var(--faint); }

/* ---- Balão (modal) da ficha, aberto ao clicar no cartão ---- */
body.modal-aberto { overflow: hidden; }
.ficha-modal { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; }
/* Sem esta regra, o display:grid acima venceria o atributo hidden e o balão
   apareceria vazio ao abrir a tela. Ele só deve surgir ao clicar num cartão. */
.ficha-modal[hidden] { display: none; }
.ficha-modal-scrim { position: absolute; inset: 0; background: rgba(28, 25, 23, .5); }
.ficha-modal-caixa {
  position: relative; z-index: 1;
  width: min(760px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
  overflow: auto; background: var(--surface);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 20px 22px 24px;
}
.ficha-modal-x {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px; display: grid; place-items: center;
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: var(--radius-xs); cursor: pointer; font-size: 14px; color: var(--muted);
}
.ficha-modal-x:hover { background: var(--danger-soft); color: var(--danger); }
.ficha-modal-cabeca {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 16px; padding-right: 36px;
}
.ficha-modal-titulo { font-size: 18px; margin: 0; }
.ficha-modal-sub { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }

/* ---- Compositor de WhatsApp (modal global, envio pela API do RD) ---- */
.wpp-cabeca { margin-bottom: 14px; padding-right: 36px; }
.wpp-modos { display: flex; gap: 8px; margin-bottom: 12px; }
.wpp-modo {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px 12px; font-size: 13px;
}
.wpp-modo:has(input:checked) { border-color: var(--accent); background: var(--surface-alt); }
.wpp-texto {
  width: 100%; resize: vertical; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font: inherit; font-size: 14px;
}
.wpp-preview {
  margin: 10px 0; padding: 10px 12px; white-space: pre-wrap;
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; color: var(--muted);
}
.wpp-variaveis { display: grid; gap: 8px; margin-top: 8px; }
.wpp-variavel { display: grid; gap: 3px; font-size: 12.5px; color: var(--muted); }
.wpp-variavel input {
  padding: 7px 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font: inherit; font-size: 14px;
}
.wpp-enviar-como { margin-bottom: 12px; }
.wpp-acoes { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.wpp-resultado { margin: 10px 0 0; }

/* ---- Exportar lista para disparo (botão verde WhatsApp + modal) ---- */
.btn-zap {
  display: inline-flex; align-items: center; gap: 7px;
  background: #25d366; border-color: #25d366; color: #fff;
}
.btn-zap:hover { background: #1eb457; border-color: #1eb457; color: #fff; }
.btn-zap svg { display: block; }
.export-grade {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px; margin: 10px 0;
}
.export-status { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.export-multi {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  max-height: 132px; overflow: auto;
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px;
}
.export-resultado { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.export-barra { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.export-lista {
  max-height: 40vh; overflow: auto;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.export-linha {
  display: grid; grid-template-columns: 22px 1fr auto; align-items: center;
  gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--border);
  font-size: 13.5px; cursor: pointer; margin: 0;
}
.export-linha:last-child { border-bottom: 0; }
.export-linha:hover { background: var(--surface-alt); }
.export-tel { color: var(--muted); font-variant-numeric: tabular-nums; }
.export-rodape {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 14px; flex-wrap: wrap;
}
.export-formato { display: flex; align-items: center; gap: 12px; font-size: 13px; }

/* ---- Documentos da análise curricular ---- */
.doc-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.doc-cat { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.doc-lista { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.doc-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.doc-upload { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.doc-upload input[type="file"] { font-size: 12px; max-width: 100%; }
.btn-lixo {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  font-size: 13px; line-height: 1; padding: 2px 6px; border-radius: var(--radius-xs);
}
.btn-lixo:hover { background: var(--danger-soft); color: var(--danger); }

/* ---- Barra de filtros compacta do CRM (uma linha) ---- */
.filtros-crm { padding: 12px 14px; }
.filtros-crm .busca-filtros {
  display: flex; flex-wrap: wrap; align-items: end; gap: 8px 10px;
}
.filtros-crm .campo { flex: 1 1 120px; min-width: 104px; margin: 0; }
.filtros-crm .campo--busca { flex: 2 1 180px; }
.filtros-crm .campo label {
  font-size: 10px; letter-spacing: .03em; margin-bottom: 3px;
}
.filtros-crm .campo input,
.filtros-crm .campo select {
  height: 34px; font-size: 12.5px; padding: 5px 8px; width: 100%;
}
.filtros-crm .busca-linha {
  display: flex; align-items: center; gap: 14px; margin-top: 10px; flex-wrap: wrap;
}
.filtros-crm .busca-linha .chk-inline { font-size: 12.5px; }

/* Flash de "salvo" após gravar um campo por fetch (sem recarregar). */
.cel-salvo {
  outline: 2px solid var(--success); outline-offset: 0;
  background: var(--success-soft) !important;
  transition: outline-color .9s ease, background .9s ease;
}

/* Botão "Salvar alterações" do painel: fica verde ao confirmar a gravação. */
.btn-salvar-painel.salvo {
  background: var(--success); border-color: var(--success); color: #fff;
}
.btn-salvar-painel.salvo:hover {
  background: var(--success); border-color: var(--success); color: #fff;
}
