/* Repeat Sales Funnel Styles */
.repeat-sales-page {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  overflow: hidden; /* Prevent page scroll */
}

/* Ensure proper layout structure */
.repeat-sales-page #unified-funnel-container {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.repeat-sales-page .universal-funnel {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.repeat-sales-page .page-header, .repeat-sales-page header.page-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  flex-shrink: 0;
}

.repeat-sales-page .header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  max-width: 1400px;
  margin: 0 auto;
  gap: 20px;
}

.repeat-sales-page .page-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.repeat-sales-page .page-description {
  margin: 4px 0 0 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.repeat-sales-page .header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* Header Statistics */
.repeat-sales-page .stats-summary {
  display: flex;
  gap: 20px;
  align-items: center;
  background: var(--bg-secondary);
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.repeat-sales-page .stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.repeat-sales-page .stat-item svg {
  opacity: 0.7;
}

.repeat-sales-page .stat-item span {
  color: var(--text-primary);
  font-weight: 600;
}

/* Button styles */
.repeat-sales-page .btn {
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  text-decoration: none;
  position: relative;
  outline: none;
  min-height: 36px;
  box-sizing: border-box;
}

.repeat-sales-page .btn:focus-visible {
  box-shadow: 0 0 0 2px var(--primary);
  z-index: 1;
}

.repeat-sales-page .btn-primary {
  background: var(--primary);
  color: white;
  border: 1px solid var(--primary);
}

.repeat-sales-page .btn-primary:hover {
  background: var(--primary-dark, #2563eb);
  border-color: var(--primary-dark, #2563eb);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.repeat-sales-page .btn-secondary:hover {
  background: var(--bg-accent);
  border-color: var(--text-secondary);
}

.repeat-sales-page .funnel-container {
  flex: 1;
  overflow: hidden;
  position: relative;
  min-height: 0;
}

.repeat-sales-page .loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-secondary);
  padding: 40px 20px;
}

.repeat-sales-page .spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top: 2px solid var(--primary);
  border-radius: 50%;
  animation: repeat-sales-spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes repeat-sales-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
  .repeat-sales-page .header-content {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .repeat-sales-page .header-actions {
    justify-content: center;
    gap: 6px;
  }

  .repeat-sales-page .stats-summary {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 12px;
  }

  .repeat-sales-page .stat-item {
    justify-content: center;
    font-size: 14px;
  }

  .repeat-sales-page .page-title {
    font-size: 18px;
    text-align: center;
  }

  .repeat-sales-page .page-description {
    font-size: 13px;
    text-align: center;
  }

  /* Better stage settings on mobile */
  .stage-setting-row {
    flex-direction: column !important;
    gap: 8px !important;
    padding: 12px !important;
    border: 1px solid var(--border) !important;
    border-radius: 6px !important;
    margin-bottom: 8px !important;
  }

  .stage-name-input,
  .stage-color-input,
  .stage-position-input {
    width: 100% !important;
    padding: 8px !important;
    font-size: 16px !important; /* Prevents zoom on iOS */
    border-radius: 4px !important;
  }
}

@media (max-width: 480px) {
  .repeat-sales-page .page-header, .repeat-sales-page header.page-header {
    padding: 12px 16px;
  }

  .repeat-sales-page .header-actions {
    flex-direction: column;
    gap: 8px;
  }

  .repeat-sales-page .header-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Universal funnel overrides */
.repeat-sales-page .universal-funnel {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.repeat-sales-page .funnel-header {
  padding: 12px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.repeat-sales-page .funnel-title h2 {
  font-size: 16px;
  color: var(--text-primary);
  margin: 0;
  font-weight: 500;
}

.repeat-sales-page .kanban-board {
  padding: 16px 20px;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden; /* Prevent double scrollbar */
  flex: 1;
  min-height: 0;
  display: flex !important;
  align-items: stretch !important; /* Make all stages same height */
}

.repeat-sales-page .kanban-stage {
  min-width: 280px;
  max-width: 300px;
  flex-shrink: 0;
}

/* Custom styling for repeat sales items */
.repeat-sales-page .funnel-item-card {
  border-left: 3px solid var(--primary);
  transition: all 0.15s ease;
}

.repeat-sales-page .funnel-item-card:hover {
  border-left-color: var(--primary-dark, #2563eb);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.repeat-sales-page .funnel-item-card:focus-within {
  border-left-color: var(--primary-dark, #2563eb);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.repeat-sales-page .item-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.3;
}

.repeat-sales-page .item-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.3;
  margin-bottom: 4px;
}

.repeat-sales-page .item-meta-row:last-child {
  margin-bottom: 0;
}

.repeat-sales-page .item-meta-row svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.repeat-sales-page .priority-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.repeat-sales-page .item-meta-row.overdue {
  color: var(--danger, #ef4444);
}

.repeat-sales-page .overdue-text {
  font-size: 10px;
  padding: 1px 4px;
  background: var(--danger, #ef4444);
  color: white;
  border-radius: 3px;
  margin-left: 4px;
}

/* Error state styling */
.repeat-sales-page .error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px 20px;
  color: var(--text-secondary);
  text-align: center;
}

.repeat-sales-page .error-icon {
  color: var(--danger, #ef4444);
  margin-bottom: 16px;
}

.repeat-sales-page .error-state h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.repeat-sales-page .error-state p {
  margin: 0 0 16px 0;
  font-size: 14px;
  line-height: 1.5;
  max-width: 400px;
}

/* Item action buttons */
.repeat-sales-page .item-actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.repeat-sales-page .btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.repeat-sales-page .btn-icon:hover {
  background: var(--bg-accent);
  color: var(--text-primary);
  transform: scale(1.05);
}

/* Accessibility improvements */
.repeat-sales-page .funnel-item-card[tabindex] {
  outline: none;
}

.repeat-sales-page .funnel-item-card[tabindex]:focus {
  border-left-color: var(--primary-dark, #2563eb);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

/* Modal styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* Universal Funnel Modal styles */
.universal-funnel-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000 !important;
  backdrop-filter: blur(4px);
}

.universal-funnel-modal .modal-dialog {
  background: var(--bg-card);
  border-radius: 12px;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
}

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

.universal-funnel-modal .modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-secondary);
}

.universal-funnel-modal .modal-header h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
}

.universal-funnel-modal .modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px;
  border-radius: 4px;
  transition: all 0.15s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.universal-funnel-modal .modal-close:hover {
  background: var(--bg-accent);
  color: var(--text-primary);
}

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

.modal-content {
  background: var(--bg-card);
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow: auto;
}

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

.modal-header h3 {
  margin: 0;
  color: var(--text-primary);
}

.modal-header button {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-secondary);
}

.modal-body {
  padding: 20px;
}

.form-group {
  margin-bottom: 16px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
}

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

/* Contact Details Modal */
.contact-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

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

.contact-modal {
  background: var(--bg-card);
  border-radius: 12px;
  max-width: 700px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease;
}

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

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

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

.contact-modal .modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

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

.contact-modal .modal-body {
  padding: 0;
  max-height: 70vh;
  overflow-y: auto;
}

/* Contact Details */
.contact-details {
  padding: 20px;
}

.contact-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.contact-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 600;
  flex-shrink: 0;
}

.contact-info h3 {
  margin: 0 0 8px 0;
  font-size: 20px;
  color: var(--text-primary);
  font-weight: 600;
}

.stage-badge {
  padding: 4px 8px;
  border-radius: 4px;
  color: white;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

/* Contact Tabs */
.contact-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
  font-size: 14px;
  font-weight: 500;
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-btn:hover:not(.active) {
  color: var(--text-primary);
  background: var(--bg-accent);
}

/* Tab Content */
.tab-content {
  min-height: 300px;
}

.tab-panel {
  display: none;
}

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

/* Detail Sections */
.detail-section {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.detail-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.detail-section h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 16px;
}

.detail-row:last-child {
  margin-bottom: 0;
}

.detail-row .label {
  font-weight: 500;
  color: var(--text-secondary);
  min-width: 140px;
  flex-shrink: 0;
}

.detail-row .value {
  color: var(--text-primary);
  text-align: right;
  flex: 1;
  word-break: break-word;
}

.detail-row .value a {
  color: var(--primary);
  text-decoration: none;
}

.detail-row .value a:hover {
  text-decoration: underline;
}

/* Priority Colors */
.priority-high {
  color: #ef4444;
}

.priority-urgent {
  color: #dc2626;
  font-weight: 600;
}

.priority-low {
  color: #6366f1;
}

/* Notes Content */
.notes-content {
  background: var(--bg-secondary);
  padding: 12px;
  border-radius: 6px;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 0;
}

.action-buttons .btn {
  justify-content: flex-start;
  text-align: left;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .contact-modal {
    width: 95%;
    margin: 20px;
    max-height: 95vh;
  }

  .contact-header {
    flex-direction: column;
    text-align: center;
  }

  .contact-tabs {
    flex-direction: column;
    gap: 0;
  }

  .tab-btn {
    border-bottom: 1px solid var(--border);
    border-radius: 0;
  }

  .detail-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .detail-row .label {
    min-width: auto;
  }

  .detail-row .value {
    text-align: left;
  }
}

/* Automation Rules Form */
.automation-rules-form {
  padding: 16px 0;
}

.automation-rules-form h4 {
  margin: 0 0 20px 0;
  color: var(--text-primary);
  font-size: 16px;
}

.automation-rules-form .form-group {
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.automation-rules-form .form-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
}

.automation-rules-form .sub-form {
  margin-top: 12px;
  padding: 12px;
  background: var(--bg-primary);
  border-radius: 4px;
  border: 1px solid var(--border);
}

.automation-rules-form .sub-form label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--text-secondary);
}

.automation-rules-form .sub-form input,
.automation-rules-form .sub-form select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
}

/* Stage Setting Row */
.stage-setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 6px;
  background: var(--bg-secondary);
  margin-bottom: 8px;
}

.stage-name-input,
.stage-color-input,
.stage-position-input {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.stage-name-input {
  flex: 1;
  min-width: 120px;
}

.stage-color-input {
  width: 50px;
  height: 36px;
  padding: 2px;
  cursor: pointer;
}

.stage-position-input {
  width: 70px;
}

/* Fix missing button styles */
.btn-clear-filters {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  padding: 8px 12px !important;
  cursor: pointer !important;
  font-size: 14px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.15s ease !important;
  min-width: 80px !important;
  font-weight: 500 !important;
}

.btn-clear-filters:hover {
  background: var(--bg-accent) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

/* Filter select improvements */
.filter-select {
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  padding: 8px 12px !important;
  font-size: 14px !important;
  min-width: 150px !important;
  cursor: pointer !important;
}

.filter-select:hover {
  border-color: var(--primary) !important;
}

.filter-select:focus {
  outline: none !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
}

/* Fix stage background extending to full height */
.kanban-stage {
  background: var(--bg-card) !important;
  border-radius: 8px !important;
  border: 1px solid var(--border) !important;
  min-height: calc(100vh - 200px) !important; /* Full viewport height minus headers */
  height: auto !important;
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
}

.stage-content {
  background: var(--bg-card) !important;
  border-radius: 0 0 7px 7px !important;
  padding: 12px !important;
  flex: 1 !important; /* Take remaining space */
  min-height: 0 !important; /* Allow flex to work properly */
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  overflow-y: auto !important;
}

.stage-empty {
  flex: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: var(--text-secondary) !important;
  font-style: italic !important;
  min-height: 200px !important;
  padding: 40px 20px !important;
  text-align: center !important;
}

/* Fix stage header positioning and background */
.kanban-stage .stage-header {
  background: var(--bg-secondary) !important;
  padding: 12px 16px !important;
  border-radius: 7px 7px 0 0 !important;
  border-bottom: 1px solid var(--border) !important;
  position: sticky !important;
  top: 56px !important; /* Position below page header */
  z-index: 10 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
  backdrop-filter: blur(8px);
  border: 1px solid var(--border) !important;
  border-bottom: 2px solid var(--border) !important;
}

.kanban-board {
  position: relative !important;
  z-index: 1 !important;
  padding-top: 0 !important; /* Remove top padding to allow proper sticky positioning */
}

/* Make sure page header is sticky */
.repeat-sales-page .page-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 30 !important;
  background: var(--bg-card) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* Make sure funnel controls are sticky below page header */
.repeat-sales-page .funnel-header {
  position: sticky !important;
  top: 85px !important; /* Below page header */
  z-index: 20 !important;
  background: var(--bg-secondary) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
  backdrop-filter: blur(8px);
}

.stage-items {
  padding: 12px !important;
  min-height: 450px !important;
  background: var(--bg-card) !important;
}

/* Improve kanban board layout */
.kanban-board {
  display: flex !important;
  gap: 16px !important;
  padding: 16px 20px !important;
  overflow-x: auto !important;
  min-height: calc(100vh - 200px) !important;
  align-items: stretch !important;
}

/* Column counter badges */
.rs-col-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 8px;
  min-width: 18px;
  height: 18px;
}

/* Style for unassigned manager text */
.item-meta-row.unassigned .text-muted {
  color: var(--text-secondary);
  opacity: 0.7;
}

/* Text overflow handling for card elements */
.funnel-item-card .item-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  font-weight: 600;
}

.funnel-item-card .note-preview {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.4;
  cursor: pointer;
  transition: color 0.15s ease;
}

.funnel-item-card .note-preview:hover {
  color: var(--primary);
}

/* Priority indicators */
.priority-urgent { border-left-color: #dc2626 !important; }
.priority-high { border-left-color: #ea580c !important; }
.priority-normal { border-left-color: var(--primary) !important; }
.priority-low { border-left-color: #6366f1 !important; }

/* Better responsive kanban */
@media (max-width: 768px) {
  .kanban-board {
    gap: 8px !important;
    padding: 12px 16px !important;
  }

  .kanban-stage {
    min-width: 260px !important;
    min-height: calc(100vh - 250px) !important;
  }

  .kanban-stage .stage-header {
    top: 48px !important; /* Adjust for mobile */
  }

  .repeat-sales-page .funnel-header {
    top: 48px !important; /* Adjust for mobile header */
  }
}

/* Contact History Styles */
.contact-history {
  padding: 0;
}

.history-summary {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-secondary);
}

.history-summary span {
  font-weight: 500;
}

.history-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  transition: all 0.15s ease;
}

.history-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.history-type {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.history-time {
  font-size: 12px;
  color: var(--text-secondary);
}

.history-content {
  color: var(--text-primary);
  line-height: 1.4;
}

/* Chat History Items */
.chat-item {
  border-left: 4px solid #06b6d4;
}

.chat-platform {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 4px;
  font-weight: 500;
}

.chat-message {
  background: var(--bg-secondary);
  padding: 8px 12px;
  border-radius: 6px;
  margin: 8px 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.message-direction {
  font-size: 11px;
  color: var(--text-secondary);
  font-style: italic;
}

/* Call History Items */
.call-item {
  border-left: 4px solid #10b981;
}

.call-details {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 4px;
}

.call-status {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.call-duration {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.call-direction {
  font-size: 11px;
  color: var(--text-secondary);
  font-style: italic;
}

.call-notes {
  margin-top: 8px;
  padding: 6px 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-primary);
}

/* No History State */
.no-history {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.no-history p {
  margin: 0 0 8px 0;
}

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

/* History Error State */
.history-error {
  text-align: center;
  padding: 20px;
  color: var(--text-secondary);
}

.history-error p {
  margin: 0 0 16px 0;
}

#history-loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

/* Mobile responsive for history */
@media (max-width: 768px) {
  .history-summary {
    flex-direction: column;
    gap: 8px;
  }

  .history-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .call-details {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* Checkbox and bulk actions styles */
.item-checkbox {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  background: var(--bg-card);
  border-radius: 3px;
  padding: 2px;
  border: 1px solid var(--border);
}

.item-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--primary);
}

.funnel-item-card {
  position: relative !important;
  padding-left: 36px !important; /* Make space for checkbox */
}

.funnel-item-card.selected {
  border-color: var(--primary) !important;
  background: rgba(59, 130, 246, 0.05) !important;
  box-shadow: 0 0 0 1px var(--primary) !important;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-secondary);
  border-radius: 6px;
  border: 1px solid var(--border);
  margin-right: 16px;
}

.selected-count {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  padding: 0 8px;
  background: var(--primary);
  color: white;
  border-radius: 4px;
  min-width: 100px;
  text-align: center;
}

.bulk-actions .btn {
  font-size: 13px !important;
  padding: 6px 12px !important;
  min-height: auto !important;
}

/* Message modal styles */
.message-modal {
  max-width: 500px;
}

.message-modal .form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
}

.message-modal .form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.message-modal textarea.form-control {
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

/* Responsive bulk actions */
@media (max-width: 768px) {
  .bulk-actions {
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
  }

  .bulk-actions .btn {
    width: 100%;
    text-align: center;
  }

  .selected-count {
    min-width: auto;
  }
}

@media (max-width: 480px) {
  .funnel-item-card {
    padding-left: 32px !important;
  }

  .item-checkbox {
    top: 6px;
    left: 6px;
  }

  .item-checkbox input[type="checkbox"] {
    width: 14px;
    height: 14px;
  }
}