/* Casco das páginas do CRM (<body class="crm-v2">): cabeçalho, abas da página, aviso de
   novidades e funil de etapas. Também carregado por /captacao e /paineis/vendas. */

/* Cores próprias do CRM (status, calendário): verde e vermelho diferentes
   dos de base.css; usadas pelas pílulas (c-pill) e pelas marcações. */
:root {
  --success: #437a22;
  --success-soft: #e2eed8;
  --error: #a13544;
  --error-soft: #f5dfe3;
  --cal-meet: #6044b8;
  --cal-task: #01696f;
  --cal-bad: #b23a3a;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 24px;
  gap: 16px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.section-title {
  font-family: "Syne", sans-serif;
  font-size: 16px;
  font-weight: 700;
  margin: 24px 0 12px;
  color: var(--text);
}

.chart-card {
  padding: 20px;
}

.chart-card .ch {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--subtle);
  margin-bottom: 16px;
}

.chart-wrap {
  position: relative;
  width: 100%;
}

.c-table-wrap table {
  min-width: 720px;
}

.meta {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.kpi .v.warning {
  color: #c8711d;
}

/* ══════════════════════════════════════════════════════════════════════
   Revisão visual do CRM (out/2026): vale para as páginas com
   <body class="crm-v2"> (todas as do CRM, Captação e Vendas). Os tokens
   (--r-card, --line-strong, …) e os componentes ficam em base.css e /css/ui.
   ══════════════════════════════════════════════════════════════════════ */

/* Só em telas largas: no mobile vale o padding de layout.css, que reserva
   espaço para o botão do menu. */
@media (min-width: 981px) {
  .crm-v2 .main {
    padding: 20px 28px;
  }
}

/* ── Cabeçalho ─────────────────────────────────────────────────────── */
.crm-v2 .top {
  align-items: center;
  margin-bottom: 14px;
  gap: 14px;
  flex-wrap: nowrap;
}

.crm-v2 .v2-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.crm-v2 .top h1 {
  font-size: 22px;
  letter-spacing: -0.01em;
}

.crm-v2 .top .sub {
  margin: 0;
  font-size: 13px;
}

/* Abas da página (Lista, Pipeline, …) logo depois do título. */
.crm-v2 .top > .c-seg {
  margin: 0 auto 0 8px;
}

/* Abas logo abaixo do cabeçalho (Configurações, Tags). */
.crm-v2 .main > .c-seg {
  margin-bottom: 14px;
}

.crm-v2 .last-updated {
  font-size: 12px;
  color: var(--muted);
}

/* Há dados novos, mas algo está aberto: aviso flutuante (acima do painel e dos formulários). */
.v2-live {
  left: 24px;
  bottom: 20px;
  z-index: 980;
  transform: none;
  pointer-events: none;
}

.v2-live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f0b429;
}

/* ── Funil (resumo por status, clicável) ───────────────────────────── */
.v2-stages {
  display: flex;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  overflow: hidden;
}

.v2-stage-cell {
  appearance: none;
  border: none;
  border-right: 1px solid var(--line);
  background: none;
  flex: 1 1 auto;
  padding: 10px 14px 9px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  min-width: 0;
}

.v2-stage-cell:last-child {
  border-right: none;
}

.v2-stage-cell:hover {
  background: #faf8f4;
}

.v2-stage-cell .n {
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  color: var(--text);
}

.v2-stage-cell .l {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-stage-cell .l i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c);
  flex: none;
}

.v2-stage-cell.zero .n {
  color: #c4bfb5;
}

.v2-stage-cell.active {
  background: color-mix(in srgb, var(--c) 9%, #fff);
}

.v2-stage-cell.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--c);
}

.v2-stage-cell.active .l {
  color: var(--text);
}
