/* ========================================
   WhatsHAM Lite - Estilos Modernos
   ======================================== */

:root {
  /* Colores principales */
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #10b981;
  --secondary-dark: #059669;
  --accent: #f59e0b;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;

  /* Colores neutros */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-card: #1e293b;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: #334155;

  /* WhatsApp colors */
  --whatsapp: #25d366;
  --whatsapp-dark: #128c7e;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.2), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.2);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.3), 0 8px 10px -6px rgb(0 0 0 / 0.2);

  /* Border radius */
  --radius-sm: 0.375rem;
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition: all 0.2s ease;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary);
}

/* ========================================
   Utilidades
   ======================================== */

.hidden {
  display: none !important;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-muted); }

.w-full { width: 100%; }

/* ========================================
   Botones
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--border-color);
}

.btn-success {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
  color: white;
}

.btn-success:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}

.btn-whatsapp {
  background: linear-gradient(135deg, var(--whatsapp) 0%, var(--whatsapp-dark) 100%);
  color: white;
}

.btn-whatsapp:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
}

.btn-icon {
  padding: 0.5rem;
  border-radius: var(--radius);
}

/* ========================================
   Formularios
   ======================================== */

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

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

.form-input.error {
  border-color: var(--danger);
}

.form-error {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--danger);
}

/* ========================================
   Cards
   ======================================== */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
}

/* ========================================
   Auth Pages (Login/Register)
   ======================================== */

.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, var(--bg-primary) 0%, #1a1a2e 100%);
}

.auth-box {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-xl);
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo h1 {
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-logo p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  background: var(--bg-tertiary);
  padding: 0.25rem;
  border-radius: var(--radius);
}

.auth-tab {
  flex: 1;
  padding: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.auth-tab.active {
  background: var(--primary);
  color: white;
}

.auth-tab:hover:not(.active) {
  color: var(--text-primary);
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.auth-divider span {
  padding: 0 1rem;
}

/* ========================================
   Dashboard Layout
   ======================================== */

.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 1.5rem;
}

.nav-section-title {
  padding: 0.5rem 1.5rem;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: var(--text-secondary);
  transition: var(--transition);
  cursor: pointer;
  border-left: 3px solid transparent;
}

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

.nav-item.active {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-light);
  border-left-color: var(--primary);
}

.nav-item i {
  width: 20px;
  font-size: 1.125rem;
}

.nav-item span {
  font-size: 0.875rem;
  font-weight: 500;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

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

.user-name {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-plan {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-header {
  padding: 1rem 2rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.main-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

.main-body {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}

/* ========================================
   Stats Cards
   ======================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-icon.primary {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary-light);
}

.stat-icon.success {
  background: rgba(16, 185, 129, 0.2);
  color: var(--secondary);
}

.stat-icon.warning {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent);
}

.stat-icon.danger {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.stat-info h3 {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

/* ========================================
   Sessions (WhatsApp)
   ======================================== */

.sessions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.session-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}

.session-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.session-header {
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.session-icon {
  width: 48px;
  height: 48px;
  background: rgba(37, 211, 102, 0.2);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--whatsapp);
  font-size: 1.5rem;
}

.session-info h3 {
  font-size: 1rem;
  font-weight: 600;
}

.session-phone {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.session-status {
  margin-left: auto;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-full);
}

.session-status.connected {
  background: rgba(16, 185, 129, 0.2);
  color: var(--secondary);
}

.session-status.disconnected {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.session-status.connecting {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent);
}

.session-body {
  padding: 1.25rem;
}

.session-qr {
  text-align: center;
  padding: 1rem;
}

.session-qr img {
  max-width: 200px;
  border-radius: var(--radius);
  background: white;
  padding: 0.5rem;
}

.session-qr p {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.session-actions {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
}

/* ========================================
   Kanban Board (CRM)
   ======================================== */

.kanban-container {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  min-height: calc(100vh - 200px);
}

.kanban-column {
  flex: 0 0 300px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
}

.kanban-column-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-column-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
}

.kanban-column-count {
  background: var(--bg-tertiary);
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.kanban-column-body {
  flex: 1;
  padding: 0.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: grab;
  transition: var(--transition);
}

.kanban-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

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

.kanban-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.kanban-card-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
}

.kanban-card-name {
  font-weight: 500;
  font-size: 0.875rem;
}

.kanban-card-phone {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.kanban-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.kanban-tag {
  padding: 0.125rem 0.5rem;
  font-size: 0.625rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary-light);
}

/* Column colors */
.kanban-column[data-stage="nuevo"] .kanban-column-title::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
}

.kanban-column[data-stage="contactado"] .kanban-column-title::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

.kanban-column[data-stage="calificado"] .kanban-column-title::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #8b5cf6;
  border-radius: 50%;
}

.kanban-column[data-stage="propuesta"] .kanban-column-title::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #06b6d4;
  border-radius: 50%;
}

.kanban-column[data-stage="ganado"] .kanban-column-title::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--secondary);
  border-radius: 50%;
}

.kanban-column[data-stage="perdido"] .kanban-column-title::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
}

/* ========================================
   Modal
   ======================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.9);
  transition: var(--transition);
}

.modal-overlay.active .modal {
  transform: scale(1);
}

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

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--danger);
  color: white;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  max-height: calc(90vh - 140px);
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ========================================
   Toast Notifications
   ======================================== */

.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 300px;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.success {
  border-left: 3px solid var(--secondary);
}

.toast.error {
  border-left: 3px solid var(--danger);
}

.toast.warning {
  border-left: 3px solid var(--accent);
}

.toast-icon {
  font-size: 1.25rem;
}

.toast.success .toast-icon { color: var(--secondary); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--accent); }

.toast-message {
  flex: 1;
  font-size: 0.875rem;
}

/* ========================================
   Empty States
   ======================================== */

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
}

.empty-state-icon {
  font-size: 4rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ========================================
   Loading Spinner
   ======================================== */

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bg-tertiary);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  .auth-box {
    padding: 1.5rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .kanban-column {
    flex: 0 0 280px;
  }
}

/* ========================================
   Kanban - Columna para agregar
   ======================================== */

.kanban-column-add {
  background: transparent;
  border: 2px dashed var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}

.kanban-column-add:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.kanban-add-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 150px;
  gap: 0.75rem;
  color: var(--text-muted);
  transition: var(--transition);
}

.kanban-column-add:hover .kanban-add-column {
  color: var(--primary);
}

.kanban-add-column i {
  font-size: 2rem;
}

.kanban-add-column span {
  font-size: 0.875rem;
  font-weight: 500;
}

/* ========================================
   Botones de icono pequeños
   ======================================== */

.btn-icon-sm {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.75rem;
}

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

.btn-whatsapp-mini {
  color: var(--whatsapp);
}

.btn-whatsapp-mini:hover {
  background: rgba(37, 211, 102, 0.2);
  color: var(--whatsapp);
}

/* ========================================
   Dropdown Menu
   ======================================== */

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 160px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition);
}

.dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(4px);
}

.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

.dropdown-menu a:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.dropdown-menu a.text-danger {
  color: var(--danger);
}

.dropdown-menu a.text-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.dropdown-menu a i {
  width: 16px;
  text-align: center;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.5rem 0;
}

/* ========================================
   Kanban Card - Mejoras
   ======================================== */

.kanban-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.kanban-card-info {
  flex: 1;
  min-width: 0;
}

.kanban-card-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  opacity: 0;
  transition: var(--transition);
}

.kanban-card:hover .kanban-card-actions {
  opacity: 1;
}

.kanban-card-email {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.kanban-card-email i {
  font-size: 0.625rem;
}

.kanban-card-notes {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.kanban-card-notes i {
  color: var(--accent);
}

/* ========================================
   Form extras
   ======================================== */

.form-color {
  height: 48px;
  padding: 0.25rem;
  cursor: pointer;
}

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

.ml-auto {
  margin-left: auto;
}

.flex-1 {
  flex: 1;
}

/* ========================================
   Search Box
   ======================================== */

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 400px;
}

.search-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  padding-left: 2.75rem;
  padding-right: 2.5rem;
}

.btn-clear-search {
  position: absolute;
  right: 0.5rem;
}

/* ========================================
   Lead Avatar con foto
   ======================================== */

.kanban-card-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  overflow: hidden;
}

.kanban-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ========================================
   Infinite Scroll Loading
   ======================================== */

.kanban-loading-more {
  text-align: center;
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.kanban-loading-more .spinner {
  width: 24px;
  height: 24px;
  margin: 0 auto;
}

/* ========================================
   Highlight para búsqueda
   ======================================== */

.kanban-card.hidden-by-search {
  display: none !important;
}

.kanban-card.highlight-search {
  border-color: var(--whatsapp);
  box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.3);
}

/* ========================================
   Zoom de foto de perfil
   ======================================== */

.modal-zoom {
  max-width: 400px;
}

.modal-zoom-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-zoom-body img {
  max-width: 100%;
  max-height: 350px;
  border-radius: var(--radius-lg);
  object-fit: contain;
}

/* ========================================
   Fila de teléfono con icono de correo
   ======================================== */

.kanban-card-phone-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-email-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 0.625rem;
  color: var(--primary-light);
  background: rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  text-decoration: none;
}

.btn-email-mini:hover {
  background: rgba(99, 102, 241, 0.4);
  color: var(--primary);
}

/* ========================================
   Etiquetas de WhatsApp Business
   ======================================== */

.kanban-card-tags-wa {
  margin-top: 0.25rem;
}

.kanban-tag-wa {
  padding: 0.125rem 0.5rem;
  font-size: 0.625rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  background: rgba(37, 211, 102, 0.2);
  color: var(--whatsapp);
}

/* ========================================
   Acciones de columna Kanban
   ======================================== */

.kanban-column-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dropdown-menu-column {
  min-width: 180px;
}

/* ========================================
   Modal de webhook de etapa
   ======================================== */

.webhook-etapa-info {
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.webhook-etapa-info p {
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.webhook-etapa-info ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.webhook-etapa-info li {
  color: var(--text-secondary);
  padding: 0.25rem 0;
  font-size: 0.75rem;
}

.webhook-etapa-info li::before {
  content: "• ";
  color: var(--primary-light);
}
