@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  /* Dark Theme Variable definitions (default) */
  --bg-primary: #080c14;
  --bg-secondary: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.65);
  --bg-card-hover: rgba(30, 41, 59, 0.7);
  --border-color: rgba(255, 255, 255, 0.06);
  --border-focus: rgba(99, 102, 241, 0.5);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Brand colors */
  --color-primary: #6366f1; /* Indigo */
  --color-primary-rgb: 99, 102, 241;
  --color-secondary: #d946ef; /* Magenta */
  --color-success: #10b981; /* Emerald */
  --color-warning: #f59e0b; /* Amber */
  --color-danger: #ef4444; /* Rose */
  --color-info: #0ea5e9; /* Sky Blue */
  
  --gradient-brand: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #d946ef 100%);
  --gradient-card: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
  --shadow-main: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.light-theme {
  /* Light Theme Variable overrides */
  --bg-primary: #f1f5f9;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.75);
  --bg-card-hover: rgba(248, 250, 252, 0.95);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-focus: rgba(99, 102, 241, 0.4);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --shadow-main: 0 8px 32px 0 rgba(148, 163, 184, 0.18);
  --shadow-glow: 0 4px 20px rgba(99, 102, 241, 0.08);
  --gradient-card: linear-gradient(180deg, rgba(0, 0, 0, 0.01) 0%, rgba(0, 0, 0, 0) 100%);
}

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

body {
  font-family: 'Plus Jakarta Sans', 'Outfit', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Glassmorphism General Card Styling */
.glass-card {
  background: var(--gradient-card), var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-main);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}


.glass-card:hover {
  border-color: rgba(var(--color-primary-rgb), 0.25);
  box-shadow: var(--shadow-main), var(--shadow-glow);
}

/* Main Layout Grid */
.app-container {
  display: flex;
  width: 100%;
  position: relative;
}

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

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin-bottom: 32px;
}

.sidebar-collapse-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  right: -12px;
  top: 36px;
  z-index: 110;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: var(--transition);
}
.sidebar-collapse-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
  transform: scale(1.1);
}
.sidebar-collapse-btn i {
  width: 14px;
  height: 14px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 20px;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.logo-text {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  transition: var(--transition);
}

.nav-item a i {
  font-size: 18px;
}

.nav-item.active a, .nav-item a:hover {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.1);
}

.nav-item.active a {
  border-left: 3px solid var(--color-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.02) 100%);
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-top: 1px solid var(--border-color);
}

/* Theme Toggle Button & Data Source Indicator */
.theme-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}
.theme-toggle-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
}

.source-status {
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.05);
  border: 1px dashed rgba(99, 102, 241, 0.2);
  font-size: 12px;
}
.source-status-title {
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.source-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  color: var(--color-primary);
}
.source-status-badge.live {
  color: var(--color-success);
}
.source-status-badge.csv {
  color: var(--color-warning);
}

/* Content Area */
.main-content {
  margin-left: 260px;
  padding: 40px;
  width: calc(100% - 260px);
  min-width: 0; /* Allow the content area to shrink below its min-content size in the flex container */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 32px;
  transition: var(--transition);
}

/* Top Header Bar */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.header-title h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.header-title p {
  color: var(--text-secondary);
  font-size: 15px;
  margin-top: 4px;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--gradient-brand);
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}
.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
}
.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
  border-color: rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: var(--color-danger);
  color: white;
  border-color: var(--color-danger);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}
.btn-icon {
  padding: 10px;
  border-radius: var(--radius-md);
}

/* Tab Sections */
.tab-content {
  display: none;
  animation: fadeIn 0.4s ease;
}
.tab-content.active {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* KPI Cards Layout */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

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

.kpi-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kpi-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-value {
  font-family: 'Outfit', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
}

.kpi-trend {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.trend-up { color: var(--color-success); }
.trend-down { color: var(--color-danger); }

.kpi-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-size: 20px;
}

/* Dashboard Plots/Widgets Grid */
.dashboard-grid-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.dashboard-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 1024px) {
  .dashboard-grid-1, .dashboard-grid-2 {
    grid-template-columns: 1fr;
  }
}

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

.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 600;
}

/* Activity Log styles */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.activity-item {
  display: flex;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}
.activity-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.activity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-primary);
  margin-top: 5px;
  box-shadow: 0 0 8px var(--color-primary);
}

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

.activity-text {
  font-size: 14px;
  line-height: 1.4;
}
.activity-text strong {
  font-weight: 600;
  color: var(--text-primary);
}

.activity-subtext {
  font-size: 12px;
  color: var(--text-muted);
}

.activity-time {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Interactive Table Component */
.table-container {
  overflow: auto;
  max-height: calc(100vh - 365px);
  min-height: 250px;
  width: 100%;
  padding-bottom: 12px;
  -webkit-overflow-scrolling: touch;
  position: relative;
  cursor: grab;
}
.table-container:active {
  cursor: grabbing;
}

/* Custom scrollbar for the table container to make it visible on macOS */
.table-container::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}
.table-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 5px;
}
.table-container::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.35);
  border-radius: 5px;
}
.table-container::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.65);
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 850px;
}

.custom-table th {
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 10;
  box-shadow: inset 0 -1px 0 var(--border-color);
}

.custom-table td {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

/* Constrain the program column and apply ellipsis to long names */
.custom-table td:nth-child(8) {
  max-width: 180px;
}
.custom-table td:nth-child(8) .badge-program {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  max-width: 100%;
  line-height: 1.2;
}

.custom-table tbody tr {
  transition: all 0.15s ease;
  cursor: pointer;
}

.custom-table tbody tr:hover {
  background: var(--bg-card-hover) !important;
}

.custom-table tbody tr:active {
  transform: scale(0.998);
}

/* Responsive Table styling */
@media (max-width: 1400px) {
  /* Hide Empresa column on standard laptop widths */
  .custom-table th:nth-child(3),
  .custom-table td:nth-child(3) {
    display: none;
  }
}

@media (max-width: 1200px) {
  /* Compact paddings and decrease font size */
  .custom-table th, .custom-table td {
    padding: 8px 10px;
    font-size: 12px;
  }
  /* Force minimum width to ensure horizontal scrollbar is triggered */
  .custom-table {
    min-width: 950px;
  }
}

@media (max-width: 768px) {
  /* Stack filter controls vertically on mobile */
  .table-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .search-input-wrapper {
    width: 100%;
  }
  .filter-select {
    width: 100%;
  }
}

/* Lead Badges colors */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
}

.badge-lead { background: rgba(148, 163, 184, 0.15); color: var(--text-secondary); }
.badge-mql { background: rgba(14, 165, 233, 0.15); color: var(--color-info); }
.badge-sql { background: rgba(245, 158, 11, 0.15); color: var(--color-warning); }
.badge-oportunidad { background: rgba(168, 85, 247, 0.15); color: var(--color-secondary); }
.badge-cliente { background: rgba(16, 185, 129, 0.15); color: var(--color-success); }

/* Table actions & filter panel */
.table-filters {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  align-items: center;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 250px;
}

.search-input-wrapper i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px 10px 42px;
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
  transition: var(--transition);
}
.search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
}

.filter-select {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}
.filter-select:focus {
  border-color: var(--border-focus);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(8, 12, 20, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-container {
  width: 100%;
  max-width: 650px;
  max-height: 85vh;
  overflow-y: auto;
  padding-right: 16px;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.active .modal-container {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
  margin-bottom: 20px;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition);
}
.modal-close:hover {
  color: var(--color-danger);
}

/* Contact Detail Specific Modal */
.contact-profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.contact-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.contact-header-info h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 700;
}

.contact-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.meta-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}
.meta-value {
  font-size: 14px;
  font-weight: 500;
}

/* Timeline of Contact Activity */
.contact-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 8px;
}
.timeline-item {
  display: flex;
  gap: 12px;
}
.timeline-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.1);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.timeline-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.timeline-title {
  font-size: 13px;
  font-weight: 600;
}
.timeline-date {
  font-size: 11px;
  color: var(--text-muted);
}

/* Form Styling (Settings Panel) */
.form-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) {
  .form-group-row {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input {
  background: rgba(8, 12, 20, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
  font-size: 14px;
  transition: var(--transition);
}
.form-input:focus {
  border-color: var(--border-focus);
  background: rgba(8, 12, 20, 0.6);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
}

/* Import CSV Area Drop Zone */
.csv-drop-zone {
  border: 2px dashed rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  background: rgba(99, 102, 241, 0.02);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.csv-drop-zone:hover {
  background: rgba(99, 102, 241, 0.05);
  border-color: var(--color-primary);
}
.csv-drop-zone i {
  font-size: 40px;
  color: var(--color-primary);
}
.csv-drop-zone-text {
  font-size: 15px;
  font-weight: 600;
}
.csv-drop-zone-subtext {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile Responsiveness Sidebar Toggle */
.menu-toggle {
  display: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .sidebar {
    left: -260px;
  }
  .sidebar.active {
    left: 0;
  }
  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 16px; /* Reduced from 24px on mobile for more space */
  }
  .menu-toggle {
    display: block;
    position: absolute;
    top: 20px;
    left: 16px;
    margin: 0;
    z-index: 90;
  }
  
  .glass-card {
    padding: 16px !important;
  }

  .top-header {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-top: 40px; /* Space for absolute toggle/bell */
    margin-bottom: 16px;
  }

  .notification-container {
    position: absolute;
    top: 10px;
    right: 16px;
    margin: 0 !important;
    z-index: 90;
  }

  .header-title {
    width: 100%;
    margin-top: 4px;
  }
  .header-title h1 {
    font-size: 22px !important;
  }
  .header-title p {
    font-size: 13px !important;
    line-height: 1.3;
  }

  .header-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    margin-top: 4px;
  }

  /* Commercial selector wrapper */
  .header-actions > div:first-child {
    display: flex;
    width: 100%;
    margin-right: 0 !important;
  }
  .header-actions > div:first-child select {
    flex: 1;
    width: 100%;
  }

  /* Sync & Connect buttons */
  .header-actions .btn {
    width: 100% !important;
    padding: 10px 16px;
    font-size: 13px;
  }
}

/* --- Gestión de Comerciales CSS --- */
.comercial-card {
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition);
}
.comercial-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(99, 102, 241, 0.2);
}

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

.comercial-card-name {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.comercial-card-email {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.delete-comercial-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.delete-comercial-btn:hover {
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.1);
}

.comercial-card-programs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge-program {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

/* Colores específicos de programas para wow visual */
.badge-program-big-data {
  background: rgba(99, 102, 241, 0.12);
  color: var(--color-primary);
  border: 1px solid rgba(99, 102, 241, 0.2);
}
.badge-program-scouting {
  background: rgba(14, 165, 233, 0.12);
  color: var(--color-info);
  border: 1px solid rgba(14, 165, 233, 0.2);
}
.badge-program-marketing {
  background: rgba(217, 70, 239, 0.12);
  color: var(--color-secondary);
  border: 1px solid rgba(217, 70, 239, 0.2);
}
.badge-program-gestion {
  background: rgba(16, 185, 129, 0.12);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Checkbox personalizado */
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 0;
}
.checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
}
.checkbox-item:hover {
  color: var(--text-primary);
}

/* --- Tablero Kanban (Pipeline) --- */
.kanban-board-container {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 12px;
  align-items: flex-start;
}

.kanban-column {
  flex: 1;
  min-width: 280px;
  max-width: 320px;
  background: rgba(15, 23, 42, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.light-theme .kanban-column {
  background: rgba(255, 255, 255, 0.4);
}

.kanban-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 15px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  color: var(--text-primary);
}

.kanban-cards-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 450px;
  max-height: 650px;
  overflow-y: auto;
  padding-right: 4px;
  transition: background-color 0.2s ease;
  border-radius: var(--radius-sm);
  border: 1px dashed transparent;
}

.kanban-cards-list.dragover {
  background: rgba(99, 102, 241, 0.04);
  border-color: rgba(99, 102, 241, 0.2);
}

/* Kanban Cards */
.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: grab;
  position: relative;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.kanban-card:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--color-primary-rgb), 0.25);
  box-shadow: var(--shadow-main);
}

.kanban-card.dragging {
  opacity: 0.4;
  border: 1px dashed var(--color-primary);
  box-shadow: none;
}

.kanban-card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.kanban-card-company {
  font-size: 12px;
  color: var(--text-secondary);
}

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

.kanban-card-points {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-primary);
}

.kanban-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

/* CRM Comments/Notes List */
.comment-item {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.light-theme .comment-item {
  background: rgba(0, 0, 0, 0.01);
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.comment-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  word-break: break-word;
}

/* Notification Container and Dropdown */
.notification-container {
  display: inline-block;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: var(--color-danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-secondary);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.notification-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  background: var(--bg-secondary);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-main);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  max-height: 400px;
  overflow: hidden;
  animation: fadeInDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.notification-dropdown-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.01);
}

.btn-clear-all {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.btn-clear-all:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--color-primary);
}

.notification-dropdown-list {
  overflow-y: auto;
  flex: 1;
  max-height: 330px;
}

.notification-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: var(--transition);
  cursor: pointer;
}
.notification-item:hover {
  background: rgba(255, 255, 255, 0.02);
}
.light-theme .notification-item:hover {
  background: rgba(0, 0, 0, 0.02);
}
.notification-item.unread {
  border-left: 3px solid var(--color-primary);
  background: rgba(99, 102, 241, 0.03);
}

.notification-item-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notification-item-detail {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-item-time {
  font-size: 10px;
  color: var(--text-muted);
}

/* Float Toasts Container and Toast Styling */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
  max-width: 380px;
  width: calc(100% - 48px);
}

.toast-alert {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: #fff;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
  opacity: 0;
  position: relative;
  overflow: hidden;
}
.toast-alert.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-alert::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: var(--gradient-brand);
}

.light-theme .toast-alert {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
  box-shadow: 0 10px 30px rgba(148, 163, 184, 0.25);
}

.toast-icon {
  background: rgba(99, 102, 241, 0.15);
  color: var(--color-primary);
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
}

.toast-text {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 4px;
}

.toast-time {
  font-size: 10px;
  color: var(--text-muted);
}

.toast-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.toast-close-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}
.light-theme .toast-close-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Horizontal scroll usability hint for tables */
.table-scroll-hint {
  display: none;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 11px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-color);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  width: 100%;
  animation: fadeIn 0.3s ease;
}
.light-theme .table-scroll-hint {
  background: rgba(0, 0, 0, 0.02);
}
.table-scroll-hint i {
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .table-scroll-hint {
    display: flex;
  }
}

/* Custom scrollbars for modal, timeline and notes list */
.modal-container::-webkit-scrollbar,
.contact-timeline::-webkit-scrollbar,
#contact-notes-list::-webkit-scrollbar {
  width: 6px;
}
.modal-container::-webkit-scrollbar-track,
.contact-timeline::-webkit-scrollbar-track,
#contact-notes-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 3px;
}
.modal-container::-webkit-scrollbar-thumb,
.contact-timeline::-webkit-scrollbar-thumb,
#contact-notes-list::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3);
  border-radius: 3px;
}
.modal-container::-webkit-scrollbar-thumb:hover,
.contact-timeline::-webkit-scrollbar-thumb:hover,
#contact-notes-list::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.55);
}

/* Grab to Scroll styling */
.kanban-board-container {
  cursor: grab;
}
.kanban-board-container:active {
  cursor: grabbing;
}
body.dragging-active {
  user-select: none !important;
}

/* Sidebar collapsed styles (Desktop only) */
@media (min-width: 769px) {
  .sidebar.collapsed {
    width: 72px;
    padding: 24px 8px;
  }
  
  .sidebar.collapsed .logo-text {
    display: none !important;
  }
  
  .sidebar.collapsed .logo-wrapper {
    gap: 0 !important;
    justify-content: center;
    width: 100%;
  }
  
  .sidebar.collapsed .sidebar-logo {
    justify-content: center;
    padding: 12px 0;
  }
  
  .sidebar.collapsed .nav-menu {
    align-items: center;
  }
  
  .sidebar.collapsed .nav-item {
    width: 100%;
  }

  .sidebar.collapsed .nav-item a {
    justify-content: center;
    padding: 12px;
    gap: 0;
  }

  .sidebar.collapsed .nav-item a span {
    display: none !important;
  }
  
  .sidebar.collapsed .sidebar-footer {
    padding: 16px 8px;
    align-items: center;
  }
  
  .sidebar.collapsed .source-status {
    display: none !important;
  }
  
  .sidebar.collapsed .theme-toggle-btn {
    justify-content: center;
    padding: 10px;
    width: 44px;
    height: 44px;
  }
  
  .sidebar.collapsed .theme-toggle-btn span {
    display: none !important;
  }
  
  /* Adjust Main Content when sidebar is collapsed */
  .sidebar.collapsed + .main-content {
    margin-left: 72px;
    width: calc(100% - 72px);
  }
}

/* Hide desktop collapse button on mobile */
@media (max-width: 768px) {
  .sidebar-collapse-btn {
    display: none !important;
  }
}

/* Box for last web visit */
.last-visit-box {
  display: flex;
  margin-top: 20px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.07);
  border: 1px solid rgba(99, 102, 241, 0.15);
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.04);
  animation: fadeIn 0.3s ease;
}
.light-theme .last-visit-box {
  background: rgba(99, 102, 241, 0.04);
  border-color: rgba(99, 102, 241, 0.12);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.02);
}

/* Login screen overlay */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, #0c1524 0%, #05080f 100%);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  backdrop-filter: blur(20px);
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 40px 32px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(99, 102, 241, 0.1);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: loginFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.login-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.login-logo {
  max-width: 200px;
  height: auto;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.3));
}

.login-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 700;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.input-with-icon {
  position: relative;
  width: 100%;
}

.input-with-icon i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  transition: var(--transition);
}

.input-with-icon .form-input {
  padding-left: 44px;
  margin-bottom: 0;
  width: 100%;
}

.input-with-icon .form-input:focus + i {
  color: var(--color-primary);
  filter: drop-shadow(0 0 4px rgba(99, 102, 241, 0.4));
}

.login-btn {
  width: 100%;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 16px;
  margin-top: 12px;
  background: var(--gradient-brand);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.login-error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--color-danger);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

/* User Manager specific button icons */
.btn-icon {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.btn-icon:hover {
  border-color: var(--border-focus);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}
.btn-icon-danger:hover {
  border-color: var(--color-danger);
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.1);
}


