:root {
  --mc-accent: #2563eb;
  --mc-accent-soft: #dbeafe;
  --mc-success: #16a34a;
  --mc-success-soft: #dcfce7;
  --mc-bg: #f5f6fa;
}

html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin-bottom: 60px;
  background-color: var(--mc-bg);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  white-space: nowrap;
  line-height: 60px;
}

/* Marca */
.mc-brand {
  font-size: 1.35rem;
  letter-spacing: -0.5px;
  color: #1f2937;
}

.mc-brand-accent {
  color: var(--mc-accent);
}

/* Cards do dashboard */
.mc-card {
  border: none;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
}

.tile-label {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 0.15rem;
}

.tile-value {
  font-size: 1.4rem;
  font-weight: 600;
  color: #1f2937;
}

.hero-percent {
  font-size: 3.25rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--mc-accent);
}

.hero-percent.text-success {
  color: var(--mc-success) !important;
}

/* Medidor de progresso: trilha em tom mais claro do mesmo matiz */
.meter {
  height: 14px;
  border-radius: 999px;
  background-color: var(--mc-accent-soft);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: 999px;
  background-color: var(--mc-accent);
  transition: width 0.6s ease;
}

.meter-success {
  background-color: var(--mc-success-soft);
}

.meter-fill-success {
  background-color: var(--mc-success);
}

/* Tabela de clientes */
.busca-clientes {
  max-width: 320px;
}

.valor-cell {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.obs-cell {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Tela de login */
.login-wrapper {
  display: flex;
  justify-content: center;
  padding: 3rem 0.5rem;
}

.login-card {
  width: 100%;
  max-width: 430px;
  border: none;
  border-radius: 1rem;
  box-shadow: 0 4px 24px rgba(16, 24, 40, 0.1);
}

.login-logo {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #1f2937;
}

.login-logo span {
  color: var(--mc-accent);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Menu de navegação */
.mc-nav-link {
  color: #6b7280;
  font-weight: 500;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.mc-nav-link:hover {
  color: var(--mc-accent);
}

.mc-nav-link.active {
  color: var(--mc-accent);
  border-bottom-color: var(--mc-accent);
}

/* ---- Tela de Leads ---- */
.filtro-tipo {
  max-width: 190px;
}

/* Chips de filtro por status */
.chip-filtro {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 500;
}

.chip-filtro:hover {
  background-color: #e2e8f0;
}

.chip-filtro.active {
  background-color: var(--mc-accent);
  color: #fff;
}

.chip-num {
  display: inline-block;
  min-width: 1.4em;
  padding: 0 0.35em;
  margin-left: 0.15rem;
  border-radius: 999px;
  background-color: rgba(0, 0, 0, 0.08);
  font-size: 0.78em;
  font-weight: 600;
}

.chip-filtro.active .chip-num {
  background-color: rgba(255, 255, 255, 0.28);
}

/* Cabeçalho de coluna ordenável */
.th-sort {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.th-sort:hover {
  color: var(--mc-accent);
}

.th-sort-ativo {
  color: var(--mc-accent);
}

.th-seta {
  font-size: 0.75em;
}

/* Badges de status do pipeline */
.status-cell .badge { white-space: nowrap; }
.badge-st-0 { background-color: #f1f5f9; color: #475569; }
.badge-st-1 { background-color: #dbeafe; color: #1e40af; }
.badge-st-2 { background-color: #fef3c7; color: #92400e; }
.badge-st-3 { background-color: #dcfce7; color: #166534; }
.badge-st-4 { background-color: #f1f5f9; color: #94a3b8; }
.badge-st-8 { background-color: #ede9fe; color: #5b21b6; }

.badge-st-neg { background-color: #fee2e2; color: #991b1b; }

/* Chips de negativa */
.chip-neg { color: #b91c1c; }
.chip-neg:hover { background-color: #fee2e2; }
.chip-neg.active { background-color: #dc2626; color: #fff; }

/* Badges de tipo */
.badge-tipo-match { background-color: #dbeafe; color: #1e40af; }
.badge-tipo-fronteira { background-color: #fef3c7; color: #92400e; cursor: help; }

/* Linha de lead */
.lead-nome {
  color: var(--mc-accent);
  text-decoration: none;
}

.lead-nome:hover {
  text-decoration: underline;
}

.lead-descartado {
  opacity: 0.55;
}

/* Botão de WhatsApp ao lado do nome */
.btn-zap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background-color: #25d366;
  color: #fff;
  vertical-align: middle;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-zap:hover {
  color: #fff;
  filter: brightness(1.08);
}

/* Sem número ainda: convite discreto para adicionar */
.btn-zap-vazio {
  background-color: transparent;
  color: #cbd5e1;
  border: 1px dashed #cbd5e1;
}

.btn-zap-vazio:hover {
  background-color: #dcfce7;
  border-color: #25d366;
  color: #25d366;
  filter: none;
}

/* Edição inline do número */
.zap-edit {
  display: inline-flex;
  gap: 0.25rem;
  vertical-align: middle;
}

.zap-input {
  width: 150px;
}

.zap-editar {
  font-size: 0.85em;
}

/* Botão de e-mail ao lado do nome */
.btn-mail {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background-color: #4f6bed;
  color: #fff;
  vertical-align: middle;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-mail:hover {
  color: #fff;
  filter: brightness(1.08);
}

/* Sem e-mail ainda: convite discreto para adicionar */
.btn-mail-vazio {
  background-color: transparent;
  color: #cbd5e1;
  border: 1px dashed #cbd5e1;
}

.btn-mail-vazio:hover {
  background-color: #e5eaff;
  border-color: #4f6bed;
  color: #4f6bed;
  filter: none;
}

/* Edição inline do e-mail */
.mail-edit {
  display: inline-flex;
  gap: 0.25rem;
  vertical-align: middle;
}

.mail-input {
  width: 210px;
}

.mail-editar {
  font-size: 0.85em;
}

/* Prévia do rascunho dentro do modal de e-mail */
.email-previa {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  padding: 0.65rem 0.75rem;
}

.email-corpo {
  white-space: pre-wrap;
  max-height: 11rem;
  overflow-y: auto;
  color: #334155;
}

/* ---- Área jurídica e central de equipe ---- */
.badge-area-trab { background-color: #e0e7ff; color: #3730a3; }

.badge-area-trib { background-color: #fce7f3; color: #9d174d; }

.alert-central {
  background-color: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #312e81;
}

.lote-sep {
  display: inline-block;
  width: 1px;
  height: 1.4rem;
  background-color: rgba(255, 255, 255, 0.35);
  vertical-align: middle;
  margin: 0 0.25rem;
}

/* ---- Follow-up ---- */
.badge-follow { background-color: #fef3c7; color: #92400e; }

.chip-follow { color: #92400e; }
.chip-follow:hover { background-color: #fef3c7; }
.chip-follow.active { background-color: #d97706; color: #fff; }

.lead-followup > td:first-child {
  box-shadow: inset 3px 0 0 #d97706;
}

/* ---- Novos hoje (data de importação) ---- */
.chip-hoje { color: #166534; }
.chip-hoje:hover { background-color: #dcfce7; }
.chip-hoje.active { background-color: #16a34a; color: #fff; }

.badge-hoje {
  background-color: #dcfce7;
  color: #166534;
  font-size: 0.72em;
  vertical-align: middle;
}

/* ---- Barra de ações em lote ---- */
.barra-lote {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  background-color: #1f2937;
  color: #fff;
  border-radius: 0.6rem;
  padding: 0.6rem 0.9rem;
  margin-bottom: 0.75rem;
}

.barra-lote .lote-acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.barra-lote .lote-txt { margin-right: 0.5rem; }

/* ---- Histórico / anotações ---- */
.notas-bloco {
  border-top: 1px dashed #e2e8f0;
  padding-top: 0.6rem;
  margin-top: 0.4rem;
}

.nota-item {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.2rem 0;
}

.nota-data {
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.nota-txt { flex: 1; }

.nota-excluir {
  border: none;
  background: none;
  color: #cbd5e1;
  line-height: 1;
  padding: 0 0.25rem;
  cursor: pointer;
}

.nota-excluir:hover { color: #dc2626; }

.notas-form { max-width: 520px; }

/* ---- Observações inline na tabela ---- */
.obs-cell {
  max-width: 220px;
}

.obs-txt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
  font-size: 0.85em;
  color: #475569;
  border-radius: 0.35rem;
  padding: 0.15rem 0.3rem;
  margin: -0.15rem -0.3rem;
}

.obs-txt:hover {
  background-color: #f1f5f9;
}

.obs-vazia {
  color: #cbd5e1;
  font-style: italic;
}

.obs-edit {
  display: flex;
  gap: 0.25rem;
  align-items: flex-start;
}

.obs-input {
  min-width: 180px;
  font-size: 0.85em;
}

/* ---- Relatórios ---- */
.donut-bloco {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.donut-svg { width: 140px; flex-shrink: 0; }
.donut-svg svg { width: 100%; height: auto; }

.donut-centro-valor {
  font-size: 6px;
  font-weight: 700;
  fill: #1f2937;
}

.donut-centro-rotulo {
  font-size: 3px;
  fill: #6b7280;
}

.donut-legenda {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  min-width: 170px;
  font-size: 0.88rem;
}

.donut-legenda li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.15rem 0;
}

.donut-bolinha {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.donut-rot { flex: 1; }
.donut-val { font-weight: 600; white-space: nowrap; }

/* Funil */
.funil-linha {
  display: grid;
  grid-template-columns: 210px 1fr 90px;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.funil-rot { display: flex; flex-direction: column; }
.funil-taxa { font-size: 0.75rem; color: #6b7280; }

.funil-barra-fundo {
  background-color: #eef2f7;
  border-radius: 5px;
  height: 22px;
  overflow: hidden;
}

.funil-barra {
  height: 100%;
  border-radius: 5px;
  transition: width 0.5s ease;
}

.funil-num { text-align: right; }
.funil-num span { display: block; line-height: 1.2; }

@media (max-width: 575px) {
  .funil-linha { grid-template-columns: 1fr; }
  .funil-num { text-align: left; }
}

.mini-stat {
  background-color: #f8fafc;
  border-radius: 0.6rem;
  padding: 0.7rem 0.9rem;
}

.mini-label { font-size: 0.8rem; color: #6b7280; }
.mini-valor { font-size: 1.25rem; font-weight: 700; color: #1f2937; }

/* Cards de origem */
.origem-card {
  background-color: #f8fafc;
  border-left: 4px solid #94a3b8;
  border-radius: 0.5rem;
  padding: 0.85rem 1rem;
  height: 100%;
}

.origem-valor {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.2;
}

/* Barras mensais */
.barras-mes {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.barra-col {
  flex: 1 0 66px;
  text-align: center;
}

.barra-valor {
  font-size: 0.7rem;
  color: #475569;
  font-weight: 600;
  margin-bottom: 0.2rem;
  white-space: nowrap;
}

.barra-trilho {
  height: 130px;
  display: flex;
  align-items: flex-end;
  background-color: #f1f5f9;
  border-radius: 5px;
  overflow: hidden;
}

.barra-fill {
  width: 100%;
  border-radius: 5px 5px 0 0;
  transition: height 0.5s ease;
  min-height: 3px;
}

.barra-rot {
  font-size: 0.78rem;
  margin-top: 0.3rem;
  text-transform: capitalize;
}

.barra-qtd { font-size: 0.7rem; color: #94a3b8; }

/* Barras de ranking */
.rank-barra-fundo {
  background-color: #f1f5f9;
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 2px;
}

.rank-barra { height: 100%; border-radius: 4px; }

/* ---- Relatório do time ---- */
.rank-linha + .rank-linha { margin-top: 0.9rem; }

.membros-filtro {
  max-height: 6.5rem;
  overflow-y: auto;
  padding: 0.35rem 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
}

/* As abas herdam o azul do tema em vez do link padrão do Bootstrap. */
.nav-tabs .nav-link { color: #64748b; }

.nav-tabs .nav-link.active { font-weight: 600; }

@media print {
  .navbar, .footer, .btn { display: none !important; }
  .mc-card { box-shadow: none !important; border: 1px solid #e2e8f0 !important; }
}

.lead-det > td {
  background-color: transparent;
}

.det-box {
  background-color: #f8fafc;
  border-left: 3px solid var(--mc-accent-soft);
  border-radius: 0 0.4rem 0.4rem 0;
  padding: 0.75rem 1rem;
  margin: 0 0 0.4rem 0.5rem;
}

.chevron-btn {
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.15s ease;
  text-decoration: none;
}

.chevron-btn[aria-expanded="true"] {
  transform: rotate(90deg);
}

/* ---- Onboarding / tour guiado ---- */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 1090;
  display: none;
  pointer-events: auto;
}

.tour-overlay.ativo {
  display: block;
}

.tour-overlay.sem-alvo {
  background-color: rgba(15, 23, 42, 0.65);
}

.tour-spot {
  position: absolute;
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.65);
  transition: all 0.25s ease;
  pointer-events: none;
}

.tour-card {
  position: fixed;
  z-index: 1092;
  width: 340px;
  max-width: calc(100vw - 24px);
  background-color: #fff;
  border-radius: 0.85rem;
  box-shadow: 0 12px 44px rgba(15, 23, 42, 0.28);
  padding: 1.1rem 1.25rem 1rem;
}

.tour-progress {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--mc-accent);
  letter-spacing: 0.03em;
  margin-bottom: 0.35rem;
}

.tour-titulo {
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: #1f2937;
}

.tour-texto {
  font-size: 0.92rem;
  color: #475569;
  margin-bottom: 1rem;
}

.tour-acoes {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.tour-nav {
  display: flex;
  gap: 0.4rem;
}

.tour-pular {
  padding-left: 0;
  text-decoration: none;
}

/* ---- Tela de Ganhos ---- */
.ganho-hero {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: #fff;
}

.ganho-hero .tile-label {
  color: rgba(255, 255, 255, 0.85);
}

.ganho-hero .text-muted {
  color: rgba(255, 255, 255, 0.85) !important;
}

.ganho-hero .text-body {
  color: #fff !important;
}

.ganho-total {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  margin: 0.25rem 0;
}

.ganho-faixa-atual {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--mc-accent);
  line-height: 1.1;
}

.ganho-proxima {
  background-color: #f8fafc;
  border-radius: 0.6rem;
}

.faixa-atual {
  background-color: #ecfdf5;
}

.faixa-atual td {
  --bs-table-bg-type: #ecfdf5;
}

/* Destaque de ganhos no dashboard da Meta */
.ganho-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: #fff;
  border-radius: 0.75rem;
  padding: 0.85rem 1.25rem;
  text-decoration: none;
}

.ganho-banner:hover {
  color: #fff;
  filter: brightness(1.05);
}

.ganho-banner .valor {
  font-size: 1.5rem;
  font-weight: 700;
}
