/* ==========================================================================
   ZapCRM • Nexus SaaS B2B Design System Tokens (Slate + Indigo)
   ========================================================================== */
:root {
  /* Brand Colors & Subtle Gradients (Nexus Indigo & Semantic Colors) */
  --brand-50: #e6f4ec;
  --brand-100: #cce9d8;
  --brand-500: #007934;
  --brand-600: #00622a;
  --brand-700: #004d21;

  --argon-gradient-primary: linear-gradient(135deg, #007934 0%, #004d21 100%);
  --argon-gradient-secondary: linear-gradient(135deg, #475569 0%, #334155 100%);
  --argon-gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --argon-gradient-info: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --argon-gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --argon-gradient-danger: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  --argon-gradient-dark: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);

  /* Base Canvas & Surfaces (Tailwind Slate Palette) */
  --bg-shell: #f8fafc;             /* Slate 50 - Fundo geral limpo */
  --bg-surface: #ffffff;           /* Branco puro para Cards e Painéis */
  --bg-surface-subtle: #f1f5f9;    /* Slate 100/80 - Fundo de colunas Kanban e inputs */
  --bg-hover: #f1f5f9;             /* Slate 100 */
  --bg-active: #e2e8f0;            /* Slate 200 */
  --bg-card: #ffffff;
  --bg-card-subtle: #f8fafc;
  --bg-panel: #ffffff;
  --bg-chat-canvas: #f8fafc;
  
  /* Sidebar Dark (Contraste SaaS B2B) */
  --bg-sidebar: #0f172a;           /* Slate 900 */
  --bg-dock: #0f172a;              /* Compatibilidade com Dock */
  --bg-sidebar-hover: rgba(30, 41, 59, 0.6); /* Slate 800/60 */
  --border-sidebar: rgba(30, 41, 59, 0.8);   /* Slate 800/80 */
  --text-sidebar: #94a3b8;         /* Slate 400 */
  --text-sidebar-active: #ffffff;

  /* Typography Colors */
  --text-main: #0f172a;            /* Slate 900 - Títulos e texto principal */
  --text-primary: #0f172a;         /* Compatibilidade */
  --text-secondary: #1e293b;       /* Slate 800 */
  --text-muted: #64748b;           /* Slate 500 - Subtítulos e descrições */
  --text-disabled: #94a3b8;        /* Slate 400 - Placeholders e metadados */
  --text-white: #ffffff;
  --text-inverted: #ffffff;

  /* Borders & Dividers (Finas e elegantes) */
  --border-color: rgba(226, 232, 240, 0.85); /* Slate 200/80 */
  --border-light: rgba(226, 232, 240, 0.85);
  --border-medium: #cbd5e1;                  /* Slate 300 */
  --border-hover: #cbd5e1;                   /* Slate 300 */
  --border-card-hover: #80c29a;              /* Brand 300 */
  --border-focus: #007934;                   /* Brand 500 */

  /* Border Radius (Mais preciso e corporativo que o Argon) */
  --border-radius-xs: 0.25rem;     /* 4px - Badges e Tags */
  --border-radius-sm: 0.5rem;      /* 8px - Botões, Inputs e Cards Kanban */
  --border-radius-md: 0.625rem;    /* 10px */
  --border-radius-lg: 0.75rem;     /* 12px - Painéis, KPIs e Colunas (rounded-xl) */
  --border-radius-xl: 1rem;        /* 16px */
  --border-radius-pill: 9999px;

  /* Compatibilidade com raios legados */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Nexus Signature Micro-Shadows (Sombras sutis estilo Linear/HubSpot) */
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.03);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.04), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-subtle: 0 1px 3px 0 rgba(15, 23, 42, 0.04);
  --shadow-card: 0 1px 3px 0 rgba(15, 23, 42, 0.04), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-pop: 0 12px 28px -4px rgba(15, 23, 42, 0.12);
  --shadow-brand: 0 2px 5px 0 rgba(0, 121, 52, 0.25);
  --shadow-dropdown: 0 10px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);

  /* Omnichannel Brand Accents */
  --color-whatsapp: #10b981;
  --color-instagram: #e1306c;
  --color-gemini-ai: #007934;
  --accent-apple: #007934;
  --accent-whatsapp: #10b981;
  --accent-purple: #007934;

  /* Balões de Chat Estilo SaaS Moderno */
  --chat-bubble-me: #007934;       /* Brand 600 sólido e limpo */
  --chat-bubble-me-text: #ffffff;
  --chat-bubble-other: #ffffff;
  --chat-bubble-other-text: #1e293b;
  --chat-bubble-other-border: #e2e8f0;

  --bubble-me-bg: #007934;
  --bubble-me-text: #ffffff;
  --bubble-other-bg: #ffffff;
  --bubble-other-text: #1e293b;
  --bubble-other-border: #e2e8f0;

  /* Funnel Stage Colors */
  --stage-novo-color: #3b82f6;
  --stage-novo-bg: #eff6ff;
  --stage-novo-border: #bfdbfe;

  --stage-atendimento-color: #d97706;
  --stage-atendimento-bg: #fffbeb;
  --stage-atendimento-border: #fde68a;

  --stage-fechado-color: #059669;
  --stage-fechado-bg: #ecfdf5;
  --stage-fechado-border: #a7f3d0;

  --stage-perdido-color: #e11d48;
  --stage-perdido-bg: #fff1f2;
  --stage-perdido-border: #fecdd3;

  /* Tipografia Oficial */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --ease-apple: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.15s ease;
  --transition-normal: 0.22s ease;
}

/* Nexus Dark Mode Tokens */
[data-theme="dark"] {
  --bg-shell: #090d16;
  --bg-dock: #090d16;
  --bg-sidebar: #090d16;
  --bg-chat-canvas: #090d16;
  --bg-panel: #0f172a;
  --bg-card: #0f172a;
  --bg-card-subtle: #1e293b;
  --bg-surface: #0f172a;
  --bg-surface-subtle: #1e293b;
  --bg-hover: #1e293b;
  --bg-active: #334155;
  --bg-sidebar-hover: #1e293b;
  --border-sidebar: rgba(255, 255, 255, 0.08);

  --text-main: #f8fafc;
  --text-primary: #f8fafc;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;
  --text-disabled: #64748b;
  --text-inverted: #090d16;
  --text-sidebar: #94a3b8;

  --border-color: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.15);
  --border-hover: rgba(255, 255, 255, 0.15);
  --border-focus: #10b981;

  --shadow-card: 0 2px 6px 0 rgba(0, 0, 0, 0.4);
  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.5);
  --shadow-pop: 0 12px 28px rgba(0, 0, 0, 0.6);

  --chat-bubble-me: #007934;
  --chat-bubble-me-text: #ffffff;
  --chat-bubble-other: #1e293b;
  --chat-bubble-other-text: #f8fafc;
  --chat-bubble-other-border: rgba(255, 255, 255, 0.08);

  --bubble-me-bg: #007934;
  --bubble-me-text: #ffffff;
  --bubble-other-bg: #1e293b;
  --bubble-other-text: #f8fafc;
  --bubble-other-border: rgba(255, 255, 255, 0.08);

  --stage-novo-color: #60a5fa;
  --stage-novo-bg: rgba(96, 165, 250, 0.14);
  --stage-novo-border: rgba(96, 165, 250, 0.3);

  --stage-atendimento-color: #fbbf24;
  --stage-atendimento-bg: rgba(251, 191, 36, 0.14);
  --stage-atendimento-border: rgba(251, 191, 36, 0.3);

  --stage-fechado-color: #34d399;
  --stage-fechado-bg: rgba(52, 211, 153, 0.14);
  --stage-fechado-border: rgba(52, 211, 153, 0.3);

  --stage-perdido-color: #fb7185;
  --stage-perdido-bg: rgba(251, 113, 133, 0.14);
  --stage-perdido-border: rgba(251, 113, 133, 0.3);
}

/* ==========================================================================
   CSS Reset & Base
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-shell);
  color: var(--text-primary);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  font-size: 13.5px;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* Custom Scrollbars Limpas */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #334155;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* ==========================================================================
   Master App Layout Grid
   ========================================================================== */
.app-shell {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: var(--bg-shell);
}

/* ==========================================================================
   0. SLIM LEFT NAVIGATION DOCK (Kommo & Apple Minimalist Style)
   ========================================================================== */
.nav-dock {
  width: 76px;
  min-width: 76px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-sidebar);
  color: var(--text-sidebar);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 14px 6px;
  z-index: 50;
  transition: width var(--transition-normal);
  user-select: none;
}

.dock-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.dock-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--border-radius-sm);
  background: var(--argon-gradient-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 121, 52, 0.25);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.dock-logo:hover {
  transform: scale(1.05);
}

/* Workspace Switcher Pill */
.dock-workspace-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-sidebar);
  border-radius: var(--border-radius-sm);
  padding: 6px 4px;
  width: 66px;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: #f1f5f9;
}

.dock-workspace-btn:hover {
  background: var(--bg-sidebar-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.workspace-avatar {
  width: 24px;
  height: 24px;
  border-radius: var(--border-radius-xs);
  background: var(--brand-600);
  color: #ffffff;
  font-weight: 700;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .workspace-avatar {
  background: var(--brand-600);
  color: #ffffff;
}

.workspace-name {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chevron-icon {
  color: var(--text-sidebar);
}

/* Dock Navigation List */
.dock-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 64px;
  height: 54px;
  border-radius: var(--border-radius-sm);
  background: transparent;
  border: none;
  color: var(--text-sidebar);
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.dock-item:hover {
  background-color: var(--bg-sidebar-hover);
  color: #f1f5f9;
}

.dock-item.active {
  background-color: var(--brand-600);
  color: #ffffff;
  font-weight: 600;
  box-shadow: var(--shadow-brand);
}

.dock-item.active::before {
  display: none;
}

.dock-label {
  font-size: 10px;
  letter-spacing: -0.01em;
  text-align: center;
  line-height: 1.1;
}

.dock-unread-dot {
  position: absolute;
  top: 7px;
  right: 14px;
  width: 8px;
  height: 8px;
  background-color: var(--accent-apple);
  border-radius: var(--radius-full);
  border: 1.5px solid var(--bg-dock);
}

.dock-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  border-top: 1px solid var(--border-light);
  padding-top: 8px;
}

.dock-icon-with-dot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-indicator-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--bg-dock);
}

.status-indicator-dot.connected {
  background-color: var(--accent-whatsapp);
}

.status-indicator-dot.disconnected {
  background-color: #ef4444;
}

/* ==========================================================================
   WORKSPACE VIEWPORT (Live Chat vs Pipelines Kanban)
   ========================================================================== */
.workspace-viewport {
  flex: 1;
  display: flex;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

.workspace {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* ==========================================================================
   WORKSPACE RESIZERS (Interactive Splitter Bars)
   ========================================================================== */
.workspace-resizer {
  width: 6px;
  min-width: 6px;
  background-color: var(--border-light);
  cursor: col-resize;
  position: relative;
  flex: 0 0 auto;
  z-index: 25;
  transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
  user-select: none;
  -webkit-user-select: none;
}

/* Expanded touch/click capture area (20px width) */
.workspace-resizer::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -7px;
  right: -7px;
  z-index: 50;
  cursor: col-resize;
}

/* Subtle Apple-style handle pill */
.workspace-resizer::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 28px;
  border-radius: var(--radius-full);
  background-color: rgba(120, 120, 128, 0.25);
  transition: background-color var(--transition-fast), height var(--transition-fast);
}

.workspace-resizer:hover,
.workspace-resizer.is-resizing {
  background-color: var(--accent-apple, #007aff) !important;
  box-shadow: 0 0 10px rgba(0, 122, 255, 0.5);
}

.workspace-resizer:hover::after,
.workspace-resizer.is-resizing::after {
  background-color: #ffffff;
  height: 44px;
}

body.resizing-active {
  cursor: col-resize !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

/* ==========================================================================
   COLUMN 1: CONVERSATIONS & LEADS INBOX
   ========================================================================== */
.col-leads {
  background-color: var(--bg-surface);
  width: 330px;
  min-width: 230px;
  max-width: 650px;
  flex: 0 0 auto !important;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  border-right: 1px solid var(--border-color);
  transition: none !important;
}

.leads-top-bar {
  padding: 14px 14px 8px 14px;
  border-bottom: 1px solid transparent;
}

.clean-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  transition: all var(--transition-fast);
}

.clean-search-box:focus-within {
  background-color: var(--bg-card);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

.clean-search-box .search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.clean-search-box input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
}

.clean-search-box input::placeholder {
  color: var(--text-muted);
}

.icon-tool-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.icon-tool-btn:hover {
  color: var(--text-primary);
}

.btn-clear {
  background: none;
  border: none;
  font-size: 16px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

/* Inbox Filter Strip */
.inbox-filter-strip {
  padding: 6px 14px 10px 14px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inbox-filter-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inbox-title-dropdown {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-dropdown-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.inbox-count-pill {
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-active);
  color: var(--accent-apple);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.inbox-action-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-text-filter {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
}

.btn-text-filter:hover {
  background: var(--bg-hover);
  border-color: var(--border-medium);
}

.btn-more-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 7px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  line-height: 1;
  transition: all var(--transition-fast);
}

.btn-more-icon:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Inbox More Options Dropdown */
.inbox-more-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.inbox-more-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 210px;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 160;
  backdrop-filter: blur(14px);
  animation: slideDownFade 0.15s ease-out;
}

.inbox-more-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
  width: 100%;
}

.inbox-more-item:hover {
  background: var(--bg-hover);
}

.inbox-more-item.danger {
  color: var(--danger-apple);
}

.inbox-more-item.danger:hover {
  background: rgba(255, 59, 48, 0.12);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-light);
  margin: 4px 0;
}

.btn-text-filter.active {
  background: var(--accent-apple) !important;
  color: #ffffff !important;
  border-color: var(--accent-apple) !important;
}

/* Inbox Bulk Control Panel */
.inbox-bulk-control-panel {
  background: var(--bg-card);
  border: 1px solid var(--accent-apple);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  margin-top: 8px;
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: slideDownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.inbox-bulk-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.inbox-bulk-check-all-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

.btn-exit-inbox-bulk {
  background: transparent;
  border: none;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  transition: all var(--transition-fast);
}

.btn-exit-inbox-bulk:hover {
  background: var(--bg-hover);
  color: var(--danger-apple);
}

.inbox-bulk-row-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.inbox-bulk-stage-tool {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.inbox-bulk-select {
  flex: 1;
  padding: 5px 8px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-card-subtle);
  color: var(--text-primary);
  outline: none;
  min-width: 0;
}

.inbox-bulk-select:focus {
  border-color: var(--accent-apple);
}

.inbox-cb-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-right: 4px;
}

.lead-item.inbox-selected {
  background-color: rgba(0, 122, 255, 0.12) !important;
  border-color: rgba(0, 122, 255, 0.35) !important;
}

/* Apple Segmented Funnel Pills */
.stage-filters {
  display: flex;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 2.5px;
  gap: 2px;
  overflow-x: auto;
}

.stage-filters::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.filter-pill:hover {
  color: var(--text-primary);
}

.filter-pill.active {
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Quick Metrics Row (Screenshot badges: 60 orange, 20 clock, etc.) */
.quick-metrics-row {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
}

.quick-metrics-row::-webkit-scrollbar {
  display: none;
}

.metric-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2.5px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: default;
}

.chip-orange {
  background: #fff7ed;
  color: #ea580c;
  border-color: #ffedd5;
}

.chip-yellow {
  background: #fefce8;
  color: #ca8a04;
  border-color: #fef08a;
}

.chip-green {
  background: #f0fdf4;
  color: #16a34a;
  border-color: #dcfce7;
}

.chip-ai {
  background: #eff6ff;
  color: #2563eb;
  border-color: #dbeafe;
}

[data-theme="dark"] .chip-orange {
  background: rgba(234, 88, 12, 0.15);
  color: #fb923c;
  border-color: rgba(234, 88, 12, 0.3);
}
[data-theme="dark"] .chip-yellow {
  background: rgba(202, 138, 4, 0.15);
  color: #facc15;
  border-color: rgba(202, 138, 4, 0.3);
}
[data-theme="dark"] .chip-green {
  background: rgba(22, 163, 74, 0.15);
  color: #4ade80;
  border-color: rgba(22, 163, 74, 0.3);
}
[data-theme="dark"] .chip-ai {
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
  border-color: rgba(37, 99, 235, 0.3);
}

/* Leads List Area */
.leads-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lead-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 0.22s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s cubic-bezier(0.22, 1, 0.36, 1), transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  border: 1px solid transparent;
  position: relative;
}

.lead-item:hover {
  background-color: #e8f5ee;
  border-color: rgba(0, 121, 52, 0.24);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.06);
  transform: translateX(2px);
}

.lead-item.active {
  background-color: #dcf2e6;
  border-color: rgba(0, 121, 52, 0.42);
  box-shadow: 0 2px 8px rgba(0, 121, 52, 0.1);
}

[data-theme="dark"] .lead-item:hover {
  background-color: #1e293b;
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .lead-item.active {
  background-color: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Lead Avatar & WhatsApp Badge */
.lead-avatar-sm {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #e6f4ec 0%, #cce9d8 100%);
  color: #007934;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: var(--shadow-subtle);
}

.avatar-with-badge {
  position: relative;
  display: inline-block;
}

.whatsapp-badge-icon {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 16px;
  height: 16px;
  background-color: var(--accent-whatsapp);
  border: 2px solid #ffffff;
  border-radius: var(--radius-full);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .whatsapp-badge-icon {
  border-color: var(--bg-sidebar);
}

.lead-info-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

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

.lead-name {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 500;
}

.lead-row-bot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lead-preview {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.lead-preview.unread {
  font-weight: 600;
  color: var(--text-primary);
}

.lead-badges-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.lead-stage-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 1.5px 6px;
  border-radius: var(--radius-xs);
  text-transform: capitalize;
}

.stage-novo {
  background: var(--stage-novo-bg);
  color: var(--stage-novo-color);
  border: 1px solid var(--stage-novo-border);
}

.stage-atendimento {
  background: var(--stage-atendimento-bg);
  color: var(--stage-atendimento-color);
  border: 1px solid var(--stage-atendimento-border);
}

.stage-fechado {
  background: var(--stage-fechado-bg);
  color: var(--stage-fechado-color);
  border: 1px solid var(--stage-fechado-border);
}

.stage-perdido {
  background: var(--stage-perdido-bg);
  color: var(--stage-perdido-color);
  border: 1px solid var(--stage-perdido-border);
}

.lead-ai-tag {
  font-size: 9.5px;
  font-weight: 600;
  padding: 1.5px 5px;
  border-radius: var(--radius-xs);
}

.lead-ai-tag.ai-active {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.lead-ai-tag.human-req {
  background: #fff1f2;
  color: #e11d48;
  border: 1px solid #fecdd3;
}

.unread-badge {
  background-color: var(--accent-whatsapp);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lead-mini-tag,
.kanban-mini-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9.5px;
  font-weight: 600;
  padding: 1.5px 6px;
  border-radius: var(--radius-xs);
  background-color: #e6f4ec;
  color: #007934;
  border: 1px solid #cce9d8;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

[data-theme="dark"] .lead-mini-tag,
[data-theme="dark"] .kanban-mini-tag {
  background-color: rgba(0, 121, 52, 0.2);
  color: #5cd68a;
  border-color: rgba(0, 121, 52, 0.35);
}

.table-tags-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}

.leads-empty, .leads-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  text-align: center;
  color: var(--text-muted);
  gap: 10px;
}

/* ==========================================================================
   COLUMN 2: ACTIVE CHAT SCREEN (Fluid & Clean)
   ========================================================================== */
.col-chat {
  background-color: var(--bg-chat-canvas);
  flex: 1 1 0%;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  overflow: hidden;
  border-right: none;
}

/* Empty State */
.chat-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 32px;
  text-align: center;
  gap: 12px;
}

#chatEmptyState[style*="display: none"],
.chat-empty-state[style*="display: none"] {
  display: none !important;
}

.empty-illustration-apple {
  position: relative;
  width: 90px;
  height: 90px;
  margin-bottom: 8px;
}

.empty-bubble-layer {
  position: absolute;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-bubble-layer.bubble-1 {
  width: 72px;
  height: 72px;
  background: #ffffff;
  box-shadow: var(--shadow-md);
  color: var(--accent-apple);
  top: 0;
  left: 0;
}

[data-theme="dark"] .empty-bubble-layer.bubble-1 {
  background: var(--bg-card);
}

.empty-bubble-layer.bubble-2 {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-size: 18px;
  bottom: 0;
  right: 0;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.chat-empty-state h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.chat-empty-state p {
  color: var(--text-secondary);
  max-width: 380px;
  font-size: 13.5px;
}

.empty-state-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

/* Active Screen */
.chat-active-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Top Chat Header (from screenshot) */
.chat-header {
  height: 64px;
  min-height: 64px;
  background-color: var(--bg-panel);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 10;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-header-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-header-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-header-title-row h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.channel-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.whatsapp-mini-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background-color: var(--accent-whatsapp);
}

.ticket-id-tag {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.chat-header-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Apple Action Header Buttons ("Marcar como lida", "Finalizar") */
.btn-apple-action {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-apple-action:hover {
  background: var(--bg-hover);
  border-color: var(--border-medium);
}

.btn-apple-action.success {
  background: #f0fdf4;
  color: #15803d;
  border-color: #bbf7d0;
}

.btn-apple-action.success:hover {
  background: #dcfce7;
  border-color: #86efac;
}

[data-theme="dark"] .btn-apple-action.success {
  background: rgba(21, 128, 61, 0.18);
  color: #4ade80;
  border-color: rgba(21, 128, 61, 0.35);
}

.lead-ai-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lead-ai-badge .ai-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background-color: var(--accent-whatsapp);
}

.lead-ai-badge.ai-on {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}
.lead-ai-badge.ai-off {
  background: #f3f4f6;
  color: #4b5563;
  border-color: #e5e7eb;
}
.lead-ai-badge.requires-human {
  background: #fff1f2;
  color: #9f1239;
  border-color: #fecdd3;
}
.lead-ai-badge.requires-human .ai-badge-dot {
  background-color: #e11d48;
}

[data-theme="dark"] .lead-ai-badge.ai-on {
  background: rgba(6, 95, 70, 0.25);
  color: #34d399;
  border-color: rgba(6, 95, 70, 0.4);
}

.btn-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.btn-icon.active {
  background: var(--bg-active);
  color: var(--accent-apple);
  border-color: rgba(0, 122, 255, 0.2);
}

/* Messages Scroll Feed */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Date Separator Pill */
.date-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0 6px 0;
}

.date-pill {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: var(--radius-full);
}

[data-theme="dark"] .date-pill {
  background: rgba(255, 255, 255, 0.08);
}

/* Chat Bubbles (Apple & WhatsApp Hybrid Aesthetic) */
.chat-bubble {
  max-width: 68%;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  font-size: 13.5px;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  box-shadow: var(--shadow-subtle);
  animation: bubblePop 0.2s var(--ease-apple);
}

@keyframes bubblePop {
  0% { opacity: 0; transform: translateY(6px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Incoming Message (Lead) */
.chat-bubble.from-other {
  align-self: flex-start;
  background-color: var(--bubble-other-bg);
  color: var(--bubble-other-text);
  border: 1px solid var(--bubble-other-border);
  border-bottom-left-radius: 4px;
}

/* Outgoing Message (Attendant or AI) */
.chat-bubble.from-me {
  align-self: flex-end;
  background-color: var(--bubble-me-bg);
  color: var(--bubble-me-text);
  border-bottom-right-radius: 4px;
}

.msg-text {
  word-break: break-word;
  white-space: pre-wrap;
}

.msg-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 10px;
  opacity: 0.75;
}

.chat-bubble.from-me .msg-meta {
  color: rgba(255, 255, 255, 0.9);
}

.chat-bubble.from-other .msg-meta {
  color: var(--text-muted);
}

.msg-media img {
  max-width: 100%;
  max-height: 280px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.msg-media img:hover {
  transform: scale(1.01);
}

.msg-media audio {
  width: 250px;
  height: 38px;
}

/* Quick Replies Strip */
.quick-replies-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--bg-panel);
  border-top: 1px solid var(--border-light);
  overflow-x: auto;
}

.quick-replies-strip::-webkit-scrollbar {
  display: none;
}

.btn-copilot {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #eff6ff 0%, #e6f4ec 100%);
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.btn-copilot:hover {
  background: linear-gradient(135deg, #dbeafe 0%, #cce9d8 100%);
  border-color: #93c5fd;
  transform: translateY(-1px);
}

[data-theme="dark"] .btn-copilot {
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.25) 0%, rgba(0, 121, 52, 0.25) 100%);
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.3);
}

.strip-divider {
  width: 1px;
  height: 18px;
  background-color: var(--border-light);
  flex-shrink: 0;
}

.qr-strip-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  flex-shrink: 0;
}

.qr-strip-items {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qr-chip {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.qr-chip:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

/* Flexible Auto-Expanding Message Input (Dobro do tamanho padrão & Flexível) */
.chat-input-bar {
  padding: 12px 20px 16px 20px;
  background-color: var(--bg-panel);
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.btn-input-accessory {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  margin-bottom: 5px;
}

.btn-input-accessory:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.input-wrapper {
  flex: 1;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 72px; /* Dobro da altura original */
  box-sizing: border-box;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
  position: relative;
}

.input-wrapper:focus-within {
  background-color: var(--bg-card);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.14);
}

.input-wrapper textarea {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  resize: vertical; /* Flexível para ajuste manual pelo usuário */
  color: var(--text-primary);
  font-size: 14.5px;
  min-height: 48px; /* Dobro do espaço de digitação inicial */
  max-height: 280px;
  line-height: 1.45;
  font-family: inherit;
  box-sizing: border-box;
  scrollbar-width: thin;
}

.input-wrapper textarea::placeholder {
  color: var(--text-muted);
}

.btn-send {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background-color: var(--accent-whatsapp);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
  transition: all var(--transition-fast);
  margin-bottom: 5px;
}

.btn-send:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
}

/* ==========================================================================
   COLUMN 3: LEAD CRM DETAILS PANEL (Ficha do Lead)
   ========================================================================== */
.col-crm {
  background-color: var(--bg-panel);
  width: 340px;
  min-width: 260px;
  max-width: 650px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  border-left: none;
}

.col-crm.hidden {
  display: none !important;
}

.crm-panel-header {
  height: 64px;
  min-height: 64px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
}

.crm-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.crm-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
  color: #9a3412;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.crm-lead-title-box {
  display: flex;
  flex-direction: column;
}

.crm-lead-title-box strong {
  font-size: 13.5px;
  color: var(--text-primary);
}

.save-status-indicator {
  font-size: 10.5px;
  color: var(--accent-whatsapp);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.save-status-indicator.visible {
  opacity: 1;
}

.btn-tag-pill {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-apple);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-tag-pill:hover {
  background: var(--bg-hover);
}

.crm-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Quick Actions Strip (from screenshot) */
.crm-quick-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.crm-section-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.actions-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.btn-action-pill {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-action-pill:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.btn-action-pill.highlight {
  color: var(--accent-apple);
  border-color: rgba(0, 122, 255, 0.25);
  background: rgba(0, 122, 255, 0.04);
}

/* Profile Card / Section */
.crm-card-section {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-header-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.crm-fields-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.crm-field-inline {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.crm-field-inline label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.crm-field-inline input, .crm-field-inline select, .crm-card-section textarea {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 12.5px;
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
}

.crm-field-inline input:focus, .crm-card-section textarea:focus {
  background: var(--bg-card);
  border-color: var(--border-focus);
}

.phone-display-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text-primary);
}

.flag-icon {
  font-size: 14px;
}

/* AI Mode Choice Buttons */
.crm-ai-btn-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.btn-ai-choice {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 7px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
}

.btn-ai-choice.active {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.12);
}

[data-theme="dark"] .btn-ai-choice.active {
  background: rgba(6, 95, 70, 0.3);
  color: #34d399;
  border-color: rgba(6, 95, 70, 0.5);
}

/* Notes with Copilot */
.notes-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-copilot-micro {
  background: none;
  border: none;
  color: var(--accent-apple);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  transition: background var(--transition-fast);
}

.btn-copilot-micro:hover {
  background: var(--bg-hover);
}

/* Deal / Funil Card (from screenshot: Negócio #13530) */
.deal-card {
  border-left: 3px solid var(--accent-apple);
}

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

.deal-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.person-badge {
  font-size: 10.5px;
  font-weight: 600;
  background: var(--bg-card-subtle);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
}

.deal-value-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.deal-value-row label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.input-currency-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
}

.currency-prefix {
  font-weight: 700;
  color: var(--accent-whatsapp);
  margin-right: 6px;
}

.input-currency-wrapper input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Sales Funnel Visual Progress Bar */
.funnel-progress-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.funnel-segments-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  height: 8px;
  border-radius: var(--radius-full);
}

.funnel-segments-bar .segment {
  background: var(--border-light);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.funnel-segments-bar .segment.active {
  background: var(--accent-apple);
  box-shadow: 0 0 6px rgba(0, 122, 255, 0.4);
}

.stage-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 4px;
}

.stage-btn {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  padding: 5px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
}

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

.stage-btn.active {
  border-color: transparent;
  font-weight: 700;
}

.stage-btn.stage-novo.active {
  background: var(--stage-novo-bg);
  color: var(--stage-novo-color);
}
.stage-btn.stage-atendimento.active {
  background: var(--stage-atendimento-bg);
  color: var(--stage-atendimento-color);
}
.stage-btn.stage-fechado.active {
  background: var(--stage-fechado-bg);
  color: var(--stage-fechado-color);
}
.stage-btn.stage-perdido.active {
  background: var(--stage-perdido-bg);
  color: var(--stage-perdido-color);
}

/* Tags Container */
.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag-badge {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  padding: 2.5px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.remove-tag {
  cursor: pointer;
  color: var(--text-muted);
}
.remove-tag:hover {
  color: #ef4444;
}

.add-tag-row {
  display: flex;
  gap: 4px;
}

.add-tag-row input {
  flex: 1;
}

/* Activity History Timeline */
.crm-timeline-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-left: 6px;
  border-left: 2px solid var(--border-light);
}

.timeline-entry {
  position: relative;
  display: flex;
  flex-direction: column;
  padding-left: 14px;
  font-size: 11.5px;
}

.timeline-dot {
  position: absolute;
  left: -19px;
  top: 3px;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background-color: var(--text-muted);
  border: 2px solid var(--bg-panel);
}

.timeline-dot.green { background-color: var(--accent-whatsapp); }
.timeline-dot.blue { background-color: var(--accent-apple); }

.timeline-text strong {
  display: block;
  color: var(--text-primary);
}

.timeline-text span {
  color: var(--text-muted);
  font-size: 10.5px;
}

/* ==========================================================================
   VIEW B: PIPELINES / KANBAN BOARD
   ========================================================================== */
.view-pipelines {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 32px;
  overflow: hidden;
  background-color: var(--bg-shell);
}

.pipelines-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.pipelines-title-group h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.pipelines-title-group p {
  color: var(--text-secondary);
  font-size: 13.5px;
}

.pipelines-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.kanban-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  box-shadow: var(--shadow-subtle);
  transition: all var(--transition-fast);
}

.kanban-search-box:focus-within {
  border-color: var(--accent-apple);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.15);
}

.kanban-search-box svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.kanban-search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: var(--text-primary);
  width: 170px;
}

.kanban-search-box input::placeholder {
  color: var(--text-muted);
}

/* Kanban Columns & Fluid Drag-and-Drop */
.kanban-board {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(280px, 1fr));
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  user-select: none;
  -webkit-user-select: none;
  align-items: flex-start;
}

.kanban-column {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  min-height: 480px;
  max-height: calc(100vh - 180px);
  overflow: hidden;
  transition: border-color 0.2s var(--ease-apple), box-shadow 0.2s var(--ease-apple), background-color 0.2s var(--ease-apple);
}

.kanban-column.drag-target-hover {
  background-color: var(--bg-hover);
  border-color: var(--accent-apple);
  box-shadow: 0 0 0 2px var(--accent-apple), var(--shadow-md);
}

.kanban-column[data-stage="novo"].drag-target-hover {
  border-color: var(--stage-novo-color);
  box-shadow: 0 0 0 2px var(--stage-novo-color), 0 8px 24px rgba(2, 132, 199, 0.18);
}
.kanban-column[data-stage="atendimento"].drag-target-hover {
  border-color: var(--stage-atendimento-color);
  box-shadow: 0 0 0 2px var(--stage-atendimento-color), 0 8px 24px rgba(217, 119, 6, 0.18);
}
.kanban-column[data-stage="fechado"].drag-target-hover {
  border-color: var(--stage-fechado-color);
  box-shadow: 0 0 0 2px var(--stage-fechado-color), 0 8px 24px rgba(5, 150, 105, 0.18);
}
.kanban-column[data-stage="perdido"].drag-target-hover {
  border-color: var(--stage-perdido-color);
  box-shadow: 0 0 0 2px var(--stage-perdido-color), 0 8px 24px rgba(220, 38, 38, 0.18);
}

.kanban-col-header {
  padding: 14px 16px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.col-title-flex {
  display: flex;
  align-items: center;
  gap: 8px;
}

.col-dot {
  width: 9px;
  height: 9px;
  border-radius: var(--radius-full);
}
.dot-novo { background-color: var(--stage-novo-color); }
.dot-atendimento { background-color: var(--stage-atendimento-color); }
.dot-fechado { background-color: var(--stage-fechado-color); }
.dot-perdido { background-color: var(--stage-perdido-color); }

.kanban-col-header h3 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.col-count {
  font-size: 11px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
}

.col-total-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-whatsapp);
}

.kanban-cards-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 320px;
  transition: background-color 0.2s ease;
  position: relative;
}

.kanban-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-subtle);
  cursor: grab;
  cursor: -webkit-grab;
  position: relative;
  transition: transform 0.16s var(--ease-apple), box-shadow 0.16s var(--ease-apple), border-color 0.16s var(--ease-apple);
  user-select: none;
  -webkit-user-select: none;
}

.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  border-color: var(--border-medium);
}

.kanban-card:active {
  cursor: grabbing;
  cursor: -webkit-grabbing;
}

/* SortableJS Fluid Drag & Drop Classes */
.kanban-ghost {
  opacity: 0.35 !important;
  background: var(--bg-hover) !important;
  border: 2px dashed var(--accent-apple) !important;
  box-shadow: none !important;
  border-radius: var(--radius-md) !important;
  transform: scale(0.99) !important;
}

.kanban-chosen {
  cursor: grabbing !important;
}

.kanban-drag {
  opacity: 0.98 !important;
  transform: rotate(2deg) scale(1.03) !important;
  box-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.25), 0 10px 15px -5px rgba(0, 0, 0, 0.12) !important;
  border-color: var(--accent-apple) !important;
  cursor: grabbing !important;
  z-index: 999999 !important;
}

body.is-dragging-kanban {
  cursor: grabbing !important;
  user-select: none !important;
}

body.is-dragging-kanban .kanban-card {
  cursor: grabbing !important;
}

.kanban-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.drag-grip-icon {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
  cursor: grab;
  opacity: 0.45;
  transition: opacity 0.15s ease, color 0.15s ease;
  user-select: none;
}

.kanban-card:hover .drag-grip-icon {
  opacity: 1;
  color: var(--accent-apple);
}

.kanban-card-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #007934, #004d21);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kanban-card-title {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kanban-card-val {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-whatsapp);
  flex-shrink: 0;
}

.kanban-card-phone {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.kanban-card-snippet {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 2px 0;
}

.kanban-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.kanban-mini-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  background: var(--bg-hover);
  color: var(--text-secondary);
  font-weight: 500;
}

.kanban-card-bot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--border-light);
}

.btn-open-chat {
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  height: 30px;
  padding: 0 11px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  cursor: pointer;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.btn-open-chat:hover {
  background-color: var(--accent-apple);
  color: #ffffff;
  border-color: var(--accent-apple);
}

.kanban-empty-placeholder {
  pointer-events: none;
  user-select: none;
  text-align: center;
  padding: 36px 12px;
  font-size: 12px;
  color: var(--text-muted);
  border: 1.5px dashed var(--border-light);
  border-radius: var(--radius-md);
  margin-top: 6px;
  background: rgba(0, 0, 0, 0.01);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* ==========================================================================
   FLOATING SUPPORT WIDGET BUTTON (from screenshot: Suporte)
   ========================================================================== */
.floating-support-btn {
  position: fixed;
  bottom: 20px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #007aff;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-full);
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.4);
  cursor: pointer;
  z-index: 99;
  transition: all var(--transition-fast);
}

.floating-support-btn:hover {
  transform: scale(1.04) translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 122, 255, 0.5);
}

/* ==========================================================================
   BUTTONS & COMMON UI
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.btn-sm {
  height: 30px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 7px;
  gap: 5px;
}

.table-actions-row {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.btn-primary {
  background-color: var(--accent-apple);
  color: #ffffff;
}
.btn-primary:hover {
  background-color: #0066d6;
}

.btn-secondary {
  background-color: var(--bg-card-subtle);
  border-color: var(--border-light);
  color: var(--text-primary);
}
.btn-secondary:hover {
  background-color: var(--bg-hover);
  border-color: var(--border-medium);
}

.btn-danger {
  background-color: #fee2e2;
  color: #dc2626;
  border-color: #fecaca;
}
.btn-danger:hover {
  background-color: #fca5a5;
}

/* Apple Spinner */
.apple-spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--accent-apple);
  border-radius: var(--radius-full);
  animation: spin 0.7s linear infinite;
}
[data-theme="dark"] .apple-spinner {
  border-color: rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent-apple);
}
.apple-spinner.large {
  width: 38px;
  height: 38px;
  border-width: 3.5px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   MODALS (Apple Style)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.15s ease-out;
}

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

.modal-box {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: scaleUp 0.2s var(--ease-apple);
}

@keyframes scaleUp {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

.modal-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  background-color: var(--bg-card-subtle);
}

/* QR Code Modal specific */
.qr-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}

.qr-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
}

.qr-container img {
  max-width: 200px;
  height: auto;
}

.qr-instructions {
  font-size: 12px;
  color: var(--text-secondary);
}
.qr-instructions ol {
  padding-left: 20px;
  margin-top: 6px;
}

/* AI Settings Modal specific */
.ai-help-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: #1e40af;
}

.ai-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
}

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

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

.btn-toggle-eye {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

.ai-select {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 12.5px;
  color: var(--text-primary);
}

/* Image viewer modal */
.image-viewer-backdrop {
  background-color: rgba(0, 0, 0, 0.85);
}

.image-viewer-box {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-viewer-close {
  position: absolute;
  top: -36px;
  right: 0;
  color: #ffffff;
  font-size: 28px;
}

.image-viewer-box img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
}

/* Responsive Breakpoints */
@media (max-width: 1200px) {
  .col-leads {
    max-width: 480px;
  }
}

@media (max-width: 960px) {
  #resizerCRM {
    display: none !important;
  }
  .col-crm {
    position: fixed;
    right: 0;
    top: 0;
    width: 320px;
    z-index: 60;
    box-shadow: var(--shadow-pop);
    transform: translateX(100%);
  }
  .col-crm.open {
    transform: translateX(0);
    display: flex;
  }
}

@media (max-width: 680px) {
  #resizerLeads,
  #resizerCRM {
    display: none !important;
  }
}

/* ==========================================================================
   UNIFIED SETTINGS MODAL & TABS (Apple System Settings Style)
   ========================================================================== */
.settings-modal-box {
  max-width: 860px;
  width: 95%;
  height: 640px;
  max-height: 90vh;
}

.settings-gear-icon {
  font-size: 20px;
}

.settings-dialog-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  background-color: var(--bg-panel);
}

.settings-dialog-nav {
  width: 230px;
  min-width: 200px;
  border-right: 1px solid var(--border-light);
  background-color: var(--bg-card-subtle);
  display: flex;
  flex-direction: column;
  padding: 12px 10px;
  gap: 4px;
}

.settings-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
  position: relative;
}

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

.settings-nav-btn.active {
  background-color: var(--bg-active);
  color: var(--accent-apple);
  font-weight: 600;
}

[data-theme="dark"] .settings-nav-btn.active {
  background-color: rgba(56, 189, 248, 0.12);
  color: var(--border-focus);
}

.nav-btn-icon {
  font-size: 16px;
  display: flex;
  align-items: center;
}

.nav-btn-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-dialog-content {
  flex: 1;
  padding: 24px 28px;
  overflow-y: auto;
}

.settings-tab-pane {
  display: none;
  animation: fadeIn 0.15s ease-out;
}

.settings-tab-pane.active {
  display: block;
}

.tab-pane-header {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.tab-pane-header h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.tab-pane-header p {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Workspace Preview Card */
.workspace-preview-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 18px;
}

.preview-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #007934, #004d21);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
}

.preview-info strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.preview-info span {
  font-size: 12px;
  color: var(--text-muted);
}

.settings-input {
  width: 100%;
  padding: 9px 12px;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.settings-input:focus {
  border-color: var(--accent-apple);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Settings Toggle Card */
.settings-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.toggle-info strong {
  display: block;
  font-size: 13.5px;
  color: var(--text-primary);
}

.toggle-info span {
  font-size: 12px;
  color: var(--text-muted);
}

/* Apple Switch */
.apple-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.apple-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  background-color: #cbd5e1;
  border-radius: 9999px;
  transition: all 0.25s var(--ease-apple);
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: all 0.25s var(--ease-apple);
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.apple-switch input:checked + .switch-slider {
  background-color: var(--accent-apple);
}

.apple-switch input:checked + .switch-slider:before {
  transform: translateX(20px);
}

/* Settings Pref Rows */
.settings-pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}

.pref-meta strong {
  display: block;
  font-size: 13.5px;
  color: var(--text-primary);
}

.pref-meta span {
  font-size: 12px;
  color: var(--text-muted);
}

.theme-pill-selector {
  display: flex;
  gap: 8px;
}

.theme-choice-btn {
  padding: 7px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-card-subtle);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}

.theme-choice-btn.active {
  background: var(--accent-apple);
  color: #ffffff;
  border-color: var(--accent-apple);
}

.sound-control-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tab-actions-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-item {
  background: var(--bg-panel);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUpToast 0.25s var(--ease-apple);
  pointer-events: auto;
}

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

@media (max-width: 768px) {
  .settings-dialog-layout {
    flex-direction: column;
  }
  .settings-dialog-nav {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-light);
  }
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   CRM HEADER ACTIONS & DANGER ZONE
   ========================================================================== */
.crm-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-sm-action-save {
  padding: 4px 10px;
  background-color: var(--accent-whatsapp);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-sm-action-save:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-danger-icon {
  color: var(--danger-apple);
  border: 1px solid rgba(255, 59, 48, 0.25);
  background: rgba(255, 59, 48, 0.06);
  border-radius: var(--radius-sm);
  padding: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-danger-icon:hover {
  background: var(--danger-apple);
  color: #ffffff;
  border-color: var(--danger-apple);
}

.danger-zone {
  border: 1px dashed rgba(255, 59, 48, 0.3) !important;
  background: rgba(255, 59, 48, 0.02) !important;
}

.crm-section-title.danger {
  color: var(--danger-apple);
}

.btn-danger-outline {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--danger-apple);
  color: var(--danger-apple);
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-danger-outline:hover {
  background: var(--danger-apple);
  color: #ffffff;
}

.delete-confirm-box {
  max-width: 440px;
}

.modal-hint-danger {
  font-size: 12.5px;
  color: var(--danger-apple);
  background: rgba(255, 59, 48, 0.08);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  margin-top: 10px;
  line-height: 1.45;
}

/* ==========================================================================
   BASE DE LEADS & CONTATOS TABLE
   ========================================================================== */
.leads-table-modal-box {
  width: 90vw;
  max-width: 1100px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.table-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.table-search-box {
  flex: 1;
  min-width: 260px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px 14px;
}

.table-search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13.5px;
  color: var(--text-primary);
  width: 100%;
}

.table-filter-select {
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}

.table-toolbar .btn-danger-outline {
  width: auto;
  white-space: nowrap;
}

/* Bulk Actions Bar inside Leads Modal */
.table-bulk-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--accent-apple);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.12);
  animation: slideDownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-wrap: wrap;
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bulk-info-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bulk-selection-badge {
  background: var(--accent-apple);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.btn-link-action {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  transition: color var(--transition-fast);
}

.btn-link-action:hover {
  color: var(--accent-apple);
}

.bulk-tools-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.bulk-stage-tool {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bulk-stage-tool label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.select-sm {
  padding: 6px 10px !important;
  font-size: 12.5px !important;
}

.bulk-divider {
  width: 1px;
  height: 22px;
  background: var(--border-light);
}

.table-custom-checkbox {
  width: 17px;
  height: 17px;
  accent-color: var(--accent-apple);
  cursor: pointer;
  border-radius: 4px;
  vertical-align: middle;
}

.leads-table tr.row-selected td {
  background-color: rgba(0, 122, 255, 0.08) !important;
}

.leads-table-container {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(88vh - 220px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.leads-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.leads-table th {
  background: var(--bg-card-subtle);
  padding: 12px 14px;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.leads-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}

.leads-table tr:hover td {
  background: var(--bg-hover);
}

.table-contact-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #007934, #004d21);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ==========================================================================
   IMPULSOS & DISPAROS EM MASSA
   ========================================================================== */
.impulsos-modal-box {
  width: 90vw;
  max-width: 960px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.impulsos-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 22px;
}

.audience-badge-preview {
  margin-top: 6px;
  font-size: 12px;
  color: var(--accent-apple);
  font-weight: 600;
}

/* Impulsos Mode Selector Pills */
.impulsos-mode-pills {
  display: flex;
  background: var(--bg-hover);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 4px;
  margin-top: 8px;
  margin-bottom: 4px;
}

.impulsos-mode-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.impulsos-mode-pill:hover {
  color: var(--text-primary);
}

.impulsos-mode-pill.active {
  background: var(--bg-card);
  color: var(--accent-apple);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .impulsos-mode-pill.active {
  background: var(--bg-card);
  color: var(--accent-apple);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

/* Manual Lead Selection Container */
.impulsos-manual-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px;
  animation: fadeInImpulsos 0.2s ease-in-out;
}

@keyframes fadeInImpulsos {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.impulsos-manual-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.impulsos-manual-search-wrapper {
  flex: 1;
  position: relative;
}

.impulsos-search-input {
  width: 100%;
  padding: 6px 10px;
  font-size: 11.5px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}

.impulsos-search-input:focus {
  border-color: var(--accent-apple);
}

.impulsos-manual-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.btn-impulsos-action {
  font-size: 11px;
  padding: 5px 9px;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-impulsos-action:hover {
  background: var(--bg-hover);
  color: var(--accent-apple);
  border-color: var(--accent-apple);
}

.impulsos-manual-scroll-area {
  max-height: 195px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  padding: 4px;
}

.impulsos-manual-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.impulsos-manual-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background 0.12s ease;
  user-select: none;
}

.impulsos-manual-item:hover {
  background: var(--bg-hover);
}

.impulsos-manual-item.is-checked {
  background: rgba(0, 122, 255, 0.08);
}

[data-theme="dark"] .impulsos-manual-item.is-checked {
  background: rgba(56, 189, 248, 0.12);
}

.impulsos-manual-checkbox {
  width: 15px;
  height: 15px;
  accent-color: var(--accent-apple);
  cursor: pointer;
  flex-shrink: 0;
}

.impulsos-manual-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-hover);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.impulsos-manual-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.impulsos-manual-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.impulsos-manual-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.impulsos-manual-phone {
  font-size: 10.5px;
  color: var(--text-muted);
}

.impulsos-manual-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: var(--bg-hover);
  color: var(--text-secondary);
  font-weight: 600;
  flex-shrink: 0;
}

.impulsos-manual-footer-note {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  padding: 0 4px;
}

.impulsos-empty-hint {
  padding: 20px 12px;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-muted);
}

.template-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.btn-chip-variable {
  font-size: 11px;
  padding: 2px 8px;
  background: rgba(0, 122, 255, 0.1);
  color: var(--accent-apple);
  border: 1px solid rgba(0, 122, 255, 0.25);
  border-radius: var(--radius-full);
  cursor: pointer;
  font-weight: 600;
}

.textarea-hint {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

.campaign-status-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

.campaign-card-title {
  font-size: 13.5px;
  color: var(--text-primary);
}

.progress-bar-container {
  height: 8px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-whatsapp), #007aff);
  transition: width 0.3s ease;
}

.campaign-metrics-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.campaign-log-list {
  flex: 1;
  min-height: 140px;
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 11.5px;
  font-family: monospace;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-entry {
  color: var(--text-secondary);
}
.log-entry.success { color: var(--accent-whatsapp); }
.log-entry.error { color: var(--danger-apple); }

/* ==========================================================================
   CALENDÁRIO & AGENDAMENTOS
   ========================================================================== */
.calendar-modal-box {
  width: 90vw;
  max-width: 960px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.calendar-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 20px;
}

.calendar-form-card, .calendar-list-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.calendar-form-card h4, .calendar-list-card h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.appointments-list {
  flex: 1;
  overflow-y: auto;
  max-height: 360px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.appointment-item {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.15s ease;
}

.appointment-item:hover {
  transform: translateX(2px);
  border-color: var(--accent-apple);
}

.apt-title {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-primary);
}

.apt-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  margin-top: 3px;
}

.btn-del-apt {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
  padding: 4px;
}
.btn-del-apt:hover {
  color: var(--danger-apple);
}

/* ==========================================================================
   INDIQUE E GANHE (REFERRAL)
   ========================================================================== */
.referral-modal-box {
  max-width: 540px;
}

.referral-banner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.ref-metric-card {
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.08), rgba(0, 121, 52, 0.08));
  border: 1px solid rgba(0, 122, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: 14px;
  text-align: center;
}

.ref-metric-title {
  font-size: 11.5px;
  color: var(--text-secondary);
  display: block;
}

.ref-metric-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent-apple);
  margin-top: 4px;
  display: block;
}

.ref-link-box {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.ref-link-box input {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}

.referral-share-actions {
  margin-top: 18px;
}

.btn-whatsapp-share {
  width: 100%;
  padding: 11px;
  background-color: var(--accent-whatsapp);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.btn-whatsapp-share:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

/* ==========================================================================
   INTERACTIVE BUTTONS MODAL & PREVIEW STYLES
   ========================================================================== */
.interactive-modal-box {
  max-width: 860px;
  width: 95%;
}

.interactive-presets-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--bg-hover);
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  border: 1px solid var(--border-light);
}

.interactive-presets-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.btn-preset-pill {
  padding: 5px 11px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-preset-pill:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.interactive-layout-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .interactive-layout-grid {
    grid-template-columns: 1fr;
  }
}

.interactive-buttons-section {
  margin-top: 14px;
  border-top: 1px solid var(--border-light);
  padding-top: 14px;
}

.inter-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.inter-section-header label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.interactive-buttons-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inter-btn-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  animation: fadeIn 0.2s ease;
}

.inter-btn-row-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inter-btn-type-select {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 12.5px;
  outline: none;
}

.inter-btn-title-input {
  flex: 1;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 12.5px;
  outline: none;
}

.btn-remove-inter-btn {
  background: transparent;
  border: none;
  color: var(--accent-danger);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.btn-remove-inter-btn:hover {
  background: rgba(239, 68, 68, 0.1);
}

.inter-btn-payload-input {
  width: 100%;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-card-subtle);
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
}

/* WhatsApp Live Preview Simulator */
.interactive-preview-col {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preview-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.wa-preview-screen {
  background: #0b141a;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 16px 16px;
  border-radius: var(--radius-md);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.wa-preview-bubble {
  align-self: flex-end;
  max-width: 90%;
  background: #005c4b;
  color: #e9edef;
  border-radius: 12px 12px 2px 12px;
  padding: 10px 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  font-size: 13.5px;
  line-height: 1.4;
  position: relative;
}

.wa-bubble-header {
  font-weight: 700;
  font-size: 13.5px;
  color: #53bdeb;
  margin-bottom: 4px;
}

.wa-bubble-body {
  white-space: pre-wrap;
  word-break: break-word;
}

.wa-bubble-footer {
  font-size: 11px;
  color: rgba(233, 237, 239, 0.65);
  margin-top: 6px;
  font-style: italic;
}

.wa-bubble-buttons {
  margin-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wa-bubble-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #53bdeb;
  text-align: center;
}

.wa-bubble-time {
  text-align: right;
  font-size: 10px;
  color: rgba(233, 237, 239, 0.6);
  margin-top: 4px;
}

.wa-preview-tip {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
  padding: 8px 10px;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   INTERACTIVE MESSAGE CHAT BUBBLE RENDERING
   ========================================================================== */
.msg-interactive-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.msg-interactive-title {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--accent-primary);
  margin-bottom: 2px;
}

.from-me .msg-interactive-title {
  color: #60a5fa;
}

.msg-interactive-body {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
}

.msg-interactive-footer {
  font-size: 11px;
  opacity: 0.75;
  font-style: italic;
  margin-top: 2px;
}

.msg-interactive-btns-list {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.from-other .msg-interactive-btns-list {
  border-top: 1px solid var(--border-light);
}

.msg-interactive-bubble-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  font-size: 12.5px;
  font-weight: 600;
}

.from-other .msg-interactive-bubble-btn {
  background: var(--bg-hover);
  border: 1px solid var(--border-light);
  color: var(--accent-primary);
}

/* ==========================================================================
   AUTHENTICATION SCREEN & LOGIN CARD STYLES
   ========================================================================== */
.login-wrapper {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #090d16;
  background-image: 
    radial-gradient(at 10% 20%, rgba(16, 185, 129, 0.12) 0px, transparent 50%),
    radial-gradient(at 90% 80%, rgba(0, 121, 52, 0.15) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(15, 23, 42, 0.9) 0px, transparent 100%);
  padding: 20px;
  overflow: hidden;
  font-family: var(--font-main);
}

.login-ambient-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.22) 0%, rgba(0, 121, 52, 0.1) 60%, transparent 100%);
  filter: blur(120px);
  pointer-events: none;
  animation: pulseGlow 6s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
  0% { transform: scale(0.9) translate(-10px, -10px); opacity: 0.7; }
  100% { transform: scale(1.1) translate(10px, 10px); opacity: 1; }
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: rgba(20, 27, 45, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-radius: 24px;
  padding: 38px 32px;
  box-shadow: 
    0 30px 60px -12px rgba(0, 0, 0, 0.65),
    0 0 45px rgba(16, 185, 129, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  animation: loginSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
}

@keyframes loginSlideUp {
  0% { opacity: 0; transform: translateY(24px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.login-card.shake {
  animation: shakeCard 0.45s ease-in-out;
}

@keyframes shakeCard {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-9px); }
  40%, 80% { transform: translateX(9px); }
}

.login-header {
  text-align: center;
  margin-bottom: 26px;
}

.login-brand-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px auto;
  border-radius: 18px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 10px 24px -4px rgba(16, 185, 129, 0.45);
}

.login-title {
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 6px 0;
  letter-spacing: -0.5px;
}

.login-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.62);
  margin: 0;
  line-height: 1.5;
}

.login-field-group {
  margin-bottom: 18px;
}

.login-field-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 7px;
}

.login-input-box {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(11, 16, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.login-input-box:focus-within {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
  background: rgba(11, 16, 28, 0.95);
}

.login-input-icon {
  position: absolute;
  left: 13px;
  color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

.login-input-box input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  padding: 13px 40px 13px 42px;
  font-size: 14px;
  color: #ffffff;
  font-family: inherit;
}

.login-input-box input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.btn-toggle-password {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.btn-toggle-password:hover {
  color: #ffffff;
}

.login-error-alert {
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 10px;
  color: #fca5a5;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  margin-bottom: 18px;
  animation: fadeIn 0.2s ease;
}

.btn-login-submit {
  width: 100%;
  padding: 13px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.35);
  transition: all 0.2s ease;
}

.btn-login-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(16, 185, 129, 0.45);
}

.btn-login-submit:active {
  transform: translateY(0);
}

.btn-login-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.login-footer {
  margin-top: 22px;
  display: flex;
  justify-content: center;
}

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.04);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

/* ==========================================================================
   DYNAMIC KANBAN COLUMNS & ADD COLUMN CARD
   ========================================================================== */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 8px 4px 16px 4px;
  align-items: flex-start;
  min-height: calc(100vh - 180px);
}

.kanban-column {
  min-width: 290px;
  max-width: 320px;
  flex: 0 0 300px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.kanban-col-header {
  padding: 12px 14px;
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

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

.btn-delete-stage {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.btn-delete-stage:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.kanban-add-column-wrapper {
  min-width: 250px;
  flex: 0 0 250px;
}

.kanban-add-column-card {
  width: 100%;
  min-height: 140px;
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: inherit;
  transition: all 0.2s var(--ease-apple);
}

.kanban-add-column-card:hover {
  background: var(--bg-hover);
  border-color: var(--accent-apple);
  color: var(--accent-apple);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.add-col-icon-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-subtle);
  transition: transform 0.2s ease;
}

.kanban-add-column-card:hover .add-col-icon-circle {
  transform: scale(1.08);
  background: var(--accent-apple);
  color: #fff;
  border-color: var(--accent-apple);
}

.add-col-text {
  font-size: 13.5px;
  font-weight: 600;
}

/* Color Presets Picker */
.color-preset-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  outline: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.color-swatch:hover {
  transform: scale(1.15);
}

.color-swatch.active {
  box-shadow: 0 0 0 3px var(--bg-card), 0 0 0 5px var(--accent-apple);
  transform: scale(1.15);
}

/* ==========================================================================
   CLICKABLE LEADS TABLE ROW & DETALHES BUTTON
   ========================================================================== */
.clickable-lead-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.clickable-lead-row:hover {
  background-color: var(--bg-hover) !important;
}

.btn-table-details {
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.btn-table-details:hover {
  background: var(--bg-hover);
  border-color: var(--accent-apple);
  color: var(--accent-apple);
}

/* ==========================================================================
   MODAL DETALHES COMPLETOS DO CONTATO (FICHA DO LEAD)
   ========================================================================== */
.lead-details-modal-box {
  width: 94%;
  max-width: 820px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
}

.lead-details-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-card);
}

.lead-details-profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.lead-details-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #007934 0%, #004d21 100%);
  color: #ffffff;
  font-size: 24px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
  flex-shrink: 0;
}

.lead-details-main-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 0;
}

.lead-details-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lead-details-title-row h2 {
  font-size: 20px;
  font-weight: 800;
  margin: 0;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.lead-details-phone-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lead-details-phone {
  font-size: 13.5px;
  color: var(--text-secondary);
  font-family: monospace;
}

.btn-wa-direct-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #ffffff;
  background: #25d366;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn-wa-direct-link:hover {
  background: #128c7e;
  transform: translateY(-1px);
}

.lead-details-body {
  padding: 22px 24px;
  overflow-y: auto;
  max-height: calc(90vh - 160px);
}

.lead-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 20px;
}

@media (max-width: 680px) {
  .lead-details-grid {
    grid-template-columns: 1fr;
  }
}

.lead-details-card {
  background: var(--bg-hover);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 8px;
}

.card-section-title svg {
  color: var(--accent-apple);
}

.info-data-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
}

.info-label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
}

.info-val {
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

.tags-flex-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

.lead-details-notes-card {
  background: var(--bg-hover);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lead-details-notes-content {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  max-height: 180px;
  overflow-y: auto;
}

/* Edit Mode Form inside Modal */
.lead-edit-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lead-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 680px) {
  .lead-edit-grid {
    grid-template-columns: 1fr;
  }
}

.lead-edit-grid .full-width {
  grid-column: 1 / -1;
}

.edit-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

.lead-details-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
}

.footer-left-actions, .footer-right-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   INSTAGRAM DIRECT INTEGRATION STYLES
   ========================================================================== */

/* Channel Filter Tabs */
.channel-filter-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
}

.channel-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--radius-full, 9999px);
  border: 1px solid var(--border-light);
  background: var(--bg-card-subtle, rgba(255, 255, 255, 0.04));
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.channel-tab-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
  background: rgba(255, 255, 255, 0.08);
}

.channel-tab-btn.active {
  background: var(--text-primary);
  color: var(--bg-body, #0a0a0c);
  border-color: var(--text-primary);
  font-weight: 600;
}

.channel-tab-btn.channel-wa:hover,
.channel-tab-btn.channel-wa.active {
  border-color: #25D366;
}
.channel-tab-btn.channel-wa.active {
  background: #25D366;
  color: #ffffff;
}

.channel-tab-btn.channel-ig:hover,
.channel-tab-btn.channel-ig.active {
  border-color: #e1306c;
}
.channel-tab-btn.channel-ig.active {
  background: linear-gradient(45deg, #f09433, #dc2743, #bc1888);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(225, 48, 108, 0.35);
}

/* Channel Badge Icons in Avatar */
.avatar-with-badge {
  position: relative;
  display: inline-flex;
}

.whatsapp-badge-icon,
.instagram-badge-icon {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--bg-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.whatsapp-badge-icon {
  background: #25D366;
  color: #ffffff;
}

.instagram-badge-icon {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: #ffffff;
}

.lead-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* Instagram Modal Styling */
.instagram-modal-box {
  max-width: 480px;
  width: 95%;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.5);
}

.ig-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(45deg, #f09433, #dc2743, #bc1888);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(220, 39, 67, 0.35);
}

.instagram-modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Instagram Status Banner */
.ig-status-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-card-subtle, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border-light);
}

.ig-status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ig-status-text {
  display: flex;
  flex-direction: column;
  font-size: 13px;
}

.ig-status-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.ig-status-text span {
  color: var(--text-muted);
  font-size: 12px;
}

/* Connected Card */
.ig-connected-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px;
  border-radius: 14px;
  background: rgba(225, 48, 108, 0.05);
  border: 1px solid rgba(225, 48, 108, 0.2);
  text-align: center;
}

.ig-avatar-wrapper {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(45deg, #f09433, #dc2743, #bc1888);
}

.ig-user-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #2a2a2e;
}

.ig-avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #1e1e24;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
}

.ig-user-info h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.ig-user-info span {
  font-size: 13px;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.badge-ig-active {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  font-size: 11.5px;
  font-weight: 600;
}

.ig-connected-actions {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

.ig-connected-actions .btn {
  flex: 1;
  justify-content: center;
}

/* Instagram Login Form */
.ig-login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
}

.input-with-icon input {
  padding-left: 28px !important;
}

.btn-instagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(220, 39, 67, 0.3);
}

.btn-instagram:hover {
  opacity: 0.94;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(220, 39, 67, 0.4);
}

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

.ig-login-alert {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* 2FA Challenge Box */
.ig-challenge-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.challenge-notice {
  text-align: center;
}

.challenge-icon {
  font-size: 26px;
  margin-bottom: 6px;
}

.challenge-notice h4 {
  margin: 0 0 4px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.challenge-notice p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

.challenge-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.challenge-actions .btn {
  flex: 1;
}

/* Kanban Instagram Badge */
.kanban-channel-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
}

.kanban-channel-badge.instagram-badge {
  background: rgba(225, 48, 108, 0.14);
  color: #e1306c;
}

.kanban-channel-badge.whatsapp-badge {
  background: rgba(37, 211, 102, 0.14);
  color: #25D366;
}

/* Chat Header Channel Badge */
.chat-channel-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
}

.chat-channel-badge.instagram {
  background: linear-gradient(45deg, rgba(240, 148, 51, 0.2), rgba(220, 39, 67, 0.2));
  color: #f77737;
  border: 1px solid rgba(220, 39, 67, 0.3);
}

.chat-channel-badge.whatsapp {
  background: rgba(37, 211, 102, 0.15);
  color: #25D366;
  border: 1px solid rgba(37, 211, 102, 0.3);
}

/* Glowing Indicator Dots */
.status-indicator-dot.instagram-active {
  background: #e1306c;
  box-shadow: 0 0 8px rgba(225, 48, 108, 0.8);
}

/* Method Tabs inside Modal */
.ig-method-tabs {
  display: flex;
  gap: 8px;
  background: var(--bg-card-subtle, rgba(255, 255, 255, 0.04));
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
}

.ig-method-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.ig-method-btn:hover {
  color: var(--text-primary);
}

.ig-method-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.ig-cookie-instructions {
  background: rgba(0, 121, 52, 0.08);
  border: 1px solid rgba(0, 121, 52, 0.2);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.ig-cookie-instructions strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: 6px;
}

.ig-cookie-instructions ol {
  margin: 0;
  padding-left: 18px;
}

.ig-cookie-instructions li {
  margin-bottom: 4px;
}

.ig-cookie-instructions code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 5px;
  border-radius: 4px;
  color: #80c29a;
  font-family: monospace;
}

/* ==========================================================================
   Audio Player & Voice Note Styling
   ========================================================================== */
.msg-media-audio {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  min-width: 250px;
  max-width: 320px;
}

.msg-media-audio audio {
  width: 100%;
  height: 38px;
  border-radius: 20px;
  outline: none;
  background: transparent;
}

.chat-bubble.from-me .msg-media-audio audio {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.08));
}

.chat-bubble.from-other .msg-media-audio audio {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.04));
}

.audio-bubble-fallback {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

[data-theme="dark"] .audio-bubble-fallback {
  background: rgba(255, 255, 255, 0.08);
}

/* Voice Recording Button Pulse */
.btn-input-accessory.recording-pulse {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
  animation: pulse-recording 1.2s infinite ease-in-out;
}

@keyframes pulse-recording {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

/* Voice Recording Bar (Apple Aesthetic Dynamic Island style) */
.recording-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 12px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 20px;
  animation: fadeInRecording 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.recording-bar.hidden,
#recordingBar.hidden,
#messageTextInput.hidden,
.hidden {
  display: none !important;
}

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

.recording-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #ef4444;
}

.recording-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ef4444;
  animation: pulse-recording 1.2s infinite ease-in-out;
}

.recording-timer {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 7px;
  border-radius: 6px;
}

[data-theme="dark"] .recording-timer {
  background: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
}

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

.btn-recording-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.18s ease;
  line-height: 1;
}

.btn-recording-cancel {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-secondary, #64748b);
}

.btn-recording-cancel:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.btn-recording-send {
  background: #10b981;
  color: #ffffff;
}

.btn-recording-send:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
}

/* ==========================================================================
   BUSINESS HOURS & OUT-OF-OFFICE SETTINGS
   ========================================================================== */
.days-selector-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.day-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.day-chip:hover {
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.day-chip:has(input:checked) {
  background-color: rgba(0, 122, 255, 0.12);
  border-color: var(--accent-apple, #007aff);
  color: var(--accent-apple, #007aff);
  font-weight: 600;
}

.day-chip input {
  cursor: pointer;
  accent-color: var(--accent-apple, #007aff);
}

.time-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  transition: all var(--transition-fast);
}

.time-input-group:focus-within {
  background-color: var(--bg-card);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

.time-input-group .time-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.time-input-group input[type="time"] {
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  outline: none;
  width: 100%;
}

.business-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.business-status-pill .status-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.business-status-pill.open .status-indicator-dot {
  background-color: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.business-status-pill.closed .status-indicator-dot {
  background-color: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

/* ====================================================================
   Quick Replies Management (Aba Respostas Rápidas)
   ==================================================================== */
.add-qr-form {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 20px;
  transition: all 0.2s var(--ease-apple);
}

.add-qr-form.editing-mode {
  border-color: var(--accent-apple);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

.add-qr-form h5 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.qr-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.existing-qr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.existing-qr-header h5 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.qr-list-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.qr-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.qr-manage-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: all 0.2s var(--ease-apple);
}

.qr-manage-item:hover {
  border-color: var(--border-medium);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.qr-manage-item.is-active-editing {
  border-color: var(--accent-apple);
  background-color: rgba(0, 122, 255, 0.04);
}

.qr-manage-info {
  flex: 1;
  min-width: 0;
}

.qr-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.qr-manage-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.qr-shortcut-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-apple);
  background-color: rgba(0, 122, 255, 0.1);
  border-radius: 9999px;
  letter-spacing: 0.2px;
}

.qr-manage-text {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.qr-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-qr-action {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background-color: var(--bg-card-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-qr-action:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.btn-qr-action.edit:hover {
  background-color: rgba(0, 122, 255, 0.1);
  color: var(--accent-apple);
  border-color: var(--accent-apple);
}

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

.btn-qr-action.primary {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
}

.btn-qr-action.primary:hover {
  background-color: #10b981;
  color: #ffffff;
}

/* ====================================================================
   WhatsApp Message Actions (Responder, Reagir, Encaminhar, Apagar)
   ==================================================================== */
.chat-bubble {
  position: relative;
}

/* Little dropdown trigger on message hover */
.msg-dropdown-trigger {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background-color: rgba(0, 0, 0, 0.08);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, background-color 0.15s ease;
  z-index: 4;
}

[data-theme="dark"] .msg-dropdown-trigger {
  background-color: rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
}

.chat-bubble:hover .msg-dropdown-trigger {
  opacity: 1;
  pointer-events: auto;
}

.msg-dropdown-trigger:hover {
  background-color: rgba(0, 0, 0, 0.18);
  color: var(--text-primary);
}

[data-theme="dark"] .msg-dropdown-trigger:hover {
  background-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* WhatsApp Message Context Menu Popup (Matches User Screenshot) */
.wa-msg-context-menu {
  position: fixed;
  z-index: 10050;
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 6px 0;
  min-width: 190px;
  animation: waMenuFadeIn 0.15s var(--ease-apple);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

@keyframes waMenuFadeIn {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

.wa-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.wa-menu-item:hover {
  background-color: var(--bg-hover);
}

.wa-menu-icon {
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: color 0.12s ease;
}

.wa-menu-item:hover .wa-menu-icon {
  color: var(--text-primary);
}

.wa-menu-item.danger {
  color: #ef4444;
}

.wa-menu-item.danger .wa-menu-icon {
  color: #ef4444;
}

.wa-menu-item.danger:hover {
  background-color: rgba(239, 68, 68, 0.08);
}

.wa-menu-divider {
  height: 1px;
  background-color: var(--border-light);
  margin: 4px 0;
}

/* Floating Quick Emoji Reactions Bar */
.wa-reactions-floating {
  position: fixed;
  z-index: 10060;
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 9999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  padding: 6px 10px;
  animation: waReactionsPop 0.18s var(--ease-apple);
}

@keyframes waReactionsPop {
  from { opacity: 0; transform: scale(0.85) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.reaction-emoji-btn {
  background: transparent;
  border: none;
  font-size: 22px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.15s ease;
}

.reaction-emoji-btn:hover {
  transform: scale(1.35);
  background-color: var(--bg-hover);
}

/* Reaction Badge on Message Bubble */
.msg-reaction-badge {
  position: absolute;
  bottom: -10px;
  right: 12px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 9999px;
  padding: 2px 6px;
  font-size: 13px;
  line-height: 1.2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  z-index: 5;
  transition: transform 0.15s ease;
}

.msg-reaction-badge:hover {
  transform: scale(1.15);
}

/* Reply / Quoting Preview Bar above message input */
.reply-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 8px 14px;
  margin-bottom: -1px;
  position: relative;
  z-index: 2;
  animation: slideDown 0.15s ease-out;
}

.reply-preview-accent {
  width: 4px;
  height: 36px;
  background: linear-gradient(180deg, #007aff, #3b82f6);
  border-radius: 2px;
  flex-shrink: 0;
}

.reply-preview-body {
  flex: 1;
  min-width: 0;
}

.reply-preview-sender {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-apple);
  margin-bottom: 2px;
}

.reply-preview-text {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-close-reply {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-close-reply:hover {
  color: var(--text-primary);
  background-color: var(--bg-hover);
}

/* Quoted message card inside chat bubble */
.msg-quoted-card {
  display: flex;
  align-items: stretch;
  gap: 8px;
  background-color: rgba(0, 0, 0, 0.04);
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 6px;
  border-left: 3.5px solid var(--accent-apple);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

[data-theme="dark"] .msg-quoted-card {
  background-color: rgba(255, 255, 255, 0.08);
}

.from-me .msg-quoted-card {
  background-color: rgba(255, 255, 255, 0.2);
  border-left-color: #ffffff;
}

.msg-quoted-card:hover {
  background-color: rgba(0, 0, 0, 0.08);
}

.from-me .msg-quoted-card:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

.quoted-body {
  flex: 1;
  min-width: 0;
}

.quoted-sender {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent-apple);
  margin-bottom: 2px;
}

.from-me .quoted-sender {
  color: #ffffff;
}

.quoted-snippet {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.from-me .quoted-snippet {
  color: rgba(255, 255, 255, 0.85);
}

/* Forward Message Modal Styling */
.forward-modal-box {
  max-width: 480px;
  width: 90%;
}

.forward-preview-box {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.forward-preview-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.forward-preview-text {
  font-size: 13px;
  color: var(--text-primary);
  max-height: 60px;
  overflow-y: auto;
  line-height: 1.4;
}

/* ====================================================================
   WHATSAPP WEB MESSAGE SELECTION & FORWARD SYSTEM (Image 1 & 2)
   ==================================================================== */
.chat-message-row {
  width: 100%;
  display: flex;
  align-items: center;
  position: relative;
  padding: 3px 6px;
  border-radius: 6px;
  transition: background-color 0.15s ease;
  box-sizing: border-box;
}

.chat-message-row.row-from-me {
  justify-content: flex-end;
}

.chat-message-row.row-from-other {
  justify-content: flex-start;
}

/* Checkbox on left of message in selection mode */
.msg-select-checkbox-wrapper {
  display: none;
  width: 38px;
  min-width: 38px;
  height: 100%;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
}

.chat-selection-mode .msg-select-checkbox-wrapper {
  display: flex;
}

.msg-select-checkbox {
  width: 19px;
  height: 19px;
  border-radius: 4px;
  border: 2px solid #8696a0;
  background-color: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  cursor: pointer;
  box-sizing: border-box;
}

.msg-select-checkbox svg {
  display: none;
  color: #ffffff;
}

.chat-message-row.is-selected .msg-select-checkbox {
  background-color: #00a884;
  border-color: #00a884;
}

.chat-message-row.is-selected .msg-select-checkbox svg {
  display: block;
}

/* WhatsApp row background highlight when in selection mode */
.chat-selection-mode .chat-message-row {
  cursor: pointer;
}

.chat-selection-mode .chat-message-row:hover {
  background-color: rgba(0, 168, 132, 0.05);
}

.chat-selection-mode .chat-message-row.is-selected {
  background-color: rgba(0, 168, 132, 0.1);
}

[data-theme="dark"] .chat-selection-mode .chat-message-row.is-selected {
  background-color: rgba(0, 168, 132, 0.18);
}

/* Bottom Selection Bar (Image 1 circled in red) */
.chat-selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-light);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04);
  height: 62px;
  box-sizing: border-box;
  animation: waBarSlideUp 0.18s var(--ease-apple);
}

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

.selection-bar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-cancel-selection {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-cancel-selection:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.selection-count-text {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.selection-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-forward-selected {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background-color: var(--bg-card-subtle);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.btn-forward-selected:hover {
  background-color: #00a884;
  border-color: #00a884;
  color: #ffffff;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 168, 132, 0.35);
}

.btn-forward-selected:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  background-color: var(--bg-card-subtle);
  color: var(--text-muted);
  border-color: var(--border-light);
}

/* Forward Modal (Image 2) */
.forward-modal-box {
  max-width: 440px;
  width: 92%;
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  background-color: var(--bg-card);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  position: relative;
}

.forward-modal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px 14px 20px;
  border-bottom: 1px solid var(--border-light);
}

.btn-close-forward {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.btn-close-forward:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.forward-modal-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.forward-modal-body {
  padding: 14px 20px 20px 20px;
  position: relative;
  min-height: 380px;
  display: flex;
  flex-direction: column;
}

.forward-search-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  background-color: var(--bg-card-subtle);
  border: 1.5px solid transparent;
  border-radius: 24px;
  transition: all 0.15s ease;
}

[data-theme="dark"] .forward-search-wrapper {
  background-color: #202c33;
}

.forward-search-wrapper:focus-within {
  border-color: #00a884;
  background-color: var(--bg-card);
}

.forward-search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.forward-search-input {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-size: 13.5px;
  color: var(--text-primary);
}

.forward-section-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 14px;
  margin-bottom: 8px;
  padding-left: 2px;
}

.forward-leads-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 320px;
  overflow-y: auto;
  margin: 0 -8px;
  padding: 0 8px 40px 8px;
  flex: 1;
}

.forward-lead-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.12s ease;
  user-select: none;
}

.forward-lead-row:hover {
  background-color: var(--bg-hover);
}

.forward-item-checkbox {
  width: 19px;
  height: 19px;
  border-radius: 4px;
  border: 2px solid #8696a0;
  background-color: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
  box-sizing: border-box;
}

.forward-item-checkbox svg {
  display: none;
  color: #ffffff;
}

.forward-lead-row.is-contact-selected .forward-item-checkbox {
  background-color: #00a884;
  border-color: #00a884;
}

.forward-lead-row.is-contact-selected .forward-item-checkbox svg {
  display: block;
}

.forward-item-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00a884, #008f6f);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.forward-item-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.forward-item-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.forward-item-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Floating WhatsApp Green Send Button */
.btn-forward-send-fab {
  position: absolute;
  bottom: 18px;
  right: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-color: #00a884;
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 168, 132, 0.45);
  transition: all 0.18s ease;
  animation: fabPop 0.18s var(--ease-apple);
  z-index: 10;
}

@keyframes fabPop {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: scale(1); }
}

.btn-forward-send-fab:hover {
  background-color: #008f6f;
  transform: scale(1.08);
  box-shadow: 0 6px 18px rgba(0, 168, 132, 0.55);
}

/* ==========================================================================
   WHATSAPP EMOJI PICKER POPUP (Like WhatsApp Web)
   ========================================================================== */
.chat-active-screen {
  position: relative !important;
}

.wa-emoji-picker-popup {
  position: absolute;
  bottom: 82px;
  left: 20px;
  width: 380px;
  max-width: calc(100% - 40px);
  height: 420px;
  max-height: calc(100vh - 200px);
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 2px 10px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  z-index: 200;
  backdrop-filter: blur(16px);
  overflow: hidden;
  animation: waEmojiPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes waEmojiPop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.wa-emoji-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background-color: var(--bg-panel);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.wa-emoji-search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.wa-emoji-search-box:focus-within {
  border-color: var(--accent-apple);
  background-color: var(--bg-card);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.14);
  color: var(--text-primary);
}

.wa-emoji-search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--text-primary);
  font-family: inherit;
}

.btn-clear-emoji-search {
  background: transparent;
  border: none;
  font-size: 16px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.btn-clear-emoji-search:hover {
  color: var(--text-primary);
}

.wa-emoji-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.wa-emoji-close:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

/* Category Tabs Bar */
.wa-emoji-tabs-bar {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  background-color: var(--bg-panel);
  border-bottom: 1px solid var(--border-light);
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

.wa-emoji-tabs-bar::-webkit-scrollbar {
  display: none;
}

.wa-emoji-tab {
  background: transparent;
  border: none;
  font-size: 18px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.65;
  border-bottom: 2px solid transparent;
}

.wa-emoji-tab:hover {
  background-color: var(--bg-hover);
  opacity: 1;
}

.wa-emoji-tab.active {
  background-color: var(--bg-card-subtle);
  opacity: 1;
  border-bottom-color: var(--accent-apple);
  border-radius: 4px 4px 0 0;
}

/* Scrollable Body */
.wa-emoji-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.wa-emoji-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wa-emoji-category-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  position: sticky;
  top: -10px;
  background: var(--bg-card);
  padding: 4px 0;
  z-index: 2;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 4px;
}

.wa-emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 3px;
}

@media (max-width: 480px) {
  .wa-emoji-grid {
    grid-template-columns: repeat(7, 1fr);
  }
}

.wa-emoji-btn {
  background: transparent;
  border: none;
  font-size: 22px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.12s ease;
  user-select: none;
}

.wa-emoji-btn:hover {
  background-color: var(--bg-hover);
  transform: scale(1.22);
  z-index: 5;
}

.wa-emoji-btn:active {
  transform: scale(0.92);
}

.wa-emoji-empty-search {
  padding: 36px 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* Footer */
.wa-emoji-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background-color: var(--bg-panel);
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-secondary);
  min-height: 40px;
  flex-shrink: 0;
}

.wa-emoji-preview-item {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.wa-emoji-preview-item .preview-emoji {
  font-size: 22px;
  line-height: 1;
}

.wa-emoji-preview-item .preview-name {
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 210px;
  font-size: 12.5px;
}

.wa-emoji-tip {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================================================
   DADOS DA NOTA FISCAL (Apple CRM Design System)
   ========================================================================== */

/* Sub-tabs inside Lead CRM Column */
.crm-tabs-nav-bar {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  background-color: var(--bg-card-subtle);
  border-bottom: 1px solid var(--border-light);
  gap: 6px;
  flex-shrink: 0;
}

.crm-nav-tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

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

.crm-nav-tab-btn.active {
  background-color: var(--bg-panel);
  color: var(--accent-apple);
  border-color: var(--border-light);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.crm-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background-color: var(--accent-apple);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  margin-left: 2px;
}

.crm-tab-badge.green {
  background-color: #10b981;
}

.crm-tab-content-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Top Actions Strip inside Nota Fiscal Tab */
.nf-top-actions-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0 8px 0;
}

.nf-top-actions-strip .btn-action-pill {
  flex: 1;
  justify-content: center;
}

/* Scanning Indicator */
.nf-scanning-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.08), rgba(16, 185, 129, 0.08));
  border: 1px solid rgba(0, 122, 255, 0.2);
  color: var(--accent-apple);
  font-size: 12px;
  font-weight: 600;
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(0.995); }
}

/* Empty State */
.nf-empty-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 16px;
  border-radius: var(--radius-lg);
  border: 1.5px dashed var(--border-medium);
  background-color: var(--bg-card-subtle);
  margin-top: 4px;
}

.nf-empty-icon {
  font-size: 38px;
  margin-bottom: 10px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.08));
}

.nf-empty-card h4 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.nf-empty-card p {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 290px;
  margin-bottom: 16px;
}

.nf-empty-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

/* Highlight Banner */
.nf-highlight-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25);
  margin-bottom: 4px;
}

.nf-banner-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nf-ai-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #ffffff;
}

.nf-sparkle {
  font-size: 13px;
}

.nf-banner-timestamp {
  font-size: 11px;
  opacity: 0.9;
}

.nf-banner-val-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.nf-val-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.88;
}

.nf-val-number {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
}

/* Access Key Copy Box */
.nf-key-input-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-panel);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
}

.nf-key-input-box input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.5px;
  outline: none;
  cursor: text;
}

.btn-copy-nf-key {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-light);
  background-color: var(--bg-card);
  color: var(--accent-apple);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.btn-copy-nf-key:hover {
  background-color: var(--bg-hover);
  border-color: var(--accent-apple);
}

.btn-copy-nf-key.copied {
  background-color: #10b981;
  color: #ffffff;
  border-color: #10b981;
}

/* Items Table */
.nf-items-table-container {
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background-color: var(--bg-panel);
}

.nf-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.nf-items-table th {
  background-color: var(--bg-card-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.nf-items-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}

.nf-items-table tbody tr:last-child td {
  border-bottom: none;
}

.items-count-badge {
  font-size: 10px;
  font-weight: 600;
  background-color: var(--bg-hover);
  color: var(--text-secondary);
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

/* Photo Preview */
.nf-photo-preview-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nf-photo-preview-wrap img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.nf-photo-preview-wrap img:hover {
  transform: scale(1.01);
}

.nf-photo-btn-bar {
  display: flex;
  justify-content: flex-end;
}

/* Bottom Actions Stack */
.nf-bottom-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  margin-bottom: 14px;
}

/* Global Invoices Modal */
.invoices-modal-box {
  max-width: 980px;
  width: 95vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.invoices-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.invoices-kpi-card {
  padding: 16px;
  border-radius: var(--radius-md);
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.invoices-kpi-card.highlight-green {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.03));
  border-color: rgba(16, 185, 129, 0.25);
}

.invoices-kpi-card.highlight-green .kpi-val {
  color: #10b981;
}

.invoices-kpi-card .kpi-label {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

.invoices-kpi-card .kpi-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

.badge-pill-outline {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-medium);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-apple);
  background-color: var(--bg-hover);
}

.nf-count-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background-color: var(--accent-apple);
  color: #ffffff;
}

/* Delete button variants & API Key Warning Banner */
.btn-action-pill.danger {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
}
.btn-action-pill.danger:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

.btn-danger-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(239, 68, 68, 0.35);
  background-color: rgba(239, 68, 68, 0.06);
  color: #ef4444;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-danger-outline:hover {
  background-color: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

.nf-api-warning-banner {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
  margin-bottom: 8px;
  animation: fadeIn 0.2s ease-out;
}

/* ==========================================================================
   MODAL DE DETALHES COMPLETOS DA NOTA FISCAL (ITENS, TRIBUTOS & CONFERÊNCIA)
   ========================================================================== */
.invoice-detail-modal-box {
  width: 96%;
  max-width: 900px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5), 0 0 40px rgba(16, 185, 129, 0.08);
  overflow: hidden;
  animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.invoice-detail-modal-body {
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-surface);
}

.dt-nf-metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.dt-metric-card {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-subtle);
}

.dt-metric-card.primary {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(5, 150, 105, 0.05) 100%);
  border-color: rgba(16, 185, 129, 0.35);
}

.dt-metric-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dt-metric-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.dt-metric-card.primary .dt-metric-val {
  color: #10b981;
  font-size: 24px;
}

.dt-metric-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.dt-section-box {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-subtle);
}

.dt-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.dt-section-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dt-key-display {
  font-family: 'SF Mono', Consolas, 'Courier New', monospace;
  font-size: 13.5px;
  letter-spacing: 1.5px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 10px 14px;
  color: #10b981;
  text-align: center;
  word-break: break-all;
  font-weight: 600;
  user-select: all;
}

.dt-two-cols-row {
  display: flex;
  gap: 14px;
}

@media (max-width: 720px) {
  .dt-two-cols-row {
    flex-direction: column;
  }
}

.dt-info-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dt-info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12.5px;
}

.dt-info-item label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
}

.dt-info-item strong {
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 700;
}

.dt-info-item span {
  color: var(--text-secondary);
  font-size: 12.5px;
}

.dt-table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
}

.dt-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.dt-items-table thead th {
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-light);
}

.dt-items-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}

.dt-items-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

.dt-items-table tbody tr:hover {
  background: rgba(16, 185, 129, 0.04);
}

.dt-taxes-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dt-taxes-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dt-tax-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.dt-tax-pill.green {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.25);
}

.dt-tax-pill.orange {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.25);
}

.dt-taxes-text {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.18);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.dt-photo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

.dt-raw-text-box {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(0, 0, 0, 0.25);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  max-height: 160px;
  overflow-y: auto;
}

/* Clickable table rows in Central de Notas */
.clickable-invoice-row {
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.clickable-invoice-row:hover {
  background-color: rgba(16, 185, 129, 0.08) !important;
}

.btn-view-invoice-detail {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--radius-xs);
  transition: all var(--transition-fast);
}

/* Print Styles */
@media print {
  body * {
    visibility: hidden;
  }
  #invoiceDetailModal, #invoiceDetailModal * {
    visibility: visible;
  }
  #invoiceDetailModal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    display: block !important;
    background: #fff !important;
    color: #000 !important;
  }
  .modal-close, .modal-footer {
    display: none !important;
  }
}

/* ==========================================================================
   Channel Filter Bar & Instagram Direct Dynamic Chat Styling
   ========================================================================== */
.channel-filter-bar {
  display: flex;
  gap: 6px;
  padding: 8px 16px 6px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
}

.channel-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 9999px;
  border: 1px solid var(--border-light);
  background: var(--bg-card-subtle, rgba(255, 255, 255, 0.04));
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.channel-pill:hover {
  background: var(--bg-card-hover, rgba(255, 255, 255, 0.08));
  color: var(--text-primary);
  transform: translateY(-1px);
}

.channel-pill.active {
  background: var(--accent, #007934);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(0, 121, 52, 0.3);
}

.channel-pill.channel-whatsapp.active {
  background: #25D366;
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(37, 211, 102, 0.35);
}

.channel-pill.channel-instagram.active {
  background: linear-gradient(45deg, #f09433, #dc2743, #bc1888);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 2px 12px rgba(220, 39, 67, 0.4);
}

/* Active Instagram Chat Accent */
.chat-window.is-instagram-channel .chat-lead-avatar {
  box-shadow: 0 0 0 2.5px #e1306c;
}

.chat-window.is-instagram-channel .btn-send-message {
  background: linear-gradient(45deg, #f09433, #dc2743, #bc1888) !important;
  box-shadow: 0 2px 10px rgba(220, 39, 67, 0.35) !important;
}

.chat-window.is-instagram-channel .chat-bubble.from-me {
  background: var(--argon-gradient-primary) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(0, 121, 52, 0.25) !important;
}

.chat-window.is-instagram-channel .chat-bubble.from-me .msg-time {
  color: rgba(255, 255, 255, 0.75) !important;
}

.lead-item.is-instagram-lead {
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.lead-item.is-instagram-lead:hover,
.lead-item.is-instagram-lead.active {
  border-left-color: #e1306c;
}

.lead-item.is-instagram-lead .lead-avatar-img,
.lead-item.is-instagram-lead .lead-avatar {
  border: 1.5px solid rgba(225, 48, 108, 0.4);
}

.status-indicator-dot.connected-ig {
  background: #e1306c !important;
  box-shadow: 0 0 8px rgba(225, 48, 108, 0.8) !important;
}

/* ==========================================================================
   VIEW C: PUBLICAÇÕES & AGENDAMENTO INSTAGRAM (Apple Minimalist Aesthetic)
   ========================================================================== */
.view-publicacoes {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background: var(--bg-shell);
  position: relative;
}

/* Top Header Bar */
.pub-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  gap: 20px;
  flex-wrap: wrap;
}

[data-theme="dark"] .pub-header {
  background: rgba(18, 22, 28, 0.85);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.pub-header-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pub-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(240, 148, 51, 0.12), rgba(220, 39, 67, 0.12), rgba(188, 24, 136, 0.12));
  color: #e1306c;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  width: fit-content;
}

.pub-header-info h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.4px;
}

.pub-header-info p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.pub-header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pub-account-selector-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-light);
  padding: 4px 12px;
  border-radius: 10px;
}

.pub-account-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.pub-account-select {
  background: transparent;
  border: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
}

/* Tab Segmented Control */
.pub-tabs-nav {
  display: flex;
  align-items: center;
  background: var(--bg-surface-2);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  gap: 2px;
}

.pub-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.pub-tab-btn:hover {
  color: var(--text-primary);
}

.pub-tab-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.pub-count-pill {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  font-weight: 700;
}

.pub-tab-btn.active .pub-count-pill {
  background: rgba(225, 48, 108, 0.15);
  color: #e1306c;
}

/* Composer Layout (2 columns) */
.pub-tab-pane {
  padding: 24px 28px 40px;
  width: 100%;
}

.pub-composer-layout {
  display: grid;
  grid-template-columns: minmax(480px, 1.25fr) minmax(360px, 0.75fr);
  gap: 28px;
  max-width: 1480px;
  margin: 0 auto;
}

@media (max-width: 1100px) {
  .pub-composer-layout {
    grid-template-columns: 1fr;
  }
}

.pub-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.pub-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.pub-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.pub-sublabel {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Dropzone */
.pub-dropzone {
  border: 2px dashed rgba(225, 48, 108, 0.3);
  border-radius: 14px;
  background: rgba(225, 48, 108, 0.02);
  padding: 26px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pub-dropzone:hover,
.pub-dropzone.drag-over {
  border-color: #e1306c;
  background: rgba(225, 48, 108, 0.06);
}

.pub-dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.pub-dropzone-icon {
  color: #e1306c;
  margin-bottom: 2px;
}

.pub-dropzone-inner strong {
  font-size: 13.5px;
  color: var(--text-primary);
}

.pub-dropzone-inner span {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Previews container */
.pub-previews-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.pub-previews-list {
  display: flex;
  gap: 10px;
}

.pub-preview-thumb-card {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid var(--border-light);
  background: #000;
  flex-shrink: 0;
}

.pub-preview-thumb-card img,
.pub-preview-thumb-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pub-thumb-remove-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border: none;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pub-thumb-remove-btn:hover {
  background: #ef4444;
}

.pub-btn-add-more {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  border: 1.5px dashed var(--border-subtle);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.pub-btn-add-more:hover {
  border-color: #e1306c;
  color: #e1306c;
}

/* Format Pills */
.pub-format-pills {
  display: flex;
  gap: 8px;
}

.pub-format-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-light);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.pub-format-pill input {
  display: none;
}

.pub-format-pill.active {
  background: rgba(225, 48, 108, 0.1);
  border-color: #e1306c;
  color: #e1306c;
}

/* AI Copilot Box */
.pub-ai-box {
  background: linear-gradient(135deg, rgba(0, 121, 52, 0.05), rgba(225, 48, 108, 0.06));
  border: 1px solid rgba(0, 121, 52, 0.25);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.pub-ai-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: #007934;
}

.pub-ai-tag {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 121, 52, 0.15);
  color: #007934;
  font-weight: 700;
  text-transform: uppercase;
}

.pub-ai-input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  font-size: 12.5px;
  color: var(--text-primary);
  outline: none;
}

.pub-ai-input:focus {
  border-color: #007934;
}

.pub-ai-controls {
  display: flex;
  gap: 8px;
}

.pub-ai-select {
  flex: 1;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  font-size: 11.5px;
  color: var(--text-primary);
  outline: none;
}

.btn-pub-ai-submit {
  padding: 7px 14px;
  border-radius: 8px;
  background: linear-gradient(135deg, #007934, #ec4899);
  color: #fff;
  border: none;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
  box-shadow: 0 2px 8px rgba(0, 121, 52, 0.3);
}

.btn-pub-ai-submit:hover {
  opacity: 0.94;
  transform: translateY(-1px);
}

/* Caption Area */
.pub-caption-wrapper {
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: var(--bg-surface-2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pub-caption-textarea {
  width: 100%;
  border: none;
  background: transparent;
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--text-primary);
  font-family: inherit;
  resize: vertical;
  min-height: 110px;
  outline: none;
  line-height: 1.5;
}

.pub-caption-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-surface-2);
  border-top: 1px solid var(--border-light);
  gap: 8px;
  flex-wrap: wrap;
}

.pub-caption-tools-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pub-tool-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pub-tool-btn:hover {
  color: var(--text-primary);
  border-color: #e1306c;
}

.pub-tag-chip {
  color: #0284c7;
}

.pub-char-counter {
  font-size: 11px;
  color: var(--text-muted);
}

/* Scheduling Options */
.pub-schedule-radios {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pub-radio-card {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border-light);
  background: var(--bg-surface-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.18s ease;
}

.pub-radio-card input {
  display: none;
}

.pub-radio-card.active {
  border-color: #e1306c;
  background: rgba(225, 48, 108, 0.06);
}

.pub-radio-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pub-radio-icon {
  font-size: 20px;
}

.pub-radio-text {
  display: flex;
  flex-direction: column;
}

.pub-radio-text strong {
  font-size: 12.5px;
  color: var(--text-primary);
}

.pub-radio-text span {
  font-size: 11px;
  color: var(--text-muted);
}

.pub-datetime-drawer {
  margin-top: 10px;
  padding: 14px;
  border-radius: 12px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pub-datetime-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pub-datetime-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.pub-input-datetime {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
}

.pub-quick-presets {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pub-presets-label {
  font-size: 11px;
  color: var(--text-muted);
}

.pub-preset-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pub-preset-btn:hover {
  border-color: #e1306c;
  color: #e1306c;
}

/* Primary Submit Button */
.pub-submit-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-pub-primary {
  width: 100%;
  padding: 13px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: #fff;
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(220, 39, 67, 0.35);
  transition: all 0.2s ease;
}

.btn-pub-primary:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(220, 39, 67, 0.45);
}

.btn-pub-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.pub-submit-feedback {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

.pub-submit-feedback.success {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.pub-submit-feedback.error {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

/* --------------------------------------------------------------------------
   RIGHT COLUMN: PHONE MOCKUP PREVIEW
   -------------------------------------------------------------------------- */
.pub-preview-sticky {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.pub-preview-header {
  width: 100%;
  max-width: 380px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pub-preview-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.pub-preview-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.pub-preview-device {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

/* iPhone Frame */
.pub-phone-mockup {
  width: 100%;
  max-width: 360px;
  border-radius: 46px;
  padding: 10px;
  background: linear-gradient(135deg, #2c2d30, #17181a);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25), 0 0 0 2px #4a4b50;
}

.mockup-bezel {
  border-radius: 38px;
  background: #000;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.2);
}

.mockup-dynamic-island {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 22px;
  background: #000;
  border-radius: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
}

.mockup-camera-sensor {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mockup-screen {
  background: #ffffff;
  color: #000000;
  min-height: 570px;
  display: flex;
  flex-direction: column;
}

[data-theme="dark"] .mockup-screen {
  background: #000000;
  color: #ffffff;
}

.mockup-status-bar {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px 0;
  font-size: 11px;
  font-weight: 600;
}

.mockup-ig-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 6px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .mockup-ig-navbar {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.mockup-ig-brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.mockup-ig-nav-icons {
  display: flex;
  gap: 14px;
}

/* Mockup Post */
.mockup-post {
  display: flex;
  flex-direction: column;
}

.mockup-post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
}

.mockup-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mockup-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f09433, #dc2743);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1.5px #e1306c;
}

.mockup-user-names {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.mockup-user-names strong {
  font-size: 12px;
}

.mockup-location {
  font-size: 9.5px;
  opacity: 0.65;
}

.mockup-dots {
  font-size: 12px;
  opacity: 0.5;
}

.mockup-media-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f1f3f7;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .mockup-media-container {
  background: #1a1e24;
}

.mockup-media-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
  color: #8b95a5;
  font-size: 11px;
}

.mockup-media-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mockup-carousel-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
}

.mockup-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
}

.mockup-actions-left {
  display: flex;
  gap: 12px;
}

.mockup-caption-section {
  padding: 0 12px 14px;
  font-size: 11.5px;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mockup-likes-line {
  font-size: 11px;
}

.mockup-caption-text {
  word-break: break-word;
  max-height: 90px;
  overflow-y: auto;
}

.mockup-caption-text strong {
  margin-right: 4px;
}

.mockup-timestamp-line {
  font-size: 9px;
  opacity: 0.5;
  text-transform: uppercase;
  margin-top: 2px;
}

.pub-preview-tip {
  max-width: 360px;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
  text-align: center;
  padding: 0 10px;
}

/* --------------------------------------------------------------------------
   SCHEDULED & HISTORY CARDS GRID
   -------------------------------------------------------------------------- */
.pub-list-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pub-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.pub-list-toolbar-left h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text-primary);
}

.pub-list-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
}

.pub-list-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pub-select-sm {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  font-size: 12px;
  color: var(--text-primary);
  outline: none;
}

.pub-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.pub-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.pub-item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.pub-item-card-media {
  width: 100%;
  height: 190px;
  background: #111;
  position: relative;
  overflow: hidden;
}

.pub-item-card-media img,
.pub-item-card-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pub-status-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  backdrop-filter: blur(8px);
}

.pub-status-badge.scheduled {
  background: rgba(14, 165, 233, 0.9);
  color: #fff;
}

.pub-status-badge.published {
  background: rgba(16, 185, 129, 0.9);
  color: #fff;
}

.pub-status-badge.publishing {
  background: rgba(245, 158, 11, 0.9);
  color: #fff;
}

.pub-status-badge.failed {
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
}

.pub-item-card-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.pub-item-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

.pub-item-conn-tag {
  font-weight: 600;
  color: #e1306c;
}

.pub-item-caption-snippet {
  font-size: 12.5px;
  color: var(--text-primary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.pub-item-error-banner {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
  color: #ef4444;
}

.pub-item-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}

.pub-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border-subtle);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.pub-empty-icon {
  font-size: 42px;
}

.pub-empty-state strong {
  font-size: 16px;
  color: var(--text-primary);
}

.pub-empty-state p {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 400px;
  margin: 0;
}

/* ==========================================================================
   PUBLICATIONS: INSTAGRAM AUTHENTICATION & CONNECTION CARD
   ========================================================================== */
.pub-auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}

/* Connected State */
.pub-auth-connected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.pub-auth-connected-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pub-auth-avatar-box {
  position: relative;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}

.pub-auth-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e1306c;
}

.pub-auth-avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, #f09433, #dc2743);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #e1306c;
}

.pub-auth-status-dot.online {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid var(--bg-card);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.pub-auth-user-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pub-auth-user-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pub-auth-user-title-row strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.pub-auth-approved-badge {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.pub-auth-subtext {
  font-size: 12px;
  color: var(--text-muted);
}

.pub-auth-connected-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Disconnected State */
.pub-auth-disconnected {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pub-auth-disco-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pub-auth-disco-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pub-auth-disco-badge strong {
  font-size: 15px;
  color: var(--text-primary);
}

.pub-auth-disco-desc {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

.pub-login-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 8px;
}

.pub-login-tab-btn {
  background: transparent;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pub-login-tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-2);
}

.pub-login-tab-btn.active {
  color: #e1306c;
  background: rgba(225, 48, 108, 0.08);
}

.pub-login-pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pub-cookie-guide {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.pub-cookie-guide code {
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 4px;
  border-radius: 4px;
  font-family: monospace;
  font-weight: 600;
}

.pub-login-form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pub-login-form-row.multi-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
}

@media (max-width: 768px) {
  .pub-login-form-row.multi-inputs {
    grid-template-columns: 1fr;
  }
}

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

.pub-input-addon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  pointer-events: none;
}

.pub-login-form-row.multi-inputs .pub-input-wrapper:first-child .pub-login-input {
  padding-left: 28px;
}

.pub-login-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
}

.pub-login-input:focus {
  border-color: #e1306c;
  box-shadow: 0 0 0 2px rgba(225, 48, 108, 0.15);
}

.btn-instagram-pub {
  background: linear-gradient(135deg, #e1306c, #c13584);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(225, 48, 108, 0.25);
}

.btn-instagram-pub:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(225, 48, 108, 0.35);
}

.btn-instagram-pub:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.pub-challenge-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 12px;
  padding: 12px 14px;
}

.pub-challenge-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: var(--text-primary);
}

.pub-challenge-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pub-login-input.code-input {
  max-width: 140px;
  text-align: center;
  font-size: 16px;
  letter-spacing: 2px;
  font-weight: 700;
}

.pub-login-alert {
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.pub-login-alert.success {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.25);
}

/* ==========================================================================
   PUBLICATIONS: LIVE TERMINAL / SEND CONSOLE
   ========================================================================== */
.pub-live-console-card {
  margin-top: 14px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  display: flex;
  flex-direction: column;
}

.pub-console-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 13px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
}

.pub-console-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pub-console-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.pub-console-dot.idle {
  background: #6e7681;
}

.pub-console-dot.running {
  background: #e3b341;
  box-shadow: 0 0 8px #e3b341;
  animation: pulseConsoleDot 1.4s infinite;
}

.pub-console-dot.success {
  background: #2ea043;
  box-shadow: 0 0 8px #2ea043;
}

.pub-console-dot.error {
  background: #f85149;
  box-shadow: 0 0 8px #f85149;
}

@keyframes pulseConsoleDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.85); }
}

.pub-console-title {
  font-size: 11px;
  color: #c9d1d9;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-weight: 700;
}

.pub-console-actions {
  display: flex;
  gap: 6px;
}

.pub-console-btn-xs {
  background: #21262d;
  border: 1px solid #30363d;
  color: #c9d1d9;
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pub-console-btn-xs:hover {
  background: #30363d;
  color: #fff;
}

.pub-console-body {
  padding: 10px 12px;
  min-height: 150px;
  max-height: 240px;
  overflow-y: auto;
  font-size: 11px;
  line-height: 1.6;
  color: #e6edf3;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #0d1117;
}

.pub-console-line {
  word-break: break-word;
}

.pub-console-line.hint {
  color: #6e7681;
  font-style: italic;
}

.pub-console-line.info {
  color: #79c0ff;
}

.pub-console-line.success {
  color: #56d364;
  font-weight: 600;
}

.pub-console-line.warning {
  color: #e3b341;
}

.pub-console-line.error {
  color: #ff7b72;
  font-weight: 600;
}

.pub-console-footer {
  padding: 6px 12px;
  background: #161b22;
  border-top: 1px solid #21262d;
  font-size: 10.5px;
  color: #8b949e;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================================================
   2. 🏛️ Estrutura da Shell da Aplicação (Layout Master Nexus / Argon)
   ========================================================================== */
.argon-app-wrapper {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  padding: 0;
  gap: 0;
  box-sizing: border-box;
}

/* ==========================================================================
   3. 📑 Sidenav Dark Estilo NexusCRM (aside)
   ========================================================================== */
.argon-sidenav {
  width: 256px;
  background: var(--bg-sidebar);
  color: var(--text-sidebar);
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  padding: 0 0.75rem 1rem 0.75rem;
  flex-shrink: 0;
  border-right: 1px solid var(--border-sidebar);
  transition: all 0.25s ease;
  z-index: 100;
}

.argon-sidenav-header {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-sidebar);
}

.argon-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--border-radius-sm);
  background: var(--argon-gradient-primary);
  box-shadow: 0 4px 10px rgba(0, 121, 52, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.argon-brand-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.125rem;
  color: #ffffff;
  letter-spacing: -0.025em;
}

.argon-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  overflow-y: auto;
}

.argon-nav-category {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1rem 0 0.35rem 0.75rem;
}

.argon-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--border-radius-sm);
  color: var(--text-sidebar);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  transition: all 0.15s ease;
}

.argon-nav-item:hover {
  background: var(--bg-sidebar-hover);
  color: #f1f5f9;
  transform: none;
}

.argon-nav-item.active {
  background: var(--brand-600);
  color: #ffffff;
  font-weight: 500;
  box-shadow: var(--shadow-brand);
}

.argon-icon-box {
  width: 20px;
  height: 20px;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  box-shadow: none;
  color: inherit;
  transition: color 0.15s ease;
}

.argon-nav-item:hover .argon-icon-box {
  color: #007934;
}

.argon-nav-item.active .argon-icon-box {
  background: transparent;
  color: #ffffff;
}

.argon-nav-item.active .argon-icon-box svg {
  stroke: #ffffff;
}

/* ==========================================================================
   4. 💬 Chat ao Vivo em 3 Colunas no Estilo NexusCRM
   ========================================================================== */
.argon-chat-viewport {
  display: grid;
  grid-template-columns: 320px 1fr 340px;
  gap: 1rem;
  height: 100%;
  width: 100%;
  padding: 1.25rem;
  box-sizing: border-box;
  overflow: hidden;
}

.col-leads-card {
  background: var(--bg-surface);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.leads-search-header {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.argon-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.argon-input {
  width: 100%;
  padding: 0.5rem 0.85rem 0.5rem 2.25rem;
  font-size: 0.875rem;
  font-family: var(--font-family);
  background: var(--bg-surface-subtle);
  border: 1px solid transparent;
  border-radius: var(--border-radius-sm);
  color: var(--text-main);
  outline: none;
  transition: all 0.15s ease;
}

.argon-input::placeholder {
  color: var(--text-disabled);
}

.argon-input:hover {
  background: #e2e8f0;
}

.argon-input:focus {
  background: #ffffff;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(0, 121, 52, 0.15);
}

.lead-row-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.15s ease;
}

.lead-row-item:hover {
  background: #f8fafc;
}

.lead-row-item.active {
  background: var(--brand-50);
  border-left: 3px solid var(--brand-600);
}

.col-chat-card {
  background: var(--bg-surface);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-card-header {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface);
}

.chat-timeline {
  flex: 1;
  background: var(--bg-shell);
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.chat-bubble {
  max-width: 68%;
  padding: 0.625rem 0.875rem;
  border-radius: var(--border-radius-md);
  font-size: 0.84375rem;
  line-height: 1.5;
  box-shadow: var(--shadow-xs);
  position: relative;
}

.chat-bubble.from-me {
  align-self: flex-end;
  background: var(--chat-bubble-me);
  color: var(--chat-bubble-me-text);
  border-bottom-right-radius: 2px;
}

.chat-bubble.from-other {
  align-self: flex-start;
  background: var(--chat-bubble-other);
  color: var(--chat-bubble-other-text);
  border: 1px solid var(--chat-bubble-other-border);
  border-bottom-left-radius: 2px;
}

.chat-card-footer {
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.col-profile-card {
  background: var(--bg-surface);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 1.25rem;
  gap: 1.25rem;
}

/* ==========================================================================
   5. 📊 Cards de Métricas & Badges (Estilo NexusCRM)
   ========================================================================== */
.argon-kpi-card {
  background: var(--bg-surface);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-color);
  padding: 1rem 1.125rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  transition: border-color 0.15s ease;
}

.argon-kpi-card:hover {
  border-color: var(--border-hover);
}

.argon-kpi-info h6 {
  margin: 0;
  font-size: 0.75rem;
  text-transform: none;
  font-weight: 500;
  color: var(--text-muted);
}

.argon-kpi-info h3 {
  margin: 0.25rem 0 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.025em;
}

.argon-kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  flex-shrink: 0;
}

.argon-kpi-icon.primary {
  background: #e6f4ec; border: 1px solid #cce9d8; color: #007934;
}
.argon-kpi-icon.success {
  background: #ecfdf5;
  border: 1px solid #d1fae5;
  color: #059669;
}
.argon-kpi-icon.warning {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  color: #d97706;
}
.argon-kpi-icon.danger {
  background: #fff1f2;
  border: 1px solid #ffe4e6;
  color: #e11d48;
}
.argon-kpi-icon.info {
  background: #e6f4ec; border: 1px solid #cce9d8; color: #007934;
}

.argon-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.625rem;
  font-weight: 600;
  border-radius: var(--border-radius-xs);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.argon-badge.badge-primary {
  background: #e6f4ec; color: #00622a; border: 1px solid rgba(0, 121, 52, 0.3);
}
.argon-badge.badge-success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid rgba(167, 243, 208, 0.6);
}
.argon-badge.badge-warning {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid rgba(253, 230, 138, 0.6);
}
.argon-badge.badge-danger {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid rgba(254, 205, 211, 0.6);
}

/* ==========================================================================
   6. 📋 Pipeline Funil Kanban (Grade NexusCRM)
   ========================================================================== */
.argon-kanban-board {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 0.25rem 0 0.5rem 0;
  height: 100%;
}

.argon-kanban-column {
  width: 310px;
  flex-shrink: 0;
  background: rgba(241, 245, 249, 0.85);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  max-height: 100%;
}

.argon-kanban-header {
  padding: 0.875rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(226, 232, 240, 0.7);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #334155;
}

.argon-kanban-list {
  padding: 0.625rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  overflow-y: auto;
  flex: 1;
}

.argon-lead-card {
  background: var(--bg-surface);
  border-radius: var(--border-radius-sm);
  padding: 0.875rem;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(226, 232, 240, 0.9);
  cursor: grab;
  transition: all 0.15s ease;
}

.argon-lead-card:hover {
  transform: none;
  border-color: var(--border-card-hover);
  box-shadow: var(--shadow-hover);
}

.argon-lead-card:active {
  cursor: grabbing;
}

/* ==========================================================================
   7. 💻 Botão de Destaque Estilo SaaS ("+ Novo Negócio")
   ========================================================================== */
.btn-argon-gradient {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--brand-600);
  color: #ffffff;
  border: 1px solid transparent;
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 0.875rem;
  text-transform: none;
  letter-spacing: normal;
  padding: 0.5rem 0.875rem;
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-brand);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-argon-gradient:hover {
  background: var(--brand-700);
  transform: none;
  box-shadow: 0 4px 10px rgba(0, 121, 52, 0.3);
}

.btn-argon-gradient:active {
  background: #004d21;
}

/* ====================================================================
   TEAM & ATTENDANTS HIERARCHY STYLES
   ==================================================================== */
.team-queue-filters {
  display: flex;
  gap: 4px;
  background: var(--bg-surface-2);
  padding: 4px 10px;
  border-bottom: 1px solid var(--border-light);
}

.team-filter-pill {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.team-filter-pill:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.team-filter-pill.active {
  background: var(--accent-color, #2563eb);
  color: #fff !important;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}

.lead-mini-tag.attendant-badge {
  background: rgba(59, 130, 246, 0.14);
  color: #1d4ed8;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.lead-mini-tag.last-sender-badge {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .lead-mini-tag.attendant-badge {
  color: #60a5fa;
}

[data-theme="dark"] .lead-mini-tag.last-sender-badge {
  color: #34d399;
}

.msg-internal-sender {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.22);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  margin-bottom: 4px;
  letter-spacing: 0.01em;
}

.lead-mini-tag.unassigned-badge {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.chat-attendant-section {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 4px;
}

.chat-attendant-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-attendant-badge.assigned {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.25);
}

.team-member-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.team-member-table th {
  background: var(--bg-surface-2);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
}

.team-member-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}

.team-member-table tr:hover td {
  background: var(--bg-surface-2);
}

.role-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
  display: inline-block;
}

.role-badge.role-admin {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.role-badge.role-supervisor {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
}

.role-badge.role-attendant {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

/* ====================================================================
   FOLLOW-UP & RESGATE DE CLIENTES VIEW
   ==================================================================== */
.view-followup {
  width: 100%;
  height: 100%;
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 28px;
  background: var(--bg-shell);
  color: var(--text-main);
  overflow-y: auto;
  box-sizing: border-box;
}

.fu-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 16px;
  padding: 18px 20px;
}

.fu-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.fu-header-left h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}

.fu-header-left p {
  margin: 2px 0 0 0;
  font-size: 12.5px;
  color: var(--text-secondary, #64748b);
}

.fu-header-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.fu-auto-toggle-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card-subtle, #f1f5f9);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 12px;
  padding: 8px 14px;
}

.fu-auto-info {
  display: flex;
  flex-direction: column;
}

.fu-auto-info strong {
  font-size: 12.5px;
  color: var(--text-primary, #0f172a);
}

.fu-auto-info span {
  font-size: 11px;
  color: var(--text-secondary, #64748b);
}

.fu-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.fu-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.fu-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  transition: 0.25s;
  border-radius: 999px;
}

.fu-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: 0.25s;
  border-radius: 50%;
}

.fu-switch input:checked + .fu-slider {
  background-color: #10b981;
}

.fu-switch input:checked + .fu-slider:before {
  transform: translateX(20px);
}

.fu-target-stage-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary, #64748b);
}

.fu-wa-pill {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(100, 116, 139, 0.12);
  color: var(--text-secondary, #475569);
}

.fu-wa-pill.connected {
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
}

.fu-wa-pill.disconnected {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.fu-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.fu-kpi-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fu-kpi-label {
  font-size: 12px;
  color: var(--text-secondary, #64748b);
  font-weight: 500;
}

.fu-kpi-val {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}

.fu-kpi-green { color: #10b981; }
.fu-kpi-blue { color: #3b82f6; }

.fu-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.fu-tab-btn {
  border: 1px solid transparent;
  background: transparent;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.fu-tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.fu-tab-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-color);
  box-shadow: var(--shadow-sm);
}

.fu-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.fu-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.fu-input,
.fu-select,
.fu-textarea,
.fu-hour-input {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
}

.fu-input {
  min-width: 240px;
}

.fu-textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  font-family: inherit;
}

.fu-hour-input {
  width: 56px;
  text-align: center;
  padding: 5px 8px;
}

.fu-batch-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
}

.fu-table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow-x: auto;
}

.fu-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  color: var(--text-primary);
}

.fu-table th {
  padding: 12px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface-subtle);
}

.fu-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.fu-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.fu-badge-blue { background: rgba(59, 130, 246, 0.14); color: #2563eb; }
.fu-badge-green { background: rgba(16, 185, 129, 0.14); color: #059669; }
.fu-badge-amber { background: rgba(245, 158, 11, 0.14); color: #d97706; }
.fu-badge-red { background: rgba(239, 68, 68, 0.14); color: #dc2626; }
.fu-badge-slate { background: rgba(100, 116, 139, 0.14); color: #475569; }

.btn-primary-sm {
  background: #00a884;
  color: #ffffff;
  border: none;
  border-radius: 9px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary-sm:hover { opacity: 0.9; }
.btn-primary-sm:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary-sm {
  background: var(--bg-card-subtle, #f1f5f9);
  color: var(--text-primary, #0f172a);
  border: 1px solid var(--border-light, #cbd5e1);
  border-radius: 9px;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.fu-templates-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 14px;
}

.fu-templates-header h3 { margin: 0; font-size: 15px; }
.fu-templates-header p { margin: 3px 0 0 0; font-size: 12px; color: var(--text-secondary, #64748b); }

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

.fu-hours-box {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary, #64748b);
}

.fu-templates-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fu-template-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fu-template-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.fu-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fu-history-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fu-history-msg {
  font-size: 12.5px;
  color: var(--text-primary, #1e293b);
  background: var(--bg-card-subtle, #f8fafc);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 8px;
  padding: 8px 10px;
}

.fu-modal-meta {
  background: var(--bg-card-subtle, #f8fafc);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-secondary, #475569);
}

/* Kanban Column Drag & Drop */
.kanban-col-header {
  cursor: grab;
}
.kanban-col-header:active {
  cursor: grabbing;
}
.kanban-col-ghost {
  opacity: 0.4;
  border: 2px dashed #00a884 !important;
}
.kanban-col-chosen {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

/* Modo Compacto do Painel Lateral do Chat */
body.crm-compact-panel .crm-compact-hide {
  display: none !important;
}

/* ============================================================================
   DASHBOARD INICIAL (.view-inicio)
   ============================================================================ */
.view-inicio {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px;
  background: var(--bg-shell, #0b1120);
  color: var(--text-primary, #f8fafc);
  overflow-y: auto;
  height: 100%;
  box-sizing: border-box;
}

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.dash-header-left h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary, #f8fafc);
}

.dash-header-left p {
  margin: 2px 0 0 0;
  font-size: 13px;
  color: var(--text-muted, #94a3b8);
}

.dash-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dash-select,
.dash-select-sm {
  font-family: var(--font-family);
  background: var(--bg-surface, #111827);
  border: 1px solid var(--border-color, #1e293b);
  color: var(--text-primary, #f8fafc);
  border-radius: 8px;
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  box-sizing: border-box;
}

.dash-select-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 7px;
}

.dash-btn-export {
  font-family: var(--font-family);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  background: var(--bg-surface, #111827);
  border: 1px solid var(--border-color, #1e293b);
  color: var(--text-primary, #f8fafc);
  border-radius: 8px;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.15s, background 0.15s;
}

.dash-btn-export:hover {
  border-color: #06b6d4;
  background: rgba(6, 182, 212, 0.1);
}

.dash-subtabs {
  display: inline-flex;
  align-items: center;
  height: 36px;
  background: var(--bg-surface, #111827);
  border: 1px solid var(--border-color, #1e293b);
  border-radius: 9px;
  padding: 3px;
  gap: 4px;
  box-sizing: border-box;
}

.dash-subtab {
  font-family: var(--font-family);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  padding: 0 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
}

.dash-subtab.active {
  background: linear-gradient(135deg, #06b6d4, #2563eb);
  color: #ffffff;
  font-weight: 600;
}

.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 12px;
}

@media (max-width: 1200px) {
  .dash-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

.dash-kpi-card {
  background: var(--bg-surface, #111827);
  border: 1px solid var(--border-color, #1e293b);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.dash-kpi-card.accent-blue { border-color: rgba(59, 130, 246, 0.45); }
.dash-kpi-card.accent-emerald { border-color: rgba(16, 185, 129, 0.45); }
.dash-kpi-card.accent-rose { border-color: rgba(244, 63, 94, 0.45); }
.dash-kpi-card.accent-purple { border-color: rgba(168, 85, 247, 0.45); }
.dash-kpi-card.accent-cyan { border-color: rgba(6, 182, 212, 0.45); }

.dash-kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  font-weight: 500;
}

.dash-kpi-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary, #f8fafc);
  line-height: 1.2;
}

.dash-kpi-sub {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
}

.dash-mid-grid {
  display: grid;
  grid-template-columns: 1.85fr 1fr;
  gap: 14px;
}

.dash-bot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 1024px) {
  .dash-mid-grid,
  .dash-bot-grid {
    grid-template-columns: 1fr;
  }
}

.dash-card {
  background: var(--bg-surface, #111827);
  border: 1px solid var(--border-color, #1e293b);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.dash-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.dash-card-head h3 {
  margin: 0;
  font-family: var(--font-family);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary, #f8fafc);
}

.dash-card-head .dash-card-subtitle {
  display: block;
  margin-top: 2px;
  font-family: var(--font-family);
  font-size: 12px;
  line-height: 1.3;
  color: var(--text-muted, #94a3b8);
}

.dash-chart-box {
  width: 100%;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dash-donut-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 220px;
}

.dash-donut-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  font-size: 12px;
  color: var(--text-secondary, #cbd5e1);
}

.dash-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dash-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.dash-list-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dash-tag-row {
  display: grid;
  grid-template-columns: 140px 1fr 48px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.dash-tag-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary, #f8fafc);
}

.dash-tag-bar-bg {
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  overflow: hidden;
}

.dash-tag-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #06b6d4, #3b82f6);
}

.dash-tag-pct {
  text-align: right;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  font-size: 12px;
}

.dash-team-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.dash-team-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  padding: 0 8px 8px 8px;
  border-bottom: 1px solid var(--border-color, #1e293b);
}

.dash-team-table td {
  padding: 9px 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  color: var(--text-primary, #f8fafc);
}

.dash-team-table tr:last-child td {
  border-bottom: none;
}

.dash-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #06b6d4, #2563eb);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-empty {
  color: var(--text-muted, #94a3b8);
  font-size: 13px;
  text-align: center;
  padding: 28px 12px;
}

@keyframes dashFadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dash-kpi-card {
  animation: dashFadeSlideUp 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.22s ease;
}

.dash-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
}

.dash-customizer-panel {
  background: var(--bg-surface, #111827);
  border: 1px solid var(--border-color, #1e293b);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: dashFadeSlideUp 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.dash-customizer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.dash-customizer-head strong {
  display: block;
  font-size: 13px;
  color: var(--text-primary, #f8fafc);
}

.dash-customizer-head span {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
}

.dash-customizer-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dash-cust-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border-color, #1e293b);
  background: var(--bg-shell, #0b1120);
  color: var(--text-muted, #94a3b8);
  transition: all 0.18s cubic-bezier(0.22, 1, 0.36, 1);
  user-select: none;
}

.dash-cust-pill:hover {
  border-color: #06b6d4;
  color: var(--text-primary, #f8fafc);
}

.dash-cust-pill.active {
  background: rgba(6, 182, 212, 0.14);
  border-color: rgba(6, 182, 212, 0.5);
  color: #22d3ee;
  font-weight: 600;
}

.dash-widgets-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.dash-widget-item {
  grid-column: span 6;
  animation: dashFadeSlideUp 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.22s ease;
}

.dash-widget-item.dash-span-4 { grid-column: span 4; }
.dash-widget-item.dash-span-6 { grid-column: span 6; }
.dash-widget-item.dash-span-8 { grid-column: span 8; }
.dash-widget-item.dash-span-12 { grid-column: span 12; }

@media (max-width: 1100px) {
  .dash-widget-item,
  .dash-widget-item.dash-span-4,
  .dash-widget-item.dash-span-6,
  .dash-widget-item.dash-span-8 {
    grid-column: span 12;
  }
}

.dash-widget-item:hover {
  border-color: rgba(6, 182, 212, 0.35);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.16);
}

.dash-widget-ghost {
  opacity: 0.38;
  border: 2px dashed #06b6d4 !important;
  transform: scale(0.98);
}

.dash-widget-chosen {
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.3) !important;
  border-color: #06b6d4 !important;
}

.dash-widget-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.dash-drag-handle {
  cursor: grab;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: var(--text-muted, #94a3b8);
  font-size: 14px;
  line-height: 1;
  user-select: none;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.dash-drag-handle:hover {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-primary, #f8fafc);
}

.dash-drag-handle:active {
  cursor: grabbing;
}

.dash-widget-icon-btn {
  font-family: var(--font-family);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted, #94a3b8);
  border-radius: 7px;
  padding: 0;
  font-size: 13px;
  cursor: pointer;
  line-height: 1;
  transition: all 0.15s;
}

.dash-widget-icon-btn:hover {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-primary, #f8fafc);
}

.dash-widget-icon-btn.remove:hover {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
}

.dash-tag-bar-fill {
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.dash-leads-scroll {
  max-height: 320px;
  overflow-y: auto;
}

.crm-appt-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr;
  gap: 8px;
  margin-bottom: 8px;
}

.crm-appt-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.crm-appt-input {
  width: 100%;
  height: 32px;
  padding: 0 9px;
  border-radius: 7px;
  border: 1px solid var(--border-light);
  background: var(--bg-card-subtle);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 12px;
  box-sizing: border-box;
}

.crm-appt-input:focus {
  outline: none;
  border-color: var(--accent-apple);
}

.crm-lead-appt-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.crm-lead-appt-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  border-radius: 7px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.28);
  font-size: 12px;
  color: var(--text-primary);
}

.crm-lead-appt-pill button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 5px;
  border-radius: 4px;
}

.crm-lead-appt-pill button:hover {
  background: rgba(244, 63, 94, 0.16);
  color: #f43f5e;
}

/* ==========================================================================
   VIEW AGENDA (CALENDÁRIO VISUAL DE LEADS)
   ========================================================================== */
.view-agenda {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px;
  overflow-y: auto;
  height: 100%;
  box-sizing: border-box;
  background: var(--bg-app);
}

.agenda-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.agenda-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.agenda-header-left h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.agenda-header-left p {
  margin: 2px 0 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.agenda-nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.agenda-month-label {
  min-width: 150px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: capitalize;
}

.agenda-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  align-items: start;
  flex: 1;
  min-height: 0;
}

@media (max-width: 1080px) {
  .agenda-layout {
    grid-template-columns: 1fr;
  }
}

.agenda-calendar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.agenda-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
}

.agenda-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.agenda-day-cell {
  min-height: 104px;
  padding: 6px;
  border-radius: 9px;
  border: 1px solid var(--border-light);
  background: var(--bg-card-subtle);
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.agenda-day-cell:hover {
  border-color: var(--accent-apple);
}

.agenda-day-cell.other-month {
  opacity: 0.42;
}

.agenda-day-cell.is-today {
  border-color: #06b6d4;
  background: rgba(6, 182, 212, 0.08);
}

.agenda-day-cell.is-selected {
  border-color: var(--accent-apple);
  box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.2);
}

.agenda-day-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.agenda-day-count {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.16);
  color: #10b981;
}

.agenda-day-chips {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.agenda-lead-chip {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 6px;
  border-radius: 5px;
  background: rgba(59, 130, 246, 0.14);
  color: var(--text-primary);
  border-left: 3px solid #3b82f6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agenda-lead-chip strong {
  color: #3b82f6;
  font-weight: 600;
  margin-right: 3px;
}

.agenda-side-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.agenda-panel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 14px 16px;
}

.agenda-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.agenda-panel-head h4,
.agenda-panel-card h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.agenda-day-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.agenda-item-card {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--bg-card-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.agenda-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.agenda-item-lead {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.agenda-item-time {
  font-size: 11px;
  font-weight: 600;
  color: #06b6d4;
}

.agenda-item-title {
  font-size: 12px;
  color: var(--text-muted);
}

.agenda-item-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

/* Pipeline Stage List Style in CRM Drawer */
.stage-selector.stage-selector-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 2px;
}

.stage-selector-list .stage-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.stage-selector-list .stage-btn:hover {
  border-color: var(--accent-apple);
  background: var(--bg-hover);
}

.stage-selector-list .stage-btn.active {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.55);
  color: var(--text-primary);
  font-weight: 600;
}

.stage-list-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.stage-list-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.stage-list-check {
  font-size: 12px;
  color: #10b981;
  font-weight: 700;
}

/* Profile Fields Customizer */
.crm-profile-fields-editor {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.crm-pfe-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.crm-pfe-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.crm-pfe-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.crm-pfe-chip.active {
  background: rgba(6, 182, 212, 0.14);
  border-color: rgba(6, 182, 212, 0.45);
  color: var(--text-primary);
  font-weight: 500;
}

.crm-pfe-chip .crm-pfe-del {
  color: #fb7185;
  font-weight: 700;
  margin-left: 2px;
  cursor: pointer;
}

.crm-pfe-add-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.crm-pfe-add-row input {
  flex: 1;
  height: 30px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 12px;
}









