.preview-section {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  flex: 1;
  transition: background 0.3s;
}
.preview-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.3s;
}

.preview-header h2 {
  font-size: 1rem;
  font-weight: 600;
}

.result-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
}
.table-wrapper {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: var(--secondary);
  text-align: left;
  padding: 0.7rem 1.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  transition: background 0.3s, border-color 0.3s;
  white-space: nowrap;
}

th.sortable {
  cursor: pointer;
  user-select: none;
}

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

th .sort-icon {
  display: inline-block;
  margin-left: 4px;
  vertical-align: middle;
  opacity: 0.4;
}

th.sortable:hover .sort-icon {
  opacity: 0.7;
}

th .sort-icon.active {
  opacity: 1;
  color: var(--primary);
}

.th-check {
  width: 48px;
  text-align: center !important;
  padding: 0.7rem 0.5rem !important;
}

.cell-check {
  width: 48px;
  text-align: center !important;
  padding: 0.7rem 0.5rem !important;
}

.cell-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

#select-all {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

tr.row-selected {
  background: var(--selected-row);
  transition: background 0.3s;
}

tbody td {
  padding: 0.7rem 1.5rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.3s;
  vertical-align: middle;
}

.cell-id {
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.highlight-match {
  background: rgba(37, 99, 235, 0.12);
  border-radius: 2px;
  padding: 0 2px;
}

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

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 1.5rem !important;
  font-style: italic;
}

.empty-state strong {
  color: var(--text);
}

.lead-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.lead-status .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.lead-status-new {
  background: #f3f4f6;
  color: #374151;
}
[data-theme="dark"] .lead-status-new {
  background: rgba(107, 114, 128, 0.15);
  color: #9ca3af;
}
.lead-status-new .status-dot { background: #6b7280; }

.lead-status-contacted {
  background: #fefce8;
  color: #a16207;
}
[data-theme="dark"] .lead-status-contacted {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
}
.lead-status-contacted .status-dot { background: #eab308; }

.lead-status-qualified {
  background: #f5fce8;
  color: #5a7a00;
}
[data-theme="dark"] .lead-status-qualified {
  background: rgba(156, 204, 0, 0.15);
  color: #b8e04d;
}
.lead-status-qualified .status-dot { background: #9ccc00; }

.lead-status-closed {
  background: #f0fdf4;
  color: #15803d;
}
[data-theme="dark"] .lead-status-closed {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}
.lead-status-closed .status-dot { background: #22c55e; }

.lead-status-lost {
  background: #fef2f2;
  color: #dc2626;
}
[data-theme="dark"] .lead-status-lost {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}
.lead-status-lost .status-dot { background: #ef4444; }
.source-select {
  padding: 0.15rem 1.5rem 0.15rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-color: var(--surface);
  color: var(--text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  transition: border-color 0.15s, background 0.3s, color 0.3s;
}

.source-select:hover,
.source-select:focus {
  border-color: var(--primary);
}

.status-select {
  padding: 0.15rem 1.5rem 0.15rem 0.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  transition: border-color 0.15s;
}

.status-select:hover,
.status-select:focus {
  border-color: currentColor;
}

.status-select-new {
  background-color: #f3f4f6;
  color: #374151;
}
[data-theme="dark"] .status-select-new {
  background-color: rgba(107, 114, 128, 0.15);
  color: #9ca3af;
}

.status-select-contacted {
  background-color: #fefce8;
  color: #a16207;
}
[data-theme="dark"] .status-select-contacted {
  background-color: rgba(234, 179, 8, 0.15);
  color: #facc15;
}

.status-select-qualified {
  background-color: #f5fce8;
  color: #5a7a00;
}
[data-theme="dark"] .status-select-qualified {
  background-color: rgba(156, 204, 0, 0.15);
  color: #b8e04d;
}

.status-select-closed {
  background-color: #f0fdf4;
  color: #15803d;
}
[data-theme="dark"] .status-select-closed {
  background-color: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.status-select-lost {
  background-color: #fef2f2;
  color: #dc2626;
}
[data-theme="dark"] .status-select-lost {
  background-color: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* ─── Assigned To Column ─── */

.cell-assigned {
  min-width: 140px;
}

.cell-assigned div {
  white-space: nowrap;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-icon:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  border-top: 1px solid var(--border);
  transition: border-color 0.3s;
  gap: 1rem;
  flex-wrap: wrap;
}

.pagination-info {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--pagination-btn);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.pagination-btn:hover:not(:disabled):not(.active) {
  background: var(--pagination-btn-hover);
  border-color: var(--text-muted);
}

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

.pagination-btn.active {
  background: var(--pagination-btn-active);
  border-color: var(--pagination-btn-active);
  color: var(--pagination-text-active);
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 32px;
  color: var(--text-muted);
  font-size: 0.8rem;
}
/* ─── Empty state ─── */

.preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  background: linear-gradient(90deg, var(--text-muted), var(--primary), var(--text-muted));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmerText 3s ease-in-out infinite;
  line-height: 1.5;
}

@keyframes shimmerText {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

.lead-name-link {
  color: var(--primary, #2563eb);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease, text-decoration 0.15s ease;
}
.lead-name-link:hover {
  text-decoration: underline;
  color: var(--primary-hover, #1d4ed8);
}

.project-select {
  padding: 0.15rem 1.5rem 0.15rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-color: var(--surface);
  color: var(--text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  transition: border-color 0.15s, background 0.3s, color 0.3s;
  max-width: 170px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.project-select:hover,
.project-select:focus {
  border-color: var(--primary);
}
