/* ==========================================================================
   VEXA WORKSPACE — ADMIN & OPERATIONS DASHBOARD
   Design System: Dark Luxury + Technology + Enterprise Control
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-deep: #050505;
  --bg-surface: #0a0d0c;
  --bg-card: rgba(15, 18, 16, 0.75);
  --bg-card-hover: rgba(22, 199, 132, 0.05);
  --sidebar-w: 260px;
  --topbar-h: 68px;

  --emerald-primary: #16C784;
  --emerald-deep: #0B8F61;
  --emerald-glow: rgba(22, 199, 132, 0.28);
  --emerald-subtle: rgba(22, 199, 132, 0.1);
  --emerald-border: rgba(22, 199, 132, 0.22);
  
  --border-light: rgba(255, 255, 255, 0.07);
  --border-focus: rgba(22, 199, 132, 0.45);

  --text-primary: #F4F7F5;
  --text-secondary: rgba(244, 247, 245, 0.72);
  --text-muted: rgba(244, 247, 245, 0.42);

  --font-main: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-main);
  height: 100vh;
  overflow: hidden;
  display: flex;
}

/* Background Ambiance */
.admin-ambient-glow {
  position: fixed;
  top: -100px;
  right: -50px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(22, 199, 132, 0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ==========================================================================
   SIDEBAR DE NAVEGAÇÃO
   ========================================================================== */
.admin-sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 18px;
  z-index: 10;
  flex-shrink: 0;
}

.sidebar-brand-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 30px;
  padding-left: 8px;
}

.sidebar-logo {
  height: 26px;
  width: auto;
  align-self: flex-start;
}

.sidebar-tag {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--emerald-primary);
}

.sidebar-nav-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-section-title {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 18px 0 6px 10px;
}

.nav-item-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 11px 14px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.22s var(--ease-smooth);
  width: 100%;
  text-align: left;
}

.nav-item-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.nav-item-btn.active {
  color: #050505;
  background: var(--emerald-primary);
  font-weight: 700;
  box-shadow: 0 0 15px rgba(22, 199, 132, 0.4);
}

.nav-item-btn svg {
  flex-shrink: 0;
}

.nav-badge-live {
  font-size: 0.6rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 999px;
  margin-left: auto;
  font-weight: 800;
}

.nav-item-btn.active .nav-badge-live {
  background: rgba(0, 0, 0, 0.2);
  color: #050505;
}

/* Perfil Inferior na Sidebar */
.sidebar-user-footer {
  padding-top: 18px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar-hex {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--emerald-primary) 0%, #086141 100%);
  color: #050505;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.85rem;
  box-shadow: 0 0 12px rgba(22, 199, 132, 0.3);
}

.user-meta-info .name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.user-meta-info .role {
  font-size: 0.65rem;
  color: var(--emerald-primary);
  letter-spacing: 0.05em;
}

/* ==========================================================================
   ÁREA PRINCIPAL DE CONTEÚDO
   ========================================================================== */
.admin-main-stage {
  flex: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* Topbar Executiva */
.admin-topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border-light);
  background: rgba(10, 13, 12, 0.85);
  backdrop-filter: blur(15px);
  padding: 0 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.topbar-page-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.label-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.label-breadcrumb {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.topbar-actions-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.status-badge-pill {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--emerald-primary);
  background: var(--emerald-subtle);
  border: 1px solid var(--emerald-border);
  padding: 5px 12px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald-primary);
  box-shadow: 0 0 8px var(--emerald-primary);
}

.btn-quick-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-quick-action:hover {
  border-color: var(--emerald-border);
  background: rgba(22, 199, 132, 0.08);
  color: var(--emerald-primary);
}

.btn-nav-primary {
  background: linear-gradient(135deg, var(--emerald-primary), #059669);
  color: #030504 !important;
  font-family: var(--font-main, 'Montserrat', sans-serif);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 9px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 0 16px rgba(22, 199, 132, 0.35);
  transition: all 0.25s ease;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.btn-nav-primary:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 24px rgba(22, 199, 132, 0.55);
  transform: translateY(-1px);
}

.btn-nav-primary:active {
  transform: translateY(0);
}

.btn-nav-primary svg {
  flex-shrink: 0;
}

/* Área das Abas (Views) */
.view-container-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 30px;
  display: none;
}

.view-container-viewport.active-view {
  display: block;
}

/* ==========================================================================
   ABA 1: DASHBOARD GERAL & PIPELINE
   ========================================================================== */
.stats-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.stat-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 22px;
  position: relative;
  transition: all 0.25s ease;
}

.stat-kpi-card:hover {
  border-color: var(--emerald-border);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.kpi-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.kpi-tag {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.kpi-icon {
  color: var(--emerald-primary);
}

.kpi-number-display {
  font-size: 1.9rem;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.kpi-number-display.green {
  color: var(--emerald-primary);
}

.kpi-sub-trend {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.kpi-sub-trend strong {
  color: var(--emerald-primary);
}

/* Grid Duplo de Módulos (Pipeline + Ações Rápidas) */
.dashboard-modules-split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 25px;
}

.panel-block-box {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 25px;
}

.panel-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}

.panel-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.deals-pipeline-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.deal-item-row {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.deal-item-row:hover {
  background: rgba(22, 199, 132, 0.04);
  border-color: var(--emerald-border);
}

.deal-lead-meta .company {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

.deal-lead-meta .focus {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.deal-badge-status {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}

.status-negotiation {
  background: rgba(22, 199, 132, 0.12);
  color: var(--emerald-primary);
  border: 1px solid var(--emerald-border);
}

.status-proposal-sent {
  background: rgba(255, 204, 0, 0.12);
  color: #ffcc00;
  border: 1px solid rgba(255, 204, 0, 0.25);
}

.deal-val-col {
  text-align: right;
}

.deal-val-col .val {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
}

.deal-val-col .term {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* ==========================================================================
   ABA 2: DECK COMERCIAL EMBUTIDO (100% OPERACIONAL)
   ========================================================================== */
#view-deck {
  padding: 0;
  height: 100%;
}

.deck-frame-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.deck-control-subbar {
  background: #0d0f0e;
  border-bottom: 1px solid var(--border-light);
  padding: 10px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.deck-info-crumb {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.deck-iframe-viewport {
  flex: 1;
  width: 100%;
  height: calc(100vh - var(--topbar-h) - 48px);
  border: none;
  background: #050505;
}

/* ==========================================================================
   ABA 3: PROPOSTAS DIGITAIS (DALU MODAS & MODELOS)
   ========================================================================== */
.proposals-grid-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.proposal-preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
}

.proposal-preview-card:hover {
  border-color: var(--emerald-border);
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
}

.prop-card-header {
  background: linear-gradient(135deg, rgba(22, 199, 132, 0.12) 0%, rgba(13, 15, 14, 0.95) 100%);
  padding: 22px;
  border-bottom: 1px solid var(--border-light);
}

.prop-client-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.prop-client-sub {
  font-size: 0.72rem;
  color: var(--emerald-primary);
  letter-spacing: 0.05em;
}

.prop-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.prop-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
  padding-bottom: 8px;
}

.prop-meta-row .lbl {
  color: var(--text-muted);
}

.prop-meta-row .val {
  font-weight: 700;
  color: var(--text-primary);
}

.prop-card-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 10px;
}

.btn-open-prop {
  flex: 1;
  background: var(--emerald-primary);
  color: #050505;
  font-family: var(--font-main);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 0 12px rgba(22, 199, 132, 0.35);
}

.btn-share-prop {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
}

/* ==========================================================================
   ABA 4: PILARES & ACESSOS RÁPIDOS
   ========================================================================== */
.pillars-config-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.pillar-config-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 25px;
}

.pillar-config-card h3 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.pillar-config-card p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

/* ==========================================================================
   MULTIDECK SELECTOR & BARRA SUPERIOR
   ========================================================================== */
.deck-selector-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.deck-dropdown-select {
  background: rgba(5, 7, 6, 0.9);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
}

.deck-dropdown-select:focus {
  border-color: var(--emerald-primary);
}

.btn-new-deck {
  background: rgba(22, 199, 132, 0.12);
  border: 1px solid var(--emerald-border);
  color: var(--emerald-primary);
  font-family: var(--font-main);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-new-deck:hover {
  background: var(--emerald-primary);
  color: #050505;
}

/* ==========================================================================
   ABA CRM DE PARCEIROS — FUNIL KANBAN
   ========================================================================== */
.crm-pipeline-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 20px;
}

.crm-top-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px 24px;
}

.crm-title-box h3 {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
}

.crm-title-box p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* CRM TOP BAR & FILTERS */
.crm-mode-badge {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(22, 199, 132, 0.15);
  color: var(--emerald-primary);
  padding: 3px 8px;
  border-radius: 4px;
}

.crm-filter-pills {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  gap: 4px;
}

.crm-filter-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.crm-filter-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.crm-filter-btn.active {
  background: rgba(22, 199, 132, 0.15);
  color: var(--emerald-primary);
  border: 1px solid var(--emerald-border);
}

.pill-count {
  font-size: 0.62rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 6px;
  border-radius: 10px;
}

.crm-kanban-board {
  display: flex;
  gap: 18px;
  flex: 1;
  overflow-x: auto;
  padding-bottom: 8px;
}

.kanban-col {
  background: rgba(13, 16, 14, 0.5);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 300px;
  max-width: 340px;
  flex: 1;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.kanban-col.drag-over {
  background: rgba(22, 199, 132, 0.08);
  border-color: var(--emerald-primary);
}

.col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 10px;
}

.col-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.col-count {
  font-size: 0.68rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 20px;
}

.kanban-cards-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  min-height: 120px;
}

/* CARDS DO KANBAN DRAGGABLE */
.crm-card {
  background: #0d100e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: grab;
  transition: all 0.2s ease;
  user-select: none;
}

.crm-card:active {
  cursor: grabbing;
}

.crm-card.is-dragging {
  opacity: 0.35;
  transform: scale(0.96);
  border-color: var(--emerald-primary);
}

.crm-card:hover {
  border-color: var(--emerald-border);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
}

.crm-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.crm-card-company {
  font-size: 0.94rem;
  font-weight: 800;
  color: #ffffff;
}

.crm-card-cadence-badge {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(22, 199, 132, 0.12);
  color: var(--emerald-primary);
  border: 1px solid rgba(22, 199, 132, 0.25);
  white-space: nowrap;
}

.crm-card-detail {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.crm-card-contact {
  font-size: 0.72rem;
  color: var(--emerald-primary);
  font-weight: 600;
}

/* INSTAGRAM NO CARD DO KANBAN */
.crm-card-instagram {
  margin-top: 4px;
  display: flex;
  align-items: center;
}

.crm-btn-instagram {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.70rem;
  font-weight: 700;
  color: #f472b6;
  background: rgba(236, 72, 153, 0.08);
  border: 1px solid rgba(236, 72, 153, 0.25);
  padding: 2.5px 8px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  width: fit-content;
}

.crm-btn-instagram:hover {
  background: rgba(236, 72, 153, 0.18);
  border-color: rgba(236, 72, 153, 0.5);
  color: #fbcfe8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.2);
}

.crm-btn-instagram svg {
  stroke: #ec4899;
  flex-shrink: 0;
}

.crm-btn-instagram .insta-arrow {
  font-size: 0.65rem;
  opacity: 0.75;
}

.crm-btn-add-insta {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  color: var(--text-muted);
  font-size: 0.66rem;
  padding: 2px 7px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.crm-btn-add-insta svg {
  stroke: var(--text-muted);
  transition: stroke 0.2s ease;
}

.crm-btn-add-insta:hover {
  border-color: rgba(236, 72, 153, 0.45);
  color: #f472b6;
  background: rgba(236, 72, 153, 0.06);
}

.crm-btn-add-insta:hover svg {
  stroke: #f472b6;
}

.crm-card-followup-alert {
  font-size: 0.66rem;
  font-weight: 700;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* BADGES DE RESPONSÁVEL NO CARD DO KANBAN */
.crm-card-assignee-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  width: fit-content;
  transition: all 0.2s ease;
}

.crm-card-assignee-badge .assignee-avatar {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.58rem;
  font-weight: 800;
  color: #ffffff;
}

.assignee-avatar-img {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  flex-shrink: 0;
  display: block;
}

/* Fernando: Azul High-Tech Executivo */
.assignee-fernando {
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}
.assignee-fernando .assignee-avatar-img {
  border: 1px solid rgba(147, 197, 253, 0.8);
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.4);
}
.assignee-fernando .assignee-avatar {
  background: #2563eb;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.5);
}

/* Jamyli: Púrpura / Rose High-Tech Executivo */
.assignee-jamyli {
  background: rgba(217, 70, 239, 0.14);
  border: 1px solid rgba(217, 70, 239, 0.35);
  color: #f0abfc;
}
.assignee-jamyli .assignee-avatar-img {
  border: 1px solid rgba(240, 171, 252, 0.8);
  box-shadow: 0 0 6px rgba(217, 70, 239, 0.4);
}
.assignee-jamyli .assignee-avatar {
  background: #c026d3;
  box-shadow: 0 0 8px rgba(192, 38, 211, 0.5);
}

/* Sem Responsável */
.assignee-none {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}
.assignee-none .assignee-avatar {
  background: rgba(255, 255, 255, 0.16);
  color: var(--text-secondary);
}

.crm-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
}

.crm-btn-wpp {
  background: rgba(22, 199, 132, 0.15);
  color: var(--emerald-primary);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 4px;
  transition: all 0.2s;
}

.crm-btn-wpp:hover {
  background: var(--emerald-primary);
  color: #050505;
}

.crm-btn-card-edit {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.crm-btn-card-edit:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

/* MODAL DE CADÊNCIA & COMPONENTES */
.cadence-box-container {
  margin-top: 16px;
  background: #060807;
  border: 1px solid rgba(22, 199, 132, 0.2);
  border-radius: 10px;
  padding: 14px;
}

.cadence-step-badge {
  font-size: 0.68rem;
  font-weight: 800;
  background: var(--emerald-primary);
  color: #050505;
  padding: 2px 8px;
  border-radius: 10px;
}

.cadence-step-buttons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 8px;
  margin-bottom: 12px;
}

.btn-cadence-step {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 8px 4px;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.btn-cadence-step:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-cadence-step.active {
  background: rgba(22, 199, 132, 0.18);
  border-color: var(--emerald-primary);
  color: var(--emerald-primary);
}

.cadence-preview-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cadence-action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.btn-send-whatsapp-cadence {
  background: var(--emerald-primary);
  color: #050505;
  font-family: var(--font-main);
  font-size: 0.74rem;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 0 12px rgba(22, 199, 132, 0.35);
  transition: all 0.2s ease;
}

.btn-send-whatsapp-cadence:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(22, 199, 132, 0.6);
}

.btn-quick-followup {
  font-size: 0.65rem;
  padding: 3px 8px;
}


/* ==========================================================================
   ABA 5: POPS OPERACIONAIS — PLAYBOOKS & PROMPTS
   ========================================================================== */
.pops-workspace-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  height: 100%;
}

.pops-sidebar-nav {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pops-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pops-nav-header h4 {
  font-size: 0.88rem;
  font-weight: 800;
  color: #ffffff;
}

.btn-new-pop-trigger {
  background: rgba(22, 199, 132, 0.1);
  border: 1px solid var(--emerald-border);
  color: var(--emerald-primary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.pops-list-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pop-menu-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  color: inherit;
}

.pop-menu-item:hover,
.pop-menu-item.active {
  background: rgba(22, 199, 132, 0.06);
  border-color: var(--emerald-border);
}

.pop-dot-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.pop-menu-item.active .pop-dot-status {
  background: var(--emerald-primary);
  box-shadow: 0 0 10px var(--emerald-primary);
}

.pop-menu-item .p-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
}

.pop-menu-item .p-cat {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.pop-content-stage {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 30px;
  overflow-y: auto;
}

.pop-playbook-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pop-tag-pill {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--emerald-primary);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.pop-title-main {
  font-size: 1.5rem;
  font-weight: 900;
  color: #ffffff;
}

.pop-desc-main {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin-top: 6px;
  max-width: 750px;
  line-height: 1.5;
}

.pop-steps-flow {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pop-step-card {
  background: rgba(5, 7, 6, 0.75);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: all 0.2s ease;
}

.pop-step-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.step-badge-num {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-body {
  flex: 1;
}

.step-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 4px;
}

.step-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.step-text code {
  background: rgba(22, 199, 132, 0.1);
  color: var(--emerald-primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.78rem;
}

/* BLOCO DE PROMPT COMPACTO & BOTÃO COPIAR */
.prompt-compact-box {
  margin-top: 12px;
  background: #020302;
  border: 1px solid rgba(22, 199, 132, 0.25);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.prompt-code-mini {
  font-family: monospace;
  font-size: 0.75rem;
  color: #a3e635;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 75px;
  overflow-y: auto;
  line-height: 1.4;
  flex: 1;
  padding-right: 8px;
}

.btn-copy-prompt {
  background: var(--emerald-primary);
  color: #050505;
  border: none;
  font-family: var(--font-main);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(22, 199, 132, 0.3);
  transition: all 0.2s ease;
}

.btn-copy-prompt:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(22, 199, 132, 0.6);
}

/* BOTÃO ADICIONAR PASSO NO TOPO DO PLAYBOOK */
.pop-header-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 6px;
}

.btn-add-step-pop {
  background: rgba(22, 199, 132, 0.12);
  border: 1px solid var(--emerald-border);
  color: var(--emerald-primary);
  font-family: var(--font-main);
  font-size: 0.76rem;
  font-weight: 800;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-add-step-pop:hover {
  background: var(--emerald-primary);
  color: #050505;
  box-shadow: 0 0 16px rgba(22, 199, 132, 0.4);
  transform: translateY(-1px);
}

.step-card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}

.btn-step-action {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-step-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-step-action.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}


/* ==========================================================================
   MODAL UNIVERSAL & ENTERPRISE ARCHITECTURE (INSPIRADO NO CLICKUP LUXURY)
   ========================================================================== */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 4, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
  animation: fadeInModal 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.admin-modal-box {
  background: #0c0f0d;
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 35px 95px rgba(0, 0, 0, 0.88), 0 0 0 1px rgba(22, 199, 132, 0.14);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUpModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--font-main);
}

@keyframes slideUpModal {
  from { transform: translateY(18px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.step-modal-expanded {
  max-width: 860px !important;
}

/* TOPBAR ESTILO CLICKUP (BREADCRUMBS & CLOSE) */
.modal-clickup-topbar {
  padding: 16px 26px 12px 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(14, 18, 15, 0.85);
  flex-shrink: 0;
}

.modal-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-muted);
}

.modal-breadcrumbs .bc-icon {
  font-size: 0.85rem;
}

.modal-breadcrumbs .bc-sep {
  color: rgba(255, 255, 255, 0.18);
  font-size: 0.7rem;
}

.modal-breadcrumbs .bc-badge {
  background: rgba(22, 199, 132, 0.12);
  color: var(--emerald-primary);
  border: 1px solid rgba(22, 199, 132, 0.25);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
}

.btn-close-modal {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-close-modal:hover {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

/* HEADER DO MODAL (PADRÃO SIMPLES QUANDO APLICÁVEL) */
.modal-header {
  padding: 20px 28px;
  background: linear-gradient(180deg, rgba(16, 21, 18, 0.9) 0%, rgba(12, 15, 13, 0.95) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.modal-header-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(22, 199, 132, 0.12);
  border: 1px solid rgba(22, 199, 132, 0.25);
  color: var(--emerald-primary);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.modal-subtitle {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 3px;
  line-height: 1.4;
}

/* TITULO EXPANSIVO ESTILO CLICKUP TASK */
.clickup-title-section {
  padding: 20px 28px 12px 28px;
  background: #0c0f0d;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.clickup-title-input {
  font-size: 1.65rem !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  letter-spacing: -0.02em !important;
  background: transparent !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  padding: 4px 0 !important;
  width: 100% !important;
  outline: none !important;
  transition: border-color 0.2s ease !important;
  box-shadow: none !important;
}

.clickup-title-input:hover {
  border-bottom-color: rgba(255, 255, 255, 0.12) !important;
}

.clickup-title-input:focus {
  border-bottom-color: var(--emerald-primary) !important;
  box-shadow: none !important;
}

.clickup-title-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.clickup-ai-pill-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.clickup-ai-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
}

.clickup-ai-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald-primary);
}

/* MODAL BODY COM SCROLL SUAVE */
.modal-body {
  padding: 24px 28px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--emerald-primary);
}

/* GRID DE PROPRIEDADES (CLICKUP 2-COLUMNS ATTRIBUTES) */
.clickup-properties-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 28px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 18px 22px;
}

.clickup-prop-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.clickup-prop-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.clickup-prop-label svg {
  color: var(--emerald-primary);
  opacity: 0.85;
}

/* RESET E ESTILIZAÇÃO UNIVERSAL DE INPUTS/SELECTS/TEXTAREAS */
.admin-modal-box input[type="text"],
.admin-modal-box input[type="number"],
.admin-modal-box input[type="date"],
.admin-modal-box input[type="email"],
.admin-modal-box input[type="tel"],
.admin-modal-box select,
.editor-textarea,
.prompt-editor-textarea {
  width: 100% !important;
  background: #060907 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 8px !important;
  padding: 10px 14px !important;
  font-family: var(--font-main) !important;
  font-size: 0.88rem !important;
  color: #ffffff !important;
  letter-spacing: normal !important;
  outline: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease !important;
  box-sizing: border-box !important;
}

.admin-modal-box input:focus,
.admin-modal-box select:focus,
.editor-textarea:focus {
  border-color: var(--emerald-primary) !important;
  box-shadow: 0 0 0 3px rgba(22, 199, 132, 0.16) !important;
  background: #080d0a !important;
}

.admin-modal-box select option {
  background: #0b0e0c !important;
  color: #ffffff !important;
  padding: 8px !important;
}

.clickup-status-select {
  border-color: rgba(22, 199, 132, 0.3) !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  cursor: pointer !important;
}

/* SEÇÃO DE CADÊNCIA LUXURY (1 A 5) */
.cadence-box-container {
  background: #070908;
  border: 1px solid rgba(22, 199, 132, 0.22);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cadence-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cadence-step-badge {
  font-size: 0.7rem;
  font-weight: 800;
  background: var(--emerald-primary);
  color: #030604;
  padding: 3px 10px;
  border-radius: 20px;
  box-shadow: 0 0 10px rgba(22, 199, 132, 0.4);
}

.cadence-step-buttons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.btn-cadence-step {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 10px 4px;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.btn-cadence-step:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.16);
}

.btn-cadence-step.active {
  background: var(--emerald-primary);
  border-color: var(--emerald-primary);
  color: #030504;
  font-weight: 800;
  box-shadow: 0 0 16px rgba(22, 199, 132, 0.45);
}

.cadence-preview-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.cadence-action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  gap: 12px;
}

.btn-send-whatsapp-cadence {
  background: linear-gradient(135deg, #16C784 0%, #0fa66c 100%);
  color: #030604;
  font-family: var(--font-main);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 10px 18px;
  border-radius: 8px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 0 16px rgba(22, 199, 132, 0.4);
  transition: all 0.2s ease;
}

.btn-send-whatsapp-cadence:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(22, 199, 132, 0.65);
}

/* SEÇÃO DE FOLLOW-UP E ARQUIVAMENTO */
.clickup-meta-footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding-top: 14px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.btn-quick-followup {
  font-size: 0.68rem;
  padding: 4px 10px;
  border-radius: 6px;
}

/* TOOLBAR DE ATALHOS DE FORMATAÇÃO (POP STEP MODAL) */
.format-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.btn-format-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.btn-format-tag:hover {
  background: rgba(22, 199, 132, 0.18);
  border-color: var(--emerald-border);
  color: #ffffff;
  transform: translateY(-1px);
}

.editor-textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}

/* PRÉVIA EM TEMPO REAL */
.preview-helper-box {
  margin-top: 8px;
  background: #050706;
  border: 1px dashed rgba(22, 199, 132, 0.25);
  border-radius: 8px;
  padding: 14px 18px;
}

.preview-badge {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--emerald-primary);
  display: block;
  margin-bottom: 6px;
}

.step-live-preview {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  word-break: break-word;
}

.step-live-preview code {
  background: rgba(22, 199, 132, 0.15);
  color: var(--emerald-primary);
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 0.84rem;
  font-family: var(--font-mono);
  border: 1px solid rgba(22, 199, 132, 0.3);
}

.step-live-preview b, 
.step-live-preview strong {
  color: #ffffff;
  font-weight: 800;
}

/* TERMINAL DE PROMPT COMPACTO (IA) */
.prompt-toggle-section {
  margin-top: 6px;
  padding: 16px 18px;
  border-radius: 12px;
  background: rgba(22, 199, 132, 0.04);
  border: 1px solid rgba(22, 199, 132, 0.2);
}

.prompt-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.custom-chk {
  accent-color: var(--emerald-primary);
  width: 20px;
  height: 20px;
  cursor: pointer;
  margin-top: 2px;
  flex-shrink: 0;
}

.chk-label {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chk-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--emerald-primary);
}

.chk-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.prompt-terminal-wrapper {
  margin-top: 12px;
  background: #020302;
  border: 1px solid rgba(22, 199, 132, 0.35);
  border-radius: 10px;
  overflow: hidden;
}

.prompt-terminal-header {
  background: rgba(22, 199, 132, 0.08);
  border-bottom: 1px solid rgba(22, 199, 132, 0.2);
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.prompt-mac-dots {
  display: flex;
  gap: 6px;
}

.prompt-mac-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.prompt-mac-dots .dot-r { background: #ef4444; }
.prompt-mac-dots .dot-y { background: #f59e0b; }
.prompt-mac-dots .dot-g { background: #10b981; }

.prompt-editor-textarea {
  width: 100%;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 14px 16px !important;
  font-family: var(--font-mono) !important;
  font-size: 0.84rem !important;
  color: #a3e635 !important;
  outline: none !important;
  resize: vertical !important;
  line-height: 1.55 !important;
  min-height: 100px;
}

/* FOOTER DO MODAL ESTILO CLICKUP */
.modal-footer {
  padding: 18px 28px;
  background: #080b09;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.modal-footer .btn-quick-action {
  padding: 10px 20px;
  font-size: 0.84rem;
  border-radius: 8px;
}

.modal-footer .btn-nav-primary {
  padding: 10px 24px;
  font-size: 0.84rem;
  font-weight: 800;
  border-radius: 8px;
  box-shadow: 0 0 18px rgba(22, 199, 132, 0.35);
}

/* ==========================================================================
   ABA DE FUNIL & ANALYTICS DE CONVERSÃO (DARK LUXURY PIPELINE)
   ========================================================================== */

.funnel-analytics-container {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
}

/* FILTRO DE SÓCIO NO FUNIL */
#funnel-partner-filter-pills .crm-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* GRID HORIZONTAL DE CARDS POR ETAPA EM NÚMEROS */
.funnel-stage-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

.funnel-stage-metric-card {
  background: rgba(12, 16, 14, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.funnel-stage-metric-card:hover {
  border-color: rgba(22, 199, 132, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.funnel-stage-metric-card.card-revenue {
  background: linear-gradient(145deg, rgba(22, 199, 132, 0.12) 0%, rgba(12, 16, 14, 0.9) 100%);
  border-color: rgba(22, 199, 132, 0.4);
}

.funnel-stage-metric-card.card-lost {
  background: linear-gradient(145deg, rgba(239, 68, 68, 0.08) 0%, rgba(18, 12, 12, 0.9) 100%);
  border-color: rgba(239, 68, 68, 0.3);
}

.funnel-stage-metric-card.card-lost:hover {
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.25);
}

.stage-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stage-card-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stage-card-icon {
  font-size: 0.95rem;
}

.stage-card-number {
  font-size: 1.7rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 2px 0;
}

.card-revenue .stage-card-number {
  color: var(--emerald-primary);
  text-shadow: 0 0 20px rgba(22, 199, 132, 0.4);
}

.stage-card-foot {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stage-card-foot .pass-rate-pill {
  color: var(--emerald-primary);
}

/* LAYOUT PRINCIPAL DO FUNIL (SPLIT 2 COLUNAS) */
.funnel-main-split {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 22px;
  align-items: start;
}

.funnel-card-panel {
  background: rgba(10, 14, 12, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  backdrop-filter: blur(12px);
}

.panel-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 16px;
}

.panel-header-row h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.panel-header-row p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

.panel-badge-pill {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(22, 199, 132, 0.12);
  border: 1px solid rgba(22, 199, 132, 0.3);
  color: var(--emerald-primary);
  white-space: nowrap;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ESTRUTURA GEOMÉTRICA DO FUNIL (SVG EM TRAPÉZIOS) */
.geometric-funnel-svg-wrapper {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
}

.geometric-funnel-svg {
  width: 100%;
  max-width: 540px;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.6));
}

.geometric-funnel-svg polygon {
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.geometric-funnel-svg polygon:hover {
  filter: brightness(1.2) drop-shadow(0 0 16px rgba(22, 199, 132, 0.6));
}

/* CARD: MAIOR GARGALO (GAP) DETECTADO */
.gap-alert-card {
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.1) 0%, rgba(18, 14, 12, 0.95) 100%);
  border: 1px solid rgba(249, 115, 22, 0.4);
  padding: 20px 22px;
  gap: 8px;
}

.gap-alert-header {
  display: flex;
  align-items: center;
}

.gap-warning-badge {
  font-size: 0.72rem;
  font-weight: 900;
  color: #fb923c;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gap-stage-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
  margin: 6px 0 4px 0;
}

.gap-description {
  font-size: 0.8rem;
  color: rgba(244, 247, 245, 0.8);
  line-height: 1.55;
  margin: 0;
}

.gap-description strong {
  color: #ffffff;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: #fb923c;
}

/* TAXA DE PASSAGEM POR ETAPA (% PRÓXIMO FUNIL) */
.stage-pass-rates-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stage-pass-rate-item {
  background: rgba(14, 18, 16, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: var(--transition);
}

.stage-pass-rate-item:hover {
  border-color: rgba(22, 199, 132, 0.3);
  background: rgba(16, 22, 18, 0.9);
}

.pass-rate-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pass-rate-label {
  font-size: 0.8rem;
  font-weight: 800;
  color: #ffffff;
}

.pass-rate-metrics {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pass-rate-percent {
  font-size: 0.8rem;
  font-weight: 800;
  color: #60a5fa;
}

.pass-rate-gap-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
}

.pass-rate-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.pass-rate-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.pass-rate-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb 0%, #38bdf8 100%);
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* PERFORMANCE DOS SÓCIOS (FERNANDO vs JAMYLI) */
.partners-performance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.partner-metric-card {
  background: rgba(14, 18, 16, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition);
}

.partner-metric-card:hover {
  transform: translateY(-2px);
}

.partner-metric-card.card-fernando {
  border-color: rgba(59, 130, 246, 0.35);
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.06) 0%, rgba(14, 18, 16, 0.95) 100%);
}

.partner-metric-card.card-fernando.is-selected {
  border-color: #3b82f6;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.16) 0%, rgba(14, 18, 16, 0.98) 100%);
}

.partner-metric-card.card-jamyli {
  border-color: rgba(217, 70, 239, 0.35);
  background: linear-gradient(145deg, rgba(217, 70, 239, 0.06) 0%, rgba(14, 18, 16, 0.95) 100%);
}

.partner-metric-card.card-jamyli.is-selected {
  border-color: #d946ef;
  box-shadow: 0 0 20px rgba(217, 70, 239, 0.4);
  background: linear-gradient(145deg, rgba(217, 70, 239, 0.16) 0%, rgba(14, 18, 16, 0.98) 100%);
}

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

.partner-metric-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  flex-shrink: 0;
}

.card-fernando .partner-metric-avatar {
  border: 2px solid rgba(59, 130, 246, 0.75);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.card-jamyli .partner-metric-avatar {
  border: 2px solid rgba(217, 70, 239, 0.75);
  box-shadow: 0 0 12px rgba(217, 70, 239, 0.4);
}

.partner-name-role h5 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 2px;
}

.partner-name-role span {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.partner-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  padding: 10px 12px;
  border-radius: 8px;
}

.p-stat-item .p-stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 2px;
}

.p-stat-item .p-stat-value {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
}

/* CADÊNCIA ANALYTICS */
.cadence-analytics-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cadence-bar-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cadence-bar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
}

.cadence-step-tag {
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cadence-count-pill {
  color: var(--emerald-primary);
  font-size: 0.72rem;
  background: rgba(22, 199, 132, 0.1);
  padding: 2px 7px;
  border-radius: 4px;
}

.cadence-bar-track {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.cadence-bar-fill {
  height: 100%;
  background: var(--emerald-primary);
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* DIAGNÓSTICO INTELIGENTE */
.diagnostic-box {
  border-color: rgba(22, 199, 132, 0.25);
  background: linear-gradient(145deg, rgba(22, 199, 132, 0.05) 0%, rgba(10, 14, 12, 0.85) 100%);
}

.diagnostic-tips-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.diagnostic-tip-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.diagnostic-tip-item strong {
  color: #ffffff;
}

.diagnostic-tip-item .tip-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* RESPONSIVIDADE DO FUNIL */
@media (max-width: 1200px) {
  .funnel-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .funnel-main-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .funnel-kpi-grid {
    grid-template-columns: 1fr;
  }
  .partners-performance-grid {
    grid-template-columns: 1fr;
  }
}

/* ==============================================================================
   CONFIGURAÇÕES, EVOLUTION API & OPENAI IA STYLES (DARK LUXURY)
   ============================================================================== */

.settings-workspace-layout {
  padding: 32px;
  max-width: 1320px;
  margin: 0 auto;
}

.settings-main-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.settings-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-header-icon {
  font-size: 1.6rem;
  filter: drop-shadow(0 0 12px rgba(22, 199, 132, 0.3));
}

.settings-main-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.02em;
}

.settings-header-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin: 6px 0 0 0;
  max-width: 720px;
  line-height: 1.5;
}

.settings-saved-pill {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--emerald-primary);
  background: rgba(22, 199, 132, 0.12);
  border: 1px solid rgba(22, 199, 132, 0.3);
  padding: 6px 14px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

/* SUB-ABAS DE CONFIGURAÇÃO */
.settings-subtabs-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 8px;
  overflow-x: auto;
}

.settings-tab-btn {
  background: transparent;
  border: none;
  padding: 10px 18px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

.settings-tab-btn.active {
  color: var(--emerald-primary);
  background: rgba(22, 199, 132, 0.1);
  border-bottom: 2px solid var(--emerald-primary);
  border-radius: 8px 8px 0 0;
}

/* PAINÉIS */
.settings-panel-content {
  display: none;
  animation: fadeIn 0.25s ease-out forwards;
}

.settings-panel-content.active {
  display: block;
}

.settings-card-box {
  background: #090c0a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.settings-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.settings-card-header h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.settings-card-header p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 4px 0 0 0;
}

/* FORM ELEMENTS */
.settings-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.settings-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.settings-input {
  background: #030504;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.86rem;
  color: #ffffff;
  transition: all 0.2s ease;
  font-family: inherit;
}

.settings-input:focus {
  outline: none;
  border-color: var(--emerald-primary);
  box-shadow: 0 0 0 2px rgba(22, 199, 132, 0.2);
}

.settings-field-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper .settings-input {
  width: 100%;
  padding-right: 42px;
}

.btn-toggle-password {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.btn-toggle-password:hover {
  opacity: 1;
}

.settings-card-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.test-feedback-text {
  font-size: 0.8rem;
  font-weight: 600;
}

.server-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
}

.server-status-pill.connected {
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.server-status-pill.disconnected {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.8s infinite;
}

/* CARDS DE INSTÂNCIAS DOS SÓCIOS */
.instances-dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.partner-instance-card {
  background: #040705;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.partner-instance-card:hover {
  border-color: rgba(22, 199, 132, 0.35);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.partner-instance-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.partner-instance-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--emerald-primary);
  box-shadow: 0 0 12px rgba(22, 199, 132, 0.25);
}

.partner-instance-name {
  font-size: 0.96rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.partner-instance-role {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.instance-connection-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
}

.instance-connection-badge.connected {
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.instance-connection-badge.disconnected {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.instance-connection-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.instance-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.btn-instance-action {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  padding: 8px 12px;
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.btn-instance-action:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-instance-action.qrcode {
  background: rgba(22, 199, 132, 0.12);
  border-color: rgba(22, 199, 132, 0.3);
  color: var(--emerald-primary);
  flex: 1.5;
}

.btn-instance-action.qrcode:hover {
  background: var(--emerald-primary);
  color: #000000;
}

/* TOGGLES LIST */
.settings-toggles-list {
  display: flex;
  flex-direction: column;
}

.settings-toggle-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.toggle-title {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  color: #ffffff;
}

.toggle-desc {
  display: block;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

/* BOTÃO DIAGNÓSTICO IA NO FUNIL */
.btn-ai-audit-trigger {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.15));
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #f3e8ff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-ai-audit-trigger:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.35), rgba(236, 72, 153, 0.3));
  border-color: rgba(168, 85, 247, 0.8);
  box-shadow: 0 0 24px rgba(168, 85, 247, 0.4);
  transform: translateY(-1px);
}

/* CONTAINER DA AUDITORIA DA IA */
.ai-audit-stage-container {
  margin-top: 20px;
  background: #040705;
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 12px;
  padding: 24px;
  min-height: 220px;
}

.ai-audit-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.ai-audit-report-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fadeIn 0.3s ease-out;
}

.ai-report-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 18px 20px;
}

.ai-report-card.alert-card {
  border-left: 4px solid #ef4444;
  background: rgba(239, 68, 68, 0.04);
}

.ai-report-card.actions-card {
  border-left: 4px solid var(--emerald-primary);
  background: rgba(22, 199, 132, 0.04);
}

.ai-report-card h5 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-report-card p {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.ai-report-card ul {
  margin: 10px 0 0 0;
  padding-left: 20px;
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* BARRA DE INTEGRAÇÃO DE CADÊNCIA NO CARD DO LEAD */
.cadence-integration-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  gap: 12px;
  flex-wrap: wrap;
}

.cadence-instance-selector-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cadence-mini-select {
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 6px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
}

.cadence-buttons-cluster {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-cadence-ai-enhance {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #d8b4fe;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cadence-ai-enhance:hover {
  background: rgba(168, 85, 247, 0.3);
  border-color: #c084fc;
}

.btn-send-evolution-api {
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  color: #030504;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.3);
}

.btn-send-evolution-api:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.cadence-dispatch-feedback-pill {
  margin-top: 8px;
  padding: 6px 12px;
  font-size: 0.74rem;
  font-weight: 700;
  border-radius: 6px;
  text-align: center;
}

.cadence-dispatch-feedback-pill.success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.cadence-dispatch-feedback-pill.error {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* QR CODE WRAPPER */
.qrcode-display-wrapper {
  margin: 16px auto;
  width: 240px;
  height: 240px;
  background: #ffffff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-shadow: 0 0 32px rgba(22, 199, 132, 0.2);
}

.qrcode-display-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qrcode-loading-spinner {
  color: #000000;
  font-size: 0.82rem;
  font-weight: 700;
}

.qrcode-status-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
}

.qrcode-expire-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .settings-form-grid-2,
  .instances-dual-grid {
    grid-template-columns: 1fr;
  }
}

/* GRID DE INSTÂNCIAS RESPONSIVO (FERNANDO, JAMYLI, VEXA BOT) */
.instances-dual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

/* HISTÓRICO DE RESUMOS PERPÉTUOS NO MODAL DO LEAD */
.lead-summaries-history-section {
  margin-top: 18px;
  background: rgba(168, 85, 247, 0.04);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 12px;
  padding: 18px 20px;
}

.lead-summaries-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.lead-summaries-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lead-summary-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px 16px;
  transition: all 0.2s ease;
}

.lead-summary-card:hover {
  border-color: rgba(168, 85, 247, 0.4);
  background: rgba(0, 0, 0, 0.55);
}

.summary-meta-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.summary-date-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #a3e635;
  letter-spacing: 0.02em;
}

.summary-sentiment-tag {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
}

.summary-sentiment-tag.alto_interesse {
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.summary-sentiment-tag.morno {
  color: #eab308;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.summary-sentiment-tag.descartado {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.summary-sentiment-tag.neutro {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
}

.summary-body-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.55;
  white-space: pre-line;
}

