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

:root {
  --bg-primary: #0a0b10;
  --bg-secondary: #12131a;
  --bg-tertiary: #191b26;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #6366f1;
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-indigo: #6366f1;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-yellow: #f59e0b;

  --glow-indigo: rgba(99, 102, 241, 0.15);
  --glow-purple: rgba(139, 92, 246, 0.15);

  --font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-family-display: 'Outfit', var(--font-family-sans);
  
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --glass-bg: rgba(18, 19, 26, 0.8);
  --glass-blur: blur(12px);

  /* Global Typography Scale */
  --font-size-base: 16px;
  --font-size-secondary: 14px;
  --font-size-small: 13px;
  --font-size-label: 15px;
  --font-size-h1: 32px;
  --font-size-h2: 26px;
  --font-size-h3: 22px;
  --font-size-h4: 18px;
}

body, input, select, textarea, button, td, th, p, li, span, a, label {
  font-size: var(--font-size-base);
}

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

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-family-sans);
  font-size: var(--font-size-base);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-indigo);
}

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

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

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family-display);
  font-weight: 800;
  font-size: var(--font-size-base);
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.logo-text {
  font-family: var(--font-family-display);
  font-weight: 700;
  font-size: var(--font-size-h3);
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, #d1d5db);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.nav-item button {
  width: 100%;
  background: none;
  border: none;
  padding: 10px 14px;
  color: var(--text-secondary);
  font-family: var(--font-family-sans);
  font-size: var(--font-size-base);
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition-fast);
  text-align: left;
}

.nav-item button svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-secondary);
  transition: var(--transition-fast);
}

.nav-item.active button,
.nav-item button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-item.active button {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #fff;
}

.nav-item.active button svg {
  stroke: var(--accent-indigo);
}

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

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green);
}

.status-text {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
}

/* Main Content area */
.main-content {
  margin-left: 260px;
  flex-grow: 1;
  width: calc(100% - 260px);
  min-width: 0;
  padding: 40px;
  min-height: 100vh;
}

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

.page-title h1 {
  font-family: var(--font-family-display);
  font-size: var(--font-size-h1);
  font-weight: 700;
  letter-spacing: -0.5px;
}

.page-title p {
  color: var(--text-secondary);
  font-size: var(--font-size-secondary);
  margin-top: 4px;
}

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

.badge-ai {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(59, 130, 246, 0.2));
  border: 1px solid rgba(139, 92, 246, 0.4);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-secondary);
  font-weight: 600;
  color: #c084fc;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Tab Panels */
.tab-panel {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.tab-panel.active {
  display: block;
}

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

/* Grid components */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.card-stat {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.card-stat:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.3);
}

.card-stat::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-indigo);
}

.card-stat.success::after { background: var(--accent-green); }
.card-stat.pending::after { background: var(--accent-yellow); }
.card-stat.failed::after { background: var(--accent-red); }

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

.stat-value {
  font-family: var(--font-family-display);
  font-size: 32px;
  font-weight: 700;
  margin-top: 12px;
  background: #fff;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-desc {
  font-size: var(--font-size-small);
  color: var(--text-muted);
  margin-top: 8px;
}

/* Two column layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 32px;
}

/* Panel cards */
.panel-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
  min-width: 0;
}

.panel-card h2 {
  font-family: var(--font-family-display);
  font-size: var(--font-size-h2);
  font-weight: 600;
  margin-bottom: 24px;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: var(--font-size-label);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
select,
textarea {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-family-sans);
  font-size: var(--font-size-base);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

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

.btn-primary,
.btn-secondary,
.btn-danger {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-family-sans);
  font-size: var(--font-size-label);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(99, 102, 241, 0.4);
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
}

.btn-danger {
  background: var(--accent-red);
  color: #fff;
}

.btn-danger:hover {
  opacity: 0.9;
}

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

.btn-icon-only:hover {
  color: #fff;
  border-color: var(--accent-indigo);
}

/* Queue List */
.queue-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.queue-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.queue-item-details {
  flex-grow: 1;
  overflow: hidden;
}

.queue-item-url {
  font-size: var(--font-size-base);
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-item-meta {
  font-size: var(--font-size-small);
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  gap: 12px;
}

.badge-status {
  padding: 4px 8px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-small);
  font-weight: 600;
  text-transform: uppercase;
}

.badge-status.pending { background: rgba(245, 158, 11, 0.15); color: var(--accent-yellow); }
.badge-status.running { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.badge-status.completed { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.badge-status.failed { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.badge-status.cancelled { background: rgba(107, 114, 128, 0.15); color: var(--text-secondary); }

/* Profiles Table */
.Profiles-table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  max-width: 100%;
}

.Profiles-table {
  width: 100%;
  min-width: 1400px; /* Enable horizontal scrolling only on smaller viewports */
  border-collapse: collapse;
  text-align: left;
}

.Profiles-table th,
.Profiles-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  font-size: var(--font-size-label);
}

.Profiles-table td:not(:last-child):not(.checkbox-cell) {
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.Profiles-table th {
  background: var(--bg-tertiary);
  font-family: var(--font-family-display);
  font-size: var(--font-size-label);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 10;
  white-space: nowrap;
}

.Profiles-table td.full-wrap-cell {
  max-width: none !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

.Profiles-table td.no-ellipsis {
  max-width: none !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

.sortable-header {
  cursor: pointer;
  user-select: none;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.sortable-header:hover {
  background-color: var(--bg-secondary) !important;
  color: #fff !important;
}

.sort-icon {
  display: inline-block;
  margin-left: 6px;
  font-size: var(--font-size-small);
  color: var(--text-muted);
}

.sortable-header:hover .sort-icon {
  color: #fff;
}

/* DataTable Header & Footer */
.datatable-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.page-size-selector {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-size-selector select {
  width: auto;
  padding: 6px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  cursor: pointer;
}

.datatable-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 16px;
}

.datatable-info {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
}

.datatable-pagination {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-pagination {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  font-size: var(--font-size-base);
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-pagination:hover:not(:disabled) {
  background: var(--accent-indigo);
  color: #fff;
  border-color: var(--accent-indigo);
}

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

.pagination-pages {
  display: flex;
  gap: 4px;
}

.pagination-page {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  min-width: 34px;
  height: 34px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-label);
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.pagination-page:hover {
  background: var(--bg-secondary);
  color: #fff;
}

.pagination-page.active {
  background: var(--accent-indigo);
  color: #fff;
  border-color: var(--accent-indigo);
}

/* Spinner Loader */
.table-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.05);
  border-top-color: var(--accent-indigo);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

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

.Profiles-table tbody tr {
  transition: background-color var(--transition-fast);
  cursor: pointer;
}

.Profiles-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.Profile-name-cell {
  font-weight: 600;
  color: #fff;
}

.Profile-score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-weight: 700;
  font-size: var(--font-size-secondary);
  border: 2px solid transparent;
}

.score-high { background: rgba(16, 185, 129, 0.1); border-color: var(--accent-green); color: var(--accent-green); }
.score-medium { background: rgba(245, 158, 11, 0.1); border-color: var(--accent-yellow); color: var(--accent-yellow); }
.score-low { background: rgba(239, 68, 68, 0.1); border-color: var(--accent-red); color: var(--accent-red); }

/* Lead Type select badges */
select.lead-type-select {
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  text-align: center;
  transition: all 0.2s ease;
  min-width: 110px;
  width: 110px;
}

select.lead-type-select.Cold {
  background: rgba(59, 130, 246, 0.15) !important;
  color: #60a5fa !important;
}

select.lead-type-select.Warm {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
}

select.lead-type-select.Hot {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
}

select.lead-type-select.Unclassified {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--text-muted) !important;
  border: 1px dashed rgba(255, 255, 255, 0.15) !important;
}

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-bar input[type="text"] {
  width: auto;
}

.filter-bar .search-query-wrapper {
  flex: 2 1 200px;
}

.filter-bar .searchable-select {
  flex: 1.2 1 140px;
  position: relative;
}

.filter-bar .searchable-select input {
  width: 100% !important;
}

.filter-bar select {
  flex: 1.2 1 140px;
  width: auto;
  min-width: 120px;
}

/* Input reset wrapper styling */
.input-reset-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.input-reset-wrapper input {
  padding-right: 32px !important;
  width: 100% !important;
}

.input-reset-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  font-weight: 500;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  line-height: 1;
  border-radius: 50%;
  transition: color var(--transition-fast), background-color var(--transition-fast);
  z-index: 5;
}

.input-reset-btn:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.08);
}

/* Searchable select dropdown */
.select-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: var(--shadow-lg);
  backdrop-filter: var(--glass-blur);
}

.select-dropdown.show {
  display: block;
}

.dropdown-item {
  padding: 12px 16px;
  cursor: pointer;
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  transition: background-color var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.dropdown-item:hover {
  background: var(--bg-tertiary);
  color: #fff;
}

.dropdown-item.empty {
  color: var(--text-muted);
  cursor: default;
  text-align: center;
  font-style: italic;
}

/* Modal Drawer */
.modal-drawer {
  position: fixed;
  top: 0;
  right: -800px;
  width: 800px;
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  z-index: 100;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.modal-drawer.open {
  right: 0;
}

.modal-drawer.drawer-sm {
  width: 500px;
  right: -500px;
}
.modal-drawer.drawer-sm.open {
  right: 0;
}

.modal-drawer.drawer-md {
  width: 600px;
  right: -600px;
}
.modal-drawer.drawer-md.open {
  right: 0;
}

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

.modal-header h2 {
  font-family: var(--font-family-display);
  font-size: var(--font-size-h2);
  font-weight: 700;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 36px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal-close-btn:hover {
  color: #fff;
}

.modal-body {
  padding: 32px;
  overflow-y: auto;
  flex-grow: 1;
}

.modal-tab-headers {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
  gap: 16px;
}

.modal-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 12px 16px;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal-tab.active {
  color: var(--accent-indigo);
  border-bottom-color: var(--accent-indigo);
}

.modal-tab-content {
  display: none;
}

.modal-tab-content.active {
  display: block;
}

/* Detail UI components */
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 24px;
}

.badge-tag {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-base);
  display: inline-block;
  margin-right: 8px;
  margin-bottom: 8px;
}

.badge-tag.accent {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #818cf8;
}

.screenshot-preview {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  margin-top: 16px;
}

/* Ranking and comparison cards */
.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.rank-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast);
}

.rank-card:hover {
  transform: translateY(-4px);
}

.rank-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-indigo);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family-display);
  font-weight: 800;
  font-size: var(--font-size-base);
  color: #fff;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.4);
}

.rank-card.rank-1 { border-color: var(--accent-yellow); }
.rank-card.rank-1 .rank-badge { background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 4px 10px rgba(245, 158, 11, 0.4); }
.rank-card.rank-2 { border-color: var(--text-secondary); }
.rank-card.rank-2 .rank-badge { background: linear-gradient(135deg, #9ca3af, #6b7280); }
.rank-card.rank-3 { border-color: #b45309; }
.rank-card.rank-3 .rank-badge { background: linear-gradient(135deg, #b45309, #78350f); }

.bullet-list {
  list-style: none;
  margin-top: 16px;
}

.bullet-list li {
  font-size: var(--font-size-base);
  margin-bottom: 8px;
  padding-left: 24px;
  position: relative;
}

.bullet-list.pros li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent-green);
  font-weight: bold;
}

.bullet-list.cons li::before {
  content: '✗';
  position: absolute;
  left: 0;
  color: var(--accent-red);
  font-weight: bold;
}

/* Logging console */
.logs-console {
  background: #050508;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: 'Courier New', Courier, monospace;
  font-size: var(--font-size-small);
  color: #39ff14; /* Matrix Green */
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* Checkbox alignment */
.checkbox-cell {
  width: 40px;
}

.checkbox-cell input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-indigo);
  cursor: pointer;
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.timeline-item {
  border-left: 2px solid var(--border-color);
  padding-left: 16px;
  position: relative;
}

.timeline-item::after {
  content: '';
  position: absolute;
  top: 6px;
  left: -5px;
  width: 8px;
  height: 8px;
  background: var(--accent-indigo);
  border-radius: 50%;
}

.timeline-meta {
  font-size: var(--font-size-small);
  color: var(--text-muted);
}

.timeline-title {
  font-weight: 600;
  margin-top: 4px;
  font-size: var(--font-size-label);
}

.timeline-desc {
  font-size: var(--font-size-secondary);
  color: var(--text-secondary);
  margin-top: 4px;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 99;
  display: none;
}

.overlay.open {
  display: block;
}

#selection-banner {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 300px;
  right: 40px;
  background: rgba(99, 102, 241, 0.95);
  backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 16px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  align-items: center;
  justify-content: space-between;
  z-index: 90;
  transition: all var(--transition-normal);
}

/* Responsive Media Queries */
@media (max-width: 1280px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
  }
  .logo-container {
    margin-bottom: 20px;
  }
  .nav-links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  .nav-item button {
    padding: 8px 12px;
    font-size: var(--font-size-base);
  }
  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 20px 16px;
  }
  .modal-drawer {
    width: 100%;
    right: -100%;
  }
  .modal-body {
    padding: 16px;
  }
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .filter-bar input,
  .filter-bar select {
    width: 100% !important;
  }
  #selection-banner {
    left: 16px;
    right: 16px;
    bottom: 16px;
    padding: 12px 16px;
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  .stats-grid {
    gap: 16px;
  }
}

/* Password Input Show/Hide Toggle Styles */
.password-input-wrapper {
  position: relative;
  width: 100%;
}

.password-input-wrapper input {
  padding-right: 48px !important;
}

.password-toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
  z-index: 2;
}

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

.password-toggle-btn svg {
  width: 20px;
  height: 20px;
}

.hidden {
  display: none !important;
}

/* Sticky First & Second Columns in Profiles Table */
.Profiles-table .checkbox-cell {
  position: sticky;
  left: 0;
  z-index: 12;
  background: var(--bg-tertiary);
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  text-align: center;
}

.Profiles-table tbody .checkbox-cell {
  background: var(--bg-secondary);
  z-index: 8;
}

.Profiles-table th:nth-child(2),
.Profiles-table td:nth-child(2) {
  position: sticky;
  left: 40px;
  z-index: 11;
  background: var(--bg-tertiary);
  width: 360px;
  min-width: 360px;
  max-width: 360px;
  border-right: 1px solid var(--border-color);
}

.Profiles-table td:nth-child(2) {
  background: var(--bg-secondary);
  z-index: 7;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

/* Ensure row hover state applies correctly on sticky columns */
.Profiles-table tbody tr:hover td:nth-child(1),
.Profiles-table tbody tr:hover td:nth-child(2) {
  background: var(--bg-tertiary) !important;
}

/* Custom Lead Dropdown UI */
.custom-lead-dropdown {
  position: relative;
  display: inline-block;
  min-width: 120px;
  width: 120px;
}

.lead-type-badge {
  border: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  outline: none;
  text-align: center;
  transition: all 0.2s ease;
  min-width: 120px;
  width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: var(--font-size-secondary) !important;
}

.lead-type-badge.Cold {
  background: rgba(59, 130, 246, 0.15) !important;
  color: #60a5fa !important;
}
.lead-type-badge.Warm {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
}
.lead-type-badge.Hot {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
}
.lead-type-badge.Unclassified {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--text-muted) !important;
  border: 1px dashed rgba(255, 255, 255, 0.15) !important;
}

.dropdown-chevron {
  transition: transform 0.2s ease;
}
.lead-type-badge.active .dropdown-chevron {
  transform: rotate(180deg);
}

/* Floating Menu */
.lead-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  overflow: hidden;
}

.lead-dropdown-menu.show {
  display: block;
}

.lead-menu-item {
  padding: 8px 12px;
  font-size: var(--font-size-secondary);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease, color 0.15s ease;
}

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

.lead-menu-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-weight: 600;
}

.lead-menu-item.Cold:hover {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}
.lead-menu-item.Warm:hover {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}
.lead-menu-item.Hot:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* Checkbox Dropdown Styles */
.checkbox-dropdown-item {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  padding: 8px 12px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.dropdown-checkbox {
  width: 16px !important;
  height: 16px !important;
  cursor: pointer !important;
  accent-color: var(--accent-blue) !important;
}

/* Toggle Switch Styles */
.switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
  transition: .2s;
  border-radius: 18px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 2px;
  bottom: 2px;
  background-color: var(--text-muted, #94a3b8);
  transition: .2s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-indigo, #6366f1);
  border-color: var(--accent-indigo, #6366f1);
}

input:checked + .slider:before {
  transform: translateX(14px);
  background-color: #ffffff;
}
