/* DataTables theme polish for Phoenix CRM */

/* One horizontal scroll per table (avoids nested Bootstrap .table-responsive bars) */
.dataTables_wrapper > .lead-dt-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid #d8dee8;
  border-radius: 0.5rem;
  min-height: 2.1rem;
  font-size: 0.84rem;
  padding: 0.25rem 0.6rem;
}
.dataTables_wrapper .dataTables_filter input {
  margin-left: 0.4rem;
  min-width: 12rem;
}
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
  border-color: #3874ff;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(56, 116, 255, 0.15);
}
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  font-size: 0.8rem;
  color: #6e7891;
  padding-top: 0.5rem !important;
}
.dataTables_wrapper .page-link {
  border-radius: 0.4rem !important;
  margin: 0 0.12rem;
  border: 1px solid #e3e6ed;
  color: #3874ff;
  min-width: 2rem;
  text-align: center;
}
.dataTables_wrapper .page-item.active .page-link {
  background: #3874ff;
  border-color: #3874ff;
}
.dataTables_wrapper .page-item.disabled .page-link {
  color: #9fa6bc;
}
table.dataTable thead th {
  border-bottom-width: 1px !important;
  white-space: nowrap;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  color: #5a6478;
  background: #f8fafc;
}
table.dataTable.no-footer {
  border-bottom: 0 !important;
}
table.dataTable tbody td {
  vertical-align: middle;
}
table.dataTable tbody tr {
  transition: background-color 0.12s ease;
}
table.dataTable tbody tr:hover {
  background: #f5f8ff !important;
}
.crm-dt-fade {
  animation: crm-dt-in 0.18s ease;
}
@keyframes crm-dt-in {
  from { opacity: 0.35; }
  to { opacity: 1; }
}
.advance-report-page .dataTables_wrapper,
.lead-list-panel .dataTables_wrapper {
  padding: 0.15rem;
  min-height: 180px;
}
.dataTables_wrapper .dataTables_processing {
  top: 48% !important;
  left: 50% !important;
  width: auto !important;
  margin: 0 !important;
  transform: translate(-50%, -50%);
  padding: 0.75rem 1.1rem;
  border: 1px solid #e3e9f5;
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 30px rgba(49, 55, 74, 0.12);
  color: #31374a;
  font-size: 0.84rem;
  font-weight: 600;
  display: inline-flex !important;
  align-items: center;
  gap: 0.55rem;
  z-index: 30;
}
.crm-dt-spinner {
  width: 1.05rem;
  height: 1.05rem;
  border: 2.5px solid #dbe4ff;
  border-top-color: #3874ff;
  border-radius: 50%;
  animation: crm-spin 0.65s linear infinite;
  flex: 0 0 auto;
}
.dt-loading-overlay {
  position: relative;
}
.dt-loading-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.55);
  z-index: 2;
}
.crm-ajax-busy {
  position: relative;
  pointer-events: none;
  min-height: 120px;
}
.crm-ajax-busy::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.55);
  z-index: 20;
  border-radius: 0.5rem;
}
.crm-ajax-busy::before {
  content: '';
  position: absolute;
  top: 42%;
  left: 50%;
  width: 1.75rem;
  height: 1.75rem;
  margin: -0.875rem 0 0 -0.875rem;
  border: 2.5px solid #dbe4ff;
  border-top-color: #3874ff;
  border-radius: 50%;
  animation: crm-spin 0.65s linear infinite;
  z-index: 21;
}
@keyframes crm-spin {
  to { transform: rotate(360deg); }
}

/* Keep list rows compact & readable */
.lead-list-table .lead-cell-meta {
  font-size: 0.72rem;
  color: #6e7891;
  line-height: 1.25;
}
.lead-list-table td {
  padding-top: 0.55rem !important;
  padding-bottom: 0.55rem !important;
}
