/* TATAME — CRM (CRM-03): subabas Interessados e Acompanhamento em Alunos e a ficha do interessado.
   Usa os tokens e componentes de app.css (lista em linhas, tag, card, abas, formulário). Aqui fica só o que é do CRM. */

/* ---------- Busca e filtros: busca em cima e filtros embaixo (duas colunas no celular, lado a lado no desktop) ----------
   Um seletor nativo tem a largura da opção mais longa ("Aula experimental agendada"): os quatro juntos não deixam espaço
   para a busca na mesma linha, então ela fica sempre na própria linha. */
.crm-toolbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.crm-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 900px) {
  .crm-toolbar .search { max-width: 420px; }
  .crm-filters { display: flex; flex-wrap: wrap; gap: 8px; }
  .crm-filters select.input { width: auto; max-width: 260px; }
}

/* ---------- Resultados ---------- */
.crm-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; margin-bottom: 4px; }
#crm-results[aria-busy="true"] .crm-list, #crm-results[aria-busy="true"] .crm-status { opacity: .55; transition: opacity .2s; }
.crm-skel .skeleton { height: 58px; margin-bottom: 8px; }
.crm-empty-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.crm-more { display: flex; justify-content: center; padding: 8px 0 4px; }
.crm-more .btn { min-width: 180px; }

/* Linha do interessado. Celular: um cartão com o nome em cima e duas linhas de dados (etapa, contato e origem; responsável e
   atualização), sem tabela espremida. Desktop: uma coluna para cada, com cabeçalho (.crm-meta e .crm-l somem do layout). */
.crm-thead { display: none; }
.crm-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.crm-c-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.crm-c-name .grow { display: flex; flex-direction: column; min-width: 0; }
.crm-c-name b { font-weight: 500; }
.crm-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-left: 46px; color: var(--muted); font-size: 12px; }
.crm-l { display: flex; flex-wrap: wrap; align-items: center; min-width: 0; }
.crm-l > span { max-width: 100%; }
.crm-l > span + span::before { content: '·'; margin: 0 6px; color: var(--faint); }
.crm-c-stage { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-right: 8px; }
.crm-l > .crm-c-stage + span::before { content: none; }
@media (min-width: 900px) {
  .crm-thead, .crm-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr) minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, .8fr); gap: 16px; align-items: center; }
  .crm-thead { display: grid; margin: 0 -10px; padding: 0 10px 10px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 500; color: var(--muted); }
  .crm-thead + .list .item:first-child::before { display: none; }
  .crm-row { padding-block: 10px; }
  .crm-meta, .crm-l { display: contents; }
  .crm-l > span + span::before { content: none; }   /* mesma especificidade da regra do celular, declarada depois */
  .crm-m-l { display: none; }
  .crm-row > *, .crm-l > * { grid-row: 1; }
  .crm-c-name { grid-column: 1; } .crm-c-contact { grid-column: 2; } .crm-c-stage { grid-column: 3; margin: 0; }
  .crm-c-source { grid-column: 4; } .crm-c-owner { grid-column: 5; } .crm-c-upd { grid-column: 6; }
  .crm-c-contact, .crm-c-source, .crm-c-owner { font-size: 13px; color: var(--text-2); }
  .crm-c-upd { font-size: 12px; color: var(--muted); }
}

/* ---------- Ficha ---------- */
.crm-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.crm-note { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 12px; border: 1px solid rgba(232,180,76,.35); background: var(--warn-soft); border-radius: var(--r-lg); }
.crm-note.good { border-color: rgba(60,192,142,.35); background: var(--good-soft); }
.crm-note b { display: block; font-size: 13.5px; font-weight: 600; }
.crm-note span { color: var(--text-2); font-size: 13px; }
.crm-note a, .crm-dl a, .crm-dups a { color: var(--accent-fg); text-decoration: none; }
.crm-dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px 24px; margin: 0; }
.crm-dl dt { margin-bottom: 3px; color: var(--muted); font-size: 12px; font-weight: 500; }
.crm-dl dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
@media (min-width: 900px) { .crm-dl { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
.crm-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
@media (max-width: 899px) { .crm-acts .btn { flex: 1 1 140px; } }

/* ---------- Possível duplicidade: aviso, nunca bloqueio ---------- */
.crm-dups { margin-bottom: 12px; padding: 10px 12px; border: 1px solid rgba(232,180,76,.35); background: var(--warn-soft); border-radius: var(--r); font-size: 13px; }
.crm-dups-h { display: flex; align-items: center; gap: 6px; color: var(--warn); }
.crm-dups-h b { font-weight: 600; }
.crm-dups p { margin: 4px 0 6px; color: var(--text-2); font-size: 12.5px; }
.crm-dups ul { margin: 0; padding: 0; list-style: none; }
.crm-dups li { padding: 3px 0; overflow-wrap: anywhere; }
.crm-dups li .muted { font-size: 12px; }
#crm-dups:empty { display: none; }
#crm-dups .crm-dups { margin-bottom: 0; }

/* ---------- Formulário ---------- */
#crm-form [hidden] { display: none; }
/* No telefone, uma coluna: em meia largura os seletores cortam etapas e nomes ("Aula experimental agendada"). */
@media (max-width: 520px) { #crm-form.form-grid { grid-template-columns: minmax(0, 1fr); } }
.crm-hint { margin: -8px 0 0; }

/* ===================== CRM-04: funil, perda e histórico ===================== */
/* Lista ou funil: botão segmentado no fim dos filtros (no celular, ocupa uma célula da grade com a altura dos campos). */
.crm-mode button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
@media (max-width: 899px) { .crm-mode button { height: 38px; } }
@media (min-width: 900px) { .crm-mode { margin-left: auto; } }
/* Etapas com contadores (filtro da lista). */
#crm-stages:empty { display: none; }
.crm-chips { margin: -4px 0 12px; }
.crm-lost-l { font-size: 12px; color: var(--warn); }

/* Funil no celular: uma linha por etapa, com o tamanho relativo. */
.crm-fun-sum { margin: 0 0 8px; }
.crm-frow { gap: 12px; }
.crm-frow b { display: block; font-weight: 500; }
.crm-fbar { display: block; height: 5px; margin-top: 7px; border-radius: 99px; background: var(--track); overflow: hidden; }
.crm-fbar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.crm-fnum { min-width: 2ch; text-align: right; font-size: 15px; font-weight: 600; }
.crm-frow > svg { flex: none; color: var(--muted); }
.crm-frow.lost b { color: var(--warn); }

/* Funil no desktop: colunas por etapa; o cartão é arrastável e tem um botão de mover (teclado e toque). */
.crm-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: 10px; align-items: start; overflow-x: auto; padding-bottom: 6px; }
.crm-col { min-height: 140px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-lg); transition: border-color .15s, background .15s; }
.crm-col.over { border-color: rgba(74,132,245,.6); background: var(--accent-soft); }
.crm-col header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.crm-col header b { font-weight: 600; }
.crm-col header .num { color: var(--muted); font-size: 12px; }
.crm-col-body { display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.crm-col-empty { margin: 6px 2px; color: var(--faint); font-size: 12.5px; }
.crm-kcard { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 10px 10px 6px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r); cursor: grab; }
.crm-kcard.dragging { opacity: .45; }
.crm-kname { color: var(--text); font-size: 13.5px; font-weight: 500; text-decoration: none; }
.crm-kname:hover { color: var(--accent-fg); }
.crm-kfoot { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.crm-kfoot .icon-btn { width: 28px; height: 28px; }

/* Ficha: no desktop, funil e histórico à esquerda, dados à direita. No celular, nessa ordem, empilhados. */
.crm-detail { display: grid; gap: 24px 32px; }
@media (min-width: 900px) { .crm-detail { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; } }
.crm-funil-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.crm-funil-h b { font-size: 16px; font-weight: 600; }
.crm-steps { display: flex; gap: 4px; margin: 12px 0 14px; padding: 0; list-style: none; }
.crm-steps li { flex: 1; min-width: 0; }
.crm-steps li::before { content: ""; display: block; height: 6px; border-radius: 99px; background: var(--track); }
.crm-steps li.done::before { background: rgba(74,132,245,.45); }
.crm-steps li.on::before { background: var(--accent); }
.crm-steps li span { display: block; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11.5px; }
.crm-steps li.on span { color: var(--text); font-weight: 600; }
@media (max-width: 899px) { .crm-steps li span { display: none; } }   /* no celular só a barra: o nome da etapa está no cabeçalho */
.crm-funil-acts { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 899px) { .crm-funil-acts .btn { flex: 1 1 auto; } }
.crm-hist-sec .section-title { margin-top: 28px; }
.crm-detail-main > .crm-hist-sec:first-child .section-title { margin-top: 4px; }
.crm-lost .grow { display: flex; flex-direction: column; gap: 3px; }
.crm-note .crm-lost-r { color: var(--text); }

/* Histórico: linha do tempo; movimentações no funil com ícone azul e sem texto livre. */
.crm-tl { margin: 0 0 10px; padding: 0; list-style: none; }
.crm-ev { display: flex; gap: 12px; padding: 12px 0; }
.crm-ev + .crm-ev { border-top: 1px solid var(--line); }
.crm-ev-ic { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text-2); }
.crm-ev.sys .crm-ev-ic { background: var(--accent-soft); border-color: rgba(74,132,245,.35); color: var(--accent-fg); }
.crm-ev[data-kind="aula_experimental"] .crm-ev-ic { color: var(--good); }
.crm-ev-main { flex: 1; min-width: 0; }
.crm-ev-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.crm-ev-h b { font-size: 13.5px; font-weight: 500; }
.crm-ev.sys .crm-ev-h b { color: var(--text-2); }
.crm-ev-b { margin: 4px 0 0; font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.crm-ev-l { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; color: var(--text-2); font-size: 12px; }
.crm-ev-acts { flex: none; align-self: flex-start; display: flex; gap: 2px; }
.crm-hist-empty { margin: 4px 0 0; }

/* Folhas: mover (etapas), perda (motivos) e interação (tipos). Opções grandes, fáceis de tocar. */
.crm-move-sub { margin: -6px 0 12px; }
.crm-move-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.crm-move-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font-size: 14px; font-weight: 500; text-align: left; transition: border-color .15s, background .15s; }
.crm-move-opt:hover:not([disabled]) { border-color: rgba(74,132,245,.6); background: var(--accent-soft); }
.crm-move-opt[disabled] { opacity: .6; cursor: default; }
.crm-move-opt.suggest { border-color: rgba(74,132,245,.45); }
.crm-move-opt em { color: var(--muted); font-size: 12px; font-style: normal; }
.crm-move-note { margin: 0 0 12px; }
.crm-reasons, .crm-kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 14px; }
@media (min-width: 520px) { .crm-kinds { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.crm-reason, .crm-kind { position: relative; display: block; }
.crm-reason input, .crm-kind input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.crm-reason span, .crm-kind span { display: flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2); font-size: 13.5px; font-weight: 500; transition: border-color .15s, background .15s, color .15s; }
.crm-reason input:checked + span, .crm-kind input:checked + span { border-color: rgba(74,132,245,.7); background: var(--accent-soft); color: var(--text); }
.crm-reason input:focus-visible + span, .crm-kind input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.crm-int-form .field, #crm-lose-form .field { margin-bottom: 14px; }
.crm-int-form [hidden], #crm-lose-form [hidden] { display: none; }

/* ---------- CRM-05: tarefas (central, fichas, Painel e folhas) ----------
   Linha: círculo de concluir, título (abre a tarefa) e uma linha de dados (vencimento, ficha, responsável) que quebra sem
   separadores soltos. Atrasada em vermelho, do dia em azul. */
.crm-tk-seg { align-self: flex-start; }
.crm-tk-seg button { white-space: nowrap; }
@media (max-width: 899px) { .crm-tk-seg { align-self: stretch; } }
.chip.late .muted { color: var(--bad); }
/* Situações quebram em linhas em vez de rolar de lado (todas à vista no celular); filtro sozinho ocupa a linha. */
.crm-tk-chips { flex-wrap: wrap; gap: 4px 2px; overflow: visible; }
.crm-tk-tools .crm-filters > :only-child { grid-column: 1 / -1; }
@media (min-width: 900px) { .crm-tk-tools .crm-filters > :only-child { grid-column: auto; } }
.crm-tk { align-items: flex-start; }
.crm-tk-check { flex: none; display: grid; place-items: center; width: 26px; height: 26px; margin-top: -1px; border-radius: 50%; border: 1.5px solid var(--line-3);
  color: transparent; transition: border-color .15s, color .15s, background .15s; }
.crm-tk.late .crm-tk-check { border-color: rgba(240,107,115,.55); }
.crm-tk-check:not(:disabled):focus-visible { border-color: var(--good); color: var(--good); }
.crm-tk-check:disabled { opacity: .4; cursor: not-allowed; }
.crm-tk-check.on { border-color: var(--good); background: var(--good-soft); color: var(--good); }
.crm-tk-check.loading { color: transparent; }
@media (hover: hover) { .crm-tk-check:not(:disabled):hover { border-color: var(--good); color: var(--good); } .crm-tk-title:hover { color: var(--accent-fg); } .crm-tk-who:hover { color: var(--accent-fg); } }
.crm-tk-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.crm-tk-title { align-self: flex-start; max-width: 100%; padding: 0; text-align: left; font-size: 14px; font-weight: 500; color: var(--text); overflow-wrap: anywhere; transition: color .15s; }
.crm-tk.done .crm-tk-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.crm-tk-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; font-size: 12.5px; color: var(--muted); }
.crm-tk-meta > * { min-width: 0; max-width: 100%; }
.crm-tk-who { display: inline-flex; min-width: 0; color: var(--text-2); text-decoration: none; }
.crm-tk-kind { flex: none; margin-left: .3em; }
.crm-due { font-weight: 500; color: var(--text-2); }
.crm-due.hoje { color: var(--accent-fg); }
.crm-due.late { color: var(--bad); }
.crm-tk-risk { margin: 18px 0 0; }
.crm-tk-risk .link { font-size: inherit; }
/* Fichas */
.crm-tk-sec { margin-bottom: 8px; }
.crm-tk-note { margin: -6px 0 6px; }
.crm-tk-none { margin: 2px 0 12px; }
.crm-tk-toggle { display: inline-block; margin: 2px 0 10px; padding: 4px 0; }
#crm-tasks[aria-busy="true"] .crm-tk-list { opacity: .6; transition: opacity .2s; }
/* Painel: três números (vencidas, hoje, próximas) e as primeiras tarefas */
.crm-dash { margin-bottom: 8px; }
.crm-dash-ks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 4px; }
.crm-dash-k { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r); color: var(--muted); font-size: 12.5px; text-decoration: none; transition: background .15s, border-color .15s; }
.crm-dash-k b { font-family: var(--display); font-size: 22px; font-weight: 600; line-height: 1.15; color: var(--text); font-variant-numeric: tabular-nums; }
.crm-dash-k.late { border-color: rgba(240,107,115,.35); background: var(--bad-soft); }
.crm-dash-k.late b { color: var(--bad); }
.crm-dash-k.hoje b { color: var(--accent-fg); }
@media (hover: hover) { .crm-dash-k:hover { border-color: var(--line-3); } }
.crm-dash-empty { padding: 10px 0 14px; }
/* Folhas */
.crm-tk-form .field { margin-bottom: 14px; }
.crm-tk-for { margin: -6px 0 14px; overflow-wrap: anywhere; }
.crm-tk-when { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 10px; }
.crm-tk-when .field { margin-bottom: 8px; }
.crm-tk-quick { flex-wrap: wrap; margin-bottom: 14px; }
.crm-tk-quick .chip { border-color: var(--line-2); }
.crm-tk-form .crm-hint { margin: -4px 0 12px; }
.crm-tk-vt { margin: -4px 0 8px; font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.crm-tk-notes { margin: 0 0 16px; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.crm-tk-dl { margin-bottom: 4px; }
.crm-tk-why { margin: 14px 0 0; }
.crm-tk-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.crm-tk-acts .btn { flex: 1 1 120px; }

/* ---------- CRM-06: conversão em aluno ---------- */
.crm-lost-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.crm-conv-sub { margin: -6px 0 14px; }
.crm-conv-dups { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; padding: 12px 14px; border: 1px solid rgba(232,180,76,.35); border-radius: var(--r); background: var(--warn-soft); font-size: 13.5px; }
.crm-conv-dup { display: flex; align-items: center; gap: 10px; }
.crm-conv-dup .grow { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.crm-conv-dup a { color: var(--accent-fg); text-decoration: none; font-weight: 500; }
.crm-conv-mode { margin-bottom: 16px; }
.crm-conv-mode button { white-space: nowrap; }
.crm-conv-form .field { margin-bottom: 14px; }
.crm-conv-form [hidden] { display: none; }
.crm-conv-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
@media (max-width: 420px) { .crm-conv-row:has(input[type=email]) { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.crm-conv-form .crm-hint { margin: -4px 0 14px; }
.crm-conv-confirm { margin-bottom: 14px; padding: 14px; border: 1px solid var(--line-3); border-radius: var(--r); background: var(--surface-2); }
.crm-conv-what { margin: 6px 0 14px; color: var(--text-2); overflow-wrap: anywhere; }
.crm-note .btn { flex: none; }
.crm-note a.btn { color: #fff; }   /* o link azul de .crm-note não vale para o botão (texto azul sobre azul) */
.crm-note > .grow { flex: 1 1 240px; min-width: 0; }   /* no celular o botão desce para a linha de baixo */
/* Ficha do aluno: histórico comercial */
.crm-orig { margin-top: 18px; }
.crm-orig-sub { margin: -4px 0 12px; }

/* ---------- CRM-07: retenção ---------- */
.crm-ac-seg { align-self: flex-start; display: inline-flex; margin-bottom: 14px; }
.crm-ac-seg button { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
@media (max-width: 899px) { .crm-ac-seg { display: flex; } }
.crm-rt-note { margin: 0 0 12px; }
.crm-rt-note .link { font-size: inherit; }
.crm-rt-stats { margin-bottom: 8px; }
.crm-rt-k.warn .stat-value { color: var(--warn); }
.crm-rt-k.late .delta { color: var(--bad); }
@media (max-width: 899px) {
  .crm-rt-stats > .crm-rt-rate { grid-column: 1 / -1; }
  .crm-rt-stats .stat-value { font-size: 28px; }
}
@media (min-width: 900px) { .crm-rt-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.crm-rt-def { margin: 0 0 18px; max-width: 78ch; }
#crm-rt-results[aria-busy="true"] .crm-rt-list, #crm-rt-results[aria-busy="true"] .crm-status { opacity: .55; transition: opacity .2s; }
.crm-rt-tools .crm-filters select.input { min-width: 0; }
/* linha: aluno | dias | o que se sabe | ações */
.crm-rt { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who days" "meta meta" "acts acts"; gap: 8px 12px; align-items: center; padding: 12px 10px; }
.crm-rt-who { grid-area: who; display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.crm-rt-who .grow { display: flex; flex-direction: column; min-width: 0; }
@media (hover: hover) { .crm-rt-who:hover b { text-decoration: underline; text-underline-offset: 3px; } }
.crm-rt-days { grid-area: days; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; color: var(--muted); font-size: 11.5px; }
.crm-rt-days b { font-family: var(--display); font-size: 22px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.crm-rt-days.risk b { color: var(--warn); }
.crm-rt-days.back b { font-size: 16px; color: var(--good); }
.crm-rt-meta { grid-area: meta; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: var(--text-2); min-width: 0; }
.crm-rt-meta > span { overflow-wrap: anywhere; }
.crm-rt-tk { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-fg); }
.crm-rt-tk.late { color: var(--bad); }
.crm-rt-acts { grid-area: acts; display: flex; flex-wrap: wrap; gap: 8px; }
@media (min-width: 900px) {
  .crm-rt { grid-template-columns: minmax(200px, 1.1fr) 64px minmax(0, 2fr) auto; grid-template-areas: "who days meta acts"; }
  .crm-rt-acts { justify-content: flex-end; }
}
/* ficha do aluno */
.crm-ret { margin-bottom: 18px; }
.crm-ret-st { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 14px; padding: 12px 14px; margin-bottom: 6px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface-2); }
.crm-ret-st.risk { border-color: rgba(232,180,76,.35); }
.crm-ret-st > .grow { flex: 1 1 240px; min-width: 0; }
.crm-ret-h { margin: 0; overflow-wrap: anywhere; }
.crm-ret-h b { font-weight: 600; }
.crm-ret-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.crm-ret-back { display: flex; align-items: flex-start; gap: 6px; margin: 8px 0 0; color: var(--good); font-size: 13.5px; }
.crm-ret-back svg { flex: none; margin-top: 3px; }
.crm-ret-prof { margin: 6px 0 0; }
.crm-ret-none { margin: 10px 0; }
/* folha de contato */
.crm-ret-out[hidden], .crm-ret-task[hidden] { display: none; }
.crm-ret-l { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.crm-outs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 520px) { .crm-outs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.crm-ret-mk { display: flex; flex-direction: row; align-items: center; gap: 10px; margin-bottom: 12px; cursor: pointer; }
.crm-ret-mk input { width: 18px; height: 18px; margin: 0; flex: none; }
.crm-ret-mk span { display: inline; margin: 0; color: var(--text); font-size: 14px; }

/* ---------- CRM-08: relatórios ---------- */
.crm-rp-tools .crm-filters { align-items: center; }
.crm-rp-csv { justify-content: center; }
@media (max-width: 899px) { .crm-rp-csv { grid-column: 1 / -1; } }
.crm-rp-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.crm-rp-dates[hidden] { display: none; }
.crm-rp-dates .field { margin: 0; }
@media (min-width: 900px) { .crm-rp-dates { max-width: 420px; } }
.crm-rp-fnote { margin: 0; }
#crm-rp-body[aria-busy="true"] > :not(.crm-skel) { opacity: .55; transition: opacity .2s; }
.crm-rp-range { margin: 4px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.crm-rp-sec .section-title { margin-top: 32px; }
.crm-rp-def { margin: -2px 0 12px; max-width: 80ch; }
.crm-rp-cmp { margin: 8px 0 4px; }
.crm-rp-stats { margin-bottom: 6px; }
.crm-rp-stats .stat-value { font-size: 28px; }
.crm-rp-stats.one { grid-template-columns: minmax(0, 1fr); }
.crm-rp-stats.one > .stat { padding-left: 0; }
.crm-rp-k.good .stat-value { color: var(--good); }
.crm-rp-k.warn .stat-value { color: var(--warn); }
.crm-rp-k.late .stat-value { color: var(--bad); }
@media (max-width: 899px) { .crm-rp-stats:not(.one) > .stat:last-child:nth-child(odd) { grid-column: 1 / -1; border-left: 0; } }
@media (min-width: 900px) {
  .crm-rp-stats { grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); }
  .crm-rp-stats.one { grid-template-columns: minmax(0, 1fr); }
  .crm-rp-stats .stat-value { font-size: 30px; }
}
.crm-rp-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px 28px; margin-top: 10px; }
@media (min-width: 900px) { .crm-rp-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.crm-rp-h3 { margin: 16px 0 8px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.crm-rp-none { margin: 4px 0 8px; }
.crm-rp-chart { min-width: 0; margin-top: 16px; }
.crm-rp-cl { margin-bottom: 8px; }
/* barras horizontais */
.crm-rp-hbars { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 10px; }
.crm-rp-hbars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 13.5px; }
.crm-rp-hl { min-width: 0; overflow-wrap: anywhere; color: var(--text-2); }
.crm-rp-hv { font-weight: 600; font-variant-numeric: tabular-nums; }
.crm-rp-hv .muted { font-weight: 400; }
.crm-rp-track { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.crm-rp-track > span { display: block; height: 100%; border-radius: 3px; background: var(--accent); min-width: 2px; }
#rp-perdas .crm-rp-track > span { background: var(--warn); }
/* tabelas */
.crm-rp-tw { overflow-x: auto; margin-bottom: 6px; }
.crm-rp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.crm-rp-table th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--muted); padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.crm-rp-table td { padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.crm-rp-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.crm-rp-table th:last-child, .crm-rp-table td:last-child { padding-right: 0; }
/* interessados parados */
.crm-rp-stuck .crm-rp-p { display: flex; align-items: center; gap: 12px; }
.crm-rp-stuck .grow { display: flex; flex-direction: column; min-width: 0; flex: 1; }
