/**
 * Company View Styles
 * 
 * Styles for the spreadsheet-like company tracking view
 */

/* View Toggle Buttons */
.view-toggle-wrapper {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  padding: 0;
}

.view-toggle-btn {
  text-decoration: none;
  background: white;
  box-shadow: 0px 3px 10px #0000001a;
  color: #4b5563;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #e4e7ee;
  transition: all 0.2s ease;
}

.view-toggle-btn:hover {
  background: #f9fafb;
  border-color: #30a5bf;
  color: #30a5bf;
}

.view-toggle-btn.active {
  background: #30a5bf;
  color: white;
  border-color: #30a5bf;
  box-shadow: 0px 3px 10px rgba(48, 165, 191, 0.3);
}

.view-toggle-btn i {
  font-size: 14px;
}

/* Tab loading spinner — shown while a tab's data is being fetched */
.view-toggle-btn.tab-loading i,
.view-toggle-btn.tab-loading svg {
  display: none;
}

.view-toggle-btn.tab-loading::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* Container */
#company-view-container {
  display: none;
  width: 100%;
}

/* Controls */
.company-view-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.company-view-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.company-view-actions-right {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* Hide Columns dropdown wrapper */
.hide-columns-wrapper {
  position: relative;
}

.hide-columns-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0px 3px 10px rgba(0,0,0,0.15);
  border: 1px solid #e4e7ee;
  z-index: 1999;
  min-width: 220px;
  padding: 26px 0 10px 0;
}

.hide-columns-dropdown.open {
  display: block;
}

.hide-columns-dropdown-close {
  position: absolute;
  top: 5px;
  right: 10px;
  cursor: pointer;
  font-size: 18px;
  color: #999;
  line-height: 1;
}

.hide-columns-dropdown-close:hover {
  color: #333;
}

.company-view-filters {
  display: flex;
  gap: 6px;
  align-items: center;
}

.company-view-controls .btn {
  text-decoration: none;
  background: white;
  box-shadow: 0px 3px 10px #0000001a;
  color: #4b5563;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #e4e7ee;
  transition: all 0.2s ease;
  margin-bottom: 0 !important;
  text-transform: none !important
}

.company-view-controls .btn-primary {
  background: #30a5bf;
  color: white;
  border-color: #30a5bf;
}

.company-view-controls .btn-primary:hover {
  opacity: 0.9;
}

.company-view-controls .btn-secondary {
  background: white;
  color: #4b5563;
}

.company-view-controls .btn-secondary:hover {
  background: #f9fafb;
  border-color: #30a5bf;
  color: #30a5bf;
}

.company-view-controls .btn i {
  font-size: 14px;
}

.company-view-controls .btn svg {
  width: 14px !important;
  height: 14px !important;
  vertical-align: middle;
}

/* Table Outer Wrapper - contains indicators */
.company-table-outer-wrapper {
  width: 100%;
  position: relative;
}

/* Table Outer Wrapper - contains indicators */
.company-table-outer-wrapper {
  width: 100%;
  position: relative;
}

/* Table Wrapper */
.company-table-wrapper {
  width: 100%;
  position: relative;
  overflow-x: auto;
  background-color: #fff;
  border-radius: 4px;
}

/* Clickable scroll indicator with gradient - Right side */
.table-scroll-indicator-right {
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 100%;
  background: linear-gradient(to right, rgba(255,255,255,0), rgba(48,165,191,0.15));
  z-index: 101;
  cursor: pointer;
  display: none;
}

/* Chevron icon indicator - Right side */
.table-scroll-indicator-right::before {
  content: '»';
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  color: #30a5bf;
  font-size: 24px;
  font-weight: bold;
  text-shadow: 0 0 3px rgba(255,255,255,0.8);
  animation: scrollHintRight 1.5s ease-in-out infinite;
}

@keyframes scrollHintRight {
  0%, 100% {
    opacity: 0.5;
    right: 10px;
  }
  50% {
    opacity: 1;
    right: 5px;
  }
}

/* Clickable scroll indicator with gradient - Left side */
.table-scroll-indicator-left {
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 100%;
  background: linear-gradient(to left, rgba(255,255,255,0), rgba(48,165,191,0.15));
  z-index: 101;
  cursor: pointer;
  display: none;
  pointer-events: all;
}

/* Chevron icon indicator - Left side */
.table-scroll-indicator-left::before {
  content: '«';
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  color: #30a5bf;
  font-size: 24px;
  font-weight: bold;
  text-shadow: 0 0 3px rgba(255,255,255,0.8);
  animation: scrollHintLeft 1.5s ease-in-out infinite;
}

@keyframes scrollHintLeft {
  0%, 100% {
    opacity: 0.5;
    left: 10px;
  }
  50% {
    opacity: 1;
    left: 5px;
  }
}

/* Table Styling */
.company-table {
  width: 100%;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background-color: #fff;
}

.company-table thead {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: #EDEEF4;
}

.company-table thead tr {
  background-color: #EDEEF4;
}

.company-table th {
  padding: 10px 6px;
  font-weight: bold;
  font-size: 13px;
  color: #555;
  text-align: left;
  line-height: 14px;
  background-color: #EDEEF4;
  border-bottom: 1px solid #F3F3F3;
  position: sticky;
  top: 0;
}

.company-table th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
}

.company-table th.sortable:hover {
  background-color: #e0e2e8;
}

/* Sort icons - Lucide move-up / move-down DOM elements */
.sort-icons {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  flex-shrink: 0;
  gap: 0;
}
.sort-icons i,
.sort-icons svg {
  display: block !important;
  width: 10px !important;
  height: 10px !important;
  margin: 0 -2px;
  opacity: 0.7;
  color: #222;
  stroke-width: 3;
  flex-shrink: 0;
  transition: opacity 0.15s, color 0.15s;
  cursor: pointer;
}
.sort-up-icon:hover svg,
.sort-up-icon:hover {
  opacity: 1 !important;
  color: #30a5bf !important;
}
.sort-down-icon:hover svg,
.sort-down-icon:hover {
  opacity: 1 !important;
  color: #30a5bf !important;
}
.company-table th.sort-asc .sort-up-icon,
.company-table th.sort-asc .sort-up-icon svg {
  opacity: 1 !important;
  color: #30a5bf !important;
}
.company-table th.sort-desc .sort-down-icon,
.company-table th.sort-desc .sort-down-icon svg {
  opacity: 1 !important;
  color: #30a5bf !important;
}

/* Table Header Resize Handles */
.company-table th.resizable {
  position: relative;
  user-select: none;
}

.company-table th .th-content {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  padding: 8px 10px;
}

.company-table th .th-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 0;
}

.company-table th .resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 15px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  z-index: 10;
  pointer-events: auto;
  background-color: transparent;
  transition: background-color 0.2s;
}

.company-table th .resize-handle:hover {
  background-color: rgba(48, 165, 191, 0.15);
  border-right: 2px solid #30a5bf;
}

.company-table th .resize-handle:active {
  background-color: rgba(48, 165, 191, 0.25);
  border-right: 2px solid #30a5bf;
}

/* Prevent text selection during resize */
body.resizing-column {
  cursor: col-resize;
  user-select: none;
}

/* Company Rows */
.company-table tbody tr {
  background-color: #fff;
  transition: background-color 0.2s;
  border-bottom: 1px solid #F3F3F3;
}

.company-table tbody tr:hover {
  background-color: #f9fafb;
}
.company-table td:first-child{
  padding-left: 10px;

}

.company-table td {
  padding: 8px 6px;
  font-size: 13px;
  color: #30a5bf;
  text-align: left;
  border-bottom: 1px solid #F3F3F3;
  vertical-align: middle;
}

/* Cell Styling */
.company-table td.editable {
  cursor: pointer;
  position: relative;
}

.company-table td.editable:hover {
  background: #f0f7ff;
}

/* Cells with add buttons */
.company-table td.cell-with-add-btn {
  position: relative;
}

.company-table td.cell-with-add-btn .btn-add-horizontal {
  vertical-align: middle;
}

/* Empty Value */
.empty-value {
  color: #999;
  font-style: italic;
  font-size: 12px;
}

/* Owner Tags */
.owner-tag {
  display: inline-block;
  padding: 3px 8px;
  background: #e3f2fd;
  color: #1976d2;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 500;
  margin-right: 4px;
  line-height: 1.4;
  vertical-align: middle;
}

/* Owner Cell with Delete */
.owner-cell-with-delete {
  padding: 8px 6px !important;
  vertical-align: middle;
}

.owner-cell-with-delete .owner-tag {
  vertical-align: middle;
}

.owner-cell-with-delete .btn-delete-inline {
  vertical-align: middle;
  margin-left: 4px;
}

.btn-delete-inline {
  padding: 2px 6px;
  background: transparent;
  border: none;
  color: #dc2626;
  cursor: pointer;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  transition: all 0.2s;
  opacity: 0.7;
}

.btn-delete-inline:hover {
  opacity: 1;
  color: #b91c1c;
  background: #fee;
  border-radius: 4px;
}

/* Priority Badge */
.priority-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 11px;
  text-align: center;
  line-height: 1;
}

.priority-badge.priority-1,
.priority-badge.priority-high {
  background: #fee;
  color: #c33;
}

.priority-badge.priority-2,
.priority-badge.priority-medium {
  background: #fff4e6;
  color: #e67e22;
}

.priority-badge.priority-3,
.priority-badge.priority-low {
  background: #dcfce7;
  color: #15803d;
}

.priority-badge.priority-4,
.priority-badge.priority-lowest {
  background: #ede9fe;
  color: #6d28d9;
}

.priority-badge.priority-5 {
  background: #5eca89;
  color: #ffffff;
}

/* Company Link */
.clickable-company {
  color: #30a5bf;
  text-decoration: none;
  font-weight: 500;
}

.clickable-company:hover {
  text-decoration: underline;
}

.ticker-symbol {
  color: #666;
  font-size: 10px;
  font-weight: 600;
  background: #f0f0f0;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 5px;
  line-height: 1;
}

/* Owner Tags */
.owner-tag {
  display: inline-block;
  padding: 3px 8px;
  background: #e3f2fd;
  color: #1976d2;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

/* Contact Items */
.cv-contact-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 5px;
}

.contact-email {
  color: #4a90e2;
  text-decoration: none;
  font-size: 12px;
}

.contact-email:hover {
  text-decoration: underline;
}

/* Contacts Cell */
.contacts-cell {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.contacts-cell:hover {
  background-color: #f9fafb !important;
}

.contacts-preview-container {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.contact-item-preview {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.contacts-cell .contacts-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}

.cv-contact-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
}

.cv-contact-item:not(:last-child) {
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 6px;
}

.contact-name {
  font-size: 12px;
  font-weight: 600;
  color: #2c3e50;
}

.contact-phone {
  font-size: 11px;
  color: #666;
  font-family: monospace;
}

/* Contacts Count Badge */
.contacts-count-badge {
  background: #30a5bf;
  color: white;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Phone Items */
.phone-item {
  display: inline-block;
  padding: 2px 6px;
  background: #f5f5f5;
  border-radius: 3px;
  font-size: 11px;
  font-family: monospace;
  line-height: 1.2;
}

/* Notes Cell */
.notes-cell {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.notes-cell:hover {
  background-color: #f9fafb !important;
}

.notes-preview-container {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

/* Notes Preview */
.notes-preview {
  font-size: 12px;
  color: #555;
  line-height: 1.4;
  flex: 1;
  font-weight: 700;

}

/* Notes Count Badge */
.notes-count-badge {
  background: #30a5bf;
  color: white;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 20px;
  text-align: center;
}

/* Last Talked Date Picker Styling */
.company-table td {
  position: relative;
}

/* Last Talked Date Input */
.last-talked-date-input {
  width: 100%;
  padding: 4px 6px;
  font-size: 13px;
  color: #30a5bf;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.last-talked-date-input:hover {
  background-color: #f0f7ff;
  border-color: #e0f2fe;
}

.last-talked-date-input:focus {
  outline: none;
  background-color: #fff;
  border-color: #30a5bf;
  box-shadow: 0 0 0 2px rgba(48, 165, 191, 0.1);
}

/* Style the calendar icon that browsers add */
.last-talked-date-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.last-talked-date-input::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* Icon Buttons */
.btn-icon {
  background: transparent !important;
  border: none !important;
  color: #30a5bf !important;
  cursor: pointer;
  padding: 1px 2px !important;
  font-size: 11px !important;
  transition: all 0.2s ease;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  line-height: 1;
  width: auto !important;
  height: auto !important;
  min-width: 20px !important;
  min-height: 20px !important;
  max-width: 24px !important;
  max-height: 24px !important;
}

.btn-icon:hover {
  color: #238a9f;
  transform: scale(1.15);
}

.btn-icon.delete-btn {
  color: #999;
}

.btn-icon.delete-btn:hover {
  color: #e74c3c;
}

/* Link-to-existing-company button */
.btn-icon.link-company-btn {
  color: #888;
}

.btn-icon.link-company-btn:hover {
  color: #30a5bf;
}

/* Activities button - matches other action buttons style */
.assistant-button.activities-btn {
  background-color: transparent !important;
  color: #30a5bf !important;
  border: 1px solid #30a5bf !important;
  padding: 6px 10px !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-family: "Inter", sans-serif !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  margin: 0 !important;
  margin-right: 8px !important;
  gap: 4px !important;
  vertical-align: middle !important;
}

.assistant-button.activities-btn:hover {
  background-color: #30a5bf !important;
  color: white !important;
}

.assistant-button.activities-btn i {
  font-size: 11px !important;
}

.add-owner-btn,
.add-contact-btn,
.add-phone-btn {
  opacity: 0.5 !important;
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-size: 10px !important;
  color: #30a5bf !important;
  flex-shrink: 0;
  padding: 1px !important;
  width: 18px !important;
  height: 18px !important;
}

/* Horizontal Add Buttons */
.btn-add-horizontal {
  background: #30a5bf !important;
  color: white !important;
  border: none !important;
  border-radius: 3px !important;
  padding: 4px 8px !important;
  font-size: 10px !important;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 3px;
  opacity: 0.7;
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 1;
  flex-shrink: 0;
  width: auto !important;
  height: 22px !important;
  min-width: auto !important;
  max-width: none !important;
  vertical-align: middle;
}

.btn-add-horizontal:hover {
  opacity: 1 !important;
  background: #238a9f !important;
  transform: none !important;
}

.btn-add-horizontal i {
  font-size: 9px;
}

.add-owner-btn:hover,
.add-contact-btn:hover,
.add-phone-btn:hover {
  opacity: 1;
  transform: scale(1.15);
  color: #238a9f;
}

.single-cell:hover .add-owner-btn,
.single-cell:hover .add-contact-btn,
.single-cell:hover .add-phone-btn,
.company-view-cell:hover .add-owner-btn,
.company-view-cell:hover .add-contact-btn,
.company-view-cell:hover .add-phone-btn {
  opacity: 0.8;
}

/* Actions Cell */
.actions-cell {
  text-align: center;
}

.actions-cell .btn-icon,
.single-cell .btn-icon.fas.fa-eye,
.single-cell .btn-icon.far.fa-trash-alt,
div[style*="width: 120px"] .btn-icon {
  font-size: 12px !important;
  padding: 2px 3px !important;
  width: 22px !important;
  height: 22px !important;
}

.cell-actions {
  display: flex;
  gap: 2px;
  justify-content: center;
}

/* Cell Editing */
.cell-edit-input {
  width: 100%;
  padding: 6px 8px;
  border: 2px solid #4a90e2;
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  box-shadow: 0 0 5px rgba(74, 144, 226, 0.3);
}

.cell-edit-input:focus {
  border-color: #357abd;
}

textarea.cell-edit-input {
  resize: vertical;
  min-height: 60px;
}

.cell-edit-actions {
  display: flex;
  gap: 5px;
  margin-top: 5px;
  justify-content: flex-end;
}

.cell-edit-actions .btn-icon {
  opacity: 1;
  padding: 4px 8px;
}

.save-btn {
  background: #4caf50;
  color: white;
}

.save-btn:hover {
  background: #45a049;
}

.cancel-btn {
  background: #f44336;
  color: white;
}

.cancel-btn:hover {
  background: #da190b;
}

/* Loader */
.loader-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px;
}

.loader {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #4a90e2;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

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

/* Error Message */
.error-message {
  padding: 40px;
  text-align: center;
  color: #d32f2f;
  font-size: 14px;
  background: #ffebee;
  border-radius: 5px;
  margin: 20px;
}

/* Custom Columns */
.custom-column {
  background: #fff3e0;
}

/* Hide Columns specific styles */
#company-view-hide-columns .filter-selector-content {
  min-width: 280px;
}

#company-view-hide-columns .filter-selector-options {
  max-height: 350px;
}

#company-view-hide-columns .filter-checkbox-list {
  max-height: 300px;
}

/* Filter Tags */
#company-filter-tags-wrapper {
  margin-bottom: 5px;
}

#company-filter-tags-header {
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 16px;
  color: #192342;
}

#company-filter-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Responsive */
@media only screen and (max-width: 768px) {
  .company-view-table-wrapper {
    border-radius: 0;
  }
  
  .company-view-cell {
    padding: 8px 10px;
    font-size: 12px;
  }
  
  .company-view-header {
    padding: 10px 10px;
    font-size: 12px;
  }
  
  .view-toggle-btn {
    padding: 8px 12px;
    font-size: 13px;
  }
}

/* Snackbar (for notifications) */
.snackbar {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  color: #1f2937;
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 320px;
  max-width: 500px;
  border: 1px solid #e5e7eb;
  animation: snackbar-slidein 0.3s ease-out;
}

.snackbar-icon {
  font-size: 20px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.snackbar-message {
  flex: 1;
  font-weight: 400;
  line-height: 1.5;
}

.snackbar-close {
  background: transparent;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  flex-shrink: 0;
  font-size: 16px;
}

.snackbar-close:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.snackbar.success .snackbar-icon {
  color: #10b981;
}

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

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

@keyframes snackbar-slidein {
  from { 
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
  }
  to { 
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

/* Shared Modal Styles for Company View Modals */
.company-view-modal .modal-content {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.company-view-modal .modal-header {
  padding: 15px;
  border-bottom: 1px solid #e4e7ee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.company-view-modal .modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #2c3e50;
  letter-spacing: normal !important;
}

.company-view-modal .modal-body {
  padding: 24px 20px;
  overflow-y: auto;
}

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

.company-view-modal .form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #2c3e50;
  font-size: 14px;
}

.company-view-modal .form-group input,
.company-view-modal .form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e4e7ee;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s ease;
  margin-top: 0 !important;
}

.company-view-modal .form-group input:focus,
.company-view-modal .form-group select:focus {
  outline: none;
  border-color: #30a5bf;
  box-shadow: 0 0 0 3px rgba(48, 165, 191, 0.1);
}

.company-view-modal .btn-primary {
  background: #30a5bf;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s ease;
  margin-bottom: 0 !important;
  text-transform: none !important;
}

.company-view-modal .btn-primary:hover {
  background: #2891a8;
}

.company-view-modal .btn-secondary {
  background: #6c757d;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s ease;
  margin-bottom: 0 !important;
  text-transform: none !important;
}

.company-view-modal .btn-secondary:hover {
  background: #5a6268;
}

.company-view-modal .column-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.company-view-modal .btn-primary i {
  font-size: 13px;
}

.company-view-modal .close {
  font-size: 28px;
  font-weight: 300;
  color: #6c757d;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s ease;
}

.company-view-modal .close:hover {
  color: #2c3e50;
}

/* Add Company Modal - Specific Styles */
.company-view-modal .search-with-button {
  display: flex;
  align-items: center;
  gap: 10px;
}

.company-view-modal .help-text {
  margin-top: 8px;
  font-size: 13px;
  color: #6c757d;
  line-height: 1.4;
}

/* Manage Columns Modal - Specific Styles */
.company-view-modal .columns-list-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e4e7ee;
}

.company-view-modal .columns-list-section h4,
.company-view-modal .add-column-section h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: #2c3e50;
}

.company-view-modal .add-column-section h4 {
  margin-bottom: 16px;
}

.company-view-modal .columns-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.company-view-modal .column-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #f9fafb;
  border: 1px solid #e4e7ee;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.company-view-modal .column-item:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.company-view-modal .column-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.company-view-modal .column-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.company-view-modal .btn-edit {
  background: transparent;
  border: none;
  color: #30a5bf;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.company-view-modal .btn-edit:hover {
  background: rgba(48, 165, 191, 0.1);
  color: #2891a8;
}

.company-view-modal .btn-edit i {
  font-size: 14px;
}

.company-view-modal .column-name {
  font-weight: 600;
  font-size: 14px;
  color: #2c3e50;
}

.company-view-modal .column-type-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #e0f2f7;
  color: #30a5bf;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  text-transform: capitalize;
}

.company-view-modal .btn-delete {
  background: transparent;
  border: none;
  color: #f44336;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.company-view-modal .btn-delete:hover {
  color: #d32f2f;
}

.company-view-modal .btn-delete i {
  font-size: 14px;
}

.company-view-modal .no-columns {
  padding: 20px;
  text-align: center;
  color: #6c757d;
  font-size: 14px;
  background: #f9fafb;
  border-radius: 6px;
  border: 1px dashed #d1d5db;
}

/* Contacts List Modal - Specific Styles */
.company-view-modal .contacts-list-section {
  margin-bottom: 0;
}

.company-view-modal .contacts-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.company-view-modal .contacts-list-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #2c3e50;
}

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

.company-view-modal .contacts-list-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.company-view-modal .contact-list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  background: #f9fafb;
  border: 1px solid #e4e7ee;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.company-view-modal .contact-list-item:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.company-view-modal .contact-list-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.company-view-modal .contact-list-name {
  font-weight: 600;
  font-size: 14px;
  color: #2c3e50;
  margin-bottom: 4px;
}

.company-view-modal .contact-list-phone,
.company-view-modal .contact-list-email,
.company-view-modal .contact-list-title {
  font-size: 12px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 6px;
}

.company-view-modal .contact-list-phone i,
.company-view-modal .contact-list-email i,
.company-view-modal .contact-list-title i {
  width: 14px;
  font-size: 11px;
  color: #30a5bf;
}

.company-view-modal .no-contacts {
  padding: 20px;
  text-align: center;
  color: #6c757d;
  font-size: 14px;
  background: #f9fafb;
  border-radius: 6px;
  border: 1px dashed #d1d5db;
}

/* Owners List Modal - Specific Styles (matching contacts) */
.company-view-modal .owners-list-section {
  margin-bottom: 0;
}

.company-view-modal .owners-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.company-view-modal .owners-list-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #2c3e50;
}

.company-view-modal .owners-list-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.company-view-modal .owner-list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px;
  background: #f9fafb;
  border: 1px solid #e4e7ee;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.company-view-modal .owner-list-item:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.company-view-modal .owner-list-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.company-view-modal .owner-list-name {
  font-weight: 600;
  font-size: 14px;
  color: #2c3e50;
  margin-bottom: 4px;
}

.company-view-modal .owner-list-actions {
  display: flex;
  gap: 4px;
}

.company-view-modal .no-owners {
  padding: 20px;
  text-align: center;
  color: #6c757d;
  font-size: 14px;
  background: #f9fafb;
  border-radius: 6px;
  border: 1px dashed #d1d5db;
}

/* Owners Cell Styles (matching contacts) */
.owners-cell {
  cursor: pointer;
}

.owners-cell:hover {
  background: #f9fafb;
}

.owners-preview-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.owner-item-preview {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.owner-name {
  font-weight: 500;
  color: #2c3e50;
}

/* Owners Count Badge (grey, shows +N for additional owners) */
.owners-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #30a5bf;
  color: white;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  min-width: 20px;
}

/* Custom Field Expandable Text Styles */
.custom-field-expand-wrapper {
  position: relative;
  width: 100%;
}

.custom-field-text {
  color: #333;
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.custom-field-expand-btn {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #d1d5db;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: none;
  margin-top: 4px;
  white-space: nowrap;
  display: inline-block;
}

.custom-field-expand-btn:hover {
  background: #e5e7eb;
  color: #374151;
  border-color: #9ca3af;
}

.custom-field-expand-btn.expanded {
  background: #f3f4f6;
  color: #6b7280;
  border-color: #d1d5db;
}

.custom-field-expand-btn.expanded:hover {
  background: #e5e7eb;
  color: #374151;
  border-color: #9ca3af;
}

.custom-field-visible,
.custom-field-hidden {
  width: 100%;
}

/* Contact List Item Actions */
.contact-list-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-edit,
.btn-view {
  background: transparent;
  border: none;
  padding: 6px 8px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 14px;
}

.btn-edit {
  color: #3b82f6;
}

.btn-edit:hover {
  background: #eff6ff;
  color: #2563eb;
}

.btn-view {
  color: #6b7280;
}

.btn-view:hover {
  background: #f3f4f6;
  color: #374151;
}

/* Contact Title in Preview */
.contact-title {
  display: block;
  font-size: 11px;
  color: #6b7280;
  margin-top: 2px;
  font-style: italic;
}

/* View Contact Modal */
.view-contact-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.view-contact-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.view-contact-field label {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.view-contact-value {
  font-size: 14px;
  color: #1f2937;
  padding: 8px 12px;
  background: #f9fafb;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
}

.view-contact-value a {
  color: #3b82f6;
  text-decoration: none;
}

.view-contact-value a:hover {
  text-decoration: underline;
}

.contact-source-badge {
  display: inline-block;
  padding: 4px 8px;
  background: #e0f2fe;
  color: #0369a1;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

/* Contact List Title Styling */
.contact-list-title {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
  font-style: italic;
}

.contact-list-title i {
  margin-right: 4px;
  font-size: 11px;
}

/* Add Company Modal - Mode Toggle */
.add-company-modal-content {
  max-width: 600px;
}

.add-company-mode-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  padding: 0;
}

.mode-toggle-btn {
  text-decoration: none;
  background: white;
  box-shadow: 0px 3px 10px #0000001a;
  color: #4b5563;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid #e4e7ee;
  transition: all 0.2s ease;
}

.mode-toggle-btn:hover {
  background: #f9fafb;
  border-color: #30a5bf;
  color: #30a5bf;
}

.mode-toggle-btn.active {
  background: #30a5bf;
  color: white;
  border-color: #30a5bf;
  box-shadow: 0px 3px 10px rgba(48, 165, 191, 0.3);
}

.mode-toggle-btn i {
  font-size: 14px;
}

/* Add Company Sections */
.add-company-section {
  animation: fadeIn 0.2s ease;
}

.add-company-section.hidden {
  display: none;
}

.add-company-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e4e7ee;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.add-company-input:focus {
  outline: none;
  border-color: #2196F3;
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.search-with-button {
  display: flex;
  gap: 8px;
}

.search-with-button .add-company-input {
  flex: 1;
}

.add-company-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

.required {
  color: red;
}

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

/* Custom Company Form */
.add-company-section .form-group {
  margin-bottom: 15px;
}

.add-company-section .form-group:last-child {
  margin-bottom: 0;
}

.add-company-section label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 14px;
  color: #374151;
}

.add-company-section .help-text {
  margin-top: 8px;
  font-size: 0.9rem;
  color: #6c757d;
  line-height: 1.4;
}

/* ==============================
   Column Reordering Styles
   ============================== */

/* Make headers look draggable */
.company-table thead th[data-field] {
  position: relative;
  user-select: none;
}

.company-table thead th[data-field]:not(:last-child):hover {
  background: #f8f9fa;
}

.company-table thead th[data-field]:hover .th-content::before {
  opacity: 0.6;
}

/* Show move cursor on header content but not on resize handle */
.company-table thead th[data-field] .th-content {
  cursor: move;
  padding: 8px 12px 8px 0;
  display: flex;
  align-items: center;
  position: relative;
}

.company-table thead th[data-field] .th-content::before {
  content: '';
  width: 8px;
  height: 14px;
  margin-right: 2px;
  opacity: 0;
  transition: opacity 0.2s ease;
  background-image: 
    radial-gradient(circle, #9ca3af 1.5px, transparent 1.5px),
    radial-gradient(circle, #9ca3af 1.5px, transparent 1.5px),
    radial-gradient(circle, #9ca3af 1.5px, transparent 1.5px),
    radial-gradient(circle, #9ca3af 1.5px, transparent 1.5px),
    radial-gradient(circle, #9ca3af 1.5px, transparent 1.5px),
    radial-gradient(circle, #9ca3af 1.5px, transparent 1.5px);
  background-size: 4px 4px;
  background-position: 
    0 0,
    4px 0,
    0 5px,
    4px 5px,
    0 10px,
    4px 10px;
  background-repeat: no-repeat;
}

/* Dragging state */
.company-table thead th.dragging-column {
  opacity: 0.5;
  background: #e9ecef;
  cursor: move;
}

/* Drop indicator */
.column-drop-indicator {
  position: fixed;
  width: 3px;
  background: #30a5bf;
  box-shadow: 0 0 8px rgba(48, 165, 191, 0.6);
  z-index: 10000;
  pointer-events: none;
  transition: left 0.1s ease, top 0.1s ease;
}

/* Drag over state */
.company-table thead th.drag-over {
  background: #e3f2fd;
  border-left: 3px solid #30a5bf;
}

/* Prevent text selection during drag */
body.resizing-column,
body.dragging-column {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Smooth transitions for column movements */
.company-table thead th {
  transition: background-color 0.15s ease;
}

/* Keep resize handle visible and functional during drag */
.company-table thead th .resize-handle {
  cursor: col-resize;
  z-index: 2;
}

/* Ensure resize handle stops drag propagation */
.company-table thead th .resize-handle:hover {
  background: rgba(48, 165, 191, 0.2);
}

/* Documents Column Styles */
.documents-cell {
  cursor: pointer;
}

.documents-cell:hover {
  background-color: #f8f9fa;
}

.documents-preview-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.add-documents-btn {
  background-color: transparent !important;
  color: #30a5bf !important;
  border: 1px solid #30a5bf !important;
  padding: 6px 10px !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-family: "Inter", sans-serif !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  margin: 0 !important;
  gap: 4px !important;
  vertical-align: middle !important;
  white-space: nowrap;
}

.add-documents-btn:hover {
  background-color: #30a5bf !important;
  color: white !important;
}

.add-documents-btn i {
  font-size: 11px !important;
}

.documents-count-badge {
  background: #30a5bf;
  color: white;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

/* Documents Modal Styles */
.documents-modal-wide {
  max-width: 900px !important;
  width: 90% !important;
}

.documents-modal-content {
  padding: 0;
}

.upload-section {
  margin-bottom: 32px;
}

.upload-dropzone {
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fafafa;
}

.upload-dropzone:hover {
  border-color: #30a5bf;
  background: #f0f9fb;
}

.upload-dropzone.dragover {
  border-color: #30a5bf;
  background: #e6f7fa;
  border-style: solid;
}

.upload-icon {
  color: #9ca3af;
  margin: 0 auto 12px;
  display: block;
}

.upload-text {
  margin: 0 0 4px 0;
  font-size: 14px;
  color: #374151;
}

.upload-link {
  color: #30a5bf;
  font-weight: 600;
  cursor: pointer;
}

.upload-link:hover {
  text-decoration: underline;
}

.upload-hint {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
}

.uploaded-documents-section {
  border-top: 1px solid #e5e7eb;
  padding-top: 24px;
}

.no-documents-state {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.documents-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.document-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e4e7ee;
  transition: all 0.2s ease;
}

.document-item:hover {
  background: #e9ecef;
  border-color: #30a5bf;
}

.document-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

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

.document-name {
  font-weight: 500;
  color: #333;
  font-size: 14px;
}

.document-meta {
  font-size: 12px;
  color: #666;
}

.document-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Upload Contacts Modal Styles */
#upload-contacts-modal .modal-content {
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#upload-contacts-modal .modal-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  margin-bottom: 0 !important;
  padding-bottom: 20px !important;
}

#upload-contacts-modal .documents-modal-wide {
  max-width: 900px;
  width: 95%;
}

#upload-contacts-modal .upload-contacts-step {
  padding: 0;
}

#upload-contacts-modal .upload-contacts-modal-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

#upload-contacts-modal .upload-contacts-modal-content-single {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

#upload-contacts-modal .upload-section {
  background: #fff;
}

#upload-contacts-modal .upload-info-section {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e4e7ee;
}

#upload-contacts-modal .preview-summary-section,
#upload-contacts-modal .column-mapping-section,
#upload-contacts-modal .preview-data-section {
  background: #fff;
  min-width: 0;
}

#upload-contacts-modal .column-mapping-section h4 {
  margin: 0 0 4px 0 !important;
}

#upload-contacts-modal .column-mapping-section > p {
  margin: 0 0 8px 0 !important;
}

#upload-contacts-modal .column-mapping-section .help-text {
  margin-top: 6px !important;
  padding: 7px 10px !important;
}

#upload-contacts-modal .help-text {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
}

/* Upload dropzone styling for contacts */
#upload-contacts-modal .upload-dropzone {
  border: 2px dashed #cbd5e0;
  border-radius: 8px;
  padding: 40px 20px;
  text-align: center;
  background: #f8f9fa;
  cursor: pointer;
  transition: all 0.2s ease;
}

#upload-contacts-modal .upload-dropzone:hover {
  border-color: #007bff;
  background: #f0f7ff;
}

#upload-contacts-modal .upload-dropzone.dragover {
  border-color: #007bff;
  background: #e3f2fd;
  border-style: solid;
}

#upload-contacts-modal .upload-icon {
  color: #94a3b8;
  margin-bottom: 12px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

#upload-contacts-modal .upload-text {
  color: #475569;
  font-size: 14px;
  margin: 0 0 4px 0;
}

#upload-contacts-modal .upload-link {
  color: #007bff;
  font-weight: 600;
}

#upload-contacts-modal .upload-link:hover {
  text-decoration: underline;
}

#upload-contacts-modal .upload-hint {
  color: #94a3b8;
  font-size: 12px;
  margin: 0;
}

/* Column mapping styles */

#upload-contacts-modal .column-mapping-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 5px 12px;
  margin-bottom: 6px;
  align-items: center;
}

#upload-contacts-modal .column-mapping-select {
  flex: 1;
  padding: 3px 8px;
  border: 1px solid #e4e7ee;
  border-radius: 4px;
  background: white;
  font-size: 12px;
  cursor: pointer;
  height: 28px;
  transition: border-color 0.2s ease;
}

#upload-contacts-modal .column-mapping-select:hover {
  border-color: #007bff;
}

#upload-contacts-modal .column-mapping-select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

#upload-contacts-modal .preview-table-wrapper {
  max-height: 300px;
  overflow: auto;
  border: 1px solid #e4e7ee;
  border-radius: 4px;
  background: white;
}

#upload-contacts-modal .preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

#upload-contacts-modal .preview-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

#upload-contacts-modal .preview-table th {
  padding: 10px;
  background: #f8f9fa;
  border-bottom: 2px solid #ddd;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

#upload-contacts-modal .preview-table td {
  padding: 10px;
  border-bottom: 1px solid #eee;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#upload-contacts-modal .preview-table tr:hover {
  background: #f8f9fa;
}

#upload-contacts-modal .preview-summary {
  margin-bottom: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 4px;
  border: 1px solid #e4e7ee;
}

#upload-contacts-modal .error-message {
  color: #e74c3c;
  padding: 12px;
  background: #fef5f5;
  border-radius: 4px;
  border: 1px solid #e74c3c;
  display: none;
  font-size: 14px;
  margin-top: 15px;
}

#upload-contacts-modal .error-message i {
  margin-right: 8px;
}

#upload-contacts-modal .upload-contacts-actions {
  display: flex;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
}

#upload-contacts-modal .modal-footer {
  border-top: 1px solid #e4e7ee;
  padding: 16px 24px;
  background: #f8f9fa;
  margin: 0;
}

#upload-contacts-modal .upload-contacts-actions > div {
  display: flex;
  gap: 10px;
}

#upload-contacts-modal #upload-contacts-progress {
  display: none;
  text-align: center;
  padding: 40px 20px;
}

#upload-contacts-modal #upload-contacts-progress .loader {
  display: inline-block;
  width: 40px;
  height: 40px;
  margin-bottom: 15px;
}

#upload-contacts-modal #upload-contacts-progress-message {
  font-size: 14px;
  color: #666;
}

/* Upload results styling */
#upload-contacts-modal #upload-results-summary {
  margin-bottom: 20px;
}

#upload-contacts-modal #upload-results-details {
  max-height: 400px;
  overflow-y: auto;
}

#upload-contacts-modal #upload-results-details h4 {
  color: #33475b;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#upload-contacts-modal #upload-results-details h4 i {
  font-size: 16px;
}

#upload-contacts-modal .result-item {
  padding: 10px;
  border-bottom: 1px solid #f0f0f0;
}

#upload-contacts-modal .result-item:last-child {
  border-bottom: none;
}

/* File input styling */
#upload-contacts-modal input[type="file"] {
  width: 100%;
  padding: 10px;
  border: 2px dashed #e4e7ee;
  border-radius: 4px;
  background: #f8f9fa;
  cursor: pointer;
  transition: all 0.2s ease;
}

#upload-contacts-modal input[type="file"]:hover {
  border-color: #007bff;
  background: #f0f7ff;
}

/* Responsive adjustments */
@media only screen and (max-width: 768px) {
  #upload-contacts-modal .column-mapping-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  #upload-contacts-modal .upload-contacts-actions {
    flex-direction: column;
  }
  
  #upload-contacts-modal .upload-contacts-actions > div {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ==============================
   Primary Contact Checkbox
   ============================== */

/* Row highlight when a contact is primary */
.company-view-modal .contact-list-item.is-primary-contact {
  background-color: #f0f9ff;
  border-left: 3px solid #30a5bf;
}

/* Contact item: column layout — body row on top, bottom row below */
.company-view-modal .contact-list-item {
  flex-direction: column;
  gap: 6px;
}

/* Top row: info + action buttons side by side */
.company-view-modal .contact-list-body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
}

/* Bottom row: email left, primary label right — direct child so always full width */
.company-view-modal .contact-list-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
}

/* Label wraps text + checkbox in a row */
.primary-contact-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.primary-contact-radio-text {
  font-size: 12px;
  color: #546e7a;
  font-weight: 500;
  white-space: nowrap;
}

/* Custom checkbox appearance */
.primary-contact-radio {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 15px;
  height: 15px;
  border: 2px solid #b0bec5;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s;
}

.primary-contact-radio:hover {
  border-color: #30a5bf;
}

.primary-contact-radio:checked {
  background: #30a5bf;
  border-color: #30a5bf;
}

.primary-contact-radio:checked::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 6px;
  border: 1.5px solid #fff;
  border-top: none;
  border-left: none;
  transform: translate(-50%, -60%) rotate(45deg);
}
