/* ====================================
   COMPONENTS - Buttons, Inputs, Badges, Dropdowns
   ==================================== */

/* ====== ICON-ONLY NAVIGATION BUTTONS ====== */
.schema-btn, .logout-btn {
  position: relative;
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 10px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: white;
  font-size: 14px;
  /* Initial state for entrance animation */
  opacity: 0;
  animation: btnReveal 0.6s cubic-bezier(0.4, 0, 0.2, 1) 1s forwards;
}

/* Stagger the entrance animations */
.schema-btn:nth-of-type(1) { animation-delay: 1s; }
.schema-btn:nth-of-type(2) { animation-delay: 1.1s; }
.schema-btn:nth-of-type(3) { animation-delay: 1.2s; }
.schema-btn:nth-of-type(4) { animation-delay: 1.3s; }
.schema-btn:nth-of-type(5) { animation-delay: 1.4s; }
.schema-btn:nth-of-type(6) { animation-delay: 1.5s; }
.logout-btn { animation-delay: 1.6s; }

/* Shimmer overlay - hidden by default */
.schema-btn::before, .logout-btn::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transform: translateX(-100%) rotate(45deg);
  transition: transform 0.6s ease;
}

/* Hover effects */
.schema-btn:hover, .logout-btn:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.4);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15), 0 0 20px rgba(255,255,255,0.2);
}

/* Shimmer animation on hover */
.schema-btn:hover::before, .logout-btn:hover::before {
  transform: translateX(100%) rotate(45deg);
}

/* Active/click state */
.schema-btn:active, .logout-btn:active {
  transform: translateY(0) scale(0.98);
}

/* SVG icon sizing */
.schema-btn svg, .logout-btn svg {
  width: 20px;
  height: 20px;
  position: relative;
  z-index: 1;
  pointer-events: none;
}

/* ====== ICON TOOLTIP ====== */
.icon-tooltip {
  position: absolute;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(102,126,234,0.3);
  color: #333;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  z-index: 3000;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.icon-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Arrow pointer for tooltip */
.icon-tooltip::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid rgba(255,255,255,0.95);
}

/* ====== STATUS DROPDOWN ====== */
#leadCallStatus {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

#leadCallStatus option[value="new"] { background: #e3f2fd; color: #1976d2; }
#leadCallStatus option[value="contacted"] { background: #f3e5f5; color: #7b1fa2; }
#leadCallStatus option[value="qualified"] { background: #e8f5e9; color: #388e3c; }
#leadCallStatus option[value="booked"] { background: #fff3e0; color: #f57c00; }
#leadCallStatus option[value="won"] { background: #e8f5e9; color: #2e7d32; }
#leadCallStatus option[value="lost"] { background: #ffebee; color: #c62828; }

/* ====== SVG ICONS ====== */
.svg-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.svg-icon-small { width: 14px; height: 14px; }
.svg-icon-large { width: 24px; height: 24px; }


/* ====== CLIENT SELECTOR DROPDOWN ====== */
.client-selector-wrapper {
  /* Start: Absolutely positioned, out of layout flow - NO JUMP */
  position: absolute;
  left: 20px;
  top: 20px;
  width: 0;
  min-width: 0;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-width 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease 0.5s;
}

.client-selector-wrapper.in-flow {
  position: relative;
  left: auto;
  top: auto;
}

.client-selector-wrapper.expanding {
  max-width: 250px;
  min-width: 250px;
}

.client-selector-wrapper.visible {
  opacity: 1;
}

.client-selector-wrapper.animation-complete {
  overflow: visible;
}

.client-selector-button {
  width: 250px;
  padding: 12px 40px 12px 16px;
  border: 2px solid #667eea;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  background: white;
  color: #667eea;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.client-selector-button::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(to right, rgba(255,255,255,0.8), transparent);
  border-radius: 6px 0 0 6px;
  pointer-events: none;
  z-index: 1;
}

.client-selector-button:hover {
  background: #f8f9ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.client-selector-button::after {
  content: '▼';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  transition: transform 0.3s;
}

.client-selector-button.open::after {
  transform: translateY(-50%) rotate(180deg);
}

.client-selector-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 250px;
  background: white;
  border: 2px solid #667eea;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
  display: none;
  z-index: 100;
  overflow: hidden;
}

.client-selector-dropdown.open {
  display: block;
  animation: dropdownSlideIn 0.2s ease-out;
}

.client-selector-search {
  padding: 12px;
  border-bottom: 1px solid #e0e0e0;
  position: sticky;
  top: 0;
  background: white;
  z-index: 2;
}

.client-selector-search input {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.client-selector-search input:focus {
  outline: none;
  border-color: #667eea;
}

.client-selector-list {
  max-height: 280px;
  overflow-y: auto;
  position: relative;
}

.client-selector-list::before {
  content: '';
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(to bottom, white 0%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

.client-selector-list::after {
  content: '';
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(to top, white 0%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

.client-selector-option {
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 15px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

.client-selector-option:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.client-selector-option.selected {
  background: #f8f9ff;
  color: #667eea;
  font-weight: 600;
}

.client-selector-option.hidden {
  display: none;
}

.client-selector-no-results {
  padding: 20px;
  text-align: center;
  color: #999;
  font-size: 14px;
  display: none;
}

.client-selector-no-results.show {
  display: block;
}

/* Custom scrollbar for client selector */
.client-selector-list::-webkit-scrollbar { width: 6px; }
.client-selector-list::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
.client-selector-list::-webkit-scrollbar-thumb { background: #667eea; border-radius: 10px; }
.client-selector-list::-webkit-scrollbar-thumb:hover { background: #764ba2; }

/* ====== SEARCH & CONTROLS ====== */
.controls {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 20px;
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
  transition: box-shadow 0.3s ease;
}

.controls > * {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-box {
  flex: 1;
  min-width: 250px;
  position: relative;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-box::before {
  content: '';
  position: absolute;
  left: -19px;
  top: 0;
  bottom: 0;
  width: 19px;
  background: linear-gradient(to right, transparent, white);
  pointer-events: none;
  z-index: 1;
}

.search-box input {
  width: 100%;
  padding: 12px 40px 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  transition: border-color 0.3s;
}

.search-box input:focus {
  outline: none;
  border-color: #667eea;
}

.search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.search-icon svg {
  display: block;
}

/* ====== BUTTONS ====== */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
}

.btn-secondary:hover {
  background: #f8f9ff;
}

.btn-purple {
  background: white;
  color: #764ba2;
  border: 2px solid #764ba2;
}

.btn-purple:hover {
  background: #f9f5ff;
}

/* ====== CHECKBOXES ====== */
.checkbox-cell {
  width: 40px;
  text-align: center;
  position: relative;
}

.lead-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #667eea;
}

/* Selection Tooltip */
.selection-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #667eea;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 10;
}

.selection-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #667eea;
}

.checkbox-cell:hover .selection-tooltip {
  opacity: 1;
}

/* ====== COMPACT ACTION BUTTONS ====== */
.trash-btn-compact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 8px;
  cursor: not-allowed;
  transition: background 0.2s ease, transform 0.1s ease;
  background: #CED4DA;
  position: relative;
}

.trash-btn-compact svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

.trash-btn-compact.active {
  background: #f44336;
  cursor: pointer;
}

.trash-btn-compact.active:hover {
  background: #d32f2f;
  transform: scale(1.05);
}

.trash-btn-compact.active:active {
  background: #b71c1c;
  transform: scale(0.97);
}

/* Compact Status Button */
.status-btn-compact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 8px;
  cursor: not-allowed;
  transition: background 0.2s ease, transform 0.1s ease;
  background: #CED4DA;
  position: relative;
}

.status-btn-compact svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
}

.status-btn-compact.active {
  background: #667eea;
  cursor: pointer;
}

.status-btn-compact.active:hover {
  background: #5568d3;
  transform: scale(1.05);
}

.status-btn-compact.active:active {
  background: #4451b8;
  transform: scale(0.97);
}

/* Compact Action Buttons */
.action-btn-compact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 2px solid #667eea;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.action-btn-compact svg {
  width: 20px;
  height: 20px;
  stroke: #667eea;
}

.action-btn-compact:hover {
  background: #f8f9ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.action-btn-compact:active {
  transform: translateY(0);
}

/* Button Tooltips */
.btn-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 100;
}

.btn-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #333;
}

.action-btn-compact:hover .btn-tooltip,
.trash-btn-compact:hover .btn-tooltip,
.status-btn-compact:hover .btn-tooltip {
  opacity: 1;
}

/* ====== MODAL TABS ====== */
.detail-tab {
  padding: 15px 25px;
  border: none;
  background: none;
  font-size: 15px;
  font-weight: 600;
  color: #718096;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  position: relative;
}

.detail-tab:hover {
  color: #667eea;
  background: rgba(102, 126, 234, 0.05);
}

.detail-tab.active {
  color: #667eea;
  border-bottom-color: #667eea;
}

.tab-panel {
  display: none;
}

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

/* ====== BADGES ====== */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-primary {
  background: #e0e7ff;
  color: #4c51bf;
}

.badge-secondary {
  background: #e2e8f0;
  color: #4a5568;
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-warning {
  background: #fed7aa;
  color: #92400e;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

/* Small button variant */
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-success {
  background: #10b981;
  color: white;
  border: none;
}

.btn-success:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-success:active {
  transform: translateY(0) scale(0.98);
}

/* Mark as Sent button - square checkmark */
.mark-sent-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.mark-sent-btn svg {
  width: 16px;
  height: 16px;
}

.btn-danger {
  background: #ef4444;
  color: white;
  border: none;
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Button spinner */
.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

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

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="file"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: all 0.3s ease;
  cursor: pointer;
  background-color: #fff;
}

.form-group select:hover {
  border-color: #cbd5e0;
  background-color: #f7fafc;
}

.form-group select:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  background-color: #f7fafc;
}

.form-group select option {
  padding: 12px;
  font-size: 15px;
  font-weight: 500;
  background-color: #fff;
  color: #2d3748;
  transition: all 0.2s ease;
}

.form-group select option:hover {
  background-color: #ebf4ff;
  color: #3b82f6;
}

.form-group select option:checked {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 600;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
  resize: vertical;
}

/* ====================================
   iOS-STYLE TOGGLE SWITCHES
   ==================================== */

.toggle-switch {
  position: relative;
  width: 48px;
  height: 24px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e0;
  transition: 0.3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .toggle-slider {
  background-color: #4299e1;
}

input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

.toggle-switch:hover .toggle-slider {
  background-color: #a0aec0;
}

input:checked + .toggle-switch:hover .toggle-slider,
input:checked:hover + .toggle-slider {
  background-color: #3182ce;
}

/* ====== iOS-STYLE TOGGLE ====== */
.ios-toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.ios-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ios-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e0;
  transition: 0.3s;
  border-radius: 28px;
}

.ios-toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.ios-toggle input:checked + .ios-toggle-slider {
  background-color: #667eea;
}

.ios-toggle input:checked + .ios-toggle-slider:before {
  transform: translateX(22px);
}

.ios-toggle:hover .ios-toggle-slider {
  background-color: #a0aec0;
}

.ios-toggle input:checked:hover + .ios-toggle-slider {
  background-color: #764ba2;
}

/* ====== REVIEW BUTTON ====== */
.review-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.review-btn:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.review-btn:active {
  transform: translateY(0) scale(0.98);
}

/* Verification Checklist Styling */
.custom-checkbox-label:hover {
  background: rgba(255, 255, 255, 0.9) !important;
  transform: translateX(4px);
}

.custom-checkbox:checked {
  transform: scale(1.1);
}

/* Button Transition for Approve/Clear Toggle */
.btn {
  transition: all 0.3s ease;
}

.btn-primary {
  transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}

.btn-secondary {
  transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}

/* ====================================
   EXPIRATION INLINE SELECTOR
   ==================================== */
.expiration-inline-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.expiration-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  padding: 12px 16px;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.expiration-box:hover {
  border-color: #667eea;
  background: #f8f9ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.expiration-box.selected {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #667eea;
  color: white;
}

.expiration-number {
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.expiration-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  opacity: 0.8;
}

.expiration-box.selected .expiration-label {
  opacity: 1;
}

/* ====================================
   GLOBAL LETTER-SPACING OVERRIDE
   Applied universally with !important
   ==================================== */
* {
  letter-spacing: -0.04em !important;
}
/* GLOBAL LETTER-SPACING */ * { letter-spacing: -0.04em !important; }
