/* My Customers - Styles */

/* Main Layout */
.page-container {
  display: flex;
  height: calc(100vh - 60px); /* Account for top nav */
  overflow: hidden;
}


/* Left Sidebar */
.sidebar {
  width: 220px;
  background: var(--glass-light);
  border-right: 1px solid var(--glass-light-border);
  padding: 1rem 0;
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: 1.5rem;
}

.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  padding: 0 1rem;
  margin-bottom: 0.5rem;
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav-item {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.sidebar-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav-item.active {
  background: rgba(74, 158, 255, 0.2);
  color: var(--accent);
  border-left: 3px solid var(--accent);
}

.sidebar-nav-item .badge {
  float: right;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Main Content Area */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem;
}

.main-content-inner {
  width: 100%;
}

/* Customer list scrollable container */
.customer-list-scroll {
  display: block;
  overflow-x: scroll;
  -webkit-overflow-scrolling: touch;
}

.customer-list-scroll > table {
  min-width: 900px;
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-left h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 600;
  color: #fff;
}

.customer-count {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
}

.header-right {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* Toolbar buttons (Group, Sort) */
.toolbar-buttons {
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,0.04);
  padding: 2px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
}

.toolbar-btn {
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.toolbar-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.toolbar-btn.active {
  background: rgba(74, 158, 255, 0.2);
  border-color: rgba(74, 158, 255, 0.3);
  color: #fff;
}

.toolbar-btn-icon {
  font-size: 0.9rem;
}

/* Toolbar dropdown menu */
.toolbar-dropdown {
  position: fixed;
  background: var(--bg);
  border: 1px solid var(--glass-light-border);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  min-width: 180px;
  z-index: 1000;
  padding: 0.5rem 0;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.toolbar-dropdown-header {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--glass-light-border);
  margin-bottom: 0.25rem;
}

.toolbar-dropdown-item {
  padding: 8px 16px;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s;
}

.toolbar-dropdown-item:hover {
  background: rgba(255,255,255,0.06);
}

.toolbar-dropdown-item.selected {
  color: var(--accent);
}

.toolbar-dropdown-item .check {
  opacity: 0;
}

.toolbar-dropdown-item.selected .check {
  opacity: 1;
}

.toolbar-dropdown-divider {
  height: 1px;
  background: var(--glass-light-border);
  margin: 0.5rem 0;
}

.sort-direction-toggle {
  padding: 8px 16px;
  font-size: 0.85rem;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.15s;
}

.sort-direction-toggle:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.search-box input {
  padding: 8px 12px;
  border: 1px solid var(--glass-light-border);
  border-radius: 6px;
  font-size: 0.85rem;
  background: var(--bg);
  color: var(--text);
  width: 250px;
  transition: border-color 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
}

.search-box input::placeholder {
  color: var(--text-dim);
}

/* Route Timing Tabs - matches Leadership period-filter style */
.route-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 1.25rem;
  background: rgba(255,255,255,0.04);
  padding: 2px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
}

.route-tab {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 12px;
  color: var(--text-dim);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.route-tab:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.route-tab.active {
  background: rgba(74, 158, 255, 0.2);
  border-color: rgba(74, 158, 255, 0.3);
  color: #fff;
}

/* Program Filter Tabs */
.program-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.program-tab {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  color: var(--text);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.program-tab:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.program-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Status Container */
.status-container {
  margin-bottom: 1rem;
}

.status-message {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.status-info {
  background: rgba(74, 158, 255, 0.2);
  border: 1px solid rgba(74, 158, 255, 0.4);
  color: var(--accent);
}

.status-success {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #86efac;
}

.status-error {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* Customer List Table */
.customer-list {
  width: 100%;
  overflow-x: auto;
  min-width: 0;
}

.customer-list-inner {
  min-width: 800px;
}

.loading-spinner {
  text-align: center;
  padding: 2rem;
  color: rgba(255, 255, 255, 0.6);
}

.no-results,
.error-message {
  text-align: center;
  padding: 2rem;
  color: rgba(255, 255, 255, 0.6);
}

.error-message {
  color: #fca5a5;
}

/* Customer Table */
.customer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.customer-table th,
.customer-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--glass-light-border);
  color: rgba(255, 255, 255, 0.85);
}

.customer-table th {
  background: rgba(255, 255, 255, 0.05);
  font-weight: 600;
  color: var(--text);
  position: sticky;
  top: 0;
  z-index: 1;
}

.customer-table tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}

.customer-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.08);
}

.customer-name {
  font-weight: 500;
  color: #fff;
}

.program-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  text-transform: uppercase;
  display: inline-block;
}

.program-iqwp-nc {
  background: rgba(74, 158, 255, 0.3);
  color: var(--accent);
}

.program-iqwp-sc {
  background: rgba(34, 197, 94, 0.3);
  color: #86efac;
}

.program-nes-nc {
  background: rgba(251, 191, 36, 0.3);
  color: #fde68a;
}

.customer-status-cell {
  color: rgba(255, 255, 255, 0.7);
}

.customer-phone-cell {
  color: rgba(255, 255, 255, 0.7);
}

.customer-address-cell {
  color: rgba(255, 255, 255, 0.7);
  max-width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.driving-order-cell {
  text-align: center;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  width: 50px;
}

.assigned-to-cell {
  color: rgba(255, 255, 255, 0.7);
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.route-date-cell {
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
}

.mapbox-cell {
  text-align: center;
  color: #86efac;
  font-size: 1rem;
}

/* Inline editable cells */
.editable-cell {
  padding: 0.5rem !important;
}

/* Date display - clickable */
.inline-date-display {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s ease;
  font-size: 0.8rem;
}

.inline-date-display:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Hidden date picker that appears on click - matches site control style */
.inline-date-picker {
  padding: 8px 12px;
  border: 1px solid var(--glass-light-border);
  border-radius: 6px;
  font-size: 0.85rem;
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.inline-date-picker:focus {
  outline: none;
  border-color: var(--accent);
}

/* Mapbox toggle */
.inline-mapbox-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.15s ease;
  color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-light-border);
}

.inline-mapbox-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.inline-mapbox-toggle.active {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.3);
}

/* Status badge - matches program-badge styling exactly */
.status-badge {
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  padding: 0.2rem 0.5rem !important;
  border-radius: 0.25rem !important;
  display: inline-block !important;
  cursor: pointer;
  transition: opacity 0.15s ease;
  white-space: nowrap;
  line-height: 1.2;
}

.status-badge:hover {
  opacity: 0.85;
}

/* Status dropdown - matches site control style */
.status-dropdown {
  background: var(--bg);
  border: 1px solid var(--glass-light-border);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  min-width: 160px;
  max-height: 300px;
  overflow-y: auto;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.status-option {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 12px;
  margin: 0;
  display: block;
  cursor: pointer;
  transition: opacity 0.1s ease;
}

.status-option:hover {
  opacity: 0.85;
}

.status-option.selected {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.4);
}

/* Collapsible group headers - matches site control style */
.group-header {
  background: var(--glass-light);
  border: 1px solid var(--glass-light-border);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.group-header:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
}

.group-header-caret {
  font-size: 0.75rem;
  color: var(--text-dim);
  transition: transform 0.2s ease;
  width: 14px;
  flex-shrink: 0;
}

.group-header.collapsed .group-header-caret {
  transform: rotate(-90deg);
}

.group-header-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  padding: 2px 0;
}

.group-header-count {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-left: auto;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
}

.group-section {
  margin-bottom: 1rem;
}

.group-content {
  margin-bottom: 1.5rem;
}

.group-content.collapsed {
  display: none;
}

.group-content .customer-table {
  margin-top: 0;
}

.contact-count {
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* Side Panel Styles */
.modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 700px;
  max-width: 100%;
  background: #1a1f36;
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.modal.active {
  transform: translateX(0);
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.modal-small {
  width: 400px;
}

.modal-large {
  width: 95%;
  max-width: 1200px;
}

.modal-medium {
  width: 100%;
}

.modal-medium .modal-body {
  padding: 1.25rem 1.5rem;
}

.modal-medium #contactForm {
  width: 100%;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--glass-light-border);
  background: #1a1f36;
  flex-shrink: 0;
}

.modal-header-info {
  flex: 1;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.modal-header-subinfo {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

.modal-subinfo-item {
  display: inline-block;
}

.modal-subinfo-item:not(:last-child)::after {
  content: "\2022";
  margin: 0 0.5rem;
  opacity: 0.5;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: color 0.2s;
}

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

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

/* Modal Sections */
.modal-section {
  margin-bottom: 1.5rem;
  background: var(--glass-light);
  border: 1px solid var(--glass-light-border);
  border-radius: 8px;
  overflow: hidden;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.modal-section:last-child {
  margin-bottom: 0;
}

.modal-section .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid var(--glass-light-border);
}

.modal-section.collapsible .section-header {
  cursor: pointer;
  user-select: none;
}

.modal-section.collapsible .section-header:hover {
  background: rgba(255, 255, 255, 0.08);
}

.section-caret {
  font-size: 0.7rem;
  margin-left: auto;
  color: var(--text-dim);
  transition: transform 0.2s ease;
}

.modal-section.collapsed .section-caret {
  transform: rotate(-90deg);
}

.modal-section.collapsed .section-content {
  display: none;
}

.modal-section .section-header h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.modal-section .section-content {
  padding: 1rem;
}

.section-content-empty {
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}

/* Customer Detail Fields */
.detail-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-row {
  display: flex;
  gap: 1rem;
}

.detail-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.detail-field.full {
  flex: 1 1 100%;
}

.detail-field.half {
  flex: 1 1 calc(50% - 0.5rem);
}

.detail-field.quarter {
  flex: 1 1 calc(25% - 0.75rem);
}

.detail-field-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 500;
}

.detail-field-value {
  padding: 10px 12px;
  border: 1px solid var(--glass-light-border);
  border-radius: 6px;
  font-size: 0.9rem;
  background: var(--bg);
  color: var(--text-dim);
}

.detail-field-value.readonly {
  background: rgba(255, 255, 255, 0.02);
}

.detail-field-value.colored-badge {
  font-weight: 600;
  text-align: center;
}

.slot-field-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.slot-field-wrapper select {
  width: 100%;
}

.btn-danger {
  background: #dc2626;
  color: #fff;
  border: none;
}

.btn-danger:hover {
  background: #b91c1c;
}

.remove-slot-btn {
  white-space: nowrap;
  padding: 8px 12px;
  align-self: flex-start;
}

.detail-field-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--glass-light-border);
  border-radius: 6px;
  font-size: 0.9rem;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s;
  font-family: inherit;
  box-sizing: border-box;
}

.detail-field-input:focus {
  outline: none;
  border-color: var(--accent);
}

.detail-field-input.changed {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.05);
}

.detail-field-input::placeholder {
  color: var(--text-dim);
}

textarea.detail-field-input {
  resize: vertical;
  min-height: 80px;
}

select.detail-field-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-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='%23b0b0c0' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

select.detail-field-input option {
  background: var(--bg);
  color: var(--text);
}

.detail-field-input.readonly {
  opacity: 0.7;
  cursor: not-allowed;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.5rem 0;
}

.detail-field-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.detail-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--glass-light-border);
}

/* Responsive: stack fields on narrow screens */
@media (max-width: 500px) {
  .detail-row {
    flex-direction: column;
  }

  .detail-field.half,
  .detail-field.quarter {
    flex: 1 1 100%;
  }
}

/* Customer Fields */
.customer-fields {
  display: grid;
  gap: 1rem;
}

.no-fields {
  color: var(--text-dim);
  font-style: italic;
  padding: 1rem;
  text-align: center;
}

/* Form Elements */
.form-row {
  margin-bottom: 0.75rem;
}

.form-row.two-col {
  display: flex;
  gap: 1rem;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg);
  border: 1px solid var(--glass-light-border);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group select {
  appearance: none;
  -webkit-appearance: none;
  -moz-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='%23b0b0c0' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
  cursor: pointer;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group input[readonly] {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-dim);
  cursor: default;
}

.form-group select option {
  background: var(--bg);
  color: var(--text);
}

/* White calendar icons for date/time inputs */
.form-group input[type="date"]::-webkit-calendar-picker-indicator,
.form-group input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* Buttons */
.btn {
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

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

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

.btn-primary:hover:not(:disabled) {
  background: #3a8ee6;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
}

.upload-btn {
  cursor: pointer;
}

/* Scheduling section - full width fields */
.modal-section#schedulingSection .detail-fields {
  width: 100%;
}

.modal-section#schedulingSection .detail-row {
  width: 100%;
}

.modal-section#schedulingSection .detail-field.field-full {
  flex: 1 1 100%;
}

.modal-section#schedulingSection .detail-field.field-half {
  flex: 1 1 calc(50% - 0.5rem);
}

/* Colored select styling */
.detail-field-input.colored-select {
  font-weight: 500;
}

.detail-field-input.colored-select option {
  background: var(--bg);
  color: #e0e0e8;
}

/* Contact Attempts - Column-based List Design */
/* Adjust these CSS variables to change column widths */
.modal-section#contactAttemptsSection {
  --contact-col-date: 100px;
  --contact-col-method: 85px;
  --contact-col-reason: 95px;
  --contact-col-by: 110px;
  --contact-col-outcome: 90px;
}

.contact-list-header {
  display: flex;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--glass-light-border);
}

.contact-list-header .contact-col {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  position: relative;
}

/* Column resizer handle */
.col-resizer {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  background: transparent;
  transition: background 0.15s;
}

.col-resizer:hover,
.col-resizer:active {
  background: var(--accent);
}

.col-resizer::after {
  content: '';
  position: absolute;
  right: 2px;
  top: 25%;
  bottom: 25%;
  width: 1px;
  background: var(--glass-light-border);
}

.col-resizer:hover::after {
  background: var(--accent);
}

.contact-col {
  display: flex;
  align-items: center;
}

/* Column widths - adjust these values to change spacing */
.contact-col.col-date {
  flex: 1;
  min-width: 100px;
}

.contact-col.col-method {
  flex: 1;
  min-width: 85px;
}

.contact-col.col-reason {
  flex: 1;
  min-width: 95px;
}

.contact-col.col-by {
  flex: 1;
  min-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-col.col-outcome {
  flex: 1;
  min-width: 90px;
}

.contact-col.col-expand {
  width: 20px;
  flex-shrink: 0;
  justify-content: center;
  margin-left: auto;
}

.contact-attempt-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.contact-attempt-row:last-child {
  border-bottom: none;
}

.contact-attempt-summary {
  display: flex;
  align-items: center;
  padding: 0.4rem 0;
  cursor: pointer;
  transition: background 0.15s;
}

.contact-attempt-summary:hover {
  background: rgba(255, 255, 255, 0.03);
}

.contact-attempt-summary .contact-col {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.contact-pill {
  font-size: 0.6rem;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  white-space: nowrap;
  display: inline-block;
}

.contact-pill.method {
  background: rgba(74, 158, 255, 0.25);
  color: var(--accent);
}

.contact-pill.reason {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
}

.contact-pill.outcome {
  background: rgba(255, 255, 255, 0.1);
}

.contact-pill.outcome-success {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.contact-pill.outcome-declined {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.contact-pill.outcome-pending {
  background: rgba(251, 191, 36, 0.2);
  color: #fde68a;
}

.contact-expand-icon {
  font-size: 0.55rem;
  color: var(--text-dim);
  transition: transform 0.2s;
}

.contact-attempt-row.expanded .contact-expand-icon {
  transform: rotate(180deg);
}

/* Expanded Details - Editable Form */
.contact-attempt-details {
  display: none;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  margin: 0.5rem 0;
}

.contact-attempt-row.expanded .contact-attempt-details {
  display: block;
}

.contact-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem 1rem;
}

.contact-detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.contact-detail-item.full-width {
  grid-column: 1 / -1;
}

.contact-detail-item label {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 500;
}

/* Contact edit inputs - match site style */
.contact-edit-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--glass-light-border);
  border-radius: 6px;
  font-size: 0.85rem;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s;
  font-family: inherit;
  box-sizing: border-box;
}

.contact-edit-input:focus {
  outline: none;
  border-color: var(--accent);
}

.contact-edit-input.changed {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.05);
}

.contact-edit-input[readonly] {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-dim);
  cursor: not-allowed;
}

select.contact-edit-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-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='%23b0b0c0' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
  cursor: pointer;
}

select.contact-edit-input option {
  background: var(--bg);
  color: var(--text);
}

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

.contact-detail-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--glass-light-border);
}

/* Responsive: stack on mobile */
@media (max-width: 600px) {
  .contact-list-header {
    display: none;
  }

  .contact-attempt-summary {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .contact-col.col-date {
    width: auto;
    flex-shrink: 1;
  }

  .contact-col.col-by {
    flex-basis: 100%;
    order: 10;
  }

  .contact-col.col-expand {
    margin-left: auto;
  }

  .contact-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* Attachments */
.attachments-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.no-attachments {
  color: var(--text-dim);
  font-style: italic;
  padding: 1rem;
  text-align: center;
}

.attachment-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.375rem;
}

.attachment-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.875rem;
}

.attachment-link:hover {
  color: #7db8ff;
}

.attachment-size {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
}

/* Upload Progress */
.upload-progress {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.5rem;
}

.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.2s ease;
}

.progress-text {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Scheduling Calendar */
.calendar-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0 0.5rem;
}

.calendar-month-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #e0e0e8;
}

.scheduling-calendar {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  overflow: hidden;
}

.calendar-day-header {
  padding: 0.75rem 0.5rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.3);
}

.calendar-day {
  min-height: 100px;
  padding: 0.5rem;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.calendar-day.other-month {
  background: rgba(26, 26, 46, 0.5);
}

.calendar-day.other-month .calendar-day-number {
  color: #505060;
}

.calendar-day.today {
  background: rgba(59, 130, 246, 0.1);
}

.calendar-day.past {
  opacity: 0.5;
}

.calendar-day-number {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.calendar-day.today .calendar-day-number {
  color: #3b82f6;
  font-weight: 700;
}

.calendar-slots {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}

.calendar-slot {
  padding: 0.35rem 0.5rem;
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.4);
  border-radius: 4px;
  font-size: 0.7rem;
  color: #22c55e;
  cursor: pointer;
  transition: all 0.15s ease;
}

.calendar-slot:hover {
  background: rgba(34, 197, 94, 0.35);
  border-color: #22c55e;
}

.calendar-slot .slot-time {
  font-weight: 600;
}

.calendar-slot .slot-assessor {
  font-size: 0.65rem;
  color: rgba(34, 197, 94, 0.8);
  margin-top: 2px;
}

/* Assign Slot Modal */
#assignSlotModal .modal-body {
  text-align: center;
  padding: 1.5rem;
}

#assignSlotModal .slot-details {
  background: var(--glass-light);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  text-align: left;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

#assignSlotModal .slot-details p {
  margin: 0.35rem 0;
  font-size: 0.9rem;
  color: var(--text-dim);
}

#assignSlotModal .slot-details strong {
  color: #e0e0e8;
}

#assignSlotModal .form-actions {
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

/* Responsive Calendar Styles (6-day desktop, 2-day mobile) */
.modal-calendar {
  width: 95%;
  max-width: 1100px;
}

.calendar-controls-2col {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.calendar-date-range {
  font-size: 1rem;
  font-weight: 600;
  color: #e0e0e8;
  min-width: 220px;
  text-align: center;
}

.calendar-jump {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calendar-jump label {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.jump-date-input {
  padding: 6px 10px;
  border: 1px solid var(--glass-light-border);
  border-radius: 6px;
  font-size: 0.85rem;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.jump-date-input:focus {
  outline: none;
  border-color: var(--accent);
}

.jump-date-input::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

/* Calendar grid - 6 columns on desktop */
.scheduling-calendar-2col {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
}

.calendar-day-col {
  background: var(--bg);
  border: 1px solid var(--glass-light-border);
  border-radius: 8px;
  overflow: hidden;
  min-height: 300px;
  display: flex;
  flex-direction: column;
}

.calendar-day-col.today {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3);
}

.calendar-day-col.past {
  opacity: 0.5;
}

.calendar-day-header-col {
  padding: 0.5rem 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid var(--glass-light-border);
  text-align: center;
}

.calendar-day-header-col .day-name {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #e0e0e8;
}

.calendar-day-header-col .day-date {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.calendar-day-col.today .calendar-day-header-col .day-name {
  color: #3b82f6;
}

.calendar-slots-col {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow-y: auto;
  flex: 1;
}

.calendar-slot-item {
  padding: 0.4rem 0.5rem;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.calendar-slot-item:hover {
  background: rgba(34, 197, 94, 0.25);
  border-color: #22c55e;
  transform: translateY(-1px);
}

.calendar-slot-item .slot-time {
  font-size: 0.75rem;
  font-weight: 600;
  color: #22c55e;
}

.calendar-slot-item .slot-assessor {
  font-size: 0.65rem;
  color: rgba(34, 197, 94, 0.75);
  margin-top: 2px;
}

.no-slots {
  padding: 1rem 0.5rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.75rem;
}

/* ============================================
   TABLET RESPONSIVE (max-width: 1024px)
   ============================================ */
@media (max-width: 1024px) {
  .modal-content {
    width: 95%;
    max-width: none;
  }

  .modal-large {
    width: 98%;
    max-width: none;
  }

  .scheduling-calendar {
    grid-template-columns: repeat(3, 1fr);
  }

  .calendar-day {
    min-height: 80px;
  }

  .detail-row {
    flex-wrap: wrap;
  }

  .detail-field.field-half {
    flex: 1 1 100%;
  }

  .detail-field.field-quarter {
    flex: 1 1 calc(50% - 0.5rem);
  }
}

/* ============================================
   MOBILE RESPONSIVE (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
  /* Main layout */
  .page-container {
    flex-direction: column;
    height: auto;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--glass-light-border);
    padding: 0.5rem 0;
  }

  .sidebar-nav {
    display: flex;
    overflow-x: auto;
    padding: 0 0.5rem;
    gap: 0.5rem;
  }

  .sidebar-nav-item {
    white-space: nowrap;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    flex-shrink: 0;
  }

  .sidebar-nav-item.active {
    border-left: none;
    background: rgba(74, 158, 255, 0.3);
  }

  .sidebar-section-title {
    display: none;
  }

  .main-content {
    height: auto;
    min-height: calc(100vh - 140px);
  }

  .main-content-inner {
    padding: 1rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .header-right {
    width: 100%;
    flex-direction: column;
    gap: 0.5rem;
  }

  .toolbar-buttons {
    width: 100%;
    justify-content: flex-start;
  }

  .search-box {
    width: 100%;
  }

  .search-box input {
    width: 100%;
  }

  .route-tabs {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .route-tab {
    flex: 1;
    min-width: 100px;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.8rem;
  }

  /* Customer table */
  .customer-table th,
  .customer-table td {
    padding: 0.5rem;
    font-size: 0.8rem;
  }

  /* Modals */
  .modal {
    padding: 0;
  }

  .modal-content {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .modal-small,
  .modal-medium,
  .modal-large {
    width: 100%;
    max-width: none;
  }

  .modal-header {
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .modal-header h2 {
    font-size: 1.1rem;
  }

  .modal-header-subinfo {
    flex-direction: column;
    gap: 0.25rem;
  }

  .modal-body {
    padding: 1rem;
    overflow-y: auto;
  }

  /* Detail fields */
  .detail-row {
    flex-direction: column;
  }

  .detail-field,
  .detail-field.field-full,
  .detail-field.field-half,
  .detail-field.field-quarter {
    flex: 1 1 100%;
  }

  .detail-field-input,
  .detail-field-value {
    font-size: 16px; /* Prevents iOS zoom on focus */
  }

  /* Scheduling section */
  .slot-field-wrapper {
    gap: 0.5rem;
  }

  .remove-slot-btn {
    width: 100%;
  }

  /* Contact attempts */
  .contact-list-header {
    display: none;
  }

  .contact-attempt-row {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem;
  }

  .contact-col {
    width: 100%;
    padding: 0.25rem 0;
  }

  .contact-col::before {
    content: attr(data-label);
    font-weight: 600;
    margin-right: 0.5rem;
    color: var(--text-dim);
    font-size: 0.75rem;
  }

  /* Calendar */
  .scheduling-calendar {
    grid-template-columns: repeat(2, 1fr);
  }

  .calendar-day {
    min-height: 70px;
    padding: 0.35rem;
  }

  .calendar-day-number {
    font-size: 0.75rem;
  }

  .calendar-slot {
    padding: 0.25rem 0.35rem;
    font-size: 0.65rem;
  }

  .calendar-controls {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .calendar-month-title {
    font-size: 1rem;
    order: -1;
    width: 100%;
    text-align: center;
    margin-bottom: 0.5rem;
  }

  /* 2-day calendar on mobile/tablet */
  .modal-calendar {
    width: 100%;
    max-width: none;
  }

  .calendar-controls-2col {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .calendar-nav {
    justify-content: space-between;
    width: 100%;
  }

  .calendar-date-range {
    font-size: 0.9rem;
    min-width: auto;
  }

  .calendar-jump {
    width: 100%;
    justify-content: center;
  }

  /* 2-column grid on mobile/tablet */
  .scheduling-calendar-2col {
    grid-template-columns: repeat(2, 1fr);
  }

  .calendar-day-col {
    min-height: 250px;
  }

  .calendar-day-header-col {
    padding: 0.6rem;
  }

  .calendar-day-header-col .day-name {
    font-size: 0.9rem;
  }

  .calendar-day-header-col .day-date {
    font-size: 0.75rem;
  }

  .calendar-slot-item .slot-time {
    font-size: 0.8rem;
  }

  .calendar-slot-item .slot-assessor {
    font-size: 0.7rem;
  }

  /* Form */
  .form-row.two-col {
    flex-direction: column;
  }

  .form-group {
    width: 100%;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }

  /* Section headers */
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .section-header .btn {
    width: 100%;
  }
}

/* ============================================
   SMALL MOBILE (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {
  .scheduling-calendar {
    grid-template-columns: repeat(1, 1fr);
  }

  .calendar-day {
    min-height: auto;
    padding: 0.5rem;
  }

  .calendar-slots {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .calendar-slot {
    flex: 1;
    min-width: calc(50% - 0.2rem);
  }

  .modal-header h2 {
    font-size: 1rem;
  }

  .btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }

  .btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
  }
}
