/* ============================================================
   PAINEL ADMIN — SISTEMA DE ATENDIMENTO
   ============================================================ */

:root {
  --sidebar-bg: linear-gradient(180deg, #065f46 0%, #064e3b 100%);
  --sidebar-bg-solid: #065f46;
  --sidebar-hover: rgba(255,255,255,0.1);
  --sidebar-active: rgba(255,255,255,0.18);
  --bg: #f8fafb;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --primary: #10B981;
  --primary-light: #34D399;
  --primary-gradient: linear-gradient(135deg, #10B981, #065f46);
  --accent: #10B981;
  --accent-light: #34D399;
  --accent-glow: #6EE7B7;
  --hover-bg: #f3f4f6;
  --waiting: #F59E0B;
  --waiting-bg: #FFFBEB;
  --active: #3B82F6;
  --active-bg: #EFF6FF;
  --completed: #10B981;
  --completed-bg: #ECFDF5;
  --urgent: #EF4444;
  --urgent-bg: #FEF2F2;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── TEMA DARK ── */
[data-theme="dark"] {
  --sidebar-bg: linear-gradient(180deg, #022c22 0%, #011a14 100%);
  --sidebar-bg-solid: #022c22;
  --sidebar-hover: rgba(255,255,255,0.08);
  --sidebar-active: rgba(255,255,255,0.14);
  --bg: #0a0a0f;
  --card-bg: #111118;
  --text: #e5e7eb;
  --text-light: #9ca3af;
  --border: #1f2937;
  --primary: #10B981;
  --primary-light: #34D399;
  --primary-gradient: linear-gradient(135deg, #10B981, #065f46);
  --accent: #10B981;
  --accent-light: #34D399;
  --accent-glow: #6EE7B7;
  --hover-bg: #1a1a24;
  --waiting: #d97706;
  --waiting-bg: #1c1304;
  --active: #60a5fa;
  --active-bg: #0c1929;
  --completed: #34d399;
  --completed-bg: #052e16;
  --urgent: #f87171;
  --urgent-bg: #2d0d0d;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.4);
}

/* ── PALETA: PRETO ── */
[data-palette="black"] {
  --sidebar-bg: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
  --sidebar-bg-solid: #1a1a1a;
  --sidebar-hover: rgba(255,255,255,0.08);
  --sidebar-active: rgba(16,185,129,0.25);
  --sidebar-text: #ffffff;
  --sidebar-icon-color: #ffffff;
}
[data-palette="black"][data-theme="dark"] {
  --sidebar-bg: linear-gradient(180deg, #0a0a0a 0%, #000000 100%);
  --sidebar-bg-solid: #0a0a0a;
}

/* ── PALETA: AZUL ESCURO ── */
[data-palette="navy"] {
  --sidebar-bg: linear-gradient(180deg, #0d1b2a 0%, #1b2838 100%);
  --sidebar-bg-solid: #0d1b2a;
  --sidebar-hover: rgba(255,255,255,0.08);
  --sidebar-active: rgba(16,185,129,0.25);
  --sidebar-text: #ffffff;
  --sidebar-icon-color: #ffffff;
}
[data-palette="navy"][data-theme="dark"] {
  --sidebar-bg: linear-gradient(180deg, #060e18 0%, #0d1b2a 100%);
  --sidebar-bg-solid: #060e18;
}

/* ── PALETA: CINZA CLARO ── */
[data-palette="light-gray"] {
  --sidebar-bg: linear-gradient(180deg, #f3f4f6 0%, #e5e7eb 100%);
  --sidebar-bg-solid: #f3f4f6;
  --sidebar-hover: rgba(0,0,0,0.05);
  --sidebar-active: rgba(16,185,129,0.15);
  --sidebar-text: #1a1a2e;
  --sidebar-icon-color: #374151;
}
[data-palette="light-gray"][data-theme="dark"] {
  --sidebar-bg: linear-gradient(180deg, #d1d5db 0%, #c0c4cc 100%);
  --sidebar-bg-solid: #d1d5db;
}

/* ── PALETA: BRANCO ── */
[data-palette="white"] {
  --sidebar-bg: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
  --sidebar-bg-solid: #ffffff;
  --sidebar-hover: rgba(0,0,0,0.04);
  --sidebar-active: rgba(16,185,129,0.12);
  --sidebar-text: #1a1a2e;
  --sidebar-icon-color: #374151;
}
[data-palette="white"][data-theme="dark"] {
  --sidebar-bg: linear-gradient(180deg, #f3f4f6 0%, #e5e7eb 100%);
  --sidebar-bg-solid: #f3f4f6;
}

[data-theme="dark"] .sidebar {
  border-right-color: var(--border);
}

[data-theme="dark"] .kanban-column {
  background: var(--card-bg);
  border: 1px solid var(--border);
}

[data-theme="dark"] .kanban-card {
  background: var(--hover-bg);
  border: 1px solid var(--border);
}

[data-theme="dark"] .kanban-card:hover {
  border-color: var(--primary);
}

[data-theme="dark"] .kanban-header-btn {
  background: var(--primary-gradient);
  color: white;
  border: none;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .kanban-header-btn:hover {
  opacity: 0.95;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .settings-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
  border-color: var(--primary);
}

[data-theme="dark"] .modal-content {
  background: var(--card-bg);
  border: 1px solid var(--border);
}

[data-theme="dark"] .modal-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .conversation-panel {
  background: var(--card-bg);
  border-left: 1px solid var(--border);
}

[data-theme="dark"] .conv-panel-messages {
  background: var(--bg);
}

[data-theme="dark"] .conv-photo-area {
  background: var(--card-bg);
  border-bottom-color: var(--border);
}

[data-theme="dark"] .conv-photo-placeholder {
  background: rgba(255,255,255,0.1);
  border-color: var(--primary);
}

[data-theme="dark"] .conv-photo-label {
  color: var(--text-light);
}

[data-theme="dark"] .conv-msg-time {
  color: var(--text-light);
}

[data-theme="dark"] .conv-msg-source {
  color: var(--text-light);
}

[data-theme="dark"] .conv-panel-input {
  background: var(--bg);
  border-top: 1px solid var(--border);
}

[data-theme="dark"] .conv-panel-input input {
  background: var(--card-bg);
}

[data-theme="dark"] .conv-msg-visitor {
  background: var(--hover-bg);
  border-color: var(--border);
  color: var(--text);
  font-weight: 500;
}

[data-theme="dark"] .conv-msg-atendente {
  background: var(--hover-bg);
  border-color: var(--border);
  color: var(--text);
}
[data-theme="dark"] .conv-msg-atendente .conv-msg-sender {
  color: rgba(255,255,255,0.9);
}

[data-theme="dark"] .conv-msg.system {
  background: var(--waiting-bg);
  color: var(--waiting);
}

[data-theme="dark"] .dash-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
}

[data-theme="dark"] .table-container {
  background: var(--card-bg);
  border: 1px solid var(--border);
}

[data-theme="dark"] table th {
  background: var(--bg);
  color: var(--text-light);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] table td {
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] table tr:hover td {
  background: var(--hover-bg);
}

[data-theme="dark"] .wa-chat-header {
  background: var(--primary-gradient) !important;
}

[data-theme="dark"] .wa-chat-body {
  background: var(--bg);
}

[data-theme="dark"] .wa-chat-container {
  background: var(--bg);
}

[data-theme="dark"] .wa-chat-container::before {
  opacity: 0.04;
}
[data-theme="dark"] .wa-msg-incoming,
[data-theme="dark"] .wa-msg-outgoing {
  background: var(--hover-bg);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .wa-chat-input-bar {
  background: var(--card-bg);
  border-top: 1px solid var(--border);
}

[data-theme="dark"] .wa-chat-input-bar textarea {
  background: var(--bg);
  color: var(--text);
}

[data-theme="dark"] .wa-bubble.in {
  background: var(--hover-bg);
  color: var(--text);
}

[data-theme="dark"] .wa-bubble.out {
  background: rgba(16,185,129,0.15);
  color: var(--text);
}

[data-theme="dark"] .lgpd-actions-bar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .lgpd-btn {
  background: var(--bg);
  color: var(--text-light);
}

[data-theme="dark"] .btn-primary {
  background: var(--primary);
}

[data-theme="dark"] .btn-secondary {
  background: var(--hover-bg);
  color: var(--text);
  border: 1px solid var(--border);
}

[data-theme="dark"] .filter-bar {
  background: var(--card-bg);
  border: 1px solid var(--border);
}

[data-theme="dark"] .template-card,
[data-theme="dark"] .automation-card {
  background: var(--hover-bg);
  border: 1px solid var(--border);
}

[data-theme="dark"] .activity-log-table tr:nth-child(even) td {
  background: var(--bg);
}

[data-theme="dark"] .call-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
}

[data-theme="dark"] .softphone-keypad button {
  background: var(--hover-bg);
  color: var(--text);
  border: 1px solid var(--border);
}

[data-theme="dark"] .softphone-keypad button:hover {
  background: var(--card-bg);
}

[data-theme="dark"] .login-card {
  background: var(--card-bg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .login-input {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .login-input:focus {
  border-color: var(--primary);
}

[data-theme="dark"] .page-top-header {
  background: var(--card-bg);
  border: 1px solid var(--border);
}

[data-theme="dark"] .page-top-desc {
  color: var(--text-light);
}

[data-theme="dark"] .new-lead-form label {
  color: var(--text);
}

[data-theme="dark"] .csv-drop-zone {
  background: var(--card-bg);
  border-color: var(--border);
}

[data-theme="dark"] .sidebar-theme-toggle {
  color: rgba(255,255,255,0.7);
}

/* ── Barras de rolagem em modo escuro (track + thumb escuros) ── */
[data-theme="dark"] {
  scrollbar-color: #30363d #161b22;
}
[data-theme="dark"] ::-webkit-scrollbar-track {
  background: var(--card-bg) !important;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: var(--border) !important;
  border-radius: 4px;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: var(--text-light) !important;
}

/* ── Campos de filtro em modo escuro (estilo Kanban/Lista) ── */
[data-theme="dark"] .kanban-filters-row select,
[data-theme="dark"] .kanban-filters-row input[type="date"],
[data-theme="dark"] .contacts-filter-row select,
[data-theme="dark"] .contacts-filter-row input[type="date"],
[data-theme="dark"] .contacts-search-box input,
[data-theme="dark"] .filter-bar select,
[data-theme="dark"] .calls-filters select,
[data-theme="dark"] .templates-filters select,
[data-theme="dark"] .templates-search input,
[data-theme="dark"] .audit-filters select,
[data-theme="dark"] .page-top-actions select,
[data-theme="dark"] .kanban-search-popover input,
[data-theme="dark"] .wa-conv-search input,
[data-theme="dark"] .qr-dropdown-search input {
  background-color: var(--hover-bg) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
[data-theme="dark"] .kanban-filters-row select,
[data-theme="dark"] .contacts-filter-row select,
[data-theme="dark"] .filter-bar select,
[data-theme="dark"] .calls-filters select,
[data-theme="dark"] .templates-filters select,
[data-theme="dark"] .audit-filters select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  padding-right: 32px !important;
}
[data-theme="dark"] .page-top-actions select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
}
[data-theme="dark"] .kanban-filters-row select:focus,
[data-theme="dark"] .kanban-filters-row input[type="date"]:focus,
[data-theme="dark"] .contacts-filter-row select:focus,
[data-theme="dark"] .contacts-filter-row input[type="date"]:focus,
[data-theme="dark"] .contacts-search-box input:focus,
[data-theme="dark"] .filter-bar select:focus,
[data-theme="dark"] .calls-filters select:focus,
[data-theme="dark"] .templates-filters select:focus,
[data-theme="dark"] .templates-search input:focus,
[data-theme="dark"] .audit-filters select:focus,
[data-theme="dark"] .page-top-actions select:focus,
[data-theme="dark"] .kanban-search-popover input:focus,
[data-theme="dark"] .wa-conv-search input:focus,
[data-theme="dark"] .qr-dropdown-search input:focus {
  background-color: var(--card-bg) !important;
  border-color: var(--primary) !important;
}
[data-theme="dark"] .contacts-clear-btn,
[data-theme="dark"] .kanban-filter-clear {
  background-color: var(--hover-bg) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
[data-theme="dark"] .contacts-clear-btn:hover,
[data-theme="dark"] .kanban-filter-clear:hover {
  background-color: var(--card-bg) !important;
  border-color: var(--urgent) !important;
  color: var(--urgent) !important;
}
[data-theme="dark"] .modal-body select,
[data-theme="dark"] .modal-body input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group input,
[data-theme="dark"] .auto-condition-row select,
[data-theme="dark"] .auto-condition-row input,
[data-theme="dark"] .nl-field select,
[data-theme="dark"] .nl-field input,
[data-theme="dark"] .csv-option select,
[data-theme="dark"] #dashPeriod {
  background-color: var(--hover-bg) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
[data-theme="dark"] .modal-body select:focus,
[data-theme="dark"] .modal-body input:focus,
[data-theme="dark"] .form-group select:focus,
[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .auto-condition-row select:focus,
[data-theme="dark"] .auto-condition-row input:focus,
[data-theme="dark"] .nl-field select:focus,
[data-theme="dark"] .nl-field input:focus,
[data-theme="dark"] .csv-option select:focus,
[data-theme="dark"] #dashPeriod:focus {
  background-color: var(--card-bg) !important;
  border-color: var(--primary) !important;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── SIDEBAR (nav com scroll; rodapé fixo) ── */
.sidebar {
  width: 220px;
  height: 100vh;
  max-height: 100dvh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-radius: 0;
  border-right: 1px solid var(--border);
  box-shadow: none;
  z-index: 10;
  overflow: hidden;
}

.sidebar-brand {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0 0 10px 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sidebar-brand > * {
  max-width: 100%;
  width: 100%;
}

/* Área da logo: ponta a ponta do sidebar, compacta, centralizada */
.sidebar-logo-area {
  margin: 0;
  width: 100%;
  aspect-ratio: 4 / 1;
  background: rgba(0,0,0,0.08);
  border-radius: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.sidebar-logo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: rgba(255,255,255,0.4);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-role-badge {
  display: block;
  margin-top: 4px;
  padding: 4px 8px;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  background: rgba(255,255,255,0.12);
  border-radius: 6px;
  font-size: 9px;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.35) rgba(0, 0, 0, 0.15);
}

.sidebar-nav::-webkit-scrollbar {
  width: 8px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

[data-palette="light-gray"] .sidebar-nav,
[data-palette="white"] .sidebar-nav {
  scrollbar-color: rgba(0, 0, 0, 0.35) rgba(0, 0, 0, 0.06);
}

[data-palette="light-gray"] .sidebar-nav::-webkit-scrollbar-track,
[data-palette="white"] .sidebar-nav::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.06);
}

[data-palette="light-gray"] .sidebar-nav::-webkit-scrollbar-thumb,
[data-palette="white"] .sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.25);
}

[data-palette="light-gray"] .sidebar-nav::-webkit-scrollbar-thumb:hover,
[data-palette="white"] .sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.4);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 400;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  border-radius: 8px;
}

.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: white;
}

.sidebar-link.active {
  background: var(--sidebar-active);
  color: white;
  font-weight: 500;
  box-shadow: none;
}

.sidebar-link .icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 1.75;
}

.theme-icon-lucide {
  width: 18px;
  height: 18px;
}

.page-title-icon {
  width: 22px;
  height: 22px;
  vertical-align: -4px;
  stroke: currentColor;
  stroke-width: 1.75;
  margin-right: 4px;
}

.btn-icon {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
  stroke: currentColor;
  stroke-width: 1.75;
  margin-right: 2px;
}

.accordion-icon {
  width: 18px;
  height: 18px;
  vertical-align: -4px;
  stroke: currentColor;
  stroke-width: 1.75;
  margin-right: 4px;
}

.sidebar-link .badge-nav {
  margin-left: auto;
  background: #ff4757;
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
  display: none;
  min-width: 18px;
  text-align: center;
}

.sidebar-link .badge-nav.show {
  display: inline;
}

.sidebar-bottom {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  min-width: 0;
}

.sidebar-bottom-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-theme-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  border: none;
  border-radius: 8px;
  color: rgba(255,255,255,0.6);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.sidebar-theme-icon:hover {
  background: rgba(255,255,255,0.12);
  color: white;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  min-width: 0;
  padding: 6px 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
}

.sidebar-footer #connText {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.sidebar-version {
  flex-shrink: 0;
  opacity: 0.7;
  font-size: 10px;
}

/* ── SELETOR DE PALETA (bolinhas) ── */
.palette-selector {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
  justify-content: flex-end;
}

.palette-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.25);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.palette-dot:hover {
  transform: scale(1.2);
}

.palette-dot.active {
  border-color: var(--primary, #10B981);
  box-shadow: 0 0 6px rgba(16,185,129,0.5);
}

.accent-color-picker {
  width: 22px; height: 22px;
  border: 2px solid rgba(255,255,255,0.25);
  border-radius: 50%;
  padding: 0; cursor: pointer;
  background: none;
  -webkit-appearance: none;
  appearance: none;
  flex-shrink: 0;
}
.accent-color-picker::-webkit-color-swatch-wrapper { padding: 0; }
.accent-color-picker::-webkit-color-swatch { border: none; border-radius: 50%; }
.accent-color-picker::-moz-color-swatch { border: none; border-radius: 50%; }

.accent-hex-input {
  width: 72px;
  padding: 3px 6px;
  font-size: 11px;
  font-family: monospace;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  outline: none;
  text-transform: uppercase;
}
.accent-hex-input:focus {
  border-color: var(--primary);
  background: rgba(255,255,255,0.12);
}
.accent-reset-btn {
  width: 24px; height: 24px;
  border: none;
  background: rgba(255,255,255,0.08);
  border-radius: 6px;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .2s;
}
.accent-reset-btn:hover {
  background: rgba(255,255,255,0.15);
  color: white;
}

.palette-dot[data-palette="purple"] { background: #065f46; }
.palette-dot[data-palette="black"] { background: #1a1a1a; }
.palette-dot[data-palette="navy"] { background: #0d1b2a; }
.palette-dot[data-palette="light-gray"] { background: #d4d4d4; border-color: rgba(0,0,0,0.15); }
.palette-dot[data-palette="white"] { background: #ffffff; border-color: rgba(0,0,0,0.15); }

/* Override sidebar text/icons para paletas claras */
[data-palette="light-gray"] .sidebar-logo-placeholder,
[data-palette="white"] .sidebar-logo-placeholder {
  color: rgba(0,0,0,0.4);
}

[data-palette="light-gray"] .sidebar-link,
[data-palette="white"] .sidebar-link {
  color: var(--sidebar-text, #1a1a1a);
  opacity: 0.75;
}

[data-palette="light-gray"] .sidebar-link:hover,
[data-palette="white"] .sidebar-link:hover {
  opacity: 1;
  color: var(--sidebar-text, #1a1a1a);
}

[data-palette="light-gray"] .sidebar-link.active,
[data-palette="white"] .sidebar-link.active {
  opacity: 1;
  color: var(--sidebar-text, #1a1a1a);
  font-weight: 400;
}

[data-palette="light-gray"] .sidebar-icon,
[data-palette="white"] .sidebar-icon {
  color: var(--sidebar-icon-color, #333);
}

[data-palette="light-gray"] .sidebar-role-badge,
[data-palette="white"] .sidebar-role-badge {
  background: rgba(0,0,0,0.08);
  color: rgba(0,0,0,0.6);
}

[data-palette="light-gray"] .sidebar-theme-icon,
[data-palette="white"] .sidebar-theme-icon {
  background: rgba(0,0,0,0.06);
  color: rgba(0,0,0,0.5);
}

[data-palette="light-gray"] .sidebar-theme-icon:hover,
[data-palette="white"] .sidebar-theme-icon:hover {
  background: rgba(0,0,0,0.12);
  color: var(--sidebar-text, #1a1a1a);
}

[data-palette="light-gray"] .sidebar-footer,
[data-palette="white"] .sidebar-footer {
  color: rgba(0,0,0,0.4);
}

[data-palette="light-gray"] .sidebar-bottom,
[data-palette="white"] .sidebar-bottom {
  border-top-color: rgba(0,0,0,0.08);
}

[data-palette="light-gray"] .sidebar,
[data-palette="white"] .sidebar {
  box-shadow: 4px 0 24px rgba(0,0,0,0.08);
}

[data-palette="light-gray"] .palette-dot,
[data-palette="white"] .palette-dot {
  border-color: rgba(0,0,0,0.15);
}

[data-palette="light-gray"] .palette-dot.active,
[data-palette="white"] .palette-dot.active {
  border-color: var(--primary, #10B981);
}

/* ── WHATSAPP SPLIT VIEW ── */
.wa-split-view {
  display: flex;
  gap: 0;
  padding: 20px 24px;
  height: calc(100vh - 200px);
  min-height: 400px;
}

.wa-conv-list {
  width: 280px;
  min-width: 280px;
  max-width: 280px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.wa-conv-list-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.wa-conv-header-icon {
  width: 20px;
  height: 20px;
  stroke-width: 1.75;
  color: var(--primary);
}

.wa-conv-search {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.wa-conv-search input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
  outline: none;
}

.wa-conv-search input:focus {
  border-color: var(--primary);
}

.wa-conv-items {
  flex: 1;
  overflow-y: auto;
}

.wa-conv-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

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

.wa-conv-item.active {
  background: rgba(74,20,140,0.08);
  border-left: 3px solid var(--primary);
}

.wa-conv-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--border);
}

.wa-conv-avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.wa-conv-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wa-conv-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.wa-conv-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.wa-conv-time {
  font-size: 11px;
  color: var(--text-light);
}

.wa-conv-badge {
  background: #25D366;
  color: #fff;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}

.wa-conv-source-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.wa-split-pipeline {
  flex: 1;
  overflow-x: auto;
  display: flex;
  gap: 14px;
  padding: 0 0 0 14px;
}

.wa-conv-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
}

@media (max-width: 900px) {
  .wa-split-view {
    flex-direction: column;
    height: auto;
  }
  .wa-conv-list {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    max-height: 300px;
  }
  .wa-split-pipeline {
    padding: 14px 0 0 0;
  }
}

/* ── MAIN CONTENT ── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.main-header {
  padding: 18px 32px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 16px;
  flex-wrap: wrap;
}

.main-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.main-header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.view-mode-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.view-mode-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  min-height: 38px;
  border: none;
  background: var(--bg);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
}

.view-mode-btn:first-child {
  border-right: 1px solid var(--border);
}

.view-mode-btn:hover {
  background: rgba(74,20,140,0.06);
  color: var(--text);
}

.view-mode-btn.active {
  background: var(--primary);
  color: #fff;
}

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

.header-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  min-height: 38px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.header-action-btn:hover {
  background: #f5f5f5;
  border-color: #ccc;
  box-shadow: var(--shadow);
}
.header-action-btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.header-action-btn-primary:hover {
  background: var(--primary-light);
  border-color: var(--primary-light);
}
.header-action-btn svg {
  flex-shrink: 0;
}

.stats {
  padding: 0 32px 12px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.stats-inline {
  padding: 0 0 0 16px;
  gap: 16px;
  border-left: 1px solid var(--border);
}

.stats-inline .stat-item {
  padding: 4px 0;
}

.stats-inline .stat-item .stat-value {
  font-size: 18px !important;
}

.stats-inline .stat-item .stat-label {
  font-size: 10px;
}

.stat-item {
  text-align: center;
}

.stat-item .stat-value {
  font-size: 24px;
  font-weight: 700;
}

.stat-item .stat-label {
  font-size: 11px;
  color: var(--text-light);
  text-transform: uppercase;
}

/* Cores dos stats agora são aplicadas inline via JS */

/* ── KANBAN BOARD ── */
/* ══════════════════════════════════════════
   DASHBOARD
   ══════════════════════════════════════════ */

/* KPI Cards */
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  padding: 0 0 20px;
}

#pageDashboard .page-top-header + .dash-kpis {
  margin-top: 24px;
}
.dash-kpi {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--border);
  position: relative;
  transition: box-shadow .2s;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.15s;
}
.dash-kpi:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.dash-kpi-icon {
  font-size: 24px;
  line-height: 1;
}

.dash-kpi-icon .dash-kpi-lucide,
.dash-kpi-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.75;
  color: currentColor;
}
.dash-kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}
.dash-kpi-label {
  font-size: 12px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.dash-kpi-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
}

/* Dash Grid */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.dash-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow .2s;
}
.dash-card-wide {
  grid-column: 1 / -1;
}
.dash-card-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.dash-card-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.dash-card-body {
  padding: 16px 20px 20px;
}

/* Bar Chart (CSS puro) */
.dash-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dash-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dash-bar-label {
  width: 110px;
  font-size: 12px;
  color: var(--text);
  text-align: right;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-bar-track {
  flex: 1;
  height: 22px;
  background: var(--bg);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.dash-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  min-width: 2px;
}
.dash-bar-value {
  width: 36px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
  flex-shrink: 0;
}

/* Donut / Pie (CSS) */
.dash-donut-container {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.dash-donut-svg {
  width: 140px;
  height: 140px;
  flex-shrink: 0;
}
.dash-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.dash-donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}
.dash-donut-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dash-donut-legend-value {
  margin-left: auto;
  font-weight: 600;
}

/* Atividade recente */
.dash-activity {
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.dash-activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.dash-activity-item:last-child {
  border-bottom: none;
}
.dash-activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dash-activity-text {
  flex: 1;
  color: var(--text);
}
.dash-activity-text strong {
  font-weight: 600;
}
.dash-activity-time {
  font-size: 11px;
  color: var(--text-light);
  flex-shrink: 0;
  white-space: nowrap;
}

/* Top Contatos */
.dash-top-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.dash-top-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.dash-top-item:last-child {
  border-bottom: none;
}
.dash-top-rank {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dash-top-rank:nth-child(1) { background: #FFB300; }
.dash-top-item:nth-child(1) .dash-top-rank { background: #FFB300; }
.dash-top-item:nth-child(2) .dash-top-rank { background: #9E9E9E; }
.dash-top-item:nth-child(3) .dash-top-rank { background: #BF6D30; }
.dash-top-name {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-top-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

/* Line Chart (barras diárias em CSS) */
.dash-line-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 120px;
  padding-top: 10px;
}
.dash-day-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 4px;
}
.dash-day-fill {
  width: 100%;
  max-width: 28px;
  background: var(--primary);
  border-radius: 4px 4px 0 0;
  transition: height 0.5s ease;
  min-height: 0;
  opacity: 0.8;
}
.dash-day-fill:hover {
  opacity: 1;
}
.dash-day-label {
  font-size: 9px;
  color: var(--text-light);
  text-align: center;
  writing-mode: horizontal-tb;
}
.dash-day-count {
  font-size: 9px;
  font-weight: 600;
  color: var(--text);
}

/* Dash Empty State */
.dash-empty {
  text-align: center;
  padding: 30px 10px;
  color: var(--text-light);
  font-size: 13px;
}

@media (max-width: 900px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
  .dash-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 500px) {
  .dash-kpis {
    grid-template-columns: 1fr;
  }
}

/* ── Filtros do Kanban ── */
.kanban-filters {
  background: var(--card-bg);
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.kanban-filters-row select,
.kanban-filters-row input[type="date"] {
  border-radius: 10px;
}

.kanban-filters-row {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap !important;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 4px;
}

.kanban-search-toggle {
  width: 40px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  color: var(--text-light);
  flex-shrink: 0;
  transition: all 0.2s;
}
.kanban-search-toggle:hover {
  background: rgba(74,20,140,0.08);
  color: var(--primary);
  border-color: var(--primary);
}

.kanban-search-popover {
  position: fixed;
  padding: 10px 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  z-index: 10001;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s, visibility 0.2s;
}
.kanban-search-popover.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.kanban-search-popover input {
  width: 260px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--card-bg);
  color: var(--text);
}
.kanban-search-popover input:focus {
  outline: none;
  border-color: var(--primary);
}

.kanban-search-wrap {
  position: relative;
  flex-shrink: 0;
}

.kanban-filters-row select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--card-bg);
  cursor: pointer;
  color: var(--text);
  flex-shrink: 0;
  min-width: 120px;
}
.kanban-filters-row select:focus {
  outline: none;
  border-color: var(--primary);
}

.kanban-filters-row input[type="date"] {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--card-bg);
  color: var(--text);
  min-width: 120px;
  flex-shrink: 0;
}
.kanban-filters-row input[type="date"]:focus {
  outline: none;
  border-color: var(--primary);
}

.kanban-filter-clear {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border: 1px solid var(--urgent);
  background: var(--urgent-bg);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--urgent);
  transition: all 0.2s;
  flex-shrink: 0;
}
.kanban-filter-clear:hover {
  background: var(--urgent);
  color: #fff;
}

.kanban-filters-summary {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 6px;
}
.kanban-filters-summary strong {
  color: var(--primary);
  font-size: 13px;
}

.atendimento-views {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.kanban {
  flex: 1;
  display: flex;
  gap: 16px;
  padding: 20px 24px;
  overflow-x: auto;
  overflow-y: hidden;
}

.atendimento-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 24px;
}

.atendimento-list-table {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.atendimento-list-header {
  display: grid;
  grid-template-columns: 1fr 120px 140px 100px 140px;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-light);
}

.atendimento-list-row {
  display: grid;
  grid-template-columns: 1fr 120px 140px 100px 140px;
  gap: 12px;
  padding: 12px 16px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.atendimento-list-row:last-child {
  border-bottom: none;
}

.atendimento-list-row:hover {
  background: rgba(74,20,140,0.04);
}

.atendimento-list-row .col-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.atendimento-list-row .list-photo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.atendimento-list-row .stage-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.atendimento-list-row .list-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  font-size: 12px;
  cursor: pointer;
  margin-right: 4px;
}

.atendimento-list-row .list-btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.atendimento-list-empty {
  padding: 40px;
  text-align: center;
  color: var(--text-light);
}

.kanban-column {
  flex: 1;
  min-width: 230px;
  max-width: 300px;
  background: var(--card-bg);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow);
}

.kanban-column.drag-over {
  border-color: var(--primary-light);
  box-shadow: 0 4px 20px rgba(108, 46, 185, 0.15);
}

.kanban-column-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 16px 16px 0 0;
}

.kanban-column-header .column-icon {
  font-size: 16px;
}

.kanban-column-header .column-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.kanban-column-header .column-count {
  margin-left: auto;
  background: rgba(0,0,0,0.08);
  color: var(--text-light);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 10px;
}

.kanban-cards {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kanban-cards::-webkit-scrollbar {
  width: 4px;
}

.kanban-cards::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.08);
  border-radius: 4px;
}

/* ── CARDS ── */
.kanban-card {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow);
  cursor: grab;
  transition: all 0.2s;
  border: 1px solid var(--border);
}

.kanban-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-2px);
  border-color: rgba(108,46,185,0.2);
}

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

.kanban-card.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.card-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  letter-spacing: -0.2px;
}

.card-time {
  font-size: 11px;
  color: var(--text-light);
}

.card-phone {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 8px;
}

.card-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.card-label-badge {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-preview {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.card-messages-count {
  font-size: 11px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-open-btn {
  font-size: 12px;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 8px;
  transition: all 0.2s;
}

.card-open-btn:hover {
  background: rgba(108, 46, 185, 0.08);
  color: var(--primary-light);
}

/* ── EMPTY STATE ── */
.kanban-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-light);
  font-size: 13px;
}

.kanban-empty .empty-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

/* ── PAINEL DE CONVERSA (lateral direita) ── */
.conversation-panel {
  position: fixed;
  top: 0;
  right: -480px;
  width: 480px;
  height: 100vh;
  background: var(--card-bg);
  box-shadow: -12px 0 40px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 24px 0 0 24px;
}

.conversation-panel.open {
  right: 0;
}

.conv-panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.35);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  backdrop-filter: blur(2px);
}

.conv-panel-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.conv-panel-header {
  padding: 10px 26px 10px 14px;
  background: var(--primary-gradient);
  color: white;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  border-radius: 24px 0 0 0;
}

.conv-panel-close {
  background: rgba(255,255,255,0.12);
  border: none;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.conv-panel-close:hover {
  background: rgba(255,255,255,0.22);
}

.conv-panel-info {
  flex: 1;
  min-width: 0;
}

.conv-panel-info p {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  opacity: 0.95;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-panel-actions {
  display: flex;
  gap: 6px;
}

.conv-status-btn {
  padding: 4px 10px;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: white;
}

.conv-status-btn:hover { opacity: 0.85; transform: scale(1.1); }
/* Cores dos botões de status agora são aplicadas inline via JS */

/* ── Pipeline Manager (Configuração de Etapas) ── */
.pipeline-stages-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.pipeline-stage-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: all 0.2s;
  cursor: grab;
}

.pipeline-stage-item:active {
  cursor: grabbing;
}

.pipeline-stage-item.dragging {
  opacity: 0.4;
  transform: scale(0.98);
}

.pipeline-stage-item:hover {
  border-color: var(--primary-light);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.pipeline-stage-drag {
  font-size: 16px;
  color: var(--text-light);
  cursor: grab;
  user-select: none;
  line-height: 1;
}

.pipeline-stage-color {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  background: none;
  flex-shrink: 0;
}

.pipeline-stage-color::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.pipeline-stage-color::-webkit-color-swatch {
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 6px;
}

.pipeline-stage-name {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  background: transparent;
  transition: all 0.2s;
  color: var(--text);
}

.pipeline-stage-name:focus {
  outline: none;
  border-color: var(--primary-light);
  background: var(--card-bg);
}

.pipeline-stage-key {
  font-size: 11px;
  color: var(--text-light);
  background: var(--border);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
  white-space: nowrap;
}

.pipeline-stage-badge {
  font-size: 10px;
  color: var(--primary);
  background: rgba(74, 20, 140, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}

.pipeline-stage-delete {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: rgba(244, 67, 54, 0.1);
  color: #F44336;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.pipeline-stage-delete:hover {
  background: #F44336;
  color: white;
}

.pipeline-add-stage {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
}

.pipeline-add-stage input[type="text"] {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

.pipeline-add-stage input[type="text"]:focus {
  outline: none;
  border-color: var(--primary-light);
}

.pipeline-add-stage input[type="color"] {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  background: none;
  flex-shrink: 0;
}

.pipeline-add-stage input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 3px;
}

.pipeline-add-stage input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 6px;
}

.pipeline-add-btn {
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.pipeline-add-btn:hover {
  background: var(--primary-light);
}

/* ── Área de Foto (Cliente) ── */
.conv-photo-area {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: linear-gradient(135deg, #F3E5F5, #E8EAF6);
  border-bottom: 1px solid #ddd;
  flex-shrink: 0;
}

.conv-photo-container {
  position: relative;
  flex-shrink: 0;
}

.conv-photo-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.7);
  border: 2px dashed #9C27B0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  gap: 2px;
}

.conv-photo-placeholder:hover {
  background: rgba(255,255,255,0.95);
  border-color: #7B1FA2;
  transform: scale(1.05);
}

.conv-photo-icon {
  font-size: 16px;
}

.conv-photo-label {
  font-size: 8px;
  color: #9C27B0;
  font-weight: 600;
  text-align: center;
}

.conv-photo-image {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: transform 0.2s;
}

.conv-photo-image:hover {
  transform: scale(1.08);
}

.conv-photo-remove {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--urgent);
  color: white;
  border: 2px solid white;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  padding: 0;
  line-height: 1;
}

.conv-photo-remove:hover {
  transform: scale(1.15);
}

.conv-photo-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}

/* ── Foto no Card do Kanban ── */
.card-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  transition: transform 0.15s ease;
}
.card-photo:hover {
  transform: scale(1.1);
}

.card-header-text {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  min-width: 0;
}

.conv-panel-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg);
}

.conv-panel-messages::-webkit-scrollbar { width: 4px; }
.conv-panel-messages::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 4px; }

.conv-msg {
  max-width: 78%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.55;
  word-wrap: break-word;
  animation: msg-in 0.25s ease;
}

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

.conv-msg-visitor {
  align-self: flex-start;
  background: #e8eaf0;
  border: 1px solid #d1d5db;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
  color: #1a1a1a;
  font-weight: 500;
}

.conv-msg-atendente {
  align-self: flex-end;
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-right-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.conv-msg-sender {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 3px;
}

.conv-msg-visitor .conv-msg-sender { color: var(--primary); }
.conv-msg-atendente .conv-msg-sender { color: var(--primary); }

.conv-msg-time {
  font-size: 10px;
  color: #999;
  margin-top: 4px;
  text-align: right;
}

.conv-msg-source {
  font-size: 10px;
  color: #bbb;
  display: inline;
  margin-left: 6px;
}

.conv-msg-text img {
  max-width: 100%;
  border-radius: 10px;
  display: block;
  margin-bottom: 4px;
}

.conv-msg-text audio {
  max-width: 100%;
}

.conv-msg-text video {
  max-width: 100%;
  border-radius: 10px;
}

.conv-panel-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.conv-panel-input input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 14px;
  outline: none;
  background: var(--bg);
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.conv-panel-input input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,188,212,0.1);
}

.conv-panel-input button {
  padding: 10px 20px;
  min-width: 80px;
  height: 40px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent), #0096c7);
  border: none;
  cursor: pointer;
  color: white;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,188,212,0.25);
}

.conv-panel-input button:hover { opacity: 0.9; transform: scale(1.05); }

/* ── PÁGINA DE CONFIGURAÇÕES ── */
.settings-page {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
  display: none;
}

.settings-page.active {
  display: block;
}

/* ── Accordion nas Configurações ── */
.settings-accordion .accordion-item {
  margin-bottom: 12px;
}
.settings-accordion .accordion-item .accordion-body {
  display: none;
  padding-top: 0;
}
.settings-accordion .accordion-item.open .accordion-body {
  display: block;
}
.settings-accordion .accordion-item.open .accordion-chevron {
  transform: rotate(90deg);
}
.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  text-align: left;
  transition: background 0.2s, border-color 0.2s;
  font-family: inherit;
}
.accordion-icon {
  width: 18px;
  height: 18px;
  opacity: 0.85;
}
.accordion-trigger:hover {
  background: var(--bg);
  border-color: var(--primary);
}
.accordion-chevron {
  font-size: 12px;
  color: var(--text-light);
  transition: transform 0.2s;
}
.accordion-body {
  padding: 14px 16px 18px;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 10px 10px;
  background: var(--card-bg);
  margin-top: -10px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.accordion-item.open .accordion-trigger {
  border-radius: 12px 12px 0 0;
  border-bottom-color: transparent;
}

.settings-accordion .settings-section.accordion-item {
  background: transparent;
  border-radius: 0;
  padding: 0;
  margin-bottom: 0;
  box-shadow: none;
  border: none;
}

/* settings-section padrão (perfil, etc) */
.settings-section:not(.accordion-item) {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.settings-section h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.3px;
}

.settings-section .section-desc {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 14px;
  line-height: 1.5;
}

.form-row {
  margin-bottom: 12px;
}

.form-row label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.form-row input,
.form-row textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.form-row input:focus,
.form-row textarea:focus {
  border-color: var(--primary);
}

.form-row textarea {
  min-height: 60px;
  resize: vertical;
}

.form-row .help-text {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 4px;
  margin-bottom: 0;
  line-height: 1.4;
}

/* Espaçamento nas configurações — parágrafos e blocos */
.features-toggles .settings-row {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.features-toggles .settings-row:last-of-type {
  margin-bottom: 8px;
  padding-bottom: 0;
  border-bottom: none;
}
.features-toggles .settings-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
}
.features-toggles .help-text {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 6px;
  margin-bottom: 0;
  line-height: 1.4;
  display: block;
}
.settings-section .form-row {
  margin-bottom: 12px;
}
.settings-section .form-row .help-text {
  margin-top: 4px;
}
.settings-section .form-row label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

/* settings-row — compacto e estilizado */
.settings-section .settings-row {
  margin-bottom: 10px;
}
.settings-section .settings-row > label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}
.settings-section .settings-row label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.settings-section .settings-row > label[for] {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}
.settings-section .settings-row input[type="number"],
.settings-section .settings-row input[type="url"],
.settings-section .settings-row input[type="text"],
.settings-section .settings-row textarea {
  margin-top: 4px;
  padding: 8px 10px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.settings-section .settings-row input[type="number"] {
  width: 90px;
}
.settings-section .settings-row textarea {
  min-height: 56px;
  resize: vertical;
}
.settings-section .settings-row .section-desc {
  margin-bottom: 6px;
  font-size: 11px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.domain-setup-instructions {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.domain-setup-instructions summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  color: var(--primary);
}
.domain-setup-instructions .instructions-content {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text);
  line-height: 1.5;
}
.domain-setup-instructions .instructions-content code {
  background: var(--card-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}
.domain-setup-instructions .instructions-content ul {
  margin: 8px 0;
  padding-left: 20px;
}

.settings-btn {
  padding: 8px 18px;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.settings-btn-primary {
  background: var(--primary-gradient);
  color: white;
}

.settings-btn-primary:hover { opacity: 0.9; }

.settings-btn-secondary {
  background: var(--border);
  color: var(--text);
  margin-left: 10px;
}

.settings-btn-secondary:hover { background: #d0d0d0; }

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

.settings-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #323232;
  color: white;
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
  z-index: 2000;
}

.settings-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.settings-toast.success { background: var(--completed); }
.settings-toast.error { background: var(--urgent); }
.settings-toast.info { background: var(--active); }

/* ── Botão Danger ── */
.settings-btn-danger {
  background: var(--urgent);
  color: white;
  margin-left: 10px;
}
.settings-btn-danger:hover { opacity: 0.9; }

/* ── Seção WhatsApp ── */
.whatsapp-status-box {
  background: var(--bg);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
}

.wa-status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
}

.wa-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #bbb;
  flex-shrink: 0;
}

.wa-status-dot.connected { background: #4CAF50; box-shadow: 0 0 8px rgba(76,175,80,0.5); }
.wa-status-dot.disconnected { background: #F44336; }
.wa-status-dot.connecting { background: #FFC107; animation: wa-pulse 1s infinite; }

@keyframes wa-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.whatsapp-qr-area {
  text-align: center;
  padding: 20px 0;
}

.wa-qr-instructions {
  text-align: left;
  background: #E3F2FD;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
  border-left: 4px solid #2196F3;
}

.wa-qr-instructions p {
  margin-bottom: 8px;
  color: #1565C0;
  font-size: 14px;
}

.wa-qr-instructions ol {
  padding-left: 20px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.8;
}

.wa-qr-container {
  position: relative;
  display: inline-block;
  background: var(--card-bg);
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  margin: 10px 0;
}

.wa-qr-image {
  width: 280px;
  height: 280px;
  border-radius: 8px;
  display: block;
}

.wa-qr-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 16px;
  font-size: 14px;
  color: #555;
}

.wa-spinner {
  width: 36px;
  height: 36px;
  border: 4px solid #e0e0e0;
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: wa-spin 0.8s linear infinite;
}

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

.wa-qr-expired {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  font-size: 15px;
  color: #F44336;
  font-weight: 600;
}

.wa-pairing-code {
  margin-top: 16px;
}

.wa-pairing-code p {
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
}

.wa-pairing-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--primary);
  background: var(--bg);
  padding: 12px 24px;
  border-radius: 10px;
  display: inline-block;
  font-family: 'Consolas', 'Courier New', monospace;
}

.whatsapp-connected {
  text-align: center;
  padding: 30px 20px;
}

.wa-connected-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.whatsapp-connected h4 {
  font-size: 20px;
  color: #4CAF50;
  margin-bottom: 8px;
}

.whatsapp-connected p {
  font-size: 14px;
  color: #666;
  max-width: 340px;
  margin: 0 auto;
}

/* ── Seção Twilio ── */
.twilio-info-box {
  background: #FCE4EC;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-left: 4px solid #E91E63;
}

.twilio-info-box p {
  margin-bottom: 6px;
  color: #AD1457;
  font-size: 12px;
}

.twilio-info-box ol {
  padding-left: 18px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
}

.twilio-status-box {
  background: var(--bg);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 10px 0;
}

.twilio-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
}

.twilio-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #bbb;
  flex-shrink: 0;
}

.twilio-status-dot.connected { background: #4CAF50; box-shadow: 0 0 8px rgba(76,175,80,0.5); }
.twilio-status-dot.disconnected { background: #F44336; }
.twilio-status-dot.configured { background: #FF9800; }
.twilio-status-dot.connecting { background: #FFC107; animation: wa-pulse 1s infinite; }

/* ── Seção WhatsApp Cloud API (WABA) ── */
.waba-info-box {
  background: #E3F2FD;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-left: 4px solid #1877F2;
}

.waba-info-box p {
  margin-bottom: 6px;
  color: #1565C0;
  font-size: 12px;
}

.waba-info-box ol {
  padding-left: 18px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
}

.waba-status-box {
  background: var(--bg);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 10px 0;
}

.waba-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
}

.waba-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #bbb;
  flex-shrink: 0;
}

.waba-status-dot.connected { background: #4CAF50; box-shadow: 0 0 8px rgba(76,175,80,0.5); }
.waba-status-dot.disconnected { background: #F44336; }
.waba-status-dot.configured { background: #FF9800; }
.waba-status-dot.connecting { background: #FFC107; animation: wa-pulse 1s infinite; }

/* ── Logo Upload ── */
.logo-upload-area {
  margin-top: 8px;
}

.logo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 32px 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--bg);
}

.logo-placeholder:hover {
  border-color: var(--primary);
  background: #f3e5f5;
}

.logo-placeholder-icon {
  font-size: 40px;
  margin-bottom: 10px;
  opacity: 0.6;
}

.logo-placeholder-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.logo-placeholder-hint {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

.logo-preview {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: 16px;
  background: var(--bg);
}

.logo-preview-img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: 12px;
  background: var(--card-bg);
  padding: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: transform 0.2s;
}

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

.logo-preview-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.logo-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  text-align: center;
  justify-content: center;
}

.logo-btn-change {
  background: var(--primary);
  color: white;
}

.logo-btn-change:hover {
  background: var(--primary-light);
}

.logo-btn-download {
  background: #E3F2FD;
  color: #1976D2;
}

.logo-btn-download:hover {
  background: #BBDEFB;
}

.logo-btn-remove {
  background: #FFEBEE;
  color: #D32F2F;
}

.logo-btn-remove:hover {
  background: #FFCDD2;
}

/* ── Conexão status ── */
.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.connection-status.connected {
  background: var(--completed-bg);
  color: var(--completed);
}

.connection-status.disconnected {
  background: var(--urgent-bg);
  color: var(--urgent);
}

.connection-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.connection-status.connected .dot { background: var(--completed); }
.connection-status.disconnected .dot { background: var(--urgent); }

/* ── Kanban page wrapper ── */
.kanban-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.kanban-page.active {
  display: flex;
}

.page-hidden {
  display: none !important;
}

/* ================================================================
   TELA DE LOGIN
   ================================================================ */

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--primary-gradient);
  overflow: auto;
}

.login-container {
  width: 100%;
  max-width: 420px;
  padding: 24px;
}

.login-card {
  background: var(--card-bg);
  border-radius: 24px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  animation: loginFadeIn 0.5s ease;
}

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

.login-header {
  text-align: center;
  padding: 40px 32px 24px;
  background: var(--primary-gradient);
  color: white;
}

.login-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.login-header h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.login-header p {
  font-size: 14px;
  opacity: 0.75;
}

.login-form {
  padding: 32px;
}

.login-error {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FFEBEE;
  color: #C62828;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 13px;
  font-weight: 600;
  border-left: 4px solid #F44336;
}

.login-error.shake {
  animation: loginShake 0.4s ease;
}

@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  50% { transform: translateX(8px); }
  75% { transform: translateX(-4px); }
}

.login-error-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.login-field {
  margin-bottom: 20px;
}

.login-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

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

.login-input-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  z-index: 1;
  pointer-events: none;
}

.login-input-wrapper input {
  width: 100%;
  padding: 14px 14px 14px 44px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.login-input-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74, 20, 140, 0.1);
}

.login-toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

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

.login-submit {
  width: 100%;
  padding: 16px;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  margin-top: 8px;
}

.login-submit:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(74, 20, 140, 0.3);
}

.login-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.login-submit-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.login-spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top: 3px solid white;
  border-radius: 50%;
  animation: wa-spin 0.7s linear infinite;
  display: inline-block;
}

.login-footer {
  text-align: center;
  padding: 16px 32px 24px;
}

.login-footer p {
  font-size: 12px;
  color: var(--text-light);
}

/* ── Esqueci minha senha ── */
.login-forgot {
  text-align: center;
  margin-top: 12px;
}
.login-forgot a,
.login-forgot-btn {
  color: var(--primary);
  font-size: 13px;
  text-decoration: none;
  transition: opacity .2s;
}
.login-forgot a:hover,
.login-forgot-btn:hover { opacity: .8; text-decoration: underline; }
.login-forgot-btn {
  background: none; border: none; padding: 0; font: inherit; color: inherit; cursor: pointer;
}

.login-back {
  margin-bottom: 12px;
}
.login-back a,
.login-back-btn {
  color: var(--text-light);
  font-size: 13px;
  text-decoration: none;
  transition: color .2s;
}
.login-back a:hover,
.login-back-btn:hover { color: var(--primary); }
.login-back-btn {
  background: none; border: none; padding: 0; font: inherit; cursor: pointer; color: var(--text-light);
}

.login-success {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #d4edda;
  color: #155724;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  border: 1px solid #c3e6cb;
}

.reset-link-box {
  margin-top: 16px;
  padding: 12px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  text-align: center;
}
.reset-dev-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  font-size: 14px;
}
.reset-dev-link:hover { text-decoration: underline; }

/* ── Sidebar User Info (logado) ── */
.sidebar-user {
  flex-shrink: 0;
  padding: 14px 16px;
  margin: 4px 12px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.08);
  border-radius: 14px;
}

.sidebar-user-clickable {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 0;
  margin: -4px 0;
  border-radius: 10px;
  transition: background 0.2s;
}
.sidebar-user-clickable:hover {
  background: rgba(255,255,255,0.06);
}
.sidebar-user-clickable:focus-visible {
  outline: 2px solid rgba(255,255,255,0.5);
  outline-offset: 2px;
}

.sidebar-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: white;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  color: rgba(255,255,255,0.9);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  color: rgba(255,255,255,0.4);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-logout-btn {
  background: rgba(255,255,255,0.08);
  border: none;
  color: rgba(255,255,255,0.5);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.sidebar-logout-btn:hover {
  background: rgba(244, 67, 54, 0.2);
  color: #F44336;
}

/* ================================================================
   TABELAS DE DADOS (Workspaces, Usuários)
   ================================================================ */

.page-top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  margin-bottom: 0;
}

.page-top-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.page-top-desc {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 2px;
}

.data-table-container {
  background: var(--card-bg);
  border-radius: 0 0 12px 12px;
  box-shadow: var(--shadow);
  overflow-x: auto;
  margin-bottom: 24px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table thead {
  background: var(--bg);
}

.data-table th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.15s;
}

.data-table tbody tr:hover {
  background: rgba(74, 20, 140, 0.02);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.table-empty {
  text-align: center;
  padding: 40px 16px !important;
  color: var(--text-light);
  font-size: 14px;
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.status-badge.active {
  background: #E8F5E9;
  color: #2E7D32;
}

.status-badge.inactive {
  background: #FFEBEE;
  color: #C62828;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-badge.active .status-dot {
  background: #4CAF50;
}

.status-badge.inactive .status-dot {
  background: #F44336;
}

/* Painel Fort status badges */
.status-badge.status-disconnected {
  background: #F3F4F6;
  color: #6B7280;
}
.status-badge.status-connecting {
  background: #FEF3C7;
  color: #D97706;
}
.status-badge.status-connected {
  background: #D1FAE5;
  color: #059669;
}
.status-badge.status-error {
  background: #FEE2E2;
  color: #DC2626;
}

/* Role badges */
.role-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.role-badge.super_admin {
  background: var(--primary-gradient);
  color: white;
}

.role-badge.admin {
  background: #E3F2FD;
  color: #1565C0;
}

.role-badge.atendente {
  background: #FFF3E0;
  color: #E65100;
}

.role-badge.tester {
  background: linear-gradient(135deg, #0d9488, #0f766e);
  color: #fff;
}

/* ── Painel de testes (QA) ── */
.test-panel-intro {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5;
}
.test-panel-list-wrap {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.test-panel-toolbar {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.test-panel-toolbar-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.test-panel-toolbar-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  font-weight: 600;
}
.test-panel-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.test-panel-stat-pass {
  color: #0f766e;
}
.test-panel-stat-fail {
  color: #b91c1c;
}
.test-panel-stat-pending {
  color: var(--text-light);
}
.test-panel-api-note {
  font-size: 12px;
  color: var(--text-light);
  margin: 0 0 12px;
  line-height: 1.4;
}
.test-panel-e2e-toolbar-note {
  font-size: 12px;
  color: var(--text-light);
  margin: 0 0 12px;
  line-height: 1.45;
}
.test-panel-e2e-toolbar-note code {
  font-size: 11px;
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
}
.test-panel-e2e {
  vertical-align: middle;
  width: 1%;
  white-space: nowrap;
}
.test-panel-e2e-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
}
.test-panel-e2e-badge .btn-icon {
  width: 14px;
  height: 14px;
}
.test-panel-e2e-ok {
  color: #0f766e;
  background: rgba(13, 148, 136, 0.12);
}
.test-panel-e2e-fail {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.1);
}
.test-panel-e2e-skip {
  color: var(--text-light);
  background: var(--bg);
  border: 1px dashed var(--border);
}
.test-panel-e2e-na {
  color: var(--text-light);
  font-weight: 500;
}
.test-panel-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.test-panel-toolbar-btn {
  font-size: 12px !important;
  padding: 8px 14px !important;
}
.test-panel-toolbar-btn.qa-btn-loading {
  opacity: 0.65;
  pointer-events: none;
}
.test-panel-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.test-panel-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.test-panel-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--bg);
  color: var(--text-light);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
.test-panel-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.test-panel-row:last-child td {
  border-bottom: none;
}
.test-panel-row.is-pass td.test-panel-title {
  box-shadow: inset 3px 0 0 0 #0d9488;
}
.test-panel-row.is-fail td.test-panel-title {
  box-shadow: inset 3px 0 0 0 #dc2626;
}
.test-panel-result {
  vertical-align: middle;
  width: 1%;
  white-space: nowrap;
}
.test-panel-status-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.test-panel-status-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-light);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.test-panel-status-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.test-panel-status-btn.is-active {
  border-color: var(--primary);
  background: rgba(74, 20, 140, 0.08);
  color: var(--primary);
}
.test-panel-row.is-pass .test-panel-status-btn[data-status-action="pass"].is-active {
  border-color: #0d9488;
  background: rgba(13, 148, 136, 0.12);
  color: #0f766e;
}
.test-panel-row.is-fail .test-panel-status-btn[data-status-action="fail"].is-active {
  border-color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
}
.test-panel-title {
  color: var(--text);
  font-weight: 500;
}
.test-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  white-space: nowrap;
}
.test-panel-go-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.test-panel-go-btn:hover {
  border-color: var(--primary);
  background: var(--card-bg);
}
.test-panel-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--primary);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.test-panel-help-btn:hover {
  background: var(--bg);
  border-color: var(--primary);
}
.test-panel-na {
  color: var(--text-light);
  font-size: 12px;
  margin-right: 8px;
}
.test-panel-count {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.test-panel-count code {
  font-size: 12px;
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 6px;
}
.test-panel-loading,
.test-panel-error {
  font-size: 14px;
  color: var(--text-light);
  padding: 24px;
  text-align: center;
}
.test-panel-error code {
  font-size: 12px;
}
.test-panel-spin {
  animation: test-panel-spin 0.8s linear infinite;
}
@keyframes test-panel-spin {
  to {
    transform: rotate(360deg);
  }
}
/* Overlay atrás do popup: z-index menor que #testHelpModal */
#testHelpModalOverlay {
  z-index: 10002;
}

/* Modal de ajuda QA acima do overlay (.modal padrão usa 10001 — ficaria atrás do overlay 10002) */
#testHelpModal.test-help-modal {
  z-index: 10003;
  max-width: 520px;
  width: 92vw;
  max-height: 85vh;
  overflow-y: auto;
}
.test-help-purpose,
.test-help-expected {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 14px;
}
.test-help-steps-title {
  font-size: 13px;
  margin: 0 0 6px;
  color: var(--text);
}
.test-help-steps {
  margin: 0 0 16px 18px;
  padding: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-light);
}
.test-help-steps li {
  margin-bottom: 6px;
}

/* Action buttons in table */
.table-actions {
  display: flex;
  gap: 6px;
}

.table-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.table-btn-edit {
  background: #E3F2FD;
  color: #1565C0;
}

.table-btn-edit:hover {
  background: #BBDEFB;
}

.table-btn-toggle {
  background: #FFF3E0;
  color: #E65100;
}

.table-btn-toggle:hover {
  background: #FFE0B2;
}

.table-btn-toggle.activate {
  background: #E8F5E9;
  color: #2E7D32;
}

.table-btn-toggle.activate:hover {
  background: #C8E6C9;
}

/* Filter bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 32px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}

.filter-bar label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  white-space: nowrap;
}

.filter-bar select {
  padding: 8px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
  min-width: 200px;
  font-family: inherit;
}

.filter-bar select:focus {
  border-color: var(--primary);
}

/* ================================================================
   MODAIS
   ================================================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.modal-overlay.open {
  display: flex;
  opacity: 1;
  pointer-events: all;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: var(--card-bg);
  border-radius: 16px;
  width: 480px;
  max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 10001;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
}

.modal.open {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}

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

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

.modal-close {
  background: var(--bg);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: var(--text-light);
}

.modal-close:hover {
  background: #FFEBEE;
  color: #F44336;
}

.modal-body {
  padding: 24px;
}

.modal-body .form-row {
  margin-bottom: 18px;
}

.modal-body .form-row:last-child {
  margin-bottom: 0;
}

.modal-body select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
  background: var(--card-bg);
  color: var(--text);
}

.modal-body select:focus {
  border-color: var(--primary);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  border-radius: 0 0 16px 16px;
}

/* Workspace slug display */
.feat-badge {
  display: inline-block;
  width: 18px;
  text-align: center;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.feat-badge.on { background: #E8F5E9; color: #2E7D32; }
.feat-badge.off { background: #f5f5f5; color: #999; }

.slug-display {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  color: var(--primary);
  background: rgba(74, 20, 140, 0.06);
  padding: 2px 8px;
  border-radius: 4px;
}

/* ================================================================
   WHATSAPP CHAT MODAL
   ================================================================ */

/* Botão WhatsApp no card */
.card-whatsapp-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #25D366;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(37, 211, 102, 0.3);
}

.card-whatsapp-btn:hover {
  background: #128C7E;
  transform: scale(1.1);
  box-shadow: 0 3px 10px rgba(37, 211, 102, 0.4);
}

.card-whatsapp-btn svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

.card-whatsapp-btn.disabled {
  background: #ccc;
  cursor: not-allowed;
  box-shadow: none;
}

.card-whatsapp-btn.disabled:hover {
  transform: none;
  background: #ccc;
}

/* Overlay do chat WhatsApp */
.wa-chat-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.wa-chat-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* Container do Chat WhatsApp */
.wa-chat-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 440px;
  height: 85vh;
  max-height: 700px;
  min-height: 450px;
  background: var(--bg);
  border-radius: 24px;
  overflow: hidden;
  z-index: 2001;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 60px rgba(0,0,0,0.2);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wa-chat-container.open {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}

/* Fundo estilo WhatsApp (padrão de fundo) */
.wa-chat-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cg fill='%23d4cfc6' opacity='0.15'%3E%3Cpath d='M20 20h8v2h-8zM60 10h4v4h-4zM100 30h6v2h-6zM150 15h3v6h-3zM200 25h5v3h-5zM250 5h4v4h-4zM300 35h7v2h-7zM350 20h5v3h-5zM40 60h6v2h-6zM90 50h4v4h-4zM130 70h8v2h-8zM180 55h3v6h-3zM220 65h5v3h-5zM280 45h4v4h-4zM320 75h6v2h-6zM370 60h4v3h-4zM10 100h5v3h-5zM70 90h7v2h-7zM110 110h4v4h-4zM160 95h6v2h-6zM210 105h3v6h-3zM260 85h5v3h-5zM310 115h4v4h-4zM360 100h7v2h-7z'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* Header do chat */
.wa-chat-header {
  background: var(--primary-gradient);
  color: white;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1;
  flex-shrink: 0;
  border-radius: 24px 24px 0 0;
}

.wa-chat-header-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.wa-chat-header-info {
  flex: 1;
  min-width: 0;
}

.wa-chat-header-name {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-chat-header-status {
  font-size: 12px;
  opacity: 0.8;
}

.wa-chat-header-actions {
  display: flex;
  gap: 8px;
}

.wa-chat-header-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  font-size: 18px;
}

.wa-chat-header-btn:hover {
  background: rgba(255,255,255,0.2);
}

/* Área de mensagens */
.wa-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 1;
  scroll-behavior: smooth;
}

.wa-chat-messages::-webkit-scrollbar {
  width: 6px;
}

.wa-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 3px;
}

/* Bolhas de mensagem */
.wa-msg {
  max-width: 80%;
  padding: 6px 8px 4px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
  position: relative;
  word-wrap: break-word;
  box-shadow: 0 1px 1px rgba(0,0,0,0.08);
}

.wa-msg-outgoing {
  background: var(--card-bg);
  color: var(--text);
  align-self: flex-end;
  border-top-right-radius: 0;
  margin-left: 40px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.wa-msg-incoming {
  background: #e8eaf0;
  color: #1a1a1a;
  font-weight: 500;
  align-self: flex-start;
  border-top-left-radius: 0;
  margin-right: 40px;
  border: 1px solid #d1d5db;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
}

.wa-msg-text {
  padding: 2px 4px;
  white-space: pre-wrap;
}

.wa-msg-image {
  max-width: 100%;
  border-radius: 6px;
  cursor: pointer;
  display: block;
  margin-bottom: 4px;
}

.wa-msg-image:hover {
  opacity: 0.9;
}

.wa-msg-audio {
  width: 100%;
  min-width: 200px;
  max-width: 280px;
  height: 36px;
  margin: 4px 0;
}

.wa-msg-document {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.04);
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  margin: 4px 0;
}

.wa-msg-document:hover {
  background: rgba(0,0,0,0.08);
}

.wa-msg-doc-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.wa-msg-doc-info {
  flex: 1;
  min-width: 0;
}

.wa-msg-doc-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-msg-doc-size {
  font-size: 11px;
  color: var(--text-light);
}

.wa-msg-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding: 0 4px;
  margin-top: 2px;
}

.wa-msg-time {
  font-size: 11px;
  color: #666;
}

.wa-msg-status {
  font-size: 12px;
  color: #4a90a4;
}

.wa-msg-deleted {
  font-style: italic;
  color: #999;
  padding: 6px 8px;
}

.wa-msg-deleted .wa-msg-text {
  font-size: 13px;
}

/* Menu de contexto da mensagem */
.wa-msg-context-trigger {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-light);
  transition: background 0.15s;
}

.wa-msg:hover .wa-msg-context-trigger {
  display: flex;
}

.wa-msg-context-trigger:hover {
  background: rgba(0,0,0,0.06);
}

.wa-msg-context-menu {
  position: absolute;
  top: 28px;
  right: 4px;
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  z-index: 10;
  min-width: 180px;
  overflow: hidden;
  animation: waContextIn 0.15s ease;
}

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

.wa-msg-context-menu button {
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.15s;
}

.wa-msg-context-menu button:hover {
  background: #f0f0f0;
}

.wa-msg-context-menu button.danger {
  color: #e53935;
}

.wa-msg-context-menu button.danger:hover {
  background: #fef0f0;
}

/* Data separator */
.wa-date-separator {
  text-align: center;
  margin: 10px 0;
}

.wa-date-separator span {
  background: #e1f2fb;
  color: #4a6984;
  padding: 5px 14px;
  border-radius: 8px;
  font-size: 12px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.06);
}

/* Barra de input do chat */
.wa-chat-input-bar {
  background: var(--card-bg);
  padding: 10px 14px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  z-index: 1;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
}

.wa-chat-input-actions {
  display: flex;
  gap: 4px;
}

.wa-chat-input-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  color: #54656f;
  font-size: 20px;
  flex-shrink: 0;
}

.wa-chat-input-btn:hover {
  background: rgba(0,0,0,0.06);
}

.wa-chat-input-btn.recording {
  color: #e53935;
  animation: waPulse 1s infinite;
}

@keyframes waPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.wa-chat-input-field {
  flex: 1;
  min-height: 40px;
  max-height: 120px;
  padding: 10px 14px;
  border: none;
  border-radius: 20px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  resize: none;
  outline: none;
  line-height: 1.4;
  overflow-y: auto;
}

.wa-chat-input-field::-webkit-scrollbar {
  width: 4px;
}

.wa-chat-input-field::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 2px;
}

.wa-chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #0096c7);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,188,212,0.25);
}

.wa-chat-send-btn:hover {
  background: linear-gradient(135deg, #0096c7, #0077b6);
  transform: scale(1.05);
}

.wa-chat-send-btn svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

/* Preview de mídia antes do envio */
.wa-media-preview {
  background: #f0f0f0;
  padding: 8px 12px;
  display: none;
  align-items: center;
  gap: 10px;
  z-index: 1;
  border-top: 1px solid #ddd;
}

.wa-media-preview.active {
  display: flex;
}

.wa-media-preview-thumb {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
}

.wa-media-preview-info {
  flex: 1;
  min-width: 0;
}

.wa-media-preview-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-media-preview-size {
  font-size: 11px;
  color: var(--text-light);
}

.wa-media-preview-cancel {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,0.06);
  border: none;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wa-media-preview-cancel:hover {
  background: rgba(0,0,0,0.12);
}

/* Gravação de áudio */
.wa-recording-bar {
  background: #f0f0f0;
  padding: 10px 16px;
  display: none;
  align-items: center;
  gap: 12px;
  z-index: 1;
}

.wa-recording-bar.active {
  display: flex;
}

.wa-recording-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e53935;
  animation: waPulse 1s infinite;
}

.wa-recording-time {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.wa-recording-cancel {
  margin-left: auto;
  padding: 6px 14px;
  border-radius: 16px;
  background: none;
  border: 1px solid #ccc;
  cursor: pointer;
  font-size: 13px;
  color: #666;
}

.wa-recording-cancel:hover {
  background: rgba(0,0,0,0.04);
}

.wa-recording-send {
  padding: 6px 14px;
  border-radius: 16px;
  background: #25D366;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: #fff;
  font-weight: 600;
}

.wa-recording-send:hover {
  background: #128C7E;
}

/* Viewer de imagem (fullscreen) */
.wa-image-viewer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.9);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.wa-image-viewer.active {
  display: flex;
}

.wa-image-viewer img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 4px;
}

.wa-image-viewer-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wa-image-viewer-close:hover {
  background: rgba(255,255,255,0.25);
}

/* Notificação sem telefone */
.wa-no-phone {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.wa-no-phone-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.wa-no-phone-text {
  font-size: 15px;
}

/* ── Responsivo ── */
@media (max-width: 900px) {
  .sidebar {
    width: 60px;
  }

  .sidebar-role-badge,
  .sidebar-logo-placeholder,
  .sidebar-link span:not(.icon):not(.badge-nav),
  .sidebar-footer,
  .sidebar-version,
  .sidebar-bottom-row .palette-selector {
    display: none !important;
  }
  .sidebar-bottom {
    flex-direction: column;
    align-items: center;
  }

  .sidebar-link {
    justify-content: center;
    padding: 14px;
    position: relative;
  }

  .sidebar-link .icon {
    font-size: 20px;
  }

  .sidebar-icon {
    width: 22px;
    height: 22px;
  }

  .sidebar-link .badge-nav {
    position: absolute;
    top: 4px;
    right: 4px;
    padding: 1px 5px;
    font-size: 9px;
  }

  .kanban-column {
    min-width: 240px;
  }

  .conversation-panel {
    width: 100%;
    right: -100%;
  }

  .wa-chat-container {
    width: 95vw;
    height: 90vh;
  }

  .main-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
  }
  .main-header-right {
    flex-wrap: wrap;
    gap: 12px;
  }
  .main-header-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .atendimento-list-header,
  .atendimento-list-row {
    grid-template-columns: 1fr 90px 110px 100px;
  }
  .atendimento-list-header .col-updated,
  .atendimento-list-row .col-updated {
    display: none;
  }
  .header-action-btn span {
    display: none;
  }
  .csv-import-modal {
    width: 95vw !important;
    max-height: 90vh !important;
  }
  .csv-preview-table-wrap {
    max-width: calc(95vw - 48px);
  }
  .contacts-filter-row {
    gap: 8px;
  }
  .contacts-search-box {
    min-width: 100%;
  }
  .contacts-filter-row select,
  .contacts-filter-row input[type="date"] {
    flex: 1;
    min-width: 120px;
  }
  .contacts-table-container {
    max-height: 60vh;
    overflow: auto;
  }
  .page-top-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  .page-top-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .kanban-filters {
    padding: 10px 12px;
  }

  .atendimento-list-header,
  .atendimento-list-row {
    grid-template-columns: 1fr 80px 100px 70px 100px;
    gap: 8px;
    padding: 10px 12px;
  }
}

/* ============================================================
   CONTACTS PAGE
   ============================================================ */

/* Barra de filtros */
.contacts-filter-bar {
  background: var(--card-bg);
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.contacts-filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.contacts-search-box {
  position: relative;
  flex: 1;
  min-width: 220px;
}
.contacts-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.contacts-search-box input {
  width: 100%;
  padding: 9px 12px 9px 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--bg);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.contacts-search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74,20,140,0.08);
}

.contacts-filter-row select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  min-width: 140px;
}
.contacts-filter-row select:focus {
  outline: none;
  border-color: var(--primary);
}

.contacts-filter-row input[type="date"] {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--card-bg);
  color: var(--text);
  min-width: 130px;
}
.contacts-filter-row input[type="date"]:focus {
  outline: none;
  border-color: var(--primary);
}

.contacts-clear-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-light);
  transition: all 0.2s;
}
.contacts-clear-btn:hover {
  background: #fee;
  border-color: var(--urgent);
  color: var(--urgent);
}

.contacts-filter-summary {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 8px;
}
.contacts-filter-summary strong {
  color: var(--primary);
}

/* Tabela */
.contacts-table-container {
  background: var(--card-bg);
  box-shadow: var(--shadow);
  overflow-x: auto;
}
.contacts-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}
.contacts-th-photo {
  width: 50px;
  text-align: center;
}
.contacts-th-sortable {
  cursor: pointer;
  user-select: none;
}
.contacts-th-sortable:hover {
  color: var(--primary);
}
.sort-arrow {
  font-size: 10px;
  margin-left: 3px;
}

/* Foto na tabela */
.contacts-photo-cell {
  text-align: center;
}
.contacts-photo-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
  cursor: pointer;
  transition: transform 0.15s;
}
.contacts-photo-img:hover {
  transform: scale(1.15);
}
.contacts-photo-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-light);
  font-weight: 600;
}

/* Tags */
.contacts-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.contacts-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  background: #f0e6ff;
  color: var(--primary);
}

/* Origem badge */
.contacts-source-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}
.contacts-source-badge.website { background: #e3f2fd; color: #1565c0; }
.contacts-source-badge.whatsapp { background: #e8f5e9; color: #2e7d32; }
.contacts-source-badge.csv_import { background: #fff3e0; color: #e65100; }
.contacts-source-badge.manual { background: #f3e5f5; color: #6a1b9a; }

/* Status badge na tabela de contatos */
.contacts-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.contacts-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

/* Ações */
.contacts-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}
.contacts-action-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  font-size: 15px;
}
.contacts-action-btn:hover {
  background: #f0f0f5;
}
.contacts-action-btn.wa:hover { background: #dcf8e6; }
.contacts-action-btn.open:hover { background: #e3f2fd; }
.contacts-action-btn.del:hover { background: #ffebee; color: var(--urgent); }
.contacts-action-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.contacts-action-btn:disabled:hover {
  background: transparent;
}

/* Paginação */
.contacts-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 24px;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  border-radius: 0 0 12px 12px;
  box-shadow: var(--shadow);
}
.contacts-page-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.contacts-page-btn:hover {
  background: #f5f5f5;
  border-color: var(--primary);
}
.contacts-page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.contacts-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.contacts-page-info {
  font-size: 13px;
  color: var(--text-light);
  margin: 0 8px;
}

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

/* Selects em page-top-actions (Dashboard, Auditoria) */
.page-top-actions select {
  padding: 8px 32px 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.page-top-actions select:hover {
  border-color: var(--primary);
}
.page-top-actions select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 46, 185, 0.15);
}

/* Botões de ação (Novo Template, Nova Etiqueta, Nova Automação, etc.) */
.kanban-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: white;
  background: var(--primary-gradient);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(108, 46, 185, 0.25);
}
.kanban-header-btn:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(108, 46, 185, 0.35);
}
.kanban-header-btn:active {
  transform: translateY(0);
}
.kanban-header-btn .btn-icon {
  width: 16px;
  height: 16px;
}

/* ============================================================
   NOVO LEAD MODAL
   ============================================================ */

.new-lead-modal {
  width: 600px;
  max-width: 95vw;
}

.new-lead-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.new-lead-photo-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.new-lead-photo-preview {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg);
  transition: border-color 0.2s;
}
.new-lead-photo-preview:hover {
  border-color: var(--primary);
}
.new-lead-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.new-lead-photo-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nl-photo-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text);
  transition: all 0.2s;
}
.nl-photo-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.nl-photo-btn svg { flex-shrink: 0; }
.nl-photo-btn-remove { border-color: var(--urgent); color: var(--urgent); }
.nl-photo-btn-remove:hover { background: var(--urgent); color: #fff; border-color: var(--urgent); }

.new-lead-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.nl-field-row {
  display: flex;
  gap: 12px;
}
.nl-field-row .nl-field { flex: 1; }
.nl-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nl-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.nl-field input,
.nl-field select,
.nl-field textarea {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--card-bg);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.nl-field input:focus,
.nl-field select:focus,
.nl-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74,20,140,0.08);
}
.nl-field textarea { resize: vertical; min-height: 60px; }

@media (max-width: 600px) {
  .nl-field-row { flex-direction: column; }
  .new-lead-photo-section { flex-direction: column; text-align: center; }
}

/* ============================================================
   CÂMERA MODAL
   ============================================================ */

.camera-modal {
  width: 540px;
  max-width: 95vw;
}
.camera-body {
  padding: 0 !important;
  position: relative;
}
.camera-container {
  width: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  max-height: 60vh;
  overflow: hidden;
}
.camera-container video {
  width: 100%;
  max-height: 60vh;
  object-fit: cover;
}
.camera-container img {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
}

.camera-switch {
  position: absolute;
  top: 12px;
  right: 12px;
}
.camera-switch button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.85);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.camera-switch button:hover { background: var(--card-bg); }

.camera-footer {
  justify-content: center;
  gap: 10px;
}
.camera-capture-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.header-action-btn-success {
  background: #4CAF50 !important;
  color: #fff !important;
  border-color: #4CAF50 !important;
}
.header-action-btn-success:hover {
  background: #388E3C !important;
  border-color: #388E3C !important;
}

/* ============================================================
   CSV IMPORT/EXPORT
   ============================================================ */

.csv-import-modal {
  width: 720px;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.csv-import-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px !important;
}

/* Upload Zone */
.csv-upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  background: #fafbfc;
}
.csv-upload-zone:hover,
.csv-upload-zone.dragover {
  border-color: var(--primary);
  background: #f3e8ff;
}
.csv-upload-zone.dragover {
  transform: scale(1.01);
}
.csv-upload-icon {
  margin-bottom: 12px;
}
.csv-upload-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.csv-upload-hint {
  font-size: 12px;
  color: var(--text-light);
}
.csv-upload-zone.has-file {
  border-color: var(--completed);
  background: var(--completed-bg);
}
.csv-upload-zone.has-file .csv-upload-icon svg {
  stroke: var(--completed);
}

/* Template Info */
.csv-template-info {
  margin-top: 20px;
  padding: 16px;
  background: #f5f3ff;
  border-radius: 10px;
  border-left: 4px solid var(--primary);
}
.csv-template-info p {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 8px;
}
.csv-template-box {
  background: #1a1a2e;
  color: #a7f3d0;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  overflow-x: auto;
  margin-bottom: 8px;
}
.csv-template-hint {
  font-size: 11px !important;
  color: var(--text-light) !important;
}
.csv-download-template {
  margin-top: 8px;
  padding: 6px 14px;
  border: 1px solid var(--primary);
  background: var(--card-bg);
  color: var(--primary);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
}
.csv-download-template:hover {
  background: var(--primary);
  color: #fff;
}

/* Preview */
.csv-preview-header {
  margin-bottom: 12px;
}
.csv-preview-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.csv-stat {
  font-size: 13px;
  color: var(--text);
  background: #f0f0f5;
  padding: 5px 12px;
  border-radius: 6px;
}
.csv-stat strong {
  color: var(--primary);
  font-size: 15px;
}
.csv-stat-headers {
  font-size: 11px;
  color: var(--text-light);
}

.csv-preview-table-wrap {
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.csv-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.csv-preview-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}
.csv-preview-table th {
  background: #f5f3ff;
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  color: var(--primary);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.csv-preview-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #f0f0f0;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.csv-preview-table tr:hover td {
  background: #f9f9ff;
}
.csv-preview-note {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 8px;
  font-style: italic;
}

/* Import Options */
.csv-import-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
  padding: 14px;
  background: #fafbfc;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.csv-option label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}
.csv-option select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--card-bg);
  color: var(--text);
}

/* Result Box */
.csv-result-box {
  text-align: center;
  padding: 24px;
}
.csv-result-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.csv-result-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.csv-result-stats {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}
.csv-result-stat {
  padding: 10px 18px;
  border-radius: 10px;
  text-align: center;
  min-width: 100px;
}
.csv-result-stat-value {
  font-size: 24px;
  font-weight: 700;
  display: block;
}
.csv-result-stat-label {
  font-size: 11px;
  font-weight: 500;
  display: block;
  margin-top: 2px;
}
.csv-result-stat.created {
  background: var(--completed-bg);
  color: var(--completed);
}
.csv-result-stat.updated {
  background: var(--active-bg);
  color: var(--active);
}
.csv-result-stat.skipped {
  background: var(--waiting-bg);
  color: #ff8f00;
}
.csv-result-stat.errors {
  background: var(--urgent-bg);
  color: var(--urgent);
}
.csv-result-errors {
  margin-top: 14px;
  text-align: left;
  max-height: 120px;
  overflow-y: auto;
  background: var(--urgent-bg);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--urgent);
}
.csv-result-errors p {
  margin-bottom: 3px;
}

/* ============================================================
   POLIMENTO — INDICADORES, BADGES, LOADING, NOTIFICAÇÕES
   ============================================================ */

/* Badge de contatos na sidebar */
.badge-contacts {
  background: var(--primary);
  font-size: 10px;
}

/* Indicador de conexão no footer da sidebar */
.sidebar-connection {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 11px;
  opacity: 0.6;
}
.conn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  transition: background 0.3s;
}
.conn-dot.conn-online { background: #4CAF50; box-shadow: 0 0 6px #4CAF5088; }
.conn-dot.conn-offline { background: #F44336; box-shadow: 0 0 6px #F4433688; }
.conn-dot.conn-reconnecting { background: #FFC107; animation: pulse-dot 1s infinite; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Botão com loading state */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.75;
}
.btn-loading::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spinner-btn 0.6s linear infinite;
}
@keyframes spinner-btn {
  to { transform: rotate(360deg); }
}

/* Barra de progresso sutil no topo */
.global-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  z-index: 99999;
  pointer-events: none;
}
.global-progress.active {
  background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--primary));
  background-size: 200% 100%;
  animation: progress-slide 1.2s ease-in-out infinite;
}
@keyframes progress-slide {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Animação de entrada para cards do kanban */
.kanban-card {
  animation: card-fade-in 0.25s ease-out;
}
@keyframes card-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Animação suave para mudança de página */
.settings-page.active,
.kanban-page.active {
  animation: page-in 0.2s ease-out;
}
@keyframes page-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Toast melhorado com ícone */
.settings-toast.show {
  animation: toast-slide-in 0.3s ease-out;
}
@keyframes toast-slide-in {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* Empty state genérico */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-light);
  text-align: center;
}
.empty-state-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
  display: flex;
  align-items: center;
  justify-content: center;
}
.empty-state-icon svg {
  width: 48px;
  height: 48px;
}
.empty-state-text {
  font-size: 14px;
  max-width: 300px;
}
.empty-state-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  grid-column: 1 / -1;
}
.reopen-btn {
  animation: pulse-reopen 2s infinite;
}
@keyframes pulse-reopen {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

/* Tooltip customizado */
[data-tooltip] {
  position: relative;
}
[data-tooltip]:hover::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 9999;
  pointer-events: none;
  animation: tooltip-in 0.15s ease-out;
}
@keyframes tooltip-in {
  from { opacity: 0; transform: translateX(-50%) translateY(4px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Hover sutil nos cards */
.kanban-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
  transition: all 0.15s ease;
}

/* Scroll suave */
html {
  scroll-behavior: smooth;
}

/* Seleção visual */
::selection {
  background: var(--primary);
  color: white;
}

/* Badge pulsante quando tem novos */
.badge-nav.badge-pulse {
  animation: badge-pulse 1.5s ease-in-out infinite;
}
@keyframes badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* Focus ring acessível */
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ================================================================
   BOTÃO DE TELEFONE NO CARD
   ================================================================ */

.card-phone-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #2196F3;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(33, 150, 243, 0.3);
}

.card-phone-btn:hover {
  background: #1565C0;
  transform: scale(1.1);
  box-shadow: 0 3px 10px rgba(33, 150, 243, 0.4);
}

.card-phone-btn svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

.card-phone-btn.hidden {
  display: none;
}

/* ================================================================
   PAINEL DE CHAMADA (FLOATING)
   ================================================================ */

.call-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 320px;
  background: #1a1a2e;
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  z-index: 10000;
  overflow: hidden;
  transform: translateY(120%);
  transition: transform 0.3s ease;
  color: #fff;
}

.call-panel.active {
  transform: translateY(0);
}

.call-panel.minimized .call-panel-body {
  display: none;
}

.call-panel.minimized {
  width: 280px;
  border-radius: 16px;
}

.call-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.call-panel-status {
  font-size: 14px;
  font-weight: 600;
}

.call-panel-minimize {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.call-panel-minimize:hover {
  background: rgba(255, 255, 255, 0.2);
}

.call-panel-body {
  padding: 24px;
  text-align: center;
}

.call-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.call-contact-name {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.call-contact-phone {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 16px;
}

.call-timer {
  font-size: 32px;
  font-weight: 300;
  font-family: 'Courier New', monospace;
  color: #4CAF50;
  margin-bottom: 8px;
}

.call-quality {
  font-size: 12px;
  color: #FFC107;
  min-height: 18px;
  margin-bottom: 20px;
}

.call-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.call-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  font-size: 11px;
  transition: all 0.2s;
  padding: 8px;
  border-radius: 12px;
}

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

.call-action-btn.active {
  background: rgba(255, 255, 255, 0.15);
  color: #FFC107;
}

.call-action-btn.hangup-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #F44336;
  color: #fff;
  flex-direction: row;
  justify-content: center;
  gap: 0;
  font-size: 0;
  box-shadow: 0 4px 16px rgba(244, 67, 54, 0.4);
}

.call-action-btn.hangup-btn:hover {
  background: #D32F2F;
  transform: scale(1.05);
}

.call-action-btn.hangup-btn svg {
  transform: rotate(135deg);
}

/* ================================================================
   MODAL CHAMADA RECEBIDA
   ================================================================ */

.incoming-call-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}

.incoming-call-overlay.active {
  display: flex;
}

.incoming-call-modal {
  background: #1a1a2e;
  border-radius: 24px;
  padding: 40px;
  text-align: center;
  color: #fff;
  width: 340px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.incoming-call-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(76, 175, 80, 0.1);
  animation: incoming-pulse 2s ease-out infinite;
}

@keyframes incoming-pulse {
  0% { transform: translate(-50%, -50%) scale(0.8); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

.incoming-call-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4CAF50, #45a049);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  position: relative;
  z-index: 1;
  animation: incoming-avatar-ring 1.5s ease-in-out infinite;
}

@keyframes incoming-avatar-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4); }
  50% { box-shadow: 0 0 0 16px rgba(76, 175, 80, 0); }
}

.incoming-call-modal h3 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px;
  position: relative;
  z-index: 1;
}

.incoming-call-modal p {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 30px;
  position: relative;
  z-index: 1;
}

.incoming-call-actions {
  display: flex;
  justify-content: center;
  gap: 24px;
  position: relative;
  z-index: 1;
}

.incoming-reject-btn,
.incoming-accept-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 12px;
  border-radius: 16px;
  transition: transform 0.2s;
}

.incoming-reject-btn {
  background: #F44336;
  box-shadow: 0 4px 16px rgba(244, 67, 54, 0.4);
}

.incoming-reject-btn:hover {
  transform: scale(1.05);
}

.incoming-accept-btn {
  background: #4CAF50;
  box-shadow: 0 4px 16px rgba(76, 175, 80, 0.4);
}

.incoming-accept-btn:hover {
  transform: scale(1.05);
}

/* ================================================================
   PÁGINA DE CHAMADAS
   ================================================================ */

.calls-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}

.calls-tab {
  padding: 12px 20px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.calls-tab:hover {
  color: var(--primary);
}

.calls-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.calls-tab-badge {
  background: #F44336;
  color: #fff;
  font-size: 11px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  font-weight: 700;
}

/* Badges de direção */
.call-dir-badge {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.call-dir-badge.inbound {
  background: #E3F2FD;
  color: #1565C0;
}

.call-dir-badge.outbound {
  background: #E8F5E9;
  color: #2E7D32;
}

/* Badges de status de chamada */
.call-status-badge {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.call-status-badge.initiated { background: #FFF3E0; color: #E65100; }
.call-status-badge.ringing { background: #FFF9C4; color: #F57F17; }
.call-status-badge.in-progress { background: #E3F2FD; color: #1565C0; }
.call-status-badge.completed { background: #E8F5E9; color: #2E7D32; }
.call-status-badge.no-answer { background: #FBE9E7; color: #BF360C; }
.call-status-badge.busy { background: #FCE4EC; color: #880E4F; }
.call-status-badge.failed { background: #FFEBEE; color: #C62828; }
.call-status-badge.canceled { background: #F3E5F5; color: #6A1B9A; }

/* Voicemail list */
.voicemails-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.voicemail-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: var(--shadow);
  transition: opacity 0.3s;
}

.voicemail-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.voicemail-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.voicemail-icon svg {
  width: 28px;
  height: 28px;
}

.voicemail-info strong {
  display: block;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 2px;
}

.voicemail-phone {
  font-size: 13px;
  color: var(--text-secondary);
  margin-right: 12px;
}

.voicemail-date {
  font-size: 12px;
  color: var(--text-secondary);
}

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

.voicemail-audio {
  height: 32px;
  max-width: 200px;
}

.table-action-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--surface);
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.table-action-btn:hover {
  background: var(--primary);
  transform: scale(1.05);
}

/* ================================================================
   RESPONSIVE — CALL PANEL
   ================================================================ */

/* ================================================================
   PAINEL DE CONVERSA — NOVOS ELEMENTOS (VOICE)
   ================================================================ */

.conv-panel-header-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  margin-right: 12px;
}

.conv-call-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #2196F3;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.conv-call-btn:hover {
  background: #1565C0;
  transform: scale(1.08);
  box-shadow: 0 3px 12px rgba(33, 150, 243, 0.4);
}

.conv-assign-select {
  padding: 5px 10px;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 8px;
  font-size: 12px;
  color: #fff;
  background: rgba(255,255,255,0.2);
  cursor: pointer;
  max-width: 160px;
}

.conv-assign-select:focus {
  border-color: rgba(255,255,255,0.7);
  outline: none;
}

.conv-assign-select option {
  background: var(--card-bg);
  color: var(--text);
}

.conv-labels-area {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(0,0,0,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  min-width: 0;
  flex: 1 1 100%;
}

.conv-labels-label {
  font-size: 12px;
  color: rgba(255,255,255,0.9);
  margin: 0;
  white-space: nowrap;
  flex-shrink: 0;
}

.conv-labels-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.conv-label-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 500;
}

.conv-label-remove {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  opacity: 0.8;
  padding: 0 2px;
}

.conv-label-remove:hover {
  opacity: 1;
}

.conv-labels-add {
  padding: 4px 10px;
  min-width: 100px;
  border: 1px dashed rgba(255,255,255,0.5);
  border-radius: 6px;
  font-size: 12px;
  background: transparent;
  color: rgba(255,255,255,0.9);
  cursor: pointer;
  flex-shrink: 0;
}

.conv-labels-add option {
  background: var(--card-bg);
  color: var(--text);
}

/* Seção de chamadas no painel */
.conv-calls-section {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.conv-calls-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.conv-calls-toggle:hover {
  background: rgba(0, 0, 0, 0.03);
}

.conv-calls-count {
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.conv-calls-arrow {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-secondary);
}

.conv-calls-list {
  padding: 0 12px 12px;
  max-height: 200px;
  overflow-y: auto;
}

.conv-call-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--card);
  margin-bottom: 6px;
  font-size: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.conv-call-dir {
  font-size: 14px;
  flex-shrink: 0;
}

.conv-call-date {
  color: var(--text-secondary);
  font-size: 11px;
  min-width: 100px;
}

.conv-call-status {
  flex: 1;
  font-weight: 500;
  white-space: nowrap;
}

.conv-call-duration {
  font-family: 'Courier New', monospace;
  color: var(--text-secondary);
  font-size: 12px;
  min-width: 40px;
  text-align: right;
}

.conv-call-play {
  width: 26px;
  height: 26px;
  border: none;
  background: var(--surface);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.conv-call-play:hover {
  background: var(--primary);
  transform: scale(1.05);
}

/* ================================================================
   TECLADO DTMF
   ================================================================ */

.call-keypad {
  padding: 8px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.keypad-display {
  text-align: center;
  font-size: 16px;
  font-family: 'Courier New', monospace;
  letter-spacing: 2px;
  padding: 6px;
  color: var(--text);
  min-height: 24px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.keypad-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  border: none;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  margin: 0 auto;
  background: var(--surface);
  color: var(--text);
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.keypad-btn small {
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.keypad-btn:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.05);
}

.keypad-btn:active,
.keypad-btn.pressed {
  background: var(--primary);
  color: #fff;
  transform: scale(0.95);
}

.keypad-btn.pressed small {
  color: rgba(255,255,255,0.7);
}

/* Hold button */
.hold-btn {
  color: #FF9800 !important;
}

.hold-btn.active {
  background: rgba(255, 152, 0, 0.2) !important;
  color: #FF9800 !important;
}

.keypad-toggle-btn {
  color: var(--text) !important;
}

.keypad-toggle-btn.active {
  background: rgba(33, 150, 243, 0.15) !important;
  color: #2196F3 !important;
}

/* ================================================================
   ESTATÍSTICAS POR ATENDENTE
   ================================================================ */

.agents-call-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agent-call-card {
  background: var(--card);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
}

.agent-call-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.agent-call-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.agent-call-info {
  flex: 1;
  min-width: 0;
}

.agent-call-info strong {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
}

.agent-call-bar {
  height: 6px;
  background: var(--surface);
  border-radius: 3px;
  overflow: hidden;
}

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

.agent-call-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}

.agent-metric {
  text-align: center;
  padding: 8px 4px;
  border-radius: 8px;
  background: var(--surface);
}

.agent-metric-value {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.agent-metric-label {
  display: block;
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ================================================================
   FILTROS E ELEMENTOS DE CHAMADAS
   ================================================================ */

.calls-filters {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  flex-wrap: wrap;
}

.calls-filters select {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}

.calls-filters select:focus {
  border-color: var(--primary);
  outline: none;
}

/* Dashboard calls metrics */
.dash-calls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.dash-calls-kpi {
  text-align: center;
  padding: 16px 8px;
  border-radius: 10px;
  background: var(--surface);
  position: relative;
  overflow: hidden;
}

.dash-calls-kpi-icon {
  font-size: 24px;
  display: block;
  margin-bottom: 6px;
}

.dash-calls-kpi-value {
  font-size: 22px;
  font-weight: 800;
  display: block;
}

.dash-calls-kpi-label {
  font-size: 11px;
  color: var(--text-secondary);
  display: block;
  margin-top: 4px;
}

/* Notas de chamada inline */
.call-notes-cell {
  display: flex;
  align-items: center;
  gap: 4px;
}

.call-notes-text {
  font-size: 12px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-notes-empty {
  color: var(--text-secondary);
  font-size: 12px;
}

.call-notes-edit {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.call-notes-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--primary);
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  resize: vertical;
}

.call-notes-edit-btns {
  display: flex;
  gap: 6px;
}

.call-notes-save {
  padding: 4px 10px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
}

.call-notes-cancel {
  padding: 4px 10px;
  background: var(--border);
  color: var(--text);
  border: none;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
}

/* Transfer panel */
.call-transfer-panel {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.05);
}

.transfer-btn {
  color: #2196F3 !important;
}

.transfer-btn:hover {
  background: rgba(33, 150, 243, 0.15) !important;
}

/* ================================================================
   RESPONSIVE — CALL PANEL & VOICE
   ================================================================ */

@media (max-width: 600px) {
  .call-panel {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
  }

  .incoming-call-modal {
    width: 90%;
    max-width: 340px;
    padding: 30px;
  }

  .voicemail-item {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .voicemail-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .conv-panel-header-btns {
    flex-wrap: wrap;
  }

  .conv-assign-select {
    max-width: 120px;
    font-size: 11px;
  }

  .conv-call-item {
    flex-wrap: wrap;
    gap: 4px;
  }
}

/* ============================================================
   ETIQUETAS (labels)
   ============================================================ */

.labels-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px 0;
}

.label-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: all 0.2s;
}

.label-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.label-item-badge {
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 6px;
  font-weight: 500;
}

.label-item-edit,
.label-item-del {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  opacity: 0.7;
  padding: 2px;
}

.label-item-edit:hover,
.label-item-del:hover {
  opacity: 1;
}

/* ============================================================
   TEMPLATES DE RESPOSTA RÁPIDA
   ============================================================ */

.templates-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  align-items: center;
}
.templates-search {
  flex: 1;
}
.templates-search input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}
.templates-search input:focus {
  border-color: var(--primary);
}
.templates-filters select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: var(--card-bg);
  color: var(--text);
  min-width: 160px;
}

.template-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 10px;
  transition: box-shadow .2s;
}
.template-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.template-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.template-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.template-card-title strong {
  font-size: 15px;
}
.template-shortcut {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-family: monospace;
}
.template-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.template-category-badge {
  background: #e3f2fd;
  color: #1565c0;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  text-transform: capitalize;
}
.template-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  border-radius: 4px;
  opacity: 0.6;
  transition: opacity .2s;
}
.template-action-btn:hover {
  opacity: 1;
  background: rgba(0,0,0,0.05);
}
.template-card-content {
  font-size: 13px;
  color: #666;
  white-space: pre-wrap;
  line-height: 1.5;
  max-height: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Dropdown de QR no chat ── */
.qr-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px 10px 0 0;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.12);
  max-height: 320px;
  display: flex;
  flex-direction: column;
  z-index: 100;
}
.qr-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 13px;
}
.qr-dropdown-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #999;
  padding: 0 4px;
}
.qr-dropdown-search {
  padding: 8px 12px;
  border-bottom: 1px solid #f0f0f0;
}
.qr-dropdown-search input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}
.qr-dropdown-list {
  overflow-y: auto;
  flex: 1;
}
.qr-dropdown-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f5f5f5;
  transition: background .15s;
}
.qr-dropdown-item:hover {
  background: #f0f7ff;
}
.qr-dropdown-item-title {
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.qr-shortcut {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 11px;
  font-family: monospace;
}
.qr-dropdown-item-preview {
  font-size: 12px;
  color: #999;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qr-dropdown-empty {
  padding: 20px;
  text-align: center;
  color: #999;
  font-size: 13px;
}

/* ── wa-chat-input-bar posição relativa ── */
.wa-chat-input-bar {
  position: relative;
}

/* ── Modal genérica (display/centro vêm do .open na regra acima) ── */
.modal-overlay.open {
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.modal-content {
  background: var(--card-bg);
  border-radius: var(--radius);
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.12);
  border: 1px solid var(--border);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
}
.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  padding: 0;
}
.modal-body {
  padding: 20px;
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text);
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
  background: var(--card-bg);
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.1);
}
.form-group textarea {
  resize: vertical;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.2s;
  transition: opacity .2s;
}
.btn-primary:hover { opacity: .88; transform: translateY(-1px); }
.btn-secondary {
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: all .2s;
}
.btn-secondary:hover { background: var(--hover-bg, #f3f4f6); border-color: var(--text-light); }

/* ============================================================
   LOG DE ATIVIDADES (AUDITORIA)
   ============================================================ */
.audit-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  align-items: center;
}
.audit-filters select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: var(--card-bg);
  color: var(--text);
}
.audit-count {
  margin-left: auto;
  font-size: 13px;
  color: #999;
}
.audit-table-wrapper {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.audit-table thead {
  background: #f8f9fa;
}
.audit-table th {
  text-align: left;
  padding: 12px 14px;
  font-weight: 600;
  color: #555;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.audit-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
.audit-table tr:hover {
  background: #f8f9fa;
}
.audit-date {
  white-space: nowrap;
  color: #666;
  font-size: 12px;
}
.audit-user {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.audit-user-email {
  font-weight: 500;
}
.audit-role-badge {
  display: inline-block;
  background: #e3f2fd;
  color: #1565c0;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 10px;
  text-transform: uppercase;
  width: fit-content;
}
.audit-action {
  font-weight: 500;
}
.audit-category {
  white-space: nowrap;
}
.audit-details {
  color: var(--text-light);
  font-size: 12px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   SLA BADGES
   ============================================================ */
.sla-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
}
.sla-breach {
  background: #ffebee;
  color: #c62828;
  animation: slaPulse 2s infinite;
}
.sla-warning {
  background: #fff8e1;
  color: #e65100;
}
@keyframes slaPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ============================================================
   AUTOMAÇÕES
   ============================================================ */
.automation-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 10px;
  transition: box-shadow .2s;
}
.automation-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.automation-inactive {
  opacity: 0.6;
}
.automation-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.automation-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.automation-card-title strong {
  font-size: 15px;
}
.automation-trigger-badge {
  background: #e8eaf6;
  color: #283593;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
}
.automation-status-badge {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.automation-status-badge.active {
  background: #e8f5e9;
  color: #2e7d32;
}
.automation-status-badge.inactive {
  background: #fafafa;
  color: #999;
}
.automation-card-details {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.auto-detail {
  font-size: 12px;
  color: var(--text-light);
}
.auto-condition-row {
  display: flex;
  gap: 8px;
}
/* ── LGPD BAR ── */
.lgpd-actions-bar {
  background: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
  padding: 6px 12px;
}
.lgpd-bar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.lgpd-consent-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #666;
}
.lgpd-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ccc;
}
.lgpd-dot.consented { background: #4CAF50; }
.lgpd-dot.not-consented { background: #f44336; }
.lgpd-dot.anonymized { background: #FF9800; }
.lgpd-bar-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.lgpd-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}
.lgpd-btn:hover { background: #f0f0f0; }
.lgpd-btn.consent { color: #2E7D32; border-color: #2E7D32; }
.lgpd-btn.consent.active { background: #2E7D32; color: #fff; }
.lgpd-btn.export { color: #1565C0; border-color: #1565C0; }
.lgpd-btn.anonymize { color: #E65100; border-color: #E65100; }
.lgpd-btn.delete { color: #c62828; border-color: #c62828; }

.schedule-btn {
  color: #666 !important;
}
.schedule-btn:hover {
  color: var(--primary) !important;
}

.auto-condition-row select,
.auto-condition-row input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
}

/* ════════ CONV TABS (Mensagens / Notas / Timeline) ════════ */
.conv-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 12px;
  gap: 2px;
  background: var(--card-bg);
}
.conv-tab {
  padding: 8px 14px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color .2s, border-color .2s;
}
.conv-tab:hover { color: var(--text); }
.conv-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ════════ NOTAS INTERNAS ════════ */
.conv-notes-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 12px;
}
.conv-notes-list { flex: 1; overflow-y: auto; }
.conv-note-card {
  background: #fffde7;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 13px;
  position: relative;
  border-left: 3px solid #fdd835;
}
[data-theme="dark"] .conv-note-card { background: #3a3520; border-left-color: #e6c619; }
.conv-note-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.conv-note-del {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
}
.conv-notes-input {
  display: flex;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.conv-notes-input textarea {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  resize: none;
  background: var(--card-bg);
  color: var(--text);
}
.conv-notes-input button {
  border: none;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
}

/* ════════ TIMELINE ════════ */
.conv-timeline-panel {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}
.conv-timeline-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.conv-timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 6px;
  flex-shrink: 0;
}
.conv-timeline-date {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ════════ NOTIFICAÇÕES ════════ */
.notif-badge {
  position: absolute;
  top: 4px;
  right: 8px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
}
.notif-panel {
  position: fixed;
  left: var(--sidebar-width, 220px);
  bottom: 60px;
  width: 340px;
  max-height: 420px;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
}
.notif-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.notif-panel-list {
  overflow-y: auto;
  max-height: 360px;
}
.notif-item {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  cursor: pointer;
  transition: background .15s;
}
.notif-item:hover { background: var(--hover-bg); }
.notif-item.unread { background: rgba(16, 185, 129, 0.06); }
.notif-item-title { font-weight: 600; margin-bottom: 2px; }
.notif-item-body { color: var(--text-muted); font-size: 12px; }
.notif-item-date { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ════════ DEALS BOARD ════════ */
.deals-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: 300px;
}
.deals-column {
  min-width: 260px;
  max-width: 300px;
  flex: 1;
  background: var(--hover-bg);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
}
.deals-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}
.deals-col-title {
  font-weight: 600;
  font-size: 14px;
}
.deals-col-count {
  font-size: 12px;
  color: var(--text-muted);
}
.deals-col-total {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}
.deals-col-cards { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.deal-card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  cursor: pointer;
  transition: box-shadow .15s, transform .1s;
}
.deal-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,.1); transform: translateY(-1px); }
.deal-card-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.deal-card-value { font-size: 16px; font-weight: 700; color: var(--primary); }
.deal-card-meta { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* ════════ BUSCA GLOBAL ════════ */
.global-search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 9999;
  display: flex;
  justify-content: center;
  padding-top: 15vh;
}
.global-search-box {
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 12px 48px rgba(0,0,0,.2);
  width: 560px;
  max-width: 90vw;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.global-search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.global-search-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  background: transparent;
  color: var(--text);
}
.global-search-results {
  overflow-y: auto;
  max-height: 50vh;
}
.gs-item {
  padding: 10px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.gs-item:hover { background: var(--hover-bg); }
.gs-item-type {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  width: 60px;
  flex-shrink: 0;
}
.gs-item-name { font-weight: 500; flex: 1; }
.gs-item-detail { font-size: 12px; color: var(--text-muted); }

/* ════════ QUICK REPLY DROPDOWN ════════ */
.quick-reply-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px 10px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,.12);
  max-height: 240px;
  overflow-y: auto;
  z-index: 100;
}
.qr-dropdown-item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
  font-size: 13px;
}
.qr-dropdown-item:hover, .qr-dropdown-item.active {
  background: var(--hover-bg);
}
.qr-dropdown-item-shortcut {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
  min-width: 50px;
}
.qr-dropdown-item-title { font-weight: 500; flex: 1; }
.qr-dropdown-item-preview { color: var(--text-muted); font-size: 12px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ════════ SLA ALERT ════════ */
.kanban-card.sla-breach {
  border-left: 4px solid #ef4444 !important;
}
.sla-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #fef2f2;
  color: #ef4444;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ════════ TAGS NO KANBAN ════════ */
.kanban-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 4px;
}
.kanban-tag-chip {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  color: #fff;
  font-weight: 500;
  line-height: 1.4;
}

/* ════════ REVENUE CHART ════════ */
.revenue-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 140px;
  padding-top: 10px;
}
.revenue-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.revenue-bar {
  width: 100%;
  max-width: 40px;
  background: var(--primary);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: height .3s;
}
.revenue-bar-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: center;
}
.revenue-bar-value {
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--text);
}

/* ════════ DEALS NA CONVERSA ════════ */
.conv-deals-panel {
  overflow-y: auto;
  flex: 1;
  padding: 12px;
}
.conv-deal-card {
  background: var(--hover-bg);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: box-shadow .15s;
}
.conv-deal-card:hover {
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
}

/* ════════ UNREAD BADGE ════════ */
.card-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  margin-left: 4px;
}

/* ════════ KEYBOARD FOCUS ════════ */
.kanban-card.kb-focused {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ════════ CSAT ════════ */
.csat-stars {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.csat-star {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--border);
  transition: color .15s, transform .1s;
  padding: 4px;
}
.csat-star:hover, .csat-star.active {
  color: #f59e0b;
  transform: scale(1.15);
}

/* ════════ MOBILE MENU ════════ */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

/* ════════ MOBILE RESPONSIVE ════════ */
@media (max-width: 768px) {
  .mobile-menu-btn { display: flex; }
  .sidebar {
    position: fixed;
    left: -260px;
    z-index: 999;
    transition: left .25s;
    width: 260px;
  }
  .sidebar.mobile-open { left: 0; }
  .main-content { margin-left: 0 !important; }
  .kanban-column { min-width: 220px; }
  .deals-column { min-width: 200px; }
  .conversation-panel { width: 100% !important; max-width: 100vw; }
  .global-search-box { width: 95vw; }
  .dash-card { padding: 12px; }
  .page-top-header { flex-direction: column; gap: 8px; }
  .page-top-actions { flex-wrap: wrap; }
  .conv-tabs { overflow-x: auto; flex-wrap: nowrap; }
  .conv-tab { white-space: nowrap; font-size: 12px; padding: 6px 8px; }
  .conv-contact-metrics { flex-wrap: wrap; }
  .modal-content { max-width: 95vw !important; margin: 8px; }
  .deals-board { flex-direction: column; }
  .deals-column { max-width: 100%; min-width: 100%; }
}

/* ════════ ONBOARDING ════════ */
.onboarding-banner {
  background: var(--primary-gradient);
  color: #fff;
  border-radius: 14px;
  padding: 16px 20px;
  margin: 12px 16px;
}
.onboarding-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.onboarding-header h3 { margin: 0; font-size: 16px; }
.onboarding-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.onboarding-step {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.15);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s;
}
.onboarding-step:hover { background: rgba(255,255,255,.25); }
.onboarding-step.done {
  background: rgba(255,255,255,.25);
  text-decoration: line-through;
  opacity: 0.7;
}
.onboarding-step-check {
  font-size: 14px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.2);
  border-radius: 50%;
}
.onboarding-progress {
  height: 6px;
  background: rgba(255,255,255,.2);
  border-radius: 3px;
  overflow: hidden;
}
.onboarding-progress-bar {
  height: 100%;
  background: #fff;
  border-radius: 3px;
  transition: width .4s;
}
.onboarding-progress-text {
  font-size: 11px;
  margin-top: 4px;
  opacity: 0.8;
}

/* ════════ SHORTCUTS MODAL ════════ */
.shortcut-group { margin-bottom: 14px; }
.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}
.shortcut-row kbd {
  display: inline-block;
  font-family: monospace;
  font-size: 12px;
  background: var(--hover-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  min-width: 36px;
  text-align: center;
}

/* ════════ COMPACT MODE ════════ */
.compact-mode .kanban-card {
  padding: 6px 10px;
}
.compact-mode .card-preview,
.compact-mode .card-labels,
.compact-mode .kanban-card-tags,
.compact-mode .card-photo {
  display: none;
}
.compact-mode .card-header { margin-bottom: 2px; }
.compact-mode .card-footer { margin-top: 2px; }
.compact-mode .card-name { font-size: 13px; }
.compact-mode .card-phone { font-size: 11px; }

/* ════════ CONV TASKS ════════ */
.conv-tasks-panel {
  overflow-y: auto;
  flex: 1;
  padding: 12px;
}

/* ════════ CONTACT METRICS ════════ */
.conv-contact-metrics {
  display: flex;
  gap: 2px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--hover-bg);
}
.ccm-item {
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ccm-value { font-size: 14px; font-weight: 700; }
.ccm-label { font-size: 9px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.5px; }

/* ════════ FOLLOW-UP PANEL ════════ */
.conv-followup-panel {
  overflow-y: auto;
  flex: 1;
  padding: 12px;
}

/* ════════ PIN BUTTON ════════ */
.card-pin-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px;
  border-radius: 4px;
  transition: color .15s, transform .15s;
  display: flex;
  align-items: center;
}
.card-pin-btn:hover { color: var(--primary); }
.card-pin-btn.pinned {
  color: var(--primary);
  transform: rotate(-45deg);
}
.kanban-card[data-pinned="true"] {
  border-top: 2px solid var(--primary);
}

/* ════════ CONTEXT MENU (kanban card) ════════ */
.card-context-menu {
  z-index: 9999;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  min-width: 180px;
  max-width: 220px;
  max-height: 340px;
  overflow-y: auto;
  padding: 4px 0;
  font-size: 13px;
}
.ctx-group { padding: 4px 0; border-bottom: 1px solid var(--border); }
.ctx-group:last-child { border-bottom: none; }
.ctx-group-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  padding: 4px 12px 2px;
  font-weight: 600;
}
.ctx-item {
  padding: 6px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background .12s;
}
.ctx-item:hover { background: var(--hover-bg); }

/* ════════ FAB (Floating Action Button) ════════ */
.fab-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.fab-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary, #10B981);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(16, 185, 129, .35);
  transition: transform .15s, box-shadow .15s;
}
.fab-btn:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(16, 185, 129, .45); }
.fab-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: fabSlideUp .15s ease;
}
@keyframes fabSlideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.fab-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  transition: background .12s;
}
.fab-menu-item:hover { background: var(--hover-bg); }

/* ════════ PRINT DASHBOARD ════════ */
@media print {
  body * { visibility: hidden; }
  #pageDashboard, #pageDashboard * { visibility: visible; }
  #pageDashboard { position: absolute; top: 0; left: 0; width: 100%; }
  .sidebar, .page-top-actions, .mobile-menu-btn, .admin-header, .fab-container { display: none !important; }
  .dash-card { break-inside: avoid; page-break-inside: avoid; border: 1px solid #ddd; margin-bottom: 12px; }
  .dash-kpi-grid { grid-template-columns: repeat(4, 1fr) !important; }
}
