/* ============================================
   RESET & BASE
   ============================================ */

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

:root {
  /* Colors - Minimalista, neutros */
  --color-bg: #ffffff;
  --color-bg-secondary: #fafafa;
  --color-bg-tertiary: #f5f5f5;
  --color-border: #e5e5e5;
  --color-border-light: #f0f0f0;
  
  --color-text: #171717;
  --color-text-secondary: #737373;
  --color-text-tertiary: #a3a3a3;
  
  --color-primary: #0a0a0a;
  --color-primary-hover: #262626;
  
  --color-success: #16a34a;
  --color-error: #dc2626;
  --color-warning: #ea580c;
  
  --color-message-in: #ffffff;
  --color-message-out: #f5f5f5;
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  
  /* Typography - Light/Regular weights only */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 500;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  
  /* Hover */
  --color-bg-hover: #f0f0f0;
  
  /* Transitions */
  --transition: 150ms ease;
}

/* ============================================
   DARK MODE
   ============================================ */

[data-theme="dark"] {
  --color-bg: #0a0a0a;
  --color-bg-secondary: #141414;
  --color-bg-tertiary: #1f1f1f;
  --color-border: #2a2a2a;
  --color-border-light: #1f1f1f;
  
  --color-text: #f5f5f5;
  --color-text-secondary: #a3a3a3;
  --color-text-tertiary: #737373;
  
  --color-primary: #f5f5f5;
  --color-primary-hover: #d4d4d4;
  
  --color-success: #22c55e;
  --color-error: #ef4444;
  --color-warning: #f97316;
  
  --color-message-in: #1f1f1f;
  --color-message-out: #262626;
  
  --color-bg-hover: #1a1a1a;
}

/* Transición suave entre temas */
.theme-transition,
.theme-transition *,
.theme-transition *::before,
.theme-transition *::after {
  transition: background-color 300ms ease, 
              color 300ms ease, 
              border-color 300ms ease,
              box-shadow 300ms ease !important;
}

/* ============================================
   THEME TOGGLE BUTTON
   ============================================ */

/* Estilos para iconos de tema (funcionan en cualquier contenedor) */
.icon-sun {
  display: none;
}

.icon-moon {
  display: block;
}

[data-theme="dark"] .icon-sun {
  display: block;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

/* Botón flotante (fallback si no hay botón en header) */
.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10000;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 200ms ease;
}

.theme-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  border-color: var(--color-text-tertiary);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.15);
}

[data-theme="dark"] .theme-toggle:focus {
  box-shadow: 0 0 0 3px rgba(245, 245, 245, 0.2);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  color: var(--color-text);
  transition: transform 300ms ease, opacity 200ms ease;
}

/* Animación de rotación al cambiar */
.theme-toggle:hover svg {
  transform: rotate(15deg);
}

/* Mobile responsive para botón flotante */
@media (max-width: 768px) {
  .theme-toggle {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
  }
  
  .theme-toggle svg {
    width: 18px;
    height: 18px;
  }
}

/* Botón de tema integrado en header - NO es flotante */
#theme-toggle.btn-config,
#theme-toggle.btn-icon {
  position: static;
  width: auto;
  height: auto;
  border-radius: var(--space-sm);
  box-shadow: none;
  z-index: auto;
}

#theme-toggle.btn-config:hover,
#theme-toggle.btn-icon:hover {
  transform: none;
  box-shadow: none;
}

body {
  font-family: var(--font-family);
  font-weight: var(--font-weight-light);
  color: var(--color-text);
  background: var(--color-bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   TOAST NOTIFICATIONS - Minimalista
   ============================================ */

#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  position: relative;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 14px 18px;
  min-width: 320px;
  max-width: 400px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  pointer-events: auto;
  animation: toastSlideIn 0.3s ease-out;
  overflow: hidden;
}

.toast:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

.toast.removing {
  animation: toastSlideOut 0.25s ease-in forwards;
}

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

@keyframes toastSlideOut {
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.toast.success .toast-icon {
  color: #22c55e;
}

.toast.error .toast-icon {
  color: #ef4444;
}

.toast.warning .toast-icon {
  color: #f59e0b;
}

.toast.info .toast-icon {
  color: #3b82f6;
}

.toast.muted .toast-icon {
  color: #6b7280;
}

.toast-icon svg {
  width: 20px;
  height: 20px;
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 2px;
}

.toast-message {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  padding: 0;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  cursor: pointer;
  color: var(--color-text-tertiary);
  transition: color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-close:hover {
  color: var(--color-text);
}

.toast-close svg {
  width: 14px;
  height: 14px;
}

/* Progress Bar */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: currentColor;
  opacity: 0.3;
  animation: toastProgress linear;
  border-radius: 0 0 12px 12px;
}

.toast.success .toast-progress {
  background: #22c55e;
}

.toast.error .toast-progress {
  background: #ef4444;
}

.toast.warning .toast-progress {
  background: #f59e0b;
}

.toast.info .toast-progress {
  background: #3b82f6;
}

.toast.muted .toast-progress {
  background: #6b7280;
}

@keyframes toastProgress {
  from {
    width: 100%;
  }
  to {
    width: 0%;
  }
}

/* Responsive */
@media (max-width: 480px) {
  #toast-container {
    top: 16px;
    right: 16px;
    left: 16px;
  }
  
  .toast {
    min-width: auto;
    max-width: none;
  }
}

/* ============================================
   SCREENS
   ============================================ */

.screen {
  display: none;
}

.screen.active {
  display: block;
}

/* ============================================
   ICON SIDEBAR (Menú fijo de íconos - izquierda)
   ============================================ */

:root {
  --icon-sidebar-width: 48px;
}

.icon-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--icon-sidebar-width);
  background: #0a0a0a;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10001;
  padding: 14px 0;
}

/* Hide icon-sidebar on login screen */
#login-screen.active ~ .icon-sidebar {
  display: none !important;
}

.icon-sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.icon-sidebar-logo svg {
  width: 24px;
  height: 24px;
}

.icon-sidebar-logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.icon-sidebar-divider {
  width: 24px;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin-bottom: 14px;
  flex-shrink: 0;
}

.icon-sidebar-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  width: 100%;
  padding: 0 6px;
}

.icon-sidebar-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  transition: all 220ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.icon-sidebar-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
}

.icon-sidebar-item.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.icon-sidebar-item svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

/* Bell with notification dot */
.icon-sidebar-bell-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-sidebar-notification-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 7px;
  height: 7px;
  background: #2ecc71;
  border-radius: 50%;
  border: 1.5px solid #0a0a0a;
}

/* Bottom section - Notifications, Settings & Avatar */
.icon-sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 6px 12px;
}

.icon-sidebar-bottom-divider {
  width: 24px;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 4px 0;
}

.icon-sidebar-avatar {
  text-decoration: none;
}

.icon-sidebar-avatar-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  transition: all 220ms ease;
  cursor: pointer;
}

.icon-sidebar-avatar-circle:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* Responsive: hide icon sidebar on mobile */
@media (max-width: 768px) {
  .icon-sidebar {
    display: none;
  }
  :root {
    --icon-sidebar-width: 0px;
  }
}

/* ============================================
   NAV SIDEBAR (Menú lateral izquierdo)
   ============================================ */

.nav-sidebar {
  position: fixed;
  left: var(--icon-sidebar-width);
  top: 0;
  bottom: 0;
  width: 240px;
  background: #ffffff !important;
  border-right: 1px solid #e8e8eb;
  display: flex !important;
  flex-direction: column;
  z-index: 10000;
  transition: width 300ms cubic-bezier(0.4, 0, 0.2, 1);
  overflow: visible; /* Permitir que el badge se vea cuando está colapsado */
}

/* Ocultar nav-sidebar en pantalla de login */
#login-screen.active ~ .nav-sidebar {
  display: none !important;
}

.nav-sidebar.collapsed {
  width: 64px !important;
}

/* Sidebar Brand Area */
.nav-sidebar-brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 16px 18px;
  border-bottom: none;
  position: relative;
}

.nav-sidebar-brand-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.nav-sidebar-brand-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Logo Text */
.nav-sidebar-logo-text {
  font-size: 20px;
  font-weight: 600;
  color: #2a2a30;
  letter-spacing: -0.3px;
  white-space: nowrap;
  line-height: 1;
}

.nav-sidebar-logo-text .brand-name {
  color: #2a2a30;
}

.nav-sidebar-logo-text .ia-highlight {
  color: #8b8b96;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 1.5px;
  margin-left: 4px;
}

.nav-sidebar-brand-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  padding-left: 2px;
}

/* 🎯 Avatar Card - Tarjeta de usuario clickeable */
.nav-sidebar-avatar-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  margin: 4px 0 0 -4px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  overflow: hidden;
}

.nav-sidebar-avatar-card:hover {
  background: rgba(0, 0, 0, 0.035);
  border-color: rgba(0, 0, 0, 0.06);
}

.nav-sidebar-avatar-card:active {
  background: rgba(0, 0, 0, 0.05);
}

/* Avatar cuadrado redondeado - tema neutral */
.nav-sidebar-avatar-sq {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 8px;
  background: #f0f0f3;
  color: #5a5a65;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
}

.nav-sidebar-avatar-card:hover .nav-sidebar-avatar-sq {
  background: #e8e8ed;
  color: #3a3a42;
}

/* Info del avatar */
.nav-sidebar-avatar-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.nav-sidebar-avatar-info .nav-sidebar-org-name {
  font-size: 13px;
  font-weight: 500;
  color: #2a2a30;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.nav-sidebar-avatar-info .nav-sidebar-email {
  font-size: 11px;
  color: #9a9aa5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* Chevron */
.nav-sidebar-avatar-chevron {
  flex-shrink: 0;
  color: #c8c8d0;
  transition: all 0.2s ease;
}

.nav-sidebar-avatar-card:hover .nav-sidebar-avatar-chevron {
  color: #9a9aa5;
  transform: translateX(1px);
}

/* === Estados colapsado === */
.nav-sidebar.collapsed .nav-sidebar-avatar-card {
  justify-content: center;
  padding: 6px;
  margin: 4px auto 0;
  border-radius: 8px;
  width: fit-content;
}

.nav-sidebar.collapsed .nav-sidebar-avatar-info,
.nav-sidebar.collapsed .nav-sidebar-avatar-chevron {
  display: none;
}

.nav-sidebar.collapsed .nav-sidebar-avatar-sq {
  width: 30px;
  height: 30px;
  min-width: 30px;
  font-size: 12px;
  border-radius: 7px;
}

.nav-sidebar-greeting {
  font-size: 11.5px;
  font-weight: 400;
  color: #9a9aa5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.nav-sidebar.collapsed .nav-sidebar-greeting {
  display: none;
}

.nav-sidebar.collapsed .nav-sidebar-brand-title {
  align-items: center;
}

.nav-sidebar-email {
  font-size: 11px;
  color: #9a9aa5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-sidebar.collapsed .nav-sidebar-brand {
  align-items: center;
  padding: 14px 0 12px;
}

.nav-sidebar.collapsed .nav-sidebar-brand-top {
  justify-content: center;
}

.nav-sidebar.collapsed .nav-sidebar-logo-text .brand-name {
  display: none;
}

.nav-sidebar.collapsed .nav-sidebar-logo-text {
  font-size: 13px;
}

.nav-sidebar.collapsed .nav-sidebar-logo-text .ia-highlight {
  margin-left: 0;
  font-size: 13px;
}

.nav-sidebar-toggle {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.04);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9a9aa5;
  transition: all 200ms ease;
  z-index: 2;
}

.nav-sidebar.collapsed .nav-sidebar-toggle {
  display: none;
}

.nav-sidebar-toggle:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #3a3a42;
}

.nav-sidebar-toggle svg {
  transition: transform 300ms ease;
}

.nav-sidebar:not(.collapsed) .nav-sidebar-toggle svg {
  transform: rotate(180deg);
}

.nav-sidebar-nav {
  margin-top: 0;
  padding: 24px 8px 12px;
  flex: 1;
  overflow-y: auto;
  overflow-x: visible;
}

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

.nav-sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.nav-sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 2px;
}

.nav-sidebar-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  color: #6b6b76;
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  transition: all 200ms ease;
  margin-bottom: 4px;
  white-space: nowrap;
  cursor: pointer;
  overflow: visible;
}

.nav-sidebar-item:hover {
  background: #f5f5f7;
  color: #1a1a1f;
}

.nav-sidebar-item.active {
  background: #f0f0f3;
  color: #1a1a1f;
  font-weight: 500;
}

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

.nav-sidebar-text {
  opacity: 1;
  transition: opacity 150ms ease;
  white-space: nowrap;
}

.nav-sidebar.collapsed .nav-sidebar-text {
  display: none;
}

.nav-sidebar-status-dot {
  position: absolute;
  right: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #737373;
  opacity: 0;
  transition: all 200ms ease;
}

.nav-sidebar.collapsed .nav-sidebar-status-dot {
  right: auto;
  left: 36px;
  top: 7px;
  width: 5px;
  height: 5px;
}

.nav-sidebar-item.status-connected .nav-sidebar-status-dot {
  background: #22c55e;
  opacity: 1;
}

.nav-sidebar-item.status-connecting .nav-sidebar-status-dot {
  background: #ea580c;
  opacity: 1;
  animation: pulse 2s ease-in-out infinite;
}

.nav-sidebar-item.status-error .nav-sidebar-status-dot {
  background: #dc2626;
  opacity: 1;
}

/* Badge "nuevo" */
.nav-sidebar-badge {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(34, 197, 94, 0.3);
  animation: pulse-badge 2s ease-in-out infinite;
  z-index: 1000; /* Asegurar que se vea por encima */
}

.nav-sidebar.collapsed .nav-sidebar-badge {
  right: auto;
  left: 34px;
  top: 6px;
  transform: none;
  font-size: 8px;
  padding: 1px 4px;
  z-index: 1001; /* Mayor z-index cuando está colapsado */
}

@keyframes pulse-badge {
  0%, 100% {
    box-shadow: 0 2px 4px rgba(34, 197, 94, 0.3);
  }
  50% {
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.6), 0 0 12px rgba(34, 197, 94, 0.4);
  }
}

/* 🌟 EFECTO SUTIL IA PARA ICONO DE SOPORTE IA */
#nav-sidebar-support {
  position: relative;
  overflow: visible;
}

#nav-sidebar-support::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(139, 92, 246, 0.18) 0%,
    rgba(59, 130, 246, 0.12) 40%,
    transparent 70%
  );
  filter: blur(6px);
  opacity: 1;
  animation: nebula-glow 4s ease-in-out infinite;
  z-index: -1;
  pointer-events: none;
}

/* Efecto de brillo sutil en el icono SVG */
.nav-sidebar-icon-gradient {
  position: relative;
  filter: drop-shadow(0 0 2px rgba(139, 92, 246, 0.35));
  animation: icon-glow 4s ease-in-out infinite;
}

/* 🌈 EFECTO NEBULOSA PARA TODOS LOS ITEMS DEL MENÚ AL HACER HOVER */
.nav-sidebar-item::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.1) 25%, rgba(236, 72, 153, 0.05) 50%, transparent 70%);
  filter: blur(6px);
  opacity: 0;
  transition: opacity 300ms ease;
  z-index: -1;
  pointer-events: none;
}

.nav-sidebar-item:hover::before {
  opacity: 1;
  animation: nebula-hover 2s ease-in-out infinite;
}

@keyframes nebula-hover {
  0%, 100% {
    transform: translateY(-50%) scale(0.95);
    box-shadow: 
      0 0 10px rgba(59, 130, 246, 0.2),
      0 0 20px rgba(139, 92, 246, 0.15);
  }
  50% {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 
      0 0 15px rgba(59, 130, 246, 0.3),
      0 0 30px rgba(139, 92, 246, 0.2);
  }
}

@keyframes nebula-glow {
  0%, 100% {
    transform: translateY(-50%) scale(0.95);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-50%) scale(1.05);
    opacity: 1;
  }
}

@keyframes icon-glow {
  0%, 100% {
    filter: drop-shadow(0 0 2px rgba(139, 92, 246, 0.35));
  }
  50% {
    filter: drop-shadow(0 0 4px rgba(139, 92, 246, 0.5)) drop-shadow(0 0 8px rgba(59, 130, 246, 0.25));
  }
}

.nav-sidebar-divider {
  height: 1px;
  background: #ececef;
  margin: 12px 8px;
}

/* Footer en sidebar (version + cookies) */
.nav-sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 14px;
  border-top: 1px solid #ececef;
  margin-top: auto;
  flex-shrink: 0;
}

.nav-sidebar-footer-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  color: #b0b0b8;
  transition: all 200ms ease;
  text-decoration: none;
}

.nav-sidebar-footer-icon:hover {
  color: #6b6b76;
  background: #f5f5f7;
}

.footer-separator {
  font-size: 10px;
  color: #d0d0d5;
}

.footer-company {
  font-size: 10px;
  color: #b0b0b8;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.nav-sidebar-footer .version-number {
  font-size: 10px;
  color: #b0b0b8;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.3px;
}

.nav-sidebar.collapsed .nav-sidebar-footer {
  flex-direction: column;
  gap: 2px;
  padding: 8px 4px;
}

.nav-sidebar.collapsed .footer-separator,
.nav-sidebar.collapsed .footer-company {
  display: none;
}

.nav-sidebar.collapsed .nav-sidebar-footer .version-number {
  font-size: 7px;
}

.nav-sidebar.collapsed .nav-sidebar-footer .version-number {
  font-size: 8px;
}

/* ============================================
   COOKIE POLICY MODAL
   ============================================ */

.cookies-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}

.cookies-modal {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  width: 520px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
}

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

.cookies-modal-header h3 {
  font-size: 1rem;
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  margin: 0;
}

.cookies-modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--color-text-tertiary);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color var(--transition);
}

.cookies-modal-close:hover {
  color: var(--color-text);
}

.cookies-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.cookies-modal-body h4 {
  font-size: 0.85rem;
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  margin: 20px 0 8px;
}

.cookies-modal-body h4:first-of-type {
  margin-top: 12px;
}

.cookies-modal-body p {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0 0 8px;
}

.cookies-updated {
  font-size: 0.75rem !important;
  color: var(--color-text-tertiary) !important;
  font-style: italic;
}

.cookie-type {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin: 8px 0;
}

.cookie-type p {
  margin: 6px 0 0;
  font-size: 0.78rem;
}

.cookie-type-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cookie-type-header strong {
  font-size: 0.82rem;
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
}

.cookie-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cookie-badge {
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--color-bg-tertiary);
  color: var(--color-text-tertiary);
  font-weight: var(--font-weight-medium);
}

.cookie-badge.required {
  background: rgba(22, 163, 74, 0.1);
  color: var(--color-success);
}

.cookies-footer-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--color-border-light);
  font-size: 0.72rem;
  color: var(--color-text-tertiary);
}

.cookies-modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--color-border-light);
  display: flex;
  justify-content: flex-end;
}

.cookies-btn-accept {
  padding: 8px 24px;
  background: var(--color-primary);
  color: var(--color-bg);
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: var(--font-weight-medium);
  font-family: var(--font-family);
  cursor: pointer;
  transition: all var(--transition);
}

.cookies-btn-accept:hover {
  opacity: 0.85;
}

/* Tooltips cuando está colapsado */
.sidebar.collapsed .nav-sidebar-item::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 12px;
  padding: 6px 12px;
  background: #1f1f1f;
  color: #ffffff;
  font-size: 13px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sidebar.collapsed .nav-sidebar-item:hover::after {
  opacity: 1;
}

/* Ajuste del dashboard cuando sidebar está activo */
#dashboard-screen {
  padding-left: calc(var(--icon-sidebar-width) + 64px);
  transition: padding-left 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

#dashboard-screen.nav-sidebar-expanded {
  padding-left: calc(var(--icon-sidebar-width) + 240px);
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  
  #dashboard-screen {
    padding-left: 0 !important;
  }
}

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

/* ============================================
   LOGIN
   ============================================ */

#login-screen {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
}

#login-screen.active {
  display: flex;
}

#login-screen:not(.active) .login-topbar {
  display: none !important;
}

/* Login Top Bar */
.login-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  pointer-events: none;
}

.login-logo {
  height: 36px;
  width: auto;
  pointer-events: auto;
  filter: invert(1);
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.login-logo:hover {
  opacity: 1;
}

[data-theme="dark"] .login-logo {
  filter: none;
  opacity: 0.9;
}

[data-theme="dark"] .login-logo:hover {
  opacity: 1;
}

.login-topbar-right {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-topbar-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.login-topbar-link:hover {
  color: var(--color-text);
  background: var(--color-bg-secondary);
}

.login-topbar-link--referral {
  display: flex;
  align-items: center;
  gap: 6px;
}

.login-topbar-link--referral svg {
  flex-shrink: 0;
}

.login-topbar-link--register {
  color: var(--color-text);
}

.login-theme-toggle {
  pointer-events: auto;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all 0.2s ease;
}

.login-theme-toggle:hover {
  color: var(--color-text);
  background: var(--color-bg-secondary);
  border-color: var(--color-text-tertiary);
}

/* ============================================
   LOGIN SIDEBAR (Decorativo - solo iconos)
   ============================================ */
.login-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 56px;
  background: var(--color-bg);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 100;
  padding: 16px 0;
}

.login-sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.login-sidebar-logo {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  letter-spacing: 1.5px;
}

.login-sidebar-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
  width: 100%;
  padding: 0 8px;
}

.login-sidebar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--color-text-tertiary);
  cursor: default;
  transition: all 200ms ease;
}

.login-sidebar-icon:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text-secondary);
}

.login-sidebar-icon svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.login-sidebar-divider {
  width: 24px;
  height: 1px;
  background: var(--color-border);
  margin: 8px 0;
}

.login-sidebar-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 8px 8px;
  border-top: 1px solid var(--color-border);
  margin-top: auto;
  padding-top: 8px;
}

/* Login notification dot */
.login-sidebar-bell-wrapper {
  position: relative;
}

.login-notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background: #ef4444;
  border-radius: 50%;
  border: 1.5px solid var(--color-bg);
}

/* Login notification panel */
.login-notif-panel {
  position: fixed;
  left: 62px;
  bottom: 16px;
  width: 320px;
  max-height: 420px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: loginNotifSlideIn 0.2s ease;
}

@keyframes loginNotifSlideIn {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--color-border);
}

.login-notif-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.2px;
}

.login-notif-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-tertiary);
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.login-notif-close:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text);
}

.login-notif-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  max-height: 360px;
}

.login-notif-list::-webkit-scrollbar {
  width: 4px;
}

.login-notif-list::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
  border-radius: 2px;
}

/* Notification items */
.login-notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background 0.15s ease;
  cursor: default;
}

.login-notif-item:hover {
  background: var(--color-bg-secondary);
}

.login-notif-item + .login-notif-item {
  margin-top: 2px;
}

.login-notif-item-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.login-notif-item-icon.info {
  background: rgba(59, 130, 246, 0.1);
  color: #3B82F6;
}

.login-notif-item-icon.success {
  background: rgba(16, 185, 129, 0.1);
  color: #10B981;
}

.login-notif-item-icon.warning {
  background: rgba(245, 158, 11, 0.1);
  color: #F59E0B;
}

.login-notif-item-icon.update {
  background: rgba(139, 92, 246, 0.1);
  color: #8B5CF6;
}

.login-notif-item-icon.promo {
  background: rgba(236, 72, 153, 0.1);
  color: #EC4899;
}

.login-notif-item-content {
  flex: 1;
  min-width: 0;
}

.login-notif-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.3;
  margin-bottom: 2px;
}

.login-notif-item-msg {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.login-notif-item-time {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-top: 4px;
}

.login-notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  gap: 8px;
}

.login-notif-empty span {
  font-size: 13px;
  color: var(--color-text-tertiary);
}

/* ─── Login Support Chat Panel ─── */
.login-support-panel {
  position: fixed;
  left: 62px;
  bottom: 16px;
  width: 360px;
  height: 480px;
  max-height: calc(100vh - 32px);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  z-index: 10002;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: loginNotifSlideIn 0.2s ease;
}

.login-support-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
}

.login-support-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.login-support-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-support-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.login-support-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--color-bg-secondary);
}

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

.login-support-msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
}

.login-support-msg--bot {
  align-self: flex-start;
}

.login-support-msg--user {
  align-self: flex-end;
}

.login-support-msg--bot .login-support-msg-bubble {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 14px 14px 14px 4px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text);
}

.login-support-msg--user .login-support-msg-bubble {
  background: #000;
  color: #fff;
  border-radius: 14px 14px 4px 14px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
}

[data-theme="dark"] .login-support-msg--user .login-support-msg-bubble {
  background: #333;
}

.login-support-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.login-support-quick-btn {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-family: inherit;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.login-support-quick-btn:hover {
  border-color: var(--color-text-tertiary);
  color: var(--color-text);
  background: var(--color-bg);
}

.login-support-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
}

.login-support-input {
  flex: 1;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  font-family: inherit;
  background: var(--color-bg-secondary);
  color: var(--color-text);
  outline: none;
  transition: border-color 0.15s ease;
}

.login-support-input:focus {
  border-color: var(--color-text-tertiary);
}

.login-support-input::placeholder {
  color: var(--color-text-tertiary);
}

.login-support-send {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  background: #000;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.login-support-send:hover {
  transform: scale(1.05);
}

[data-theme="dark"] .login-support-send {
  background: #e5e5e5;
  color: #000;
}

.login-support-typing {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  align-items: center;
}

.login-support-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-text-tertiary);
  animation: supportTyping 1.2s infinite;
}

.login-support-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.login-support-typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes supportTyping {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

@media (max-width: 768px) {
  .login-support-panel {
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
  }
}

/* Login container shift for sidebar */
#login-screen .login-container {
  padding-left: 56px;
}

#login-screen .login-topbar {
  padding-left: 72px;
}

/* Responsive: hide login sidebar on mobile */
@media (max-width: 768px) {
  .login-sidebar {
    display: none;
  }
  #login-screen .login-container {
    padding-left: 0;
  }
  #login-screen .login-topbar {
    padding-left: 16px;
  }
}

.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--color-bg);
}

.login-box {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 40px 36px 32px;
  width: 100%;
  max-width: 400px;
  margin-top: auto;
  margin-bottom: auto;
  transform: translateY(70px);
}

/* Login Greeting */
.login-greeting-area {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.login-greeting-text {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.login-greeting-emoji {
  font-size: 26px;
  line-height: 1;
}

.login-welcome-msg {
  font-size: 15px;
  color: var(--color-text-secondary);
  margin-bottom: 28px;
  font-weight: 400;
}

.login-welcome-msg strong {
  color: var(--color-text);
  font-weight: 600;
}

.logo {
  font-size: 24px;
  font-weight: var(--font-weight-normal);
  margin-bottom: var(--space-xs);
  letter-spacing: -0.5px;
}

.subtitle {
  color: var(--color-text-secondary);
  font-size: 14px;
  margin-bottom: var(--space-xs);
  font-weight: var(--font-weight-medium);
}

.subtitle-small {
  color: var(--color-text-tertiary);
  font-size: 12px;
  margin-bottom: var(--space-lg);
}

.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 42px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-tertiary);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.password-toggle:hover {
  color: var(--color-text-secondary);
}

.password-toggle .eye-closed {
  display: none;
}

.password-toggle.active .eye-open {
  display: none;
}

.password-toggle.active .eye-closed {
  display: block;
}

.login-footer {
  text-align: left;
  margin-top: var(--space-md);
}

.login-link {
  color: var(--color-text-secondary);
  font-size: 13px;
  text-decoration: none;
  transition: color var(--transition);
}

.login-link:hover {
  color: var(--color-text);
}

/* ── Login + Recovery form — inputs modernos ──── */

#login-form .input-group,
#forgot-password-form .input-group {
  margin-bottom: 12px;
}

#login-form .input-group input,
#forgot-password-form .input-group input {
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 15px;
  background: var(--color-bg-secondary);
  border: 1.5px solid var(--color-border);
  color: var(--color-text);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

#login-form .input-group input::placeholder,
#forgot-password-form .input-group input::placeholder {
  color: var(--color-text-tertiary);
  font-size: 14px;
}

#login-form .input-group input:focus,
#forgot-password-form .input-group input:focus {
  outline: none;
  border-color: var(--color-text-tertiary);
  background: var(--color-bg);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-text) 6%, transparent);
}

/* Botón principal del login y recuperación */
#login-form .btn-primary,
#login-form #btn-send-otp,
#login-form #btn-verify-otp,
#forgot-password-form .btn-primary,
#forgot-submit,
#rec-verify-btn {
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  letter-spacing: -0.1px;
}

/* Modal recuperación: ocultar label (placeholder ya describe el campo) */
#forgot-password-form .input-group label {
  display: none;
}

/* Captcha match */
/* ── Captcha ─────────────────────────────────── */

.captcha-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-bg-secondary);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s;
}

.captcha-row:hover {
  border-color: var(--color-text-tertiary);
}

.captcha-row.captcha-checked {
  border-color: #22c55e;
}

.captcha-check {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 2px solid var(--color-border);
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
  position: relative;
}

.captcha-row.captcha-checked .captcha-check {
  background: #22c55e;
  border-color: #22c55e;
  color: #fff;
}

.captcha-checkmark {
  width: 14px;
  height: 14px;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.2s, transform 0.2s;
}

.captcha-row.captcha-checked .captcha-checkmark {
  opacity: 1;
  transform: scale(1);
}

.captcha-label {
  flex: 1;
  font-size: 14px;
  color: var(--color-text);
}

.captcha-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.captcha-brand-text {
  font-size: 9px;
  font-weight: 700;
  color: var(--color-text-tertiary);
  letter-spacing: 0.3px;
}

.captcha-brand-sub {
  font-size: 8px;
  color: var(--color-text-tertiary);
}

/* ── OTP Code Entry ─────────────────────────── */

.otp-sent-msg {
  font-size: 13px;
  color: var(--color-text-secondary);
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.5;
}

.otp-digits {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}

.otp-digit {
  width: 46px;
  height: 56px;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-bg-secondary);
  color: var(--color-text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  font-family: 'Courier New', monospace;
  caret-color: transparent;
}

.otp-digit:focus {
  border-color: var(--color-text-tertiary);
  background: var(--color-bg);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-text) 6%, transparent);
}

.otp-digit:disabled {
  opacity: 0.5;
}

.btn-back-link {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-secondary);
  cursor: pointer;
  background: none;
  border: none;
  margin-top: 10px;
  padding: 6px;
  transition: color 0.2s;
  text-decoration: underline;
}

.btn-back-link:hover {
  color: var(--color-text);
}

.otp-resend-line {
  text-align: center;
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-top: 16px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  text-decoration: underline;
  font-size: 13px;
  padding: 0;
  font-family: inherit;
  transition: color 0.2s;
}

.link-btn:hover {
  color: var(--color-text);
}

.link-btn:disabled {
  opacity: 0.45;
  cursor: default;
  text-decoration: none;
}

#otp-countdown {
  color: var(--color-text-tertiary);
  font-size: 12px;
  margin-left: 2px;
}

/* ─────────────────────────────────────────────── */

.login-divider {
  color: var(--color-text-tertiary);
  margin: 0 var(--space-sm);
}

.login-social-icons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: auto;
}

.login-social-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  color: var(--color-text-tertiary);
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}

.login-social-icon:hover {
  color: var(--color-text);
  border-color: var(--color-text-secondary);
}

.login-footer-copy {
  text-align: center;
  color: var(--color-text-tertiary);
  font-size: 11px;
  margin-top: 8px;
  padding-bottom: 24px;
}

.login-legal {
  text-align: left;
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
  line-height: 1.6;
}

.login-legal a {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.login-legal a:hover {
  color: var(--color-text);
}

.login-signup {
  text-align: left;
  font-size: 13px;
  color: var(--color-text-tertiary);
  margin-top: var(--space-md);
}

.login-signup a {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-weight: 400;
  transition: color 0.2s ease;
}

.login-signup a:hover {
  text-decoration: underline;
}

/* Admin Access Icon */
.admin-access-icon {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary);
  opacity: 0.3;
  transition: opacity 0.2s ease, color 0.2s ease;
  text-decoration: none;
  border-radius: 6px;
}

.admin-access-icon:hover {
  opacity: 1;
  color: var(--color-text-secondary);
  background: var(--color-bg-tertiary);
}



/* ============================================
   MODAL
   ============================================ */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
  cursor: pointer;
}

.modal-content {
  position: relative;
  z-index: 1; /* Asegurar que esté por encima del overlay */
  pointer-events: auto; /* Asegurar que puede recibir clicks */
  background: var(--color-bg);
  border-radius: 12px;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

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

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

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

.modal-title {
  font-size: 18px;
  font-weight: var(--font-weight-medium);
  letter-spacing: -0.3px;
}

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

.modal-close:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-text);
}

.modal-body {
  padding: var(--space-lg);
}

.modal-description {
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-lg);
}

.modal-description strong {
  color: var(--color-primary);
  font-weight: var(--font-weight-medium);
}

/* ═══════════════════════════════════════════
   Rating Modal (Califícanos)
   ═══════════════════════════════════════════ */

.modal-rating {
  max-width: 440px;
}

.rating-modal-body {
  padding: 20px 24px 24px;
}

.rating-subtitle {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

.rating-aspects {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.rating-aspect {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--color-bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--color-border);
  transition: all 0.2s ease;
}

.rating-aspect:hover {
  border-color: #d0d0d0;
}

.rating-aspect-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  letter-spacing: -0.1px;
}

.rating-stars {
  display: flex;
  gap: 4px;
}

.rating-stars .star {
  font-size: 20px;
  color: #d4d4d4;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  line-height: 1;
}

.rating-stars .star:hover,
.rating-stars .star.hovered {
  color: #fbbf24;
  transform: scale(1.15);
}

.rating-stars .star.active {
  color: #f59e0b;
}

.rating-comment-area {
  margin-bottom: 18px;
}

.rating-comment-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 8px;
}

.rating-comment {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-bg);
  resize: vertical;
  min-height: 64px;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

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

.rating-submit-btn {
  width: 100%;
  padding: 11px 16px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: -0.1px;
}

.rating-submit-btn:hover {
  background: linear-gradient(135deg, #5558e6, #7c4fe0);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

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

.rating-thank-you {
  text-align: center;
  padding: 24px 0 8px;
}

.rating-thank-you.hidden {
  display: none;
}

.rating-thank-icon {
  font-size: 42px;
  margin-bottom: 12px;
  animation: thankPulse 1.5s ease infinite;
}

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

.rating-thank-you h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}

.rating-thank-you p {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* Nav sidebar rate item */
.nav-sidebar-rate {
  color: var(--color-text-secondary);
}

.nav-sidebar-rate:hover {
  color: #f59e0b;
}

.nav-sidebar-rate:hover svg {
  color: #f59e0b;
}

/* ═══════════════════════════════════════════
   App Store Badges (Sidebar)
   ═══════════════════════════════════════════ */

.nav-sidebar-app-badges {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  margin: 2px 0;
}

.app-badge-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
}

.app-badge-btn:hover {
  border-color: #6366f1;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.04);
}

.app-badge-btn .nav-sidebar-text {
  font-size: 11px;
  white-space: nowrap;
}

.app-badge-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Sidebar collapsed */
.nav-sidebar.collapsed .nav-sidebar-app-badges {
  flex-direction: column;
  padding: 4px 8px;
}

.nav-sidebar.collapsed .app-badge-btn {
  justify-content: center;
  padding: 6px;
}

.nav-sidebar.collapsed .app-badge-btn .nav-sidebar-text {
  display: none;
}

/* ═══════════════════════════════════════════
   App Coming Soon Modal
   ═══════════════════════════════════════════ */

.modal-app-coming {
  max-width: 480px;
}

.app-coming-body {
  padding: 20px 24px 24px;
}

.app-coming-hero {
  text-align: left;
  margin-bottom: 24px;
}

.app-coming-badges {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.app-store-badge {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 500;
}

.app-store-badge svg {
  width: 20px;
  height: 20px;
  opacity: 0.7;
}

.app-coming-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.app-coming-desc {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.app-coming-desc strong {
  color: var(--color-text);
  font-weight: 600;
}

/* ── Timeline ── */

.app-timeline {
  position: relative;
  padding: 4px 0 4px 36px;
  margin-bottom: 20px;
}

.app-timeline-line {
  display: none;
}

.app-timeline-progress {
  display: none;
}

.app-timeline-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 10px 0;
}

.app-timeline-item:last-child {
  padding-bottom: 0;
}

.app-timeline-dot {
  position: absolute;
  left: -36px;
  top: 12px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 1;
  background: var(--color-bg);
}

/* Completed dot */
.app-timeline-item.completed .app-timeline-dot {
  border: 1.5px solid var(--color-text);
}

/* In-progress dot */
.app-timeline-item.in-progress .app-timeline-dot {
  border: 1.5px solid var(--color-text);
}

.dot-pulse {
  width: 6px;
  height: 6px;
  background: var(--color-text);
  border-radius: 50%;
  animation: dotPulseAnim 1.5s ease infinite;
}

@keyframes dotPulseAnim {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.6); }
}

/* Upcoming dot */
.app-timeline-item.upcoming .app-timeline-dot {
  border: 1.5px solid var(--color-border);
}

.app-timeline-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0;
}

.app-timeline-date {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.app-timeline-item.upcoming .app-timeline-date {
  color: var(--color-text-secondary);
  opacity: 0.5;
}

.app-timeline-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.1px;
}

.app-timeline-item.upcoming .app-timeline-label {
  color: var(--color-text-secondary);
}

.app-timeline-detail {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.app-timeline-item.upcoming .app-timeline-detail {
  opacity: 0.5;
}

/* In-progress item highlight */
.app-timeline-item.in-progress .app-timeline-content {
  background: var(--color-bg-secondary);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  margin: -4px -8px;
}

.app-timeline-item.in-progress .app-timeline-label {
  color: var(--color-text);
}

/* Footer note */
.app-coming-footer-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--color-bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--color-border);
}

.app-coming-sparkle {
  font-size: 20px;
  flex-shrink: 0;
}

.app-coming-footer-note p {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin: 0;
}

.app-coming-footer-note p strong {
  color: var(--color-text);
}

/* Referral Benefits */
.referral-benefits {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  background: var(--color-bg-secondary);
  border-radius: 8px;
}

.benefit-item {
  flex: 1;
  text-align: center;
}

.benefit-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  margin: 0 auto var(--space-sm);
}

.benefit-text {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.input-hint {
  display: block;
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-top: 4px;
}

.success-message {
  padding: var(--space-md);
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 6px;
  color: var(--color-success);
  font-size: 13px;
  margin-top: var(--space-md);
  text-align: center;
}

.success-message.hidden {
  display: none;
}

.error-message {
  padding: var(--space-md);
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  color: #dc2626;
  font-size: 13px;
  margin-top: var(--space-md);
  text-align: center;
}

.error-message.hidden {
  display: none;
}

.input-group {
  margin-bottom: var(--space-md);
}

.input-group label {
  display: block;
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xs);
}

.input-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition);
}

.input-group input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.btn-primary {
  width: 100%;
  padding: 10px 16px;
  background: var(--color-text);
  color: var(--color-bg);
  border: 1px solid var(--color-text);
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  font-weight: normal;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-primary:hover {
  opacity: 0.8;
}

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

.btn-secondary {
  padding: 8px 16px;
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  font-weight: normal;
  cursor: pointer;
  transition: border-color 0.2s;
}

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

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

.btn-text {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  padding: 6px 8px;
  transition: color var(--transition);
}

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

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

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

.error-message {
  color: var(--color-error);
  font-size: 13px;
  margin-top: var(--space-md);
  display: none;
}

.error-message.show {
  display: block;
}

/* ============================================
   DASHBOARD LAYOUT
   ============================================ */

/* System Notifications */
.system-notifications {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
  max-width: 420px;
  width: calc(100vw - 48px);
  pointer-events: none;
}

.system-notification {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: 8px;
  background: var(--color-bg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--color-border);
  animation: notifSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto;
}

.system-notification.info {
  background: var(--color-bg);
}

.system-notification.success {
  background: var(--color-bg);
}

.system-notification.warning {
  background: var(--color-bg);
}

.system-notification.error {
  background: var(--color-bg);
}

.system-notification-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.system-notification.info .system-notification-icon { color: var(--color-primary); }
.system-notification.success .system-notification-icon { color: #16a34a; }
.system-notification.warning .system-notification-icon { color: #ea580c; }
.system-notification.error .system-notification-icon { color: #dc2626; }

.system-notification-content {
  flex: 1;
  min-width: 0;
}

.system-notification-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
}

.system-notification-message {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-top: 4px;
  line-height: 1.5;
}

.system-notification-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  color: var(--color-text-tertiary);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease;
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 24px;
  line-height: 1;
  font-weight: 300;
}

.system-notification-close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--color-text);
  transform: scale(1.1);
}

.system-notification-close:active {
  transform: scale(0.95);
}

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

.system-notification.removing {
  animation: notifSlideOut 0.25s ease forwards;
}

@keyframes notifSlideOut {
  to {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
  }
}

@media (max-width: 768px) {
  .system-notifications {
    bottom: 16px;
    right: 16px;
    max-width: calc(100vw - 32px);
    width: calc(100vw - 32px);
  }
  
  .system-notification {
    padding: 12px;
  }
}

/* ============================================
   NOTIFICATIONS MODAL
   ============================================ */

.modal-notifications {
  max-width: 440px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-notifications .modal-header {
  padding: 20px 24px 16px;
  border-bottom: none;
}

.notif-modal-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notif-modal-badge {
  background: var(--color-primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.notif-modal-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.notif-mark-all-read {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.notif-mark-all-read:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-primary);
}

/* Tabs */
.notif-modal-tabs {
  display: flex;
  gap: 0;
  padding: 0 24px;
  border-bottom: 1px solid var(--color-border);
}

.notif-tab {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.notif-tab:hover {
  color: var(--color-text);
}

.notif-tab.active {
  color: var(--color-text);
  border-bottom-color: var(--color-text);
}

/* Body */
.notif-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 !important;
  min-height: 200px;
}

/* Loading state */
.notif-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 24px;
  color: var(--color-text-secondary);
  font-size: 13px;
}

.notif-loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-text-secondary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Empty state */
.notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px 24px;
  text-align: center;
}

.notif-empty p {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin: 0;
}

.notif-empty span {
  font-size: 12px;
  color: var(--color-text-tertiary);
}

/* Notification list */
.notif-list {
  display: flex;
  flex-direction: column;
}

/* Individual notification item */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--color-border);
  cursor: default;
  transition: background 0.15s ease;
  position: relative;
}

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

.notif-item:hover {
  background: var(--color-bg-secondary);
}

.notif-item.unread {
  background: rgba(0, 0, 0, 0.015);
}

.notif-item.unread::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
}

/* Icon */
.notif-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
}

.notif-item-icon.info {
  background: rgba(59, 130, 246, 0.08);
  color: #3b82f6;
}

.notif-item-icon.success {
  background: rgba(22, 163, 74, 0.08);
  color: #16a34a;
}

.notif-item-icon.warning {
  background: rgba(234, 88, 12, 0.08);
  color: #ea580c;
}

.notif-item-icon.error {
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
}

.notif-item-icon.whatsapp {
  background: rgba(37, 211, 102, 0.08);
  color: #25d366;
}

.notif-item-icon.connection {
  background: rgba(139, 92, 246, 0.08);
  color: #8b5cf6;
}

/* Content */
.notif-item-content {
  flex: 1;
  min-width: 0;
}

.notif-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.4;
  margin-bottom: 2px;
}

.notif-item-message {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-item-time {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-top: 4px;
  white-space: nowrap;
}

/* Dismiss button */
.notif-item-dismiss {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--color-text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0;
  transition: all 0.15s ease;
  margin-top: 2px;
}

.notif-item:hover .notif-item-dismiss {
  opacity: 1;
}

.notif-item-dismiss:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
}

/* Responsive */
@media (max-width: 480px) {
  .modal-notifications {
    max-width: 100%;
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
}

/* ============================================
   PROFILE MODAL
   ============================================ */

.modal-profile {
  max-width: 420px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-profile .modal-header {
  padding: 20px 24px 12px;
  border-bottom: none;
}

.profile-modal-body {
  padding: 0 24px 24px !important;
  overflow-y: auto;
}

/* Hero - Avatar & Name */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0 20px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 4px;
}

.profile-avatar-large {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #0a0a0a;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  flex-shrink: 0;
  letter-spacing: -0.5px;
}

.profile-hero-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.profile-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  line-height: 1.3;
  letter-spacing: -0.3px;
}

.profile-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: fit-content;
  background: rgba(0, 0, 0, 0.05);
  color: var(--color-text-secondary);
}

.profile-role-badge.admin {
  background: rgba(59, 130, 246, 0.08);
  color: #3b82f6;
}

.profile-role-badge.superadmin {
  background: rgba(139, 92, 246, 0.08);
  color: #8b5cf6;
}

/* Sections */
.profile-section {
  padding: 16px 0 8px;
  border-bottom: 1px solid var(--color-border);
}

.profile-section:last-of-type {
  border-bottom: none;
}

.profile-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--color-text-tertiary);
  margin-bottom: 12px;
}

.profile-section-title svg {
  opacity: 0.5;
}

/* Fields */
.profile-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  gap: 12px;
}

.profile-field-label {
  font-size: 13px;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.profile-field-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  text-align: right;
  word-break: break-all;
  min-width: 0;
}

.profile-field-value.plan-badge {
  display: inline-flex;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.profile-field-value.plan-trial {
  background: rgba(234, 88, 12, 0.08);
  color: #ea580c;
}

.profile-field-value.plan-basic {
  background: rgba(59, 130, 246, 0.08);
  color: #3b82f6;
}

.profile-field-value.plan-pro {
  background: rgba(139, 92, 246, 0.08);
  color: #8b5cf6;
}

.profile-field-value.plan-enterprise {
  background: rgba(16, 185, 129, 0.08);
  color: #10b981;
}

.profile-field-value.status-active {
  color: #16a34a;
}

.profile-field-value.status-inactive {
  color: #dc2626;
}

.profile-field-value.days-warning {
  color: #ea580c;
  font-weight: 600;
}

.profile-field-value.days-danger {
  color: #dc2626;
  font-weight: 600;
}

.profile-field-value.days-ok {
  color: #16a34a;
}

/* Logout */
.profile-logout-section {
  padding-top: 16px;
}

.profile-logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.profile-logout-btn:hover {
  background: rgba(220, 38, 38, 0.04);
  border-color: rgba(220, 38, 38, 0.2);
  color: #dc2626;
}

/* Responsive */
@media (max-width: 480px) {
  .modal-profile {
    max-width: 100%;
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
}

.header {
  height: 60px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  background: var(--color-bg);
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

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

.header-center {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex: 1;
  justify-content: center;
}

.header-title {
  font-size: 16px;
  font-weight: var(--font-weight-medium);
  letter-spacing: -0.3px;
  margin: 0;
  line-height: 1.2;
}

.header-subtitle {
  font-size: 11px;
  color: var(--color-text-tertiary);
  font-weight: 300;
  margin: 0;
  line-height: 1.2;
  letter-spacing: 0.2px;
}

.header-greeting {
  font-size: 13px;
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-normal);
  margin: 0;
  line-height: 1.3;
}

.header-org-name {
  font-size: 12px;
  color: var(--color-text-tertiary);
  font-weight: var(--font-weight-normal);
  margin: 0;
  line-height: 1.3;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* ─── Subscription Badge ─── */
.sub-badge-wrapper {
  position: relative;
}

.sub-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-family);
  transition: opacity 0.2s;
}

.sub-badge:hover {
  opacity: 0.7;
}

.sub-badge-plan {
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-tertiary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sub-badge-time {
  font-size: 10px;
  color: var(--color-text-tertiary);
  font-weight: 400;
}

.sub-badge-time.days-danger { color: #ef4444; }
.sub-badge-time.days-warning { color: #f59e0b; }
.sub-badge-time.days-ok { color: var(--color-text-tertiary); }

.sub-badge-sep {
  font-size: 10px;
  color: var(--color-text-tertiary);
  opacity: 0.5;
}

/* Subscription Dropdown */
.sub-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 260px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
  animation: subDropIn 0.15s ease;
}

.sub-dropdown.active {
  display: block;
}

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

.sub-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--color-border);
}

.sub-dropdown-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.sub-dropdown-plan-tag {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  background: var(--color-bg-secondary);
  color: var(--color-text-tertiary);
  border: none;
}

.sub-dropdown-plan-tag.plan-free,
.sub-dropdown-plan-tag.plan-trial {
  background: var(--color-bg-secondary);
  color: var(--color-text-tertiary);
}

.sub-dropdown-plan-tag.plan-starter {
  background: var(--color-bg-secondary);
  color: var(--color-text-secondary);
}

.sub-dropdown-plan-tag.plan-pro {
  background: var(--color-bg-secondary);
  color: var(--color-text-secondary);
}

.sub-dropdown-plan-tag.plan-business,
.sub-dropdown-plan-tag.plan-enterprise {
  background: var(--color-bg-secondary);
  color: var(--color-text-secondary);
}

.sub-dropdown-body {
  padding: 10px 14px;
}

.sub-dropdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
}

.sub-dropdown-label {
  font-size: 11px;
  color: var(--color-text-tertiary);
}

.sub-dropdown-value {
  font-size: 11px;
  color: var(--color-text-primary);
  font-weight: 400;
  text-align: right;
}

.sub-dropdown-value.days-danger { color: #ef4444; }
.sub-dropdown-value.days-warning { color: #f59e0b; }
.sub-dropdown-value.days-ok { color: var(--color-text-secondary); }

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

.sub-dropdown-progress {
  padding: 8px 14px 12px;
  border-top: 1px solid var(--color-border);
}

.sub-dropdown-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--color-text-tertiary);
  margin-bottom: 5px;
}

.sub-dropdown-progress-bar {
  width: 100%;
  height: 3px;
  background: var(--color-border);
  border-radius: 3px;
  overflow: hidden;
}

.sub-dropdown-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--color-text-primary);
  transition: width 0.6s ease;
  width: 0%;
}

.sub-dropdown-progress-fill.usage-low { background: #22c55e; }
.sub-dropdown-progress-fill.usage-mid { background: #f59e0b; }
.sub-dropdown-progress-fill.usage-high { background: #ef4444; }

.sub-dropdown-warn {
  font-size: 9px;
  color: var(--color-text-tertiary);
  margin-top: 6px;
  line-height: 1.35;
  opacity: 0.7;
}

.sub-dropdown-upgrade {
  display: block;
  width: 100%;
  text-align: center;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-tertiary);
  background: none;
  border: none;
  border-top: 1px solid var(--color-border);
  border-radius: 0 0 10px 10px;
  text-decoration: none;
  transition: color 0.2s;
  cursor: pointer;
  font-family: var(--font-family);
}

.sub-dropdown-upgrade:hover {
  color: var(--color-text-primary);
}

/* ─── Payment / Upgrade Modal ─── */
.pay-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: payFadeIn 0.2s ease;
}
.pay-overlay.active { display: flex; }

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

.pay-modal {
  width: 100%;
  max-width: 420px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 24px;
  animation: paySlideUp 0.25s ease;
}

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

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

.pay-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
}

.pay-modal-subtitle {
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin: 2px 0 0;
}

.pay-modal-close {
  background: none;
  border: none;
  color: var(--color-text-tertiary);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.15s;
  display: flex;
}
.pay-modal-close:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-secondary);
}

/* Period Toggle */
.pay-period-wrap {
  display: flex;
  background: var(--color-bg-secondary);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 16px;
  border: 1px solid var(--color-border);
}

.pay-period-btn {
  flex: 1;
  padding: 7px 10px;
  border: none;
  background: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-tertiary);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: var(--font-family);
}

.pay-period-btn.active {
  background: var(--color-bg);
  color: var(--color-text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.pay-period-save {
  font-size: 9px;
  font-weight: 600;
  color: #22c55e;
  background: color-mix(in srgb, #22c55e 10%, transparent);
  padding: 1px 5px;
  border-radius: 3px;
}

/* Plan Cards */
.pay-plans {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.pay-plan-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.pay-plan-card:hover {
  border-color: var(--color-text-tertiary);
}

.pay-plan-card.selected {
  border-color: var(--color-text-primary);
  background: var(--color-bg-secondary);
}

.pay-plan-radio {
  width: 16px;
  height: 16px;
  min-width: 16px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pay-plan-card.selected .pay-plan-radio {
  border-color: var(--color-text-primary);
  background: var(--color-text-primary);
}

.pay-plan-card.selected .pay-plan-radio::after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-bg);
}

.pay-plan-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.pay-plan-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.pay-plan-desc {
  font-size: 10px;
  color: var(--color-text-tertiary);
}

.pay-plan-pricing {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.pay-plan-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.pay-plan-period {
  font-size: 10px;
  color: var(--color-text-tertiary);
}

/* Summary */
.pay-summary {
  padding: 12px 14px;
  background: var(--color-bg-secondary);
  border-radius: 8px;
  margin-bottom: 14px;
  border: 1px solid var(--color-border);
}

.pay-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--color-text-tertiary);
  padding: 3px 0;
}

.pay-summary-total {
  border-top: 1px solid var(--color-border);
  margin-top: 6px;
  padding-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
}

/* Pay Button */
.pay-btn {
  width: 100%;
  padding: 12px;
  background: var(--color-text-primary);
  color: var(--color-bg);
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
  font-family: var(--font-family);
}

.pay-btn:hover:not(:disabled) { opacity: 0.85; }
.pay-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pay-secure-text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 10px;
  color: var(--color-text-tertiary);
  margin-top: 12px;
  opacity: 0.6;
}

/* ─── Expired Plan Blocking Modal ─── */
.expired-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: payFadeIn 0.3s ease;
}
.expired-overlay.active { display: flex; }

.expired-modal {
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 28px 24px 20px;
  animation: paySlideUp 0.3s ease;
}

.expired-modal::-webkit-scrollbar {
  width: 4px;
}
.expired-modal::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

.expired-modal-header {
  text-align: center;
  margin-bottom: 20px;
}

.expired-icon {
  margin: 0 auto 10px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.expired-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 4px;
}

.expired-subtitle {
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin: 0;
}

.expired-popular {
  font-size: 9px;
  font-weight: 600;
  color: #a855f7;
  background: color-mix(in srgb, #a855f7 10%, transparent);
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
}

/* Payment method tabs */
.expired-pay-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.expired-pay-tab {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-tertiary);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: var(--font-family);
}

.expired-pay-tab.active {
  border-color: var(--color-text-primary);
  color: var(--color-text-primary);
  background: var(--color-bg-secondary);
}

.expired-pay-tab:hover:not(.active) {
  border-color: var(--color-text-tertiary);
}

.expired-tab-content {
  animation: payFadeIn 0.2s ease;
}

.expired-summary {
  padding: 12px 14px;
  background: var(--color-bg-secondary);
  border-radius: 8px;
  margin-bottom: 14px;
  border: 1px solid var(--color-border);
}

.expired-surcharge-label {
  color: var(--color-text-tertiary);
  font-style: italic;
}

/* Bank transfer info */
.expired-bank-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.expired-bank-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.expired-bank-logo {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 8px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
}

.expired-bank-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.expired-bank-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 2px;
}

.expired-bank-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--color-text-secondary);
  flex-wrap: wrap;
}

.expired-bank-label {
  color: var(--color-text-tertiary);
}

.expired-bank-account {
  font-weight: 600;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  color: var(--color-text-primary);
}

.expired-copy-btn {
  background: none;
  border: none;
  color: var(--color-text-tertiary);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
}

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

.expired-transfer-note {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: color-mix(in srgb, #3b82f6 8%, transparent);
  border: 1px solid color-mix(in srgb, #3b82f6 20%, transparent);
  border-radius: 8px;
  font-size: 10px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.expired-transfer-note svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: #3b82f6;
}

.expired-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: center;
}

.expired-logout-btn {
  background: none;
  border: none;
  color: var(--color-text-tertiary);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.15s;
  font-family: var(--font-family);
}

.expired-logout-btn:hover {
  color: #ef4444;
  background: color-mix(in srgb, #ef4444 8%, transparent);
}

@media (max-width: 480px) {
  .expired-modal {
    padding: 20px 16px 16px;
    border-radius: 14px;
  }
  .expired-bank-card {
    flex-direction: column;
    gap: 8px;
  }
}

/* Status Buttons - Same style as config button */
.btn-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--color-text);
  cursor: default;
  transition: all var(--transition);
  position: relative;
}

.btn-status svg {
  flex-shrink: 0;
}

.btn-status .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-border);
  transition: all var(--transition);
}

.btn-status .status-dot.active {
  background: var(--color-success);
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.15);
  animation: pulse-status 2s ease-in-out infinite;
}

.btn-status .status-dot.error {
  background: var(--color-error);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
  animation: pulse-status 2s ease-in-out infinite;
}

.btn-status .status-dot.warning {
  background: var(--color-warning);
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.15);
  animation: pulse-status 2s ease-in-out infinite;
}

@keyframes pulse-status {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

/* Social Media Status Buttons - Coming Soon */
.btn-status-soon {
  opacity: 0.6;
  cursor: pointer;
  position: relative;
  transition: all var(--transition);
}

.btn-status-soon:hover {
  opacity: 0.8;
  transform: translateY(-1px);
}

.btn-status {
  cursor: pointer;
}

.btn-status:not(.btn-status-soon):hover {
  background: var(--color-bg-tertiary);
  transform: translateY(-1px);
}

.status-dot-red {
  background: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15) !important;
  animation: pulse-status 2s ease-in-out infinite;
}

/* ============================================
   GPT & SOCIAL MEDIA MODALS
   ============================================ */

/* Multimedia Modal */
.multimedia-main {
  max-width: 800px;
  margin: 0 auto;
}

.multimedia-description {
  text-align: center;
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-bottom: 20px;
  line-height: 1.4;
}

.multimedia-types {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.media-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 12px;
  border: 1px solid var(--color-border);
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
  transition: none;
}

.media-type-card:hover {
  border-color: var(--color-text);
}

.media-type-card svg {
  color: var(--color-text-tertiary);
}

.media-type-card h4 {
  font-size: 11px;
  font-weight: normal;
  color: var(--color-text);
  margin: 0;
}

.media-format {
  font-size: 10px;
  color: var(--color-text-tertiary);
}

.rules-section {
  border-top: 1px solid var(--color-border);
  padding-top: 16px;
  margin-top: 8px;
}

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

.section-header span:first-child {
  font-size: 10px;
  font-weight: normal;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rules-counter {
  font-size: 10px;
  color: var(--color-text-tertiary);
}

.rules-list {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-rules {
  text-align: center;
  font-size: 11px;
  color: var(--color-text-tertiary);
  padding: 20px;
}

/* Rules Table */
.rules-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.rules-table thead th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border);
  font-weight: normal;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 9px;
}

.rules-table tbody tr {
  border-bottom: 1px solid var(--color-border);
  transition: none;
}

.rules-table tbody tr:hover {
  background: rgba(0,0,0,0.02);
}

.rules-table tbody tr.rule-inactive {
  opacity: 0.5;
}

.rules-table tbody td {
  padding: 10px 12px;
  vertical-align: middle;
}

.rule-indicator-cell {
  width: 30px;
  padding-left: 16px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: block;
}

.status-active {
  background: #22c55e;
  animation: pulse-status 2s infinite;
}

.status-inactive {
  background: #ef4444;
}

.rule-type-cell {
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-size: 9px;
  font-weight: 500;
  width: 70px;
}

.rule-triggers-cell {
  color: var(--color-text);
  font-size: 10px;
}

.rule-file-cell {
  color: var(--color-text);
  font-size: 10px;
}

.file-size-hint {
  color: var(--color-text-tertiary);
  font-size: 9px;
}

.rule-actions-cell {
  width: 100px;
  text-align: right;
}

.rule-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 16px;
  cursor: pointer;
  user-select: none;
}

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

.toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ef4444;
  border-radius: 16px;
  transition: background-color 0.2s;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #22c55e;
}

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

.rule-delete-btn {
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--color-text-tertiary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: none;
  padding: 0;
}

.rule-delete-btn:hover {
  color: var(--color-text);
}

/* Multimedia Create Form */
.multimedia-create {
  max-width: 700px;
  margin: 0 auto;
}

.create-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: var(--space-lg);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.btn-back {
  width: 28px;
  height: 28px;
  border-radius: 3px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: none;
  padding: 0;
}

.btn-back:hover {
  border-color: var(--color-text);
  color: var(--color-text);
}

.create-breadcrumb {
  font-size: 12px;
  color: var(--color-text-secondary);
  font-weight: normal;
}

.form-section {
  margin-bottom: var(--space-lg);
}

.form-section label {
  display: block;
  font-size: 12px;
  font-weight: normal;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.big-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color 0.2s;
}

.big-input:focus {
  outline: none;
  border-color: var(--color-text);
}

.big-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  background: var(--color-bg);
  color: var(--color-text);
  resize: vertical;
  transition: border-color 0.2s;
}

.big-textarea:focus {
  outline: none;
  border-color: var(--color-text);
}

.input-help {
  margin-top: var(--space-sm);
}

.help-examples {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.example-tag {
  padding: 4px 8px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  font-size: 11px;
  color: var(--color-text-tertiary);
  cursor: pointer;
  transition: border-color 0.2s;
}

.example-tag:hover {
  border-color: var(--color-text);
  color: var(--color-text);
}

.upload-zone {
  border: 1px dashed var(--color-border);
  border-radius: 4px;
  padding: var(--space-lg);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
  position: relative;
}

.upload-zone:hover {
  border-color: var(--color-text);
}

.upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.upload-icon svg {
  color: var(--color-text-tertiary);
}

.upload-content h4 {
  font-size: 13px;
  font-weight: normal;
  color: var(--color-text);
  margin: 0;
}

.upload-content p {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin: 0;
}

.size-limit {
  font-size: 11px;
  color: var(--color-text-tertiary);
}

.file-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-sm);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 4px;
}

.preview-info {
  flex: 1;
}

.preview-info h4 {
  font-size: 13px;
  font-weight: normal;
  color: var(--color-text);
  margin: 0 0 2px 0;
}

.preview-info p {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin: 0;
}

.remove-btn {
  width: 24px;
  height: 24px;
  border-radius: 3px;
  border: none;
  background: transparent;
  color: var(--color-text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s;
}

.remove-btn:hover {
  color: var(--color-text);
}

.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}

.btn-cancel {
  padding: 8px 16px;
  border: 1px solid var(--color-border);
  border-radius: 2px;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: normal;
  cursor: pointer;
  transition: none;
}

.btn-cancel:hover {
  border-color: var(--color-text);
  color: var(--color-text);
}

.btn-save {
  padding: 8px 16px;
  border: 1px solid var(--color-text);
  border-radius: 2px;
  background: var(--color-text);
  color: var(--color-bg);
  font-size: 11px;
  font-weight: normal;
  cursor: pointer;
  transition: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-save svg {
  width: 14px;
  height: 14px;
}

.btn-save:hover:not(:disabled) {
  opacity: 0.9;
}

.btn-save:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text-tertiary);
}

/* GPT Status Modal */
.gpt-status-container {
  max-width: 500px;
  margin: 0 auto;
  padding: var(--space-xl) 0;
}

.gpt-status-main {
  text-align: center;
  padding-bottom: var(--space-xl);
  margin-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-border);
}

.status-indicator-large {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-lg);
  background: var(--color-bg-secondary);
  border: 2px solid var(--color-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-dot-large {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.2);
  animation: pulse-status 2s ease-in-out infinite;
}

.status-dot-large.error {
  background: var(--color-error);
  box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.2);
}

.status-dot-large.warning {
  background: var(--color-warning);
  box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.2);
}

.gpt-status-main h3 {
  font-size: 24px;
  font-weight: var(--font-weight-medium);
  margin: 0 0 var(--space-sm) 0;
  color: var(--color-text);
}

.status-description {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin: 0;
}

.gpt-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.metric-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-lg);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  transition: all var(--transition);
}

.metric-item:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.metric-label {
  font-size: 11px;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: var(--font-weight-medium);
}

.metric-value {
  font-size: 20px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
}

/* Social Media Modal */
.social-coming-soon {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
  padding: var(--space-xl) 0;
}

.coming-soon-icon {
  width: 120px;
  height: 120px;
  margin: 0 auto var(--space-xl);
  background: var(--color-bg-secondary);
  border: 2px solid var(--color-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
}

.social-coming-soon h3 {
  font-size: 22px;
  font-weight: var(--font-weight-medium);
  margin: 0 0 var(--space-md) 0;
  color: var(--color-text);
}

.social-coming-soon p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-xl) 0;
}

.social-coming-soon p strong {
  color: var(--color-text);
  font-weight: var(--font-weight-medium);
}

.features-preview {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  text-align: left;
}

.feature-preview-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 13px;
  color: var(--color-text);
}

.feature-preview-item svg {
  color: var(--color-success);
  flex-shrink: 0;
}

.social-coming-soon .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

.status-soon {
  position: absolute;
  top: -7px;
  right: -7px;
  background: var(--color-bg);
  color: var(--color-text-tertiary);
  font-size: 8px;
  font-weight: 500;
  padding: 2px 5px;
  border-radius: 3px;
  letter-spacing: 0.2px;
  text-transform: lowercase;
  border: 1px solid var(--color-border);
  z-index: 1;
}

.user-email {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.main-content {
  display: flex;
  height: calc(100vh - 60px);
  overflow: hidden; /* Prevenir scroll en el contenedor padre */
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
  width: 360px;
  height: 100%; /* Altura fija del contenedor padre */
  border-right: 1px solid var(--color-border);
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0; /* No se encoge nunca */
  overflow: hidden; /* Sin scroll en el contenedor */
}

.panel-title {
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

/* Chat List Header (title + timestamp) */
.chat-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
  padding: 4px 0;
  min-height: 32px;
}

.chat-list-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.chat-list-count {
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  padding: 4px 10px;
  background: var(--color-bg-tertiary);
  border-radius: 12px;
  border: 1px solid var(--color-border);
  transition: all 200ms ease;
}

.chat-list-count.has-unread {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  font-weight: var(--font-weight-medium);
}

/* Botón para mostrar silenciados */
.btn-show-muted {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-show-muted:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-warning);
  color: var(--color-warning);
  transform: translateY(-1px);
}

.btn-show-muted.active {
  background: var(--color-warning);
  color: white;
  border-color: var(--color-warning);
}

.btn-show-muted svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

#muted-count-text {
  font-weight: 600;
}

.section-label-muted {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-warning);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================
   MODAL DE CONTACTOS SILENCIADOS
   ============================================ */

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

.muted-contacts-description {
  color: var(--color-text-secondary);
  font-size: 14px;
  margin: 0;
}

.muted-contacts-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-height: 400px;
  overflow-y: auto;
}

.muted-contact-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.muted-contact-item:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-primary);
  transform: translateX(4px);
}

.muted-contact-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
  background-color: var(--color-bg-tertiary);
  border: 2px solid var(--color-border);
  opacity: 1;
  visibility: visible;
}

.muted-contact-info {
  flex: 1;
}

.muted-contact-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: 2px;
}

.muted-contact-phone {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.btn-activate {
  padding: 6px 16px;
  background: var(--color-success);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-activate:hover {
  background: var(--color-success-dark, #059669);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.chat-list-timestamp {
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  padding: 4px 10px;
  background: linear-gradient(135deg, var(--color-bg-tertiary) 0%, var(--color-bg-secondary) 100%);
  border-radius: 12px;
  border: 1px solid var(--color-border);
  transition: all 200ms ease;
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chat-list-timestamp:hover {
  border-color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.chat-list-timestamp:not(:empty)::before {
  content: '⏱';
  font-size: 13px;
  opacity: 0.8;
}

/* Status Badge */
.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 16px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  font-size: 13px;
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
  transition: all 0.2s ease;
}

.status-badge .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-tertiary);
  transition: background 0.2s ease;
}

.status-badge .status-dot.online {
  background: var(--color-success);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.status-badge .status-dot.error {
  background: var(--color-error);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.status-badge .status-dot.warning {
  background: var(--color-warning);
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.2);
}

/* Connection Panel */
.connection-panel {
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border-light);
  flex-shrink: 0;
}

.panel-title-compact {
  font-size: 10px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px;
  margin-bottom: 6px;
}

.qr-container.hidden {
  display: none;
}

.qr-container img {
  width: 280px;
  height: 280px;
  border-radius: 8px;
  background: white;
  border: 2px solid var(--color-border-light);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.qr-timer {
  margin-top: 4px;
  padding: 2px 6px;
  background: var(--color-text-tertiary);
  color: white;
  border-radius: 8px;
  font-size: 9px;
  font-weight: var(--font-weight-medium);
  display: inline-block;
}

.qr-timer.hidden {
  display: none;
}

.pairing-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  margin-bottom: 6px;
}

.pairing-container.hidden {
  display: none;
}

.pairing-info {
  text-align: center;
}

.pairing-title {
  font-size: 10px;
  color: var(--color-text-tertiary);
  margin-bottom: 6px;
}

.pairing-code {
  font-size: 28px;
  font-weight: var(--font-weight-medium);
  letter-spacing: 6px;
  color: var(--color-primary);
  margin: 8px 0;
  font-family: 'Courier New', monospace;
}

.pairing-instructions {
  font-size: 10px;
  color: var(--color-text-tertiary);
  line-height: 1.4;
  max-width: 200px;
  margin-top: 6px;
}

.connection-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.connection-actions > div {
  display: flex;
  gap: 6px;
}

.connection-actions button {
  flex: 1;
  padding: 8px 12px;
  font-size: 12px;
}

.btn-text-small {
  padding: 6px 8px;
  font-size: 11px;
  opacity: 0.7;
  transition: opacity var(--transition);
}

.btn-text-small:hover {
  opacity: 1;
}

/* Search Panel */
.search-panel {
  padding: 12px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

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

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--color-text-tertiary);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--color-text);
  transition: all var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  background: var(--color-bg);
}

.search-input::placeholder {
  color: var(--color-text-tertiary);
}

/* Chat List */
.chat-list-panel {
  padding: var(--space-lg);
  flex: 1 1 0; /* flex-grow, flex-shrink, flex-basis */
  overflow-y: auto; /* Scroll vertical independiente */
  overflow-x: hidden; /* Sin scroll horizontal */
  min-height: 0; /* Importante para que flex + overflow funcionen */
  max-height: 100%; /* No exceder el contenedor padre */
}

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* Sección de silenciados con animación */
.chat-section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg) var(--space-md);
  margin: var(--space-lg) 0;
  border-top: 1px solid var(--color-border);
  position: relative;
}

.chat-section-divider::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
}

.section-label-muted {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-warning);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.muted-section-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg-tertiary);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.muted-section-toggle:hover {
  background: var(--color-bg-hover);
  transform: translateY(-1px);
}

.muted-section-toggle .toggle-icon {
  font-size: 10px;
  color: var(--color-text-secondary);
  transition: transform 0.2s ease;
}

.muted-section-toggle .muted-icon {
  font-size: 13px;
  color: var(--color-warning);
}

.muted-section-toggle .section-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.muted-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--color-warning);
  color: white;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.muted-chats-container {
  max-height: 2000px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
  opacity: 1;
}

.muted-chats-container.collapsed {
  max-height: 0;
  opacity: 0;
  margin: 0;
}

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

.chat-section-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================
   SECCIONES DE CHATS (Limpieza)
   ============================================ */

.chat-section-muted,
.chat-section-active {
  animation: sectionSlideIn 0.3s ease-out;
}

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

.chat-item {
  padding: var(--space-md);
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  position: relative;
  display: flex;
  gap: var(--space-md);
  align-items: center;
  
  /* ✨ OPTIMIZACIÓN: Transiciones suaves sin parpadeos */
  transition: background-color 200ms ease, 
              opacity 200ms ease,
              transform 200ms ease;
  
  /* 🚀 PERFORMANCE: Usar will-change solo en hover para mejor rendering */
  will-change: auto;
}

.chat-item:hover {
  will-change: background-color, transform;
}

/* ========================================
   ANIMACIONES DE CHAT SILENCIADO
   ======================================== */

/* ❌ DESHABILITADO: Animación de entrada (causa parpadeos en updates)
@keyframes chatSlideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
*/

/* Animación de salida para chats (solo cuando se eliminan) */
@keyframes chatSlideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

/* ❌ DESHABILITADO: Prevenir animación en cada update
.chat-item {
  animation: chatSlideIn 0.3s ease-out;
}
*/

/* Chat silenciado - estilo más tenue con transición suave */
.chat-item.chat-muted {
  opacity: 0.6;
  transition: opacity 300ms ease, transform 200ms ease;
}

.chat-item.chat-muted:hover {
  opacity: 0.85;
  transform: translateX(2px);
}

/* Icono de silenciado */
.muted-icon {
  width: 12px;
  height: 12px;
  color: var(--color-text-tertiary);
  margin-right: 6px;
  opacity: 0.7;
  flex-shrink: 0;
  animation: iconFadeIn 0.3s ease-out;
}

@keyframes iconFadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 0.7;
    transform: scale(1);
  }
}

.chat-item:hover {
  background: var(--color-bg-secondary);
}

.chat-item.active {
  background: var(--color-bg-tertiary);
  border-color: var(--color-border);
}

.chat-item-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
  overflow: visible;
  position: relative;
  transition: transform 0.2s ease;
}

.chat-item-avatar:hover {
  transform: scale(1.05);
}

.avatar-initial {
  font-weight: 600;
  font-size: 18px;
  color: white;
  user-select: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

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

/* Badge de plataforma - esquina inferior derecha visible */
.platform-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-bg);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  z-index: 2;
}

.platform-badge svg {
  width: 10px;
  height: 10px;
  stroke: white;
  stroke-width: 2;
}

.platform-badge.platform-whatsapp {
  background: #25D366;
}

.platform-badge.platform-telegram {
  background: #0088cc;
}

.chat-item-content {
  flex: 1;
  min-width: 0;
  margin-right: 90px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.chat-item-name-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-item-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Tag pills inline con el nombre */
.chat-tag-pills {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 0;
  vertical-align: middle;
}

.chat-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
  line-height: 1.2;
  background-color: color-mix(in srgb, var(--tag-color) 20%, transparent);
  border: 1px solid var(--tag-color);
  color: var(--tag-color);
  flex-shrink: 0;
}

.chat-tag-pill-more {
  background: var(--color-bg-tertiary);
  border-color: var(--color-border-light);
  color: var(--color-text-tertiary);
  --tag-color: transparent;
}

.chat-item-name-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.chat-item-name {
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  line-height: 1.3;
  cursor: text;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-item-edit-hint {
  font-size: 8px;
  font-weight: 600;
  color: var(--primary-color, #6c5ce7);
  border: 1px solid var(--primary-color, #6c5ce7);
  border-radius: 8px;
  padding: 1px 5px;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
  cursor: pointer;
  flex-shrink: 0;
}

.chat-item:hover .chat-item-edit-hint {
  opacity: 1;
}

.chat-item-edit-hint:hover {
  background: var(--primary-color, #6c5ce7);
  color: #fff;
}

.chat-item-name[data-editing="true"] + .chat-item-edit-hint {
  display: none;
}

/* Input inline para editar nombre en la lista de chats */
.chat-list-name-input {
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  font-family: inherit;
  border: none;
  border-bottom: 2px solid var(--primary-color, #6c5ce7);
  background: transparent;
  color: var(--color-text);
  padding: 0 2px;
  outline: none;
  width: 100%;
  max-width: 160px;
  line-height: 1.3;
}

.chat-item-last-seen {
  font-size: 11px;
  color: var(--color-text-tertiary);
  line-height: 1.2;
}

.chat-item-time {
  font-size: 11px;
  color: var(--color-text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
  text-align: right;
}

/* Toggle en posición fija a la derecha */
.ai-toggle-wrapper {
  position: absolute;
  right: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.chat-item-message {
  font-size: 12px;
  color: var(--color-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

.message-text {
  font-size: 12px;
}

.chat-item-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--color-primary);
  color: white;
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  border-radius: 10px;
  margin-left: 8px;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

/* ============================================
   CHAT ACTIONS (PIN, DELETE, etc)
   ============================================ */

.chat-actions {
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  position: absolute;
  right: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  gap: 24px;
  z-index: 10;
}

/* ============================================
   CHAT VIEW
   ============================================ */

.chat-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
}

.chat-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  border-left: 1px solid var(--color-border);
  transition: opacity 0.2s ease-out;
}

.chat-empty.hidden {
  display: none;
}

.chat-empty .empty-state {
  text-align: center;
  color: var(--color-text-tertiary);
  max-width: 560px;
  padding: var(--space-xl);
}

.chat-empty .empty-state svg {
  margin-bottom: var(--space-xl);
  color: var(--color-text-tertiary);
  opacity: 0.9;
}

/* 🎨 Animaciones del ícono de PC - Mejoradas */
.chat-empty .empty-state svg .pc-screen {
  animation: pc-breathe 4s ease-in-out infinite;
  transform-origin: center bottom;
}

.chat-empty .empty-state svg .pc-content-line {
  animation: line-scan 2.5s ease-in-out infinite;
  transform-origin: left center;
}

.chat-empty .empty-state svg .pc-content-line:nth-child(2) {
  animation-delay: 0.4s;
}

.chat-empty .empty-state svg .pc-content-line:nth-child(3) {
  animation-delay: 0.8s;
}

.chat-empty .empty-state svg .chat-bubble {
  animation: bubble-pop 3s ease-in-out infinite;
  transform-origin: center center;
}

.chat-empty .empty-state svg .typing-dot {
  animation: dot-bounce 1.2s ease-in-out infinite;
}

.chat-empty .empty-state svg .typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.chat-empty .empty-state svg .typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes pc-breathe {
  0%, 100% {
    opacity: 0.12;
    transform: scale(1);
  }
  50% {
    opacity: 0.25;
    transform: scale(1.02);
  }
}

@keyframes line-scan {
  0% {
    opacity: 0.2;
    stroke-dasharray: 0 100;
  }
  50% {
    opacity: 0.8;
    stroke-dasharray: 100 0;
  }
  100% {
    opacity: 0.2;
    stroke-dasharray: 0 100;
  }
}

@keyframes bubble-pop {
  0%, 100% {
    transform: translateY(0) scale(1);
    opacity: 0.5;
  }
  25% {
    transform: translateY(-8px) scale(1.05);
    opacity: 0.9;
  }
  50% {
    transform: translateY(-4px) scale(1.02);
    opacity: 0.7;
  }
  75% {
    transform: translateY(-6px) scale(1.03);
    opacity: 0.8;
  }
}

@keyframes dot-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

.chat-empty .empty-state h2 {
  font-size: 32px;
  font-weight: var(--font-weight-light);
  margin-bottom: var(--space-md);
  color: var(--color-text-primary);
  letter-spacing: -0.5px;
}

.chat-empty .empty-state .empty-state-subtitle {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
  line-height: 1.5;
}

.chat-empty .empty-state .empty-state-description {
  font-size: 13px;
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}

.chat-empty .empty-state-features {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.chat-empty .feature-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 13px;
  color: var(--color-text-tertiary);
}

.chat-empty .feature-item svg {
  margin: 0;
  opacity: 0.5;
  width: 18px;
  height: 18px;
}

/* ============================================
   DASHBOARD — CONNECTION GUIDE
   ============================================ */
.wa-connect-guide {
  margin-top: 20px;
  padding: 20px 24px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  max-width: 320px;
  width: 100%;
  text-align: left;
}
.wc-guide-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 14px;
  text-align: center;
}
.wc-guide-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}
.wc-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.wc-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-text);
  color: var(--color-bg);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.wc-step-text {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}
.wc-guide-btn {
  width: 100%;
  padding: 9px 16px;
  background: var(--color-text);
  color: var(--color-bg);
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}
.wc-guide-btn:hover { opacity: 0.8; }

.empty-state {
  text-align: center;
  padding: var(--space-lg);
  color: var(--color-text-tertiary);
}

.chat-view {
  flex: 1 1 0; /* Toma el resto del espacio */
  display: flex;
  overflow: hidden; /* Control total del overflow */
  height: 100%; /* Altura fija */
}

.chat-active {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%; /* Altura fija completa */
  overflow: visible; /* Permitir que el emoji picker se vea */
  animation: chatFadeIn 0.25s ease-out;
}

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

.chat-active.hidden {
  display: none;
}

.chat-header {
  height: 60px;
  border-bottom: 1px solid var(--color-border);
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-bg);
  animation: slideDown 0.3s ease-out;
}

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

/* Catálogo Slider */
.catalog-slider-container {
  position: relative;
  height: 110px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
  padding: 12px 0;
  overflow: hidden;
}

.catalog-slider {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  padding: 0 48px;
  height: 100%;
  align-items: center;
  -webkit-overflow-scrolling: touch;
}

.catalog-slider::-webkit-scrollbar {
  display: none;
}

.catalog-slider {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.catalog-item {
  flex-shrink: 0;
  width: 90px;
  height: 90px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.catalog-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--color-primary);
}

.catalog-item:active {
  transform: translateY(0);
}

.catalog-item-image {
  width: 100%;
  height: 60px;
  object-fit: cover;
  background: var(--color-bg-tertiary);
}

.catalog-item-info {
  padding: 4px 6px;
  background: var(--color-bg);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.catalog-item-name {
  font-size: 10px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.catalog-item-price {
  font-size: 9px;
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-semibold);
}

.catalog-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 2;
  color: var(--color-text-secondary);
}

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

.catalog-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.catalog-nav-left {
  left: 8px;
}

.catalog-nav-right {
  right: 8px;
}

.catalog-nav.disabled {
  opacity: 0.3;
  pointer-events: none;
}

.catalog-sync-btn {
  position: absolute;
  top: 12px;
  right: 60px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
  color: white;
  pointer-events: auto;
  font-size: 16px;
}

.catalog-sync-btn:hover {
  background: var(--color-primary-dark);
  transform: scale(1.05);
}

.catalog-sync-btn:active {
  transform: scale(0.95);
}

.catalog-sync-btn.syncing {
  animation: spin 1s linear infinite;
  pointer-events: none;
}

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

.catalog-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary);
  font-size: 12px;
  padding: 0 60px;
  text-align: center;
}

.chat-contact {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex: 1;
  min-width: 0;
}

.contact-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  overflow: hidden;
  flex-shrink: 0;
}

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

.contact-info {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.contact-info h3 {
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ✏️ Etiqueta editar nombre */
.contact-name-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-edit-name-label {
  font-size: 9px;
  color: var(--primary-color, #6c5ce7);
  background: var(--primary-color-light, rgba(108, 92, 231, 0.08));
  border: 1px solid var(--primary-color, #6c5ce7);
  border-radius: 10px;
  padding: 1px 7px;
  cursor: pointer;
  white-space: nowrap;
  opacity: 0.7;
  transition: all 0.2s ease;
  font-weight: 500;
  letter-spacing: 0.2px;
  flex-shrink: 0;
  user-select: none;
}

.btn-edit-name-label:hover {
  opacity: 1;
  background: var(--primary-color, #6c5ce7);
  color: #fff;
  transform: scale(1.05);
}

.contact-info p {
  font-size: 9px;
  color: var(--color-text-tertiary);
  font-family: 'Courier New', monospace;
  letter-spacing: -0.5px;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  max-width: 100%;
}

/* Messages */
.messages-container {
  flex: 1 1 0;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg width='120' height='120' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23000000' stroke-width='0.5' opacity='0.08'%3E%3C!-- Mensaje burbujas --%3E%3Cpath d='M15 20h18c2 0 3-1 3-3v-8c0-2-1-3-3-3H15c-2 0-3 1-3 3v8c0 2 1 3 3 3z'/%3E%3Cpath d='M18 20l-2 3'/%3E%3C!-- Check mark --%3E%3Cpolyline points='88 15 91 18 96 13'/%3E%3Cpolyline points='92 15 95 18 100 13'/%3E%3C!-- Micrófono --%3E%3Ccircle cx='65' cy='75' r='3'/%3E%3Cpath d='M65 78v4m-2 0h4m-2-12v4'/%3E%3Cpath d='M62 73c0-1.5 1.3-3 3-3s3 1.5 3 3v4c0 1.5-1.3 3-3 3s-3-1.5-3-3z'/%3E%3C!-- Paper plane --%3E%3Cpath d='M85 65l-12-6 12-6 4 6z'/%3E%3Cpath d='M73 59l4 6-4 6'/%3E%3C!-- Emoji feliz --%3E%3Ccircle cx='35' cy='95' r='5'/%3E%3Ccircle cx='33' cy='94' r='0.8' fill='%23000000'/%3E%3Ccircle cx='37' cy='94' r='0.8' fill='%23000000'/%3E%3Cpath d='M33 96.5c0.5 0.8 1.5 1.2 2 1.2s1.5-0.4 2-1.2'/%3E%3C!-- Corazón --%3E%3Cpath d='M105 95c-1.5-1.5-4-1.5-5.5 0l-0.5 0.5-0.5-0.5c-1.5-1.5-4-1.5-5.5 0-1.5 1.5-1.5 4 0 5.5l6 6 6-6c1.5-1.5 1.5-4 0-5.5z'/%3E%3C!-- Rayo --%3E%3Cpath d='M50 48l-3 6h4l-3 6'/%3E%3C!-- Notificación campana --%3E%3Cpath d='M20 85c0-2 1.5-3.5 3.5-3.5s3.5 1.5 3.5 3.5-1.5 3.5-3.5 3.5'/%3E%3Cpath d='M23.5 88.5v1.5m-3-8v-2c0-1.5 1.3-3 3-3s3 1.5 3 3v2'/%3E%3C!-- Candado --%3E%3Crect x='76' y='28' width='8' height='10' rx='1'/%3E%3Cpath d='M78 28v-3c0-1.1 0.9-2 2-2s2 0.9 2 2v3'/%3E%3C!-- Estrella --%3E%3Cpath d='M50 90l1.5 3 3.3 0.5-2.4 2.3 0.6 3.2-2.9-1.5-2.9 1.5 0.6-3.2-2.4-2.3 3.3-0.5z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 120px 120px;
  min-height: 0;
  max-height: 100%;
}

/* Modo oscuro */
[data-theme="dark"] .messages-container {
  background-color: #0a0a0a;
  background-image: url("data:image/svg+xml,%3Csvg width='120' height='120' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='0.5' opacity='0.06'%3E%3C!-- Mensaje burbujas --%3E%3Cpath d='M15 20h18c2 0 3-1 3-3v-8c0-2-1-3-3-3H15c-2 0-3 1-3 3v8c0 2 1 3 3 3z'/%3E%3Cpath d='M18 20l-2 3'/%3E%3C!-- Check mark --%3E%3Cpolyline points='88 15 91 18 96 13'/%3E%3Cpolyline points='92 15 95 18 100 13'/%3E%3C!-- Micrófono --%3E%3Ccircle cx='65' cy='75' r='3'/%3E%3Cpath d='M65 78v4m-2 0h4m-2-12v4'/%3E%3Cpath d='M62 73c0-1.5 1.3-3 3-3s3 1.5 3 3v4c0 1.5-1.3 3-3 3s-3-1.5-3-3z'/%3E%3C!-- Paper plane --%3E%3Cpath d='M85 65l-12-6 12-6 4 6z'/%3E%3Cpath d='M73 59l4 6-4 6'/%3E%3C!-- Emoji feliz --%3E%3Ccircle cx='35' cy='95' r='5'/%3E%3Ccircle cx='33' cy='94' r='0.8' fill='%23ffffff'/%3E%3Ccircle cx='37' cy='94' r='0.8' fill='%23ffffff'/%3E%3Cpath d='M33 96.5c0.5 0.8 1.5 1.2 2 1.2s1.5-0.4 2-1.2'/%3E%3C!-- Corazón --%3E%3Cpath d='M105 95c-1.5-1.5-4-1.5-5.5 0l-0.5 0.5-0.5-0.5c-1.5-1.5-4-1.5-5.5 0-1.5 1.5-1.5 4 0 5.5l6 6 6-6c1.5-1.5 1.5-4 0-5.5z'/%3E%3C!-- Rayo --%3E%3Cpath d='M50 48l-3 6h4l-3 6'/%3E%3C!-- Notificación campana --%3E%3Cpath d='M20 85c0-2 1.5-3.5 3.5-3.5s3.5 1.5 3.5 3.5-1.5 3.5-3.5 3.5'/%3E%3Cpath d='M23.5 88.5v1.5m-3-8v-2c0-1.5 1.3-3 3-3s3 1.5 3 3v2'/%3E%3C!-- Candado --%3E%3Crect x='76' y='28' width='8' height='10' rx='1'/%3E%3Cpath d='M78 28v-3c0-1.1 0.9-2 2-2s2 0.9 2 2v3'/%3E%3C!-- Estrella --%3E%3Cpath d='M50 90l1.5 3 3.3 0.5-2.4 2.3 0.6 3.2-2.9-1.5-2.9 1.5 0.6-3.2-2.4-2.3 3.3-0.5z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 120px 120px;
}

.messages {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.message {
  display: flex;
  gap: var(--space-sm);
  max-width: 70%;
  animation: messageFadeIn 0.2s ease-out;
  animation-fill-mode: backwards;
}

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

.message.outgoing {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  position: relative;
}

.message.incoming .message-bubble {
  background: var(--color-message-in);
  border: 1px solid var(--color-border);
}

.message.outgoing .message-bubble {
  background: var(--color-message-out);
  border: 1px solid var(--color-border-light);
}

.message-time {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-top: 4px;
  display: block;
}

.message.processing .message-bubble {
  opacity: 0.6;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.7; }
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  margin-bottom: 12px;
  background: var(--color-bg-secondary);
  border-radius: 18px;
  width: fit-content;
  max-width: 100px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-tertiary);
  animation: typingAnimation 1.4s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingAnimation {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

/* Message Input */
.message-input-container {
  position: relative;
  border-top: 1px solid var(--color-border);
  padding: var(--space-md) var(--space-lg);
  background: var(--color-bg);
  overflow: visible;
}

.message-form {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  position: relative;
}

.message-tools {
  display: flex;
  gap: 4px;
  align-items: center;
}

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

.tool-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.5;
}

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

.tool-btn:active {
  transform: scale(0.95);
}

.message-form input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
}

.message-form input:focus {
  border-color: var(--color-primary);
}

.message-form input:disabled {
  background: var(--color-bg-tertiary);
  cursor: not-allowed;
}

.btn-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  flex-shrink: 0;
}

.btn-send:hover:not(:disabled) {
  background: var(--color-primary-hover);
}

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

/* Emoji Picker */
.emoji-picker {
  position: absolute;
  bottom: 100%;
  left: 10px;
  margin-bottom: 8px;
  width: 420px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  z-index: 1000;
}

[data-theme="dark"] .emoji-picker {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.emoji-categories {
  display: flex;
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
}

.emoji-cat-btn {
  flex: 1;
  padding: 8px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 20px;
  cursor: pointer;
  transition: background var(--transition);
}

.emoji-cat-btn:hover {
  background: var(--color-bg-tertiary);
}

.emoji-cat-btn.active {
  background: var(--color-bg);
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  padding: 8px;
  max-height: 240px;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
}

.emoji-item {
  padding: 8px;
  font-size: 24px;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.emoji-item:hover {
  background: var(--color-bg-tertiary);
  transform: scale(1.2);
}

.emoji-item:active {
  transform: scale(1.1);
}

/* ============================================
   UTILITIES
   ============================================ */

.hidden {
  display: none !important;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-tertiary);
}
/* ============================================
   CONFIG MODAL - PROMPT CONFIGURATION
   ============================================ */

.modal-large .modal-content {
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-config {
  padding: 0;
}

.modal-config .modal-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: var(--color-bg);
  z-index: 10;
}

.modal-config .modal-body {
  padding: var(--space-lg);
}

.btn-config {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition);
}

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

/* Ventas, Multimedia — sin caja, solo icono + texto */
#ventas-ia-btn,
#multimedia-btn {
  background: none;
  border: none;
  padding: 6px 8px;
  border-radius: 4px;
  color: var(--color-text-secondary);
  font-size: 12.5px;
}

#ventas-ia-btn:hover,
#multimedia-btn:hover {
  background: rgba(0,0,0,0.04);
  border: none;
  color: var(--color-text);
}

/* Prompt — texto + borde fino */
#config-btn,
.btn-prompt-header {
  background: none !important;
  border: 1px solid var(--color-border) !important;
  padding: 5px 10px !important;
  border-radius: 6px !important;
  color: var(--color-text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

#config-btn:hover,
.btn-prompt-header:hover {
  background: var(--color-bg-secondary) !important;
  border-color: var(--color-text-tertiary) !important;
  color: var(--color-text);
}

/* Required asterisk badge — shown on Prompt and WA buttons */
/* Asterisco de importancia — texto naranja limpio, sin caja */
.req-badge {
  display: inline;
  background: none;
  color: #f59e0b;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  margin-left: 1px;
  vertical-align: super;
  font-style: normal;
}

/* WA badge — superpuesto al ícono */
#wa-status {
  position: relative;
}

.req-badge-wa {
  position: absolute;
  top: 1px;
  right: 1px;
  font-size: 11px;
  margin-left: 0;
}

/* Config Steps */
.config-step {
  display: none;
}

.config-step.active {
  display: block;
}

.config-intro {
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  background: var(--color-bg-secondary);
  border-radius: 6px;
  border: 1px solid var(--color-border);
}

.config-description {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.section-title {
  font-size: 16px;
  font-weight: var(--font-weight-medium);
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

/* Industry Selector - Grid con Scroll Horizontal */
.industry-grid {
  display: grid;
  grid-template-rows: repeat(3, auto);
  grid-auto-flow: column;
  grid-auto-columns: 150px;
  gap: 10px;
  margin-bottom: var(--space-lg);
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 10px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.industry-grid::-webkit-scrollbar {
  height: 5px;
}

.industry-grid::-webkit-scrollbar-track {
  background: transparent;
}

.industry-grid::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

.industry-grid::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-tertiary);
}

.industry-card {
  padding: 16px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
  background: var(--color-bg);
  min-height: 90px;
}

.industry-card:hover {
  border-color: var(--color-text-tertiary);
  background: var(--color-bg-secondary);
}

.industry-card.selected {
  border-color: var(--color-text);
  background: var(--color-bg-tertiary);
}

.industry-card svg {
  width: 32px;
  height: 32px;
  color: var(--color-text);
  margin-bottom: 8px;
  flex-shrink: 0;
}

.industry-card h4 {
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  margin-top: 4px;
  line-height: 1.3;
  color: var(--color-text);
}

.industry-card p {
  display: none;
}

/* Subtype Selector */
.subtype-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.subtype-card {
  padding: var(--space-md);
  border: 2px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.subtype-card:hover {
  border-color: var(--color-text-tertiary);
  background: var(--color-bg-secondary);
}

.subtype-card.selected {
  border-color: var(--color-primary);
  background: var(--color-bg-tertiary);
}

.subtype-icon {
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.subtype-icon svg {
  color: var(--color-text);
}

.subtype-card h5 {
  font-size: 14px;
  font-weight: var(--font-weight-medium);
}

/* Config Form */
.config-form-container {
  max-height: 50vh;
  overflow-y: auto;
  margin-bottom: var(--space-lg);
}

.form-section {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.form-section:last-child {
  border-bottom: none;
}

.form-section-header {
  margin-bottom: var(--space-md);
}

.form-section-title {
  font-size: 15px;
  font-weight: var(--font-weight-medium);
  margin-bottom: 4px;
}

.form-section-description {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.form-field {
  margin-bottom: var(--space-md);
}

.form-field label {
  display: block;
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  margin-bottom: 6px;
  color: var(--color-text);
}

.form-field label .required {
  color: var(--color-error);
}

.form-field-help {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-top: 4px;
}

.form-field input[type="text"],
.form-field input[type="time"],
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  transition: border var(--transition);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

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

.form-field-multiselect {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.multiselect-option {
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.multiselect-option:hover {
  background: var(--color-bg-secondary);
}

.multiselect-option.selected {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

/* Prompt Preview */
.prompt-preview-container {
  margin-bottom: var(--space-lg);
}

.prompt-preview {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: var(--space-md);
  max-height: 50vh;
  overflow-y: auto;
}

.prompt-preview pre {
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: var(--color-text);
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Config Actions */
.config-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

/* Settings Section */
.settings-section {
  margin-bottom: var(--space-xl);
}

.settings-section-title {
  font-size: 16px;
  font-weight: var(--font-weight-medium);
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

.settings-section-description {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
  line-height: 1.6;
}

.form-checkbox {
  width: 18px;
  height: 18px;
  margin-right: var(--space-sm);
  cursor: pointer;
  accent-color: var(--color-primary);
}

.form-textarea {
  width: 100%;
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text);
  resize: vertical;
  transition: border-color var(--transition);
}

.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.form-textarea::placeholder {
  color: var(--color-text-tertiary);
}

.form-hint {
  display: block;
  margin-top: var(--space-sm);
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* ============================================
   AI TOGGLE SWITCH - Pequeño y elegante
   ============================================ */

.ai-toggle {
  position: relative;
  width: 32px;
  height: 18px;
  background: var(--color-border);
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}

.ai-toggle:hover {
  background: var(--color-border-light);
}

.ai-toggle.active {
  background: var(--color-success);
}

.ai-toggle.active:hover {
  background: #15803d;
}

.ai-toggle-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.ai-toggle.active .ai-toggle-slider {
  transform: translateX(14px);
}

.ai-toggle-label {
  font-size: 10px;
  color: var(--color-text-tertiary);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  user-select: none;
  transition: color 0.2s ease;
}

.ai-toggle.active + .ai-toggle-label {
  color: var(--color-success);
}

/* ============================================
   PROMPT TABS - Asistido / Manual
   ============================================ */

.prompt-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: var(--space-lg);
  padding: 4px;
  background: var(--color-bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.prompt-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.prompt-tab:hover {
  background: var(--color-bg-tertiary);
}

.prompt-tab.active {
  background: var(--color-bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.prompt-tab .tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
}

.prompt-tab .tab-icon svg {
  width: 24px;
  height: 24px;
}

.prompt-tab.active .tab-icon {
  color: var(--color-primary);
}

.prompt-tab .tab-text {
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
}

.prompt-tab .tab-hint {
  font-size: 11px;
  color: var(--color-text-tertiary);
}

.prompt-tab.active .tab-text {
  color: var(--color-primary);
}

/* Active Badge on Tab */
.tab-active-badge {
  display: none;
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--color-success);
  color: white;
}

.tab-active-badge.visible {
  display: inline-block;
}

.prompt-tab {
  position: relative;
}

.prompt-tab.is-active-prompt {
  border: 2px solid var(--color-success);
}

.prompt-tab.is-active-prompt .tab-active-badge {
  display: inline-block;
}

/* Active Prompt Info Bar */
.active-prompt-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: var(--space-md);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.04) 100%);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 8px;
  font-size: 13px;
}

.active-prompt-label {
  color: var(--color-text-secondary);
}

.active-prompt-type {
  font-weight: 600;
  color: var(--color-success);
}

.active-prompt-type.none {
  color: var(--color-text-tertiary);
  font-weight: normal;
}

/* Prompt Tab Content */
.prompt-tab-content {
  display: none;
}

.prompt-tab-content.active {
  display: block;
}

/* Manual Prompt Section */
.manual-prompt-section {
  margin-bottom: var(--space-lg);
}

.manual-prompt-section .form-group {
  max-width: 100%;
  width: 100%;
  margin: 0;
}

.prompt-textarea {
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.6;
  min-height: 300px;
  width: 100%;
}

.prompt-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg-secondary);
  border-radius: 6px;
  font-size: 13px;
}

.prompt-status .status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-tertiary);
}

.prompt-status.saved .status-indicator {
  background: var(--color-success);
}

.prompt-status .status-text {
  color: var(--color-text-secondary);
}

/* Settings Info */
.settings-info {
  background: var(--color-bg-secondary);
  border-radius: 6px;
  padding: var(--space-md);
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
}

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

.info-label {
  color: var(--color-text-secondary);
  font-size: 13px;
}

.info-value {
  color: var(--color-text);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
}

/* ============================================
   STATISTICS MODAL
   ============================================ */

.modal-stats {
  max-width: 1000px;
}

.modal-stats .modal-header {
  position: sticky;
  top: 0;
  background: var(--color-bg);
  z-index: 10;
}

.modal-stats .modal-body {
  padding: 0;
}

/* KPI Cards Grid */
.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* Siempre 4 columnas en una fila */
  gap: var(--space-md);
  padding: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

@media (max-width: 900px) {
  .stats-kpi-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columnas en tablets */
  }
}

@media (max-width: 600px) {
  .stats-kpi-grid {
    grid-template-columns: 1fr; /* 1 columna en móviles */
  }
}

.stats-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: var(--space-md);
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  transition: all var(--transition);
}

.stats-card:hover {
  border-color: var(--color-text-tertiary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.stats-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--color-bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-text-secondary);
}

.stats-card-content {
  flex: 1;
  min-width: 0;
}

.stats-card-label {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: var(--font-weight-medium);
}

.stats-card-value {
  font-size: 24px;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.2;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.stats-card-sublabel {
  font-size: 11px;
  color: var(--color-text-tertiary);
}

/* Charts Section */
.stats-charts {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.stats-chart-container {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: var(--space-lg);
}

.stats-chart-title {
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  margin-bottom: var(--space-md);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Bar Chart */
.stats-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
  padding: var(--space-sm) 0;
}

.bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.bar-visual {
  width: 100%;
  background: var(--color-text);
  border-radius: 2px 2px 0 0;
  position: relative;
  transition: all 0.2s ease;
  cursor: pointer;
  min-height: 2px;
}

.bar-visual:hover {
  background: var(--color-text-secondary);
}

.bar-value {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.bar-label {
  font-size: 10px;
  color: var(--color-text-tertiary);
  text-align: center;
  font-weight: 400;
}

/* Split Chart (AI vs Manual) */
.stats-split-chart {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.split-chart-visual {
  padding: var(--space-md) 0;
}

.split-bar {
  height: 40px;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  border: 1px solid var(--color-border);
}

.split-bar-ai {
  background: var(--color-text);
  transition: width 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 500;
  font-size: 13px;
}

.split-bar-manual {
  background: var(--color-bg-tertiary);
  transition: width 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  font-weight: 500;
  font-size: 13px;
}

.split-chart-legend {
  display: flex;
  gap: var(--space-lg);
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 3px;
}

.legend-label {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.legend-label strong {
  color: var(--color-text);
  font-weight: var(--font-weight-medium);
}

/* Top Contacts List */
.stats-top-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.top-contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm);
  background: var(--color-bg-secondary);
  border-radius: 6px;
  transition: all var(--transition);
}

.top-contact-item:hover {
  background: var(--color-bg-tertiary);
}

.top-contact-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.top-contact-rank.gold {
  background: var(--color-text);
}

.top-contact-rank.silver {
  background: var(--color-text-secondary);
}

.top-contact-rank.bronze {
  background: var(--color-text-tertiary);
  color: var(--color-text);
}

.top-contact-info {
  flex: 1;
  min-width: 0;
}

.top-contact-name {
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-contact-count {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.top-contact-bar {
  flex: 1;
  height: 8px;
  background: var(--color-bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.top-contact-bar-fill {
  height: 100%;
  background: var(--color-text);
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* Memory Stats */
.memory-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.memory-stat-item {
  text-align: center;
  padding: var(--space-md);
  background: var(--color-bg-secondary);
  border-radius: 4px;
}

.memory-stat-label {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-top: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.memory-stat-value {
  font-size: 28px;
  font-weight: 500;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.stats-footer {
  padding: var(--space-lg);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
}

/* ============================================
   CONNECTION MODALS
   ============================================ */

.modal-compact {
  max-width: 420px;
}

.modal-body-center {
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 240px;
}

.modal-footer-center {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.modal-footer-center button {
  width: 100%;
}

.modal-title svg {
  margin-right: 8px;
  vertical-align: middle;
}

/* Status dots in header buttons */
.btn-status {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

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

.btn-status .status-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-tertiary);
  border: 2px solid var(--color-bg);
  transition: all var(--transition);
}

.btn-status .status-dot.connected {
  background: var(--color-success);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.btn-status .status-dot.error {
  background: var(--color-error);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.btn-status .status-dot.waiting {
  background: var(--color-warning);
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.1);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Success/Info backgrounds */
:root {
  --color-success-bg: #f0fdf4;
  --color-info-bg: #eff6ff;
}

[data-theme="dark"] {
  --color-success-bg: #14532d;
  --color-info-bg: #1e3a8a;
}

/* ============================================
   CONNECTION MODALS - WhatsApp & Telegram
   ============================================ */

.modal-connection {
  max-width: 400px;
  border-radius: 16px;
}

.modal-header-minimal {
  border-bottom: none;
  padding: var(--space-md) var(--space-lg);
  justify-content: flex-end;
}

.modal-footer-minimal {
  border-top: none;
  padding: var(--space-lg);
  gap: var(--space-sm);
}

/* Minimal Buttons */
.btn-minimal {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-minimal:hover {
  color: var(--color-text);
  border-color: var(--color-text-secondary);
}

.btn-primary-minimal {
  background: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
}

.btn-primary-minimal:hover {
  opacity: 0.85;
}

.btn-disconnect {
  color: var(--color-error);
  border-color: transparent;
}

.btn-disconnect:hover {
  border-color: var(--color-error);
}

/* Connection View */
.connection-view {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
}

.connection-hint {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: var(--space-md);
  letter-spacing: 0.5px;
}

/* QR Display */
.qr-display {
  margin: 0 auto;
  display: inline-block;
}

.qr-image {
  width: 220px;
  height: 220px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
  padding: var(--space-sm);
}

[data-theme="dark"] .qr-image {
  background: var(--color-bg-secondary);
}

/* Phone Input for Pairing Code */
.phone-input-wrap {
  padding: var(--space-lg) var(--space-xl) var(--space-md);
  text-align: center;
}
.phone-input-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-md);
  color: var(--color-text-secondary);
}
.phone-input-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
}
.phone-input-sub {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}
.phone-input-row {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--color-bg-secondary);
  transition: border-color 0.15s ease;
}
.phone-input-row:focus-within {
  border-color: var(--color-text-secondary);
}
.phone-flag {
  padding: 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-bg-tertiary);
  border-right: 1px solid var(--color-border);
  height: 44px;
  display: flex;
  align-items: center;
  user-select: none;
}
.phone-input-field {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0 14px;
  height: 44px;
  font-size: 15px;
  color: var(--color-text);
  font-family: inherit;
  outline: none;
  letter-spacing: 0.5px;
}
.phone-input-field::placeholder {
  color: var(--color-text-tertiary);
  font-weight: 400;
}
.phone-input-hint {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-top: var(--space-sm);
  line-height: 1.5;
}
.phone-input-hint strong {
  color: var(--color-text-secondary);
}

/* Pairing Code */
.pairing-code {
  font-size: 36px;
  font-weight: 500;
  letter-spacing: 0.4em;
  color: var(--color-text);
  font-family: 'SF Mono', 'Courier New', monospace;
  margin: var(--space-xl) 0 var(--space-md);
}

/* Sync Animation */
.connection-sync-animation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  padding: var(--space-xl) 0;
  position: relative;
}

.sync-device, .sync-cloud {
  color: var(--color-text-secondary);
  opacity: 0.6;
}

.sync-lines {
  display: flex;
  gap: 4px;
  align-items: center;
}

.sync-lines span {
  width: 8px;
  height: 1px;
  background: var(--color-text-secondary);
  opacity: 0.3;
  animation: syncPulse 1.5s ease-in-out infinite;
}

.sync-lines span:nth-child(1) { animation-delay: 0s; }
.sync-lines span:nth-child(2) { animation-delay: 0.2s; }
.sync-lines span:nth-child(3) { animation-delay: 0.4s; }

@keyframes syncPulse {
  0%, 100% { opacity: 0.2; transform: scaleX(1); }
  50% { opacity: 0.8; transform: scaleX(1.5); }
}

.sync-circle {
  position: absolute;
  width: 120px;
  height: 120px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  opacity: 0.3;
  animation: syncCircle 3s ease-in-out infinite;
}

@keyframes syncCircle {
  0%, 100% { transform: scale(0.9); opacity: 0.2; }
  50% { transform: scale(1.1); opacity: 0.4; }
}

.connection-status-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.connection-ai-status {
  font-size: 11px;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Legacy Styles (kept for backwards compatibility) */
.connection-method-label {
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-lg);
}

/* Form Group */
.form-group {
  max-width: 340px;
  margin: var(--space-xl) auto;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 15px;
  color: var(--color-text);
  background: var(--color-bg);
  transition: all var(--transition);
  font-family: inherit;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-text);
}

.form-input-code {
  text-align: center;
  font-size: 24px;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.5em;
  font-family: 'SF Mono', 'Courier New', monospace;
}

.form-hint {
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin-top: var(--space-sm);
  line-height: 1.5;
}

/* Connection Success */
.connection-success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  color: var(--color-text);
}

.connection-success-title {
  font-size: 18px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.connection-success-phone {
  font-size: 13px;
  color: var(--color-text-secondary);
  font-family: 'SF Mono', monospace;
}

/* Buttons */
.btn {
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.btn:hover {
  background: var(--color-bg-secondary);
}

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

.btn-primary:hover {
  background: var(--color-text-secondary);
  border-color: var(--color-text-secondary);
}

.btn-secondary {
  background: var(--color-bg);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-bg-secondary);
}

.btn-error {
  background: var(--color-error);
  color: #fff;
  border-color: var(--color-error);
}

.btn-error:hover {
  opacity: 0.9;
}
/* ============================================
   TELEGRAM MODAL
   ============================================ */

.tg-step-label {
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-tertiary);
  margin-bottom: 8px;
  margin-top: 8px;
}

.tg-step-hint {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

.tg-phone-row {
  display: flex;
  gap: 8px;
  text-align: left;
  max-width: 300px;
  margin: 0 auto 8px;
}

.tg-country-code {
  width: 72px;
  flex-shrink: 0;
  padding-left: 10px;
  padding-right: 4px;
  cursor: pointer;
  appearance: auto;
  -webkit-appearance: auto;
  font-size: 14px;
}

.tg-phone-number {
  flex: 1;
  min-width: 0;
}

.tg-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  margin: 0 auto 20px;
}

.tg-connected-label {
  font-size: 15px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  margin-bottom: 12px;
}

.tg-connected-name {
  font-size: 14px;
  color: var(--color-text);
  margin-bottom: 2px;
}

.tg-connected-handle {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.tg-connected-phone {
  font-size: 12px;
  color: var(--color-text-tertiary);
  font-family: 'SF Mono', 'Courier New', monospace;
}

.tg-modal-footer {
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  align-items: stretch;
  padding: 16px 24px 24px;
}

.tg-btn-full {
  width: 100%;
  justify-content: center;
  padding: 12px 16px;
}

.tg-btn-disconnect {
  background: none;
  border: none;
  color: var(--color-text-tertiary);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
  font-family: inherit;
  transition: color var(--transition);
  text-align: center;
}

.tg-btn-disconnect:hover {
  color: var(--color-error);
}

/* ============================================
   SUPPORT CHAT MODAL
   ============================================ */

.support-chat-modal {
  max-width: 500px;
  width: 90%;
  height: 70vh;
  max-height: 600px;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
}

.support-chat-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  padding: 0 !important;
}

.support-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
  background: var(--color-bg-secondary);
}

.support-message {
  margin-bottom: var(--space-md);
  display: flex;
  flex-direction: column;
}

.support-message-assistant .support-message-content {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 16px 16px 16px 4px;
  padding: var(--space-md);
  max-width: 85%;
  font-size: 14px;
  line-height: 1.6;
}

.support-message-user {
  align-items: flex-end;
}

.support-message-user .support-message-content {
  background: #000;
  color: #fff;
  border-radius: 16px 16px 4px 16px;
  padding: var(--space-md);
  max-width: 85%;
  font-size: 14px;
  line-height: 1.6;
}

[data-theme="dark"] .support-message-user .support-message-content {
  background: #333;
  color: #fff;
}

.support-chat-input-area {
  padding: var(--space-md);
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.support-chat-input {
  flex: 1;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: var(--font-family);
  resize: none;
  background: var(--color-bg-secondary);
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
  min-height: 40px;
  max-height: 120px;
  line-height: 1.4;
}

.support-chat-input:focus {
  outline: none;
  border-color: var(--color-text-tertiary);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .support-chat-input:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.support-chat-input::placeholder {
  color: var(--color-text-tertiary);
}

#support-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  border-radius: 50%;
  background: #000;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

#support-send-btn:hover {
  transform: scale(1.05);
}

#support-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

#support-send-btn svg {
  width: 18px;
  height: 18px;
}

[data-theme="dark"] #support-send-btn {
  background: #fff;
  color: #000;
}

.support-message-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: var(--space-md);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  max-width: 85%;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.support-loading-dots {
  display: flex;
  gap: 4px;
}

.support-loading-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-text-tertiary);
  animation: supportDotPulse 1.4s infinite ease-in-out;
}

.support-loading-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.support-loading-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes supportDotPulse {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 🎛️  PROMPT EN 3 PARTES: Welcome + Context + Payment                     */
/* ═══════════════════════════════════════════════════════════════════════════ */

.prompt-parts-separator {
  margin: 24px 0 16px;
  padding: 0;
  text-align: center;
  position: relative;
}

.prompt-parts-separator::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--border-subtle, #e5e7eb);
}

.prompt-parts-separator span {
  position: relative;
  background: var(--bg-primary, #fff);
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Sección colapsable de cada parte */
.prompt-part-section {
  border: 1px solid var(--border-subtle, #e5e7eb);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.prompt-part-section:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.prompt-part-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  background: var(--bg-secondary, #f9fafb);
  transition: background 0.2s;
  user-select: none;
}

.prompt-part-header:hover {
  background: var(--bg-hover, #f3f4f6);
}

.prompt-part-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
}

.prompt-part-icon {
  font-size: 20px;
}

/* SVG icon in section headers */
.prompt-part-icon-svg {
  flex-shrink: 0;
  color: var(--text-secondary, #6b7280);
}

.prompt-part-section:hover .prompt-part-icon-svg {
  color: var(--color-primary, #6366f1);
}

.prompt-part-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg-tertiary, #e5e7eb);
  color: var(--text-secondary, #6b7280);
}

.prompt-part-badge.active {
  background: #dcfce7;
  color: #166534;
}

.prompt-part-chevron {
  transition: transform 0.3s;
  color: var(--text-secondary, #6b7280);
}

.prompt-part-chevron.open {
  transform: rotate(180deg);
}

.prompt-part-body {
  padding: 14px 5%;
  border-top: 1px solid var(--border-subtle, #e5e7eb);
}

.prompt-part-body.hidden {
  display: none;
}

.prompt-part-desc {
  font-size: 13px;
  color: var(--text-secondary, #6b7280);
  margin-bottom: 16px;
  line-height: 1.5;
}

/* Prompt section: textarea within .prompt-part-body */
.prompt-part-body .manual-prompt-section {
  margin: 0;
  padding: 0;
}

.prompt-part-body .prompt-textarea {
  min-height: 220px;
}

/* Override: form-groups inside prompt cards take full width */
.prompt-part-body .form-group {
  max-width: 100%;
  width: 100%;
  margin: 0 0 16px 0;
}

.prompt-part-body .form-input,
.prompt-part-body .form-textarea,
.prompt-part-body .form-select {
  width: 100%;
  box-sizing: border-box;
}

.prompt-part-body .config-actions {
  max-width: 100%;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle, #e5e7eb);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.prompt-part-body .welcome-btn-card,
.prompt-part-body .payment-method-card {
  width: 100%;
  box-sizing: border-box;
}

/* Prompt quick-start templates */
.prompt-templates {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.prompt-templates-label {
  font-size: 11px;
  color: var(--color-text-tertiary);
  flex-shrink: 0;
  margin-right: 2px;
}

.prompt-template-btn {
  padding: 5px 11px;
  font-size: 12px;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  background: var(--color-bg);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.prompt-template-btn:hover {
  border-color: var(--color-primary, #667eea);
  color: var(--color-primary, #667eea);
}

/* Toggle switch — scoped to .toggle-label to avoid conflict with .toggle-switch .toggle-slider */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary, #1f2937);
}

.toggle-label input[type="checkbox"] {
  display: none;
}

.toggle-label .toggle-slider {
  width: 44px;
  height: 24px;
  background: #d1d5db !important;
  border-radius: 12px;
  position: relative !important;
  transition: background 0.3s;
  flex-shrink: 0;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  display: inline-block;
}

/* Kill the ghost ::before from global .toggle-slider */
.toggle-label .toggle-slider::before {
  display: none !important;
}

.toggle-label .toggle-slider::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-label input:checked + .toggle-slider {
  background: #22c55e !important;
}

.toggle-label input:checked + .toggle-slider::after {
  transform: translateX(20px);
}

/* Welcome button cards */
.welcome-btn-card {
  border: 1px solid var(--border-subtle, #e5e7eb);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  background: var(--bg-primary, #fff);
  position: relative;
}

.welcome-btn-card .btn-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.welcome-btn-card .btn-card-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary, #6b7280);
}

.welcome-btn-card .btn-card-remove {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 18px;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background 0.2s;
}

.welcome-btn-card .btn-card-remove:hover {
  background: #fee2e2;
}

.welcome-btn-card .btn-card-row {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.welcome-btn-card .btn-card-row.three-col {
  grid-template-columns: 60px 1fr 1fr;
}

.welcome-btn-card .form-input,
.welcome-btn-card .form-select {
  padding: 8px 10px;
  font-size: 13px;
  border: 1px solid var(--border-subtle, #e5e7eb);
  border-radius: 8px;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #1f2937);
}

.welcome-btn-card .form-select {
  appearance: auto;
}

.welcome-btn-card .action-data-container {
  margin-top: 8px;
  padding: 10px;
  background: var(--bg-secondary, #f9fafb);
  border-radius: 8px;
}

.welcome-btn-card .action-data-container label {
  font-size: 12px;
  color: var(--text-secondary, #6b7280);
  display: block;
  margin-bottom: 4px;
}

/* Payment method cards */
.payment-method-card {
  border: 1px solid var(--border-subtle, #e5e7eb);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  background: var(--bg-primary, #fff);
}

.payment-method-card .method-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.payment-method-card .method-card-remove {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 18px;
  padding: 2px 6px;
  border-radius: 6px;
}

.payment-method-card .method-card-remove:hover {
  background: #fee2e2;
}

.payment-method-card .method-row {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.payment-method-card .method-row.full {
  grid-template-columns: 1fr;
}

.payment-method-card .form-input {
  padding: 8px 10px;
  font-size: 13px;
  border: 1px solid var(--border-subtle, #e5e7eb);
  border-radius: 8px;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #1f2937);
}

/* Small button */
.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 8px;
  margin-top: 8px;
}

/* ===========================
   PIPELINE VERTICAL BAR
   36px collapsed → 280px expanded
   Minimal white, today's high-value leads
   =========================== */

@keyframes arrowPulse {
  0%, 100% { transform: translateX(0); opacity: 0.35; }
  50% { transform: translateX(-3px); opacity: 0.8; }
}

@keyframes arrowExpanded {
  0% { transform: rotate(180deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.15); }
  100% { transform: rotate(180deg) scale(1); }
}

.pipeline-bar {
  position: fixed;
  right: 0;
  top: 60px;
  width: 36px;
  height: calc(100vh - 60px);
  background: #ffffff;
  z-index: 900;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease;
  overflow: hidden;
  border-left: 1px solid rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
}

.pipeline-bar:hover {
  width: 280px;
  box-shadow: -6px 0 24px rgba(0,0,0,0.07);
}

.pipeline-bar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  cursor: pointer;
  flex-shrink: 0;
}

.pipeline-arrow {
  color: #1a1a1a;
  animation: arrowPulse 2.4s ease-in-out infinite;
}

.pipeline-bar:hover .pipeline-arrow {
  animation: arrowExpanded 0.5s ease forwards;
}

/* Collapsed */
.pipeline-bar-collapsed {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 0;
  gap: 8px;
  min-width: 36px;
  transition: opacity 0.2s ease;
}

.pipeline-bar:hover .pipeline-bar-collapsed {
  opacity: 0;
  pointer-events: none;
  position: absolute;
}

.pipeline-mini-dots {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 4px 0;
}

.pipeline-mini-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.pipeline-mini-dot.hot { background: #ef4444; }
.pipeline-mini-dot.warm { background: #f59e0b; }

.pipeline-bar-total {
  color: rgba(0,0,0,0.25);
  font-size: 9px;
  font-weight: 600;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

/* Expanded */
.pipeline-bar-expanded {
  display: flex;
  flex-direction: column;
  padding: 0 16px 16px;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.25s ease 0.12s;
  overflow-y: auto;
  height: 100%;
  min-width: 280px;
}

.pipeline-bar-expanded::-webkit-scrollbar { width: 3px; }
.pipeline-bar-expanded::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 3px; }

.pipeline-bar:hover .pipeline-bar-expanded { opacity: 1; }

.pipeline-bar-header { padding-bottom: 0; }

.pipeline-bar-date {
  font-size: 11px;
  font-weight: 600;
  color: rgba(0,0,0,0.35);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pipeline-bar-desc {
  font-size: 12px;
  color: rgba(0,0,0,0.45);
  margin: 0;
  line-height: 1.4;
}

/* Summary dots */
.pipeline-bar-summary {
  display: flex;
  gap: 14px;
  padding: 6px 0;
}

.pipeline-summary-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.pipeline-summary-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.pipeline-summary-dot.hot { background: #ef4444; }
.pipeline-summary-dot.warm { background: #f59e0b; }
.pipeline-summary-dot.total { background: rgba(0,0,0,0.2); }

.pipeline-summary-count {
  font-size: 13px;
  font-weight: 700;
  color: #1a1a1a;
}

.pipeline-summary-label {
  font-size: 10px;
  color: rgba(0,0,0,0.35);
}

/* Today's lead cards */
.pipeline-today-leads {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pipeline-today-lead {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.pipeline-today-lead:hover {
  background: rgba(0,0,0,0.03);
}

.pipeline-today-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pipeline-today-dot.hot { background: #ef4444; }
.pipeline-today-dot.warm { background: #f59e0b; }
.pipeline-today-dot.cold { background: #3b82f6; }
.pipeline-today-dot.default { background: #d1d5db; }

.pipeline-today-info {
  flex: 1;
  min-width: 0;
}

.pipeline-today-name {
  font-size: 12px;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pipeline-today-detail {
  font-size: 10px;
  color: rgba(0,0,0,0.35);
  margin-top: 1px;
}

.pipeline-today-score {
  font-size: 10px;
  font-weight: 700;
  color: rgba(0,0,0,0.4);
  flex-shrink: 0;
}

.pipeline-today-empty {
  color: rgba(0,0,0,0.25);
  font-size: 11px;
  text-align: center;
  padding: 20px 8px;
}

/* Link to sales.html */
.pipeline-bar-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(0,0,0,0.4);
  text-decoration: none;
  padding: 10px 0 4px;
  border-top: 1px solid rgba(0,0,0,0.05);
  transition: color 0.15s ease;
  margin-top: auto;
}

.pipeline-bar-link:hover {
  color: #1a1a1a;
}

/* Floating label — vertical side tab anchored to the right panel */
.pipeline-floating-label {
  position: fixed;
  right: 36px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 9px;
  background: #1a1a1a;
  border-radius: 8px 0 0 8px;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 899;
  box-shadow: -3px 0 12px rgba(0,0,0,0.12);
}

.pipeline-bar:hover ~ .pipeline-floating-label {
  opacity: 0;
  transform: translateY(-50%) translateX(8px);
  pointer-events: none;
}

.pipeline-floating-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  animation: floatingDotPulse 2s ease-in-out infinite;
}

.pipeline-floating-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  white-space: nowrap;
  line-height: 1;
}

@keyframes floatingDotPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.4); }
}



/* ===========================
   LEAD DETAIL MODAL
   =========================== */

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

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

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

.pl-lead-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}

.pl-lead-modal.active { display: flex; }

.pl-lead-modal-backdrop {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(3px);
}

.pl-lead-modal-card {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  width: 90%;
  max-width: 440px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.04);
  animation: plModalIn 0.25s ease;
}

.pl-lead-modal.closing .pl-lead-modal-card {
  animation: plModalOut 0.2s ease forwards;
}

.pl-lead-modal-close {
  position: absolute;
  top: 12px; right: 12px;
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: rgba(0,0,0,0.3);
  border-radius: 8px;
  transition: all 0.15s ease;
  z-index: 1;
}

.pl-lead-modal-close:hover {
  background: rgba(0,0,0,0.05);
  color: rgba(0,0,0,0.6);
}

.pl-lead-modal-body {
  padding: 28px 24px 24px;
}

.pl-lead-modal-loading {
  display: flex;
  justify-content: center;
  padding: 40px 0;
}

.pl-lead-modal-spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid rgba(0,0,0,0.08);
  border-top-color: #1a1a1a;
  border-radius: 50%;
  animation: plSpinner 0.7s linear infinite;
}

.pl-lead-modal-empty {
  text-align: center;
  padding: 30px 20px;
  color: rgba(0,0,0,0.35);
  font-size: 13px;
}

/* Modal head */
.pl-lead-modal-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.pl-lead-modal-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.pl-lead-modal-avatar.hot { background: #ef4444; }
.pl-lead-modal-avatar.warm { background: #f59e0b; }
.pl-lead-modal-avatar.cold { background: #3b82f6; }
.pl-lead-modal-avatar.default { background: #9ca3af; }

.pl-lead-modal-head-info {
  flex: 1;
  min-width: 0;
}

.pl-lead-modal-name {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pl-lead-modal-phone {
  font-size: 12px;
  color: rgba(0,0,0,0.35);
  margin-top: 2px;
}

.pl-lead-modal-score-big {
  font-size: 28px;
  font-weight: 800;
  flex-shrink: 0;
  line-height: 1;
}

.pl-lead-modal-score-big span {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.5;
  margin-left: 2px;
}

.pl-lead-modal-score-big.hot { color: #ef4444; }
.pl-lead-modal-score-big.warm { color: #f59e0b; }
.pl-lead-modal-score-big.cold { color: #3b82f6; }
.pl-lead-modal-score-big.default { color: #9ca3af; }

/* Tags */
.pl-lead-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.pl-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.pl-tag.hot { background: rgba(239,68,68,0.1); color: #dc2626; }
.pl-tag.warm { background: rgba(245,158,11,0.1); color: #d97706; }
.pl-tag.cold { background: rgba(59,130,246,0.1); color: #2563eb; }
.pl-tag.default { background: rgba(0,0,0,0.05); color: rgba(0,0,0,0.5); }
.pl-tag.stage { background: rgba(99,102,241,0.08); color: #6366f1; }
.pl-tag.urgency-high { background: rgba(239,68,68,0.08); color: #dc2626; }
.pl-tag.urgency-medium { background: rgba(245,158,11,0.08); color: #d97706; }
.pl-tag.urgency-low { background: rgba(0,0,0,0.04); color: rgba(0,0,0,0.45); }
.pl-tag.intention { background: rgba(16,185,129,0.08); color: #059669; }

/* Field grid */
.pl-lead-modal-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  padding: 14px 0;
  border-top: 1px solid rgba(0,0,0,0.05);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.pl-lead-modal-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pl-field-label {
  font-size: 11px;
  color: rgba(0,0,0,0.4);
}

.pl-field-value {
  font-size: 12px;
  font-weight: 600;
  color: #1a1a1a;
}

/* Actions */
.pl-lead-modal-actions {
  display: flex;
  gap: 10px;
}

.pl-lead-modal-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pl-lead-modal-btn.primary {
  background: #1a1a1a;
  color: #fff;
}

.pl-lead-modal-btn.primary:hover {
  background: #333;
}

.pl-lead-modal-btn.secondary {
  background: rgba(0,0,0,0.04);
  color: rgba(0,0,0,0.55);
}

.pl-lead-modal-btn.secondary:hover {
  background: rgba(0,0,0,0.08);
  color: #1a1a1a;
}

#dashboard-screen .main-content {
  margin-right: 36px;
}

