/**
 * ARQUIVO: carteira-mobile.css
 * CATEGORIA: Carteira Mobile › Estilos do Módulo
 * RESPONSABILIDADE: Interface Fintech inspirada no design de referência (Apple/iOS Dark Cards)
 * 100% modular e isolado para dispositivos móveis.
 */

/* Container Principal em Tela Cheia no Mobile */
#carteira-mobile-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0077B6;
  background: linear-gradient(135deg, #0077B6 0%, #00B4D8 35%, #7DD3FC 75%, #CAF0F8 100%);
  background-attachment: fixed;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  -webkit-font-smoothing: antialiased;
  color: #ffffff;
  animation: carteiraSlideUpSheet 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 1 !important;
}

@keyframes carteiraSlideUpSheet {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes carteiraSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── CASCADING ENTRANCE & EXIT TRANSITIONS ─── */
#carteira-mobile-container .cascade-item {
  will-change: transform, opacity;
}

#carteira-mobile-container.page-exit-active {
  animation: carteiraSlideDownSheet 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  opacity: 1 !important;
}

#carteira-mobile-container.page-exit-active .cascade-item {
  animation: carteiraCascadeDown 0.16s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  animation-delay: calc(var(--index, 0) * 0.015s) !important;
}

#carteira-mobile-container.tab-switching .cascade-item {
  animation: carteiraCascadeDown 0.12s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  animation-delay: calc(var(--index, 0) * 0.01s) !important;
}

@keyframes carteiraSlideDownSheet {
  from { transform: translateY(0); }
  to { transform: translateY(100%); }
}

@keyframes carteiraCascadeDown {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(16px); }
}

/* ──────────────────────────────────────────────────────────────
   1. TOPO OCEAN GRADIENT (STATUS BAR, HEADER & HERO)
   Gradiente idêntico ao card Gestão de Clientes (.vmobile-hero-card):
   linear-gradient(135deg, #0077B6 0%, #00B4D8 35%, #7DD3FC 75%, #CAF0F8 100%)
   ────────────────────────────────────────────────────────────── */
.cm-top-section,
.cm-dashboard-top-section {
  background: linear-gradient(135deg, #0077B6 0%, #00B4D8 35%, #7DD3FC 75%, #CAF0F8 100%) !important;
  position: relative;
  flex-shrink: 0;
  padding-bottom: 6px;
  box-shadow: 0 4px 20px rgba(0, 119, 182, 0.15);
}

.cm-top-header {
  padding: 16px 20px 10px;
  background: linear-gradient(135deg, #0077B6 0%, #00B4D8 35%, #7DD3FC 75%, #CAF0F8 100%);
  position: relative;
  flex-shrink: 0;
}

.cm-top-section .cm-top-header,
.cm-dashboard-top-section .cm-top-header {
  background: transparent !important;
}

.cm-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.cm-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cm-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 70, 110, 0.18);
  overflow: hidden;
}

.cm-greeting {
  display: flex;
  flex-direction: column;
}

.cm-greeting-small {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.2px;
}

.cm-greeting-name {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 4px;
  text-shadow: 0 1px 3px rgba(0, 70, 110, 0.25);
}

.cm-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cm-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, background 0.15s ease;
}

.cm-icon-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.35);
}

.cm-icon-btn .cm-badge-dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #EF4444;
  border: 1.5px solid #0077B6;
}

/* ──────────────────────────────────────────────────────────────
   SEGMENTED PILL TABS (Dashboard, Cards, Analytics, Histórico)
   ────────────────────────────────────────────────────────────── */
.cm-pill-tabs {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  overflow-x: auto;
  padding: 0 14px 8px;
  scrollbar-width: none;
  width: 100%;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.cm-pill-tabs::-webkit-scrollbar {
  display: none;
}

.cm-pill-tab {
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 2px rgba(0, 60, 100, 0.2);
}

.cm-pill-tab.active {
  background: #ffffff;
  color: #0077B6;
  box-shadow: 0 4px 14px rgba(0, 70, 110, 0.18);
  font-weight: 700;
  text-shadow: none;
}

.cm-pill-tab:not(.active):active {
  background: rgba(255, 255, 255, 0.2);
}

/* ──────────────────────────────────────────────────────────────
   HERO BALANCE SECTION (Calculado de Leads Salvos no Radar)
   ────────────────────────────────────────────────────────────── */
.cm-hero-balance-section {
  padding: 14px 20px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.cm-balance-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 4px;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 3px rgba(0, 60, 100, 0.25);
}

.cm-balance-amount {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -1px;
  color: #ffffff;
  margin-bottom: 16px;
  line-height: 1.1;
  text-shadow: 0 4px 16px rgba(0, 60, 100, 0.25);
}

/* Alert Banner Pill */
.cm-alert-pill {
  width: 100%;
  max-width: 380px;
  background: rgba(0, 60, 95, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  box-shadow: 0 4px 16px rgba(0, 70, 110, 0.15);
}

.cm-alert-pill:active {
  transform: scale(0.98);
  background: rgba(0, 60, 95, 0.65);
}

.cm-alert-content {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cm-alert-arrow {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  flex-shrink: 0;
}

/* ──────────────────────────────────────────────────────────────
   2. WHITE BOTTOM SHEET (Painel Deslizante Branco)
   ────────────────────────────────────────────────────────────── */
.cm-bottom-sheet {
  background: #ffffff;
  border-radius: 28px 28px 0 0;
  padding: 12px 20px 80px;
  flex: 1;
  color: #111827;
  position: relative;
  animation: carteiraSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.08);
}

.cm-sheet-handle {
  width: 36px;
  height: 4px;
  background: #E5E7EB;
  border-radius: 2px;
  margin: 0 auto 16px;
}

.cm-section-title {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 12px;
  letter-spacing: -0.2px;
}

/* Horizontal Avatar List (Recent Send / Clientes Recentes) */
.cm-recent-avatars-scroll {
  display: flex;
  align-items: center;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 0 18px;
  scrollbar-width: none;
}

.cm-recent-avatars-scroll::-webkit-scrollbar {
  display: none;
}

.cm-recent-avatar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
  width: 58px;
  transition: transform 0.15s ease;
}

.cm-recent-avatar-item:active {
  transform: scale(0.92);
}

.cm-recent-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #F0F9FF;
  border: 2px solid #BAE6FD;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #0077B6;
  background-size: cover;
  background-position: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
}

.cm-recent-name {
  font-size: 11px;
  font-weight: 600;
  color: #4B5563;
  text-align: center;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Current Activity List */
.cm-search-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.cm-search-input-wrap {
  flex: 1;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 14px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cm-search-input-wrap input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: #111827;
  width: 100%;
}

.cm-filter-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #F3F4F6;
  border: 1px solid #E5E7EB;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4B5563;
  cursor: pointer;
}

.cm-activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cm-activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #F3F4F6;
  cursor: pointer;
}

.cm-activity-item:last-child {
  border-bottom: none;
}

.cm-activity-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cm-activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.cm-activity-icon.icon-green {
  background: #DCFCE7;
  color: #16A34A;
}

.cm-activity-icon.icon-blue {
  background: #DBEAFE;
  color: #2563EB;
}

.cm-activity-icon.icon-purple {
  background: #F3E8FF;
  color: #9333EA;
}

.cm-activity-texts {
  display: flex;
  flex-direction: column;
}

.cm-activity-name {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}

.cm-activity-sub {
  font-size: 11px;
  color: #6B7280;
  margin-top: 2px;
}

.cm-activity-value {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  text-align: right;
}

.cm-activity-value.positive {
  color: #16A34A;
}

/* Floating Bottom Button - Padrão Apple HIG com Slide Fluido */
.cm-floating-pill-btn {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translate3d(-50%, 0, 0);
  opacity: 1;
  background: linear-gradient(135deg, #0077B6 0%, #0096C7 100%);
  color: #ffffff;
  padding: 12px 26px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  box-shadow: 0 8px 24px rgba(0, 119, 182, 0.38);
  cursor: pointer;
  z-index: 10060;
  will-change: transform, opacity;
  animation: none !important;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s ease,
              background 0.15s ease !important;
}

/* Slide Fluido de Saída ao se aproximar do final da página */
.cm-floating-pill-btn.cm-btn-slide-out {
  transform: translate3d(-50%, 120px, 0) scale(0.88) !important;
  opacity: 0 !important;
  pointer-events: none !important;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0) !important;
  transition: transform 0.42s cubic-bezier(0.32, 0.72, 0, 1),
              opacity 0.32s cubic-bezier(0.32, 0.72, 0, 1),
              box-shadow 0.3s ease !important;
}

/* Slide Fluido de Entrada ao rolar para cima */
.cm-floating-pill-btn.cm-btn-slide-in {
  transform: translate3d(-50%, 0, 0) scale(1) !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  box-shadow: 0 8px 24px rgba(0, 119, 182, 0.38) !important;
  transition: transform 0.48s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.38s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.35s ease !important;
}

.cm-floating-pill-btn:active {
  transform: translate3d(-50%, 0, 0) scale(0.95);
  background: linear-gradient(135deg, #005f92 0%, #0077B6 100%);
}

/* ──────────────────────────────────────────────────────────────
   3. TELA 2: SUB-ABA CARDS (Cartões Virtuais de Clientes)
   ────────────────────────────────────────────────────────────── */
.cm-cards-view-title {
  font-size: 18px;
  font-weight: 800;
  color: #111827;
  margin: 6px 0 16px;
  letter-spacing: -0.3px;
}

.cm-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 24px;
}

/* Base do Cartão Estilo Crédito VIP */
.cm-credit-card {
  width: 100%;
  height: 205px;
  border-radius: 20px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
  user-select: none;
}

.cm-credit-card:active {
  transform: scale(0.97);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
}

/* Overlay com círculos de relevo em marca d'água */
.cm-credit-card::before {
  content: '';
  position: absolute;
  top: -20px;
  right: -30px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

.cm-credit-card::after {
  content: '';
  position: absolute;
  bottom: -40px;
  right: 20px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* Variantes de Cor e Design Exclusivo para cada Cliente */
.cm-card-theme-sapphire,
.cm-card-sapphire {
  background: linear-gradient(135deg, #1E3A8A 0%, #1D4ED8 50%, #172554 100%);
  border: 1px solid rgba(147, 197, 253, 0.25);
  box-shadow: 0 12px 28px rgba(30, 58, 138, 0.35);
  color: #ffffff;
}

.cm-card-theme-obsidian,
.cm-card-platinum {
  background: linear-gradient(135deg, #18181B 0%, #27272A 50%, #09090B 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  color: #ffffff;
}

.cm-card-theme-emerald,
.cm-card-infinite {
  background: linear-gradient(135deg, #064E3B 0%, #047857 50%, #022C22 100%);
  border: 1px solid rgba(110, 231, 183, 0.25);
  box-shadow: 0 12px 28px rgba(6, 78, 59, 0.35);
  color: #ffffff;
}

.cm-card-theme-gold {
  background: linear-gradient(135deg, #78350F 0%, #B45309 45%, #451A03 100%);
  border: 1px solid rgba(253, 230, 138, 0.35);
  box-shadow: 0 12px 28px rgba(180, 83, 9, 0.35);
  color: #ffffff;
}

.cm-card-theme-amethyst {
  background: linear-gradient(135deg, #3B0764 0%, #6B21A8 50%, #2E1065 100%);
  border: 1px solid rgba(216, 180, 254, 0.25);
  box-shadow: 0 12px 28px rgba(107, 33, 168, 0.35);
  color: #ffffff;
}

.cm-card-theme-ruby {
  background: linear-gradient(135deg, #4C0519 0%, #9F1239 50%, #29000C 100%);
  border: 1px solid rgba(254, 205, 211, 0.25);
  box-shadow: 0 12px 28px rgba(159, 18, 57, 0.35);
  color: #ffffff;
}

.cm-card-theme-platinum {
  background: linear-gradient(135deg, #334155 0%, #475569 50%, #1E293B 100%);
  border: 1px solid rgba(226, 232, 240, 0.35);
  box-shadow: 0 12px 28px rgba(30, 41, 59, 0.4);
  color: #ffffff;
}

.cm-card-theme-sunset {
  background: linear-gradient(135deg, #581C87 0%, #BE185D 50%, #EA580C 100%);
  border: 1px solid rgba(251, 146, 60, 0.3);
  box-shadow: 0 12px 28px rgba(190, 24, 93, 0.35);
  color: #ffffff;
}

.cm-card-theme-cyber {
  background: linear-gradient(135deg, #020617 0%, #0F172A 50%, #083344 100%);
  border: 1px solid rgba(34, 211, 238, 0.35);
  box-shadow: 0 12px 28px rgba(8, 51, 68, 0.45);
  color: #ffffff;
}

.cm-card-theme-copper {
  background: linear-gradient(135deg, #431407 0%, #9A3412 50%, #2A0C03 100%);
  border: 1px solid rgba(253, 186, 116, 0.3);
  box-shadow: 0 12px 28px rgba(154, 52, 18, 0.35);
  color: #ffffff;
}

/* Elementos Internos do Cartão */
.cm-card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1;
}

.cm-card-brand-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.95);
}

.cm-card-brand-tag i {
  width: 18px;
  height: 18px;
}

.cm-card-stage-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  color: #ffffff;
}

.cm-card-middle-row {
  display: flex;
  align-items: center;
  margin: 8px 0 2px;
  z-index: 1;
}

.cm-card-chip-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Bloco do CNPJ: rótulo em cima do número alinhado na lateral esquerda */
.cm-card-cnpj-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: 4px;
  z-index: 1;
}

.cm-card-cnpj-label {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  text-align: left;
  margin-bottom: 2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Chip Metálico de Cartão com Ranhuras Realistas */
.cm-sim-chip {
  width: 38px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, #E5C07B 0%, #D19A66 50%, #E5C07B 100%);
  border: 1px solid rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.6), 0 2px 5px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.cm-sim-chip.platinum,
.cm-sim-chip.silver {
  background: linear-gradient(135deg, #E2E8F0 0%, #94A3B8 50%, #CBD5E1 100%);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8), 0 2px 5px rgba(0, 0, 0, 0.3);
}

.cm-sim-chip.bronze {
  background: linear-gradient(135deg, #FDBA74 0%, #C2410C 50%, #EA580C 100%);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.6), 0 2px 5px rgba(0, 0, 0, 0.3);
}

.cm-sim-chip::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background: rgba(0, 0, 0, 0.25);
}

.cm-sim-chip::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 100%;
  background: rgba(0, 0, 0, 0.25);
}

.cm-contactless-wave {
  color: rgba(255, 255, 255, 0.85);
  font-size: 16px;
  transform: rotate(90deg);
  display: inline-block;
}

/* Número do Cartão / CNPJ Formatado em Estilo Em relevo */
.cm-card-number,
.cm-card-cnpj-number {
  font-family: "Courier New", Courier, monospace, -apple-system;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: rgba(255, 255, 255, 0.98);
  margin-top: 4px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
  z-index: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Barra de Progresso no Cartão (Cronograma) */
.cm-card-progress-bar-wrap {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
  margin: 6px 0 8px;
  z-index: 1;
}

.cm-card-progress-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #10B981 0%, #34D399 100%);
  transition: width 0.3s ease;
}

/* Linha Inferior do Cartão (Holder, Estimativa) */
.cm-card-bottom-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  z-index: 1;
  width: 100%;
}

.cm-card-field {
  display: flex;
  flex-direction: column;
}

.cm-field-title {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
  margin-bottom: 2px;
}

.cm-field-value {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cm-card-visa-logo {
  display: none !important;
}

/* ──────────────────────────────────────────────────────────────
   4. TELA 3: DETALHES DO CARD (Informações Chaves e Anotações Editáveis)
   ────────────────────────────────────────────────────────────── */
.cm-detail-view-container {
  background: #F9FAFB;
  min-height: 100vh;
  color: #111827;
  padding: 16px 18px 80px;
  overflow-y: auto;
}

.cm-detail-nav-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.cm-back-btn {
  background: #ffffff;
  border: 1px solid #E5E7EB;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #111827;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.cm-back-btn:active {
  transform: scale(0.93);
}

.cm-detail-title {
  font-size: 17px;
  font-weight: 700;
  color: #111827;
}

/* Hero Card em destaque na tela de detalhes */
.cm-detail-hero-card {
  margin-bottom: 20px;
}

/* 3 Botões Circulares de Ação Rápida */
.cm-quick-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin-bottom: 24px;
}

.cm-quick-action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.cm-quick-action-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #1E4BFF;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(30, 75, 255, 0.28);
  transition: transform 0.15s ease;
}

.cm-quick-action-circle:active {
  transform: scale(0.92);
}

.cm-quick-action-label {
  font-size: 11px;
  font-weight: 600;
  color: #4B5563;
}

/* Seção Card Information (Branca Arredondada) */
.cm-info-card-box {
  background: #ffffff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
  border: 1px solid #F3F4F6;
  margin-bottom: 16px;
}

.cm-info-box-title {
  font-size: 16px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 16px;
}

.cm-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid #F3F4F6;
}

.cm-info-row:last-child {
  border-bottom: none;
}

.cm-info-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #4B5563;
  font-size: 13px;
  font-weight: 500;
}

.cm-info-row-left i {
  color: #1E4BFF;
  width: 18px;
  height: 18px;
}

.cm-info-row-right {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  text-align: right;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Área de Anotações Chave Editáveis */
.cm-notes-card-box {
  background: #ffffff;
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
  border: 1px solid #F3F4F6;
}

.cm-notes-textarea {
  width: 100%;
  min-height: 90px;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
  color: #111827;
  outline: none;
  resize: vertical;
  line-height: 1.4;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.cm-notes-textarea:focus {
  border-color: #0077B6;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.15);
}

.cm-save-notes-btn {
  width: 100%;
  background: #0077B6;
  color: #ffffff;
  padding: 11px;
  border-radius: 12px;
  border: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(0, 119, 182, 0.28);
  transition: background 0.15s ease;
}

.cm-save-notes-btn:active {
  background: #005f92;
}

/* ──────────────────────────────────────────────────────────────
   TELA: ANALYTICS DA CARTEIRA
   ────────────────────────────────────────────────────────────── */
.cm-analytics-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 20px 14px;
}

.cm-analytics-kpi-card {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 16px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 14px rgba(0, 70, 110, 0.12);
}

.cm-kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 6px;
}

.cm-kpi-value {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.cm-kpi-sub {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 4px;
}

.cm-funnel-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

/* ──────────────────────────────────────────────────────────────
   SEÇÃO: FUNIL DE ESTÁGIOS APPLE HIG
   ────────────────────────────────────────────────────────────── */
.cm-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cm-funnel-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Card Inset Grouped Apple HIG */
.cm-funnel-card {
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 20px;
  padding: 16px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.025);
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.16s ease, background 0.15s ease;
  position: relative;
  overflow: hidden;
}

.cm-funnel-card:active {
  transform: scale(0.985);
  background: #F8FAFC;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.015);
}

.cm-funnel-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Squircle Apple Icon Box */
.cm-funnel-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.cm-funnel-icon-box.stage-sapphire {
  background: rgba(0, 122, 255, 0.1);
  color: #007AFF;
}

.cm-funnel-icon-box.stage-emerald {
  background: rgba(52, 199, 89, 0.12);
  color: #34C759;
}

.cm-funnel-icon-box.stage-amber {
  background: rgba(255, 149, 0, 0.12);
  color: #FF9500;
}

.cm-funnel-header-text {
  flex: 1;
  min-width: 0;
}

.cm-funnel-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cm-funnel-stage-name {
  font-size: 14.5px;
  font-weight: 700;
  color: #1C1C1E;
  letter-spacing: -0.2px;
}

/* Apple Capsule Pill Badge */
.cm-funnel-pill {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
}

.cm-funnel-pill.stage-sapphire {
  background: rgba(0, 122, 255, 0.08);
  color: #007AFF;
  border: 1px solid rgba(0, 122, 255, 0.18);
}

.cm-funnel-pill.stage-emerald {
  background: rgba(52, 199, 89, 0.08);
  color: #248A3D;
  border: 1px solid rgba(52, 199, 89, 0.18);
}

.cm-funnel-pill.stage-amber {
  background: rgba(255, 149, 0, 0.08);
  color: #C97200;
  border: 1px solid rgba(255, 149, 0, 0.18);
}

.cm-funnel-count {
  font-size: 12px;
  font-weight: 500;
  color: #8E8E93;
  margin-top: 2px;
}

.cm-funnel-chevron {
  color: #C7C7CC;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 4px;
}

/* Apple Progress Bar */
.cm-funnel-progress-wrap {
  width: 100%;
  height: 6px;
  background: rgba(120, 120, 128, 0.12);
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0 10px;
}

.cm-funnel-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.cm-funnel-progress-fill.stage-sapphire {
  background: linear-gradient(90deg, #007AFF 0%, #5AC8FA 100%);
}

.cm-funnel-progress-fill.stage-emerald {
  background: linear-gradient(90deg, #34C759 0%, #30D158 100%);
}

.cm-funnel-progress-fill.stage-amber {
  background: linear-gradient(90deg, #FF9500 0%, #FFCC00 100%);
}

.cm-funnel-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.cm-funnel-bottom-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #8E8E93;
}

.cm-funnel-bottom-value {
  font-size: 14.5px;
  font-weight: 700;
  color: #1C1C1E;
}

/* ──────────────────────────────────────────────────────────────
   SEÇÃO: TOP CLIENTES APPLE HIG COM BADGES SVG
   ────────────────────────────────────────────────────────────── */
.cm-ranking-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.cm-ranking-item {
  display: flex;
  align-items: center;
  padding: 13px 15px;
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 18px;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), background 0.15s ease, box-shadow 0.15s ease;
}

.cm-ranking-item:active {
  background: #F2F2F7;
  transform: scale(0.985);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.015);
}

.cm-ranking-pos-wrap {
  flex-shrink: 0;
}

/* Badges de Medalha SVG Apple HIG */
.cm-rank-badge {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-sizing: border-box;
}

.cm-rank-badge.rank-gold {
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #B45309;
  box-shadow: 0 3px 8px rgba(245, 158, 11, 0.16);
}

.cm-rank-badge.rank-silver {
  background: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 100%);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #475569;
  box-shadow: 0 3px 8px rgba(148, 163, 184, 0.16);
}

.cm-rank-badge.rank-bronze {
  background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
  border: 1px solid rgba(234, 88, 12, 0.3);
  color: #C2410C;
  box-shadow: 0 3px 8px rgba(234, 88, 12, 0.14);
}

.cm-rank-badge.rank-default {
  background: rgba(120, 120, 128, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.04);
  color: #8E8E93;
}

.cm-rank-num-text {
  font-size: 13px;
  font-weight: 700;
  color: #636366;
}

.cm-ranking-info {
  flex: 1;
  min-width: 0;
}

.cm-ranking-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #1C1C1E;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.15px;
}

.cm-ranking-sub {
  font-size: 11.5px;
  color: #8E8E93;
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cm-ranking-contact {
  color: #636366;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cm-ranking-bullet {
  color: #C7C7CC;
}

/* Stage Pill sem box-shadow, nítido e transparente */
.cm-stage-pill {
  display: inline-flex;
  align-items: center;
  padding: 1.5px 7px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: none !important;
}

.cm-stage-pill.stage-sapphire {
  background: rgba(0, 122, 255, 0.08);
  color: #007AFF;
  border: 1px solid rgba(0, 122, 255, 0.18);
}

.cm-stage-pill.stage-emerald {
  background: rgba(52, 199, 89, 0.08);
  color: #248A3D;
  border: 1px solid rgba(52, 199, 89, 0.2);
}

.cm-stage-pill.stage-amber {
  background: rgba(255, 149, 0, 0.08);
  color: #C97200;
  border: 1px solid rgba(255, 149, 0, 0.2);
}

.cm-ranking-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.cm-ranking-val {
  font-size: 14px;
  font-weight: 800;
  color: #34C759;
  white-space: nowrap;
  letter-spacing: -0.2px;
}

.cm-ranking-arrow {
  color: #C7C7CC;
  display: flex;
  align-items: center;
}

/* ──────────────────────────────────────────────────────────────
   TELA: RECENTES DA CARTEIRA
   ────────────────────────────────────────────────────────────── */
.cm-hero-search-section {
  padding: 0 20px 14px;
}

.cm-hero-input-wrap {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 14px;
  padding: 8px 14px;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.cm-hero-input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 13px;
}

.cm-hero-input-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.cm-search-clear-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cm-filter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-top: 10px;
  padding-bottom: 2px;
}

.cm-filter-chips::-webkit-scrollbar {
  display: none;
}

.cm-filter-chip {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cm-filter-chip.active {
  background: #ffffff;
  color: #111827;
  border-color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cm-recent-cards-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.cm-recent-card-item {
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cm-recent-card-item:active {
  transform: scale(0.98);
}

.cm-recent-item-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cm-recent-item-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1E4BFF 0%, #3B82F6 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.cm-recent-item-main {
  flex: 1;
  min-width: 0;
}

.cm-recent-item-title {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cm-recent-item-contact {
  font-size: 11px;
  color: #6B7280;
  margin-top: 1px;
}

.cm-recent-item-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.cm-recent-item-badge.cm-card-sapphire {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.cm-recent-item-badge.cm-card-infinite {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}

.cm-recent-item-badge.cm-card-platinum {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.cm-recent-item-note {
  background: #ffffff;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 11px;
  color: #374151;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.4;
}

.cm-recent-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
  border-top: 1px solid #F3F4F6;
}

.cm-recent-item-prog-bar {
  flex: 1;
  height: 5px;
  background: #E5E7EB;
  border-radius: 999px;
  overflow: hidden;
}

.cm-recent-item-prog-fill {
  height: 100%;
  background: linear-gradient(90deg, #1E4BFF, #10B981);
  border-radius: 999px;
}

.cm-recent-item-value {
  font-size: 12px;
  font-weight: 700;
  color: #10B981;
  white-space: nowrap;
}

.cm-empty-state {
  text-align: center;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
