/* Wrapper ensures scrollbar is inside page and aligned with table */
.tbe-table-scroll-wrapper{
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  border-radius: 6px;
}

/* Top bar with arrow buttons */
.tbe-table-scrollbar{
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  margin: 0 0 8px 0;
  padding: 6px 6px;
  border: 1px solid #ccd0d4;
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box;
}

.tbe-scroll-btn{
  width: 34px;
  height: 28px;
  border: 1px solid #ccd0d4;
  background: #f7f7f7;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1;
  font-size: 14px;
}
.tbe-scroll-btn:disabled{
  opacity: 0.4;
  cursor: not-allowed;
}

.tbe-table-scroll-top{
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  height: 14px;
}
.tbe-table-scroll-inner{
  height: 1px;
  width: 0px;
}

/* Make the native scrollbar thumb visible (browser-controlled) */
.tbe-table-scroll-top::-webkit-scrollbar,
.tbe-table-scroll-wrapper::-webkit-scrollbar{
  height: 10px;
}

/* Resizable column handle */
.tbe-resizable-th{
  overflow: hidden;
  white-space: nowrap;
}
.tbe-col-resizer{
  position: absolute;
  right: 0;
  top: 0;
  width: 14px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  touch-action: none;
  z-index: 9999;
  background: transparent;
}
.tbe-col-resizer:after{
  content: '';
  position: absolute;
  left: 6px;
  top: 0;
  width: 2px;
  height: 100%;
  background: rgba(0,0,0,0.12);
}


/* ===== Glass Pricing style responsive wrapper (reused across CRM lists) ===== */
.responsive-table-wrapper{
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.responsive-table-wrapper table{
  min-width: 1200px;
}
.responsive-table-wrapper th,
.responsive-table-wrapper td{
  white-space: nowrap !important;
}


/* Prevent grid/flex parents from expanding infinitely */
#glass-nav-toggler-class, .glass-crm-main-content, .responsive-table-wrapper, .tbe-table-scroll-wrapper, .tbe-table-scrollbar { min-width: 0; }
#glass-nav-toggler-class .glass-crm-main-content > div { min-width: 0; max-width: 100%; }

.tbe-resizable-th:hover .tbe-col-resizer{ background: rgba(0,0,0,0.04); }
.tbe-resizable-th:hover .tbe-col-resizer:after{ background: rgba(0,0,0,0.25); }


/* Ensure CRM list tables actually overflow so the top scrollbar appears when needed */
.tbe-table-scroll-wrapper table,
.tbe-table-scroll-wrapper table.wp-list-table,
.tbe-table-scroll-wrapper table.table{
  width: max-content;
  min-width: 1200px;
}
.tbe-table-scroll-wrapper th,
.tbe-table-scroll-wrapper td{
  white-space: nowrap !important;
}

/* Global table polish */
.tbe-table-scrollbar{
  box-shadow: 0 1px 2px rgba(16,24,40,0.04);
}

.tbe-table-scroll-wrapper table,
.tbe-table-scroll-wrapper table.wp-list-table,
.tbe-table-scroll-wrapper table.table,
.responsive-table-wrapper table{
  border-collapse: separate;
  border-spacing: 0;
}

.tbe-table-scroll-wrapper thead th,
.responsive-table-wrapper thead th,
table.wp-list-table thead th,
table.widefat thead th,
table.striped thead th,
table.table thead th{
  position: relative;
  vertical-align: middle !important;
  padding: 10px 14px !important;
  background: linear-gradient(180deg, #fafbfc 0%, #f1f4f7 100%);
  border-bottom: 1px solid #d0d7de !important;
  color: #1f2937;
  font-weight: 600;
}

.tbe-table-scroll-wrapper tbody td,
.responsive-table-wrapper tbody td,
table.wp-list-table tbody td,
table.widefat tbody td,
table.striped tbody td,
table.table tbody td{
  vertical-align: middle !important;
  padding: 9px 14px !important;
}

.tbe-sortable-th{
  cursor: pointer;
  user-select: none;
}

.tbe-sortable-th span[onclick*="sortTable"],
.tbe-sortable-th span[onclick*="sortTableBy"]{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 3px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: #64748b;
  font-size: 12px;
  line-height: 1;
}

.tbe-sortable-th:hover span[onclick*="sortTable"],
.tbe-sortable-th:hover span[onclick*="sortTableBy"],
.tbe-sort-active span[onclick*="sortTable"],
.tbe-sort-active span[onclick*="sortTableBy"]{
  border-color: #cbd5e1;
  background: #ffffff;
  color: #0f172a;
}

.tbe-sortable-th[data-sort-direction="asc"]::after,
.tbe-sortable-th[data-sort-direction="desc"]::after{
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: #2563eb;
}

.tbe-sortable-th[data-sort-direction="asc"]::after{ content: "▲"; }
.tbe-sortable-th[data-sort-direction="desc"]::after{ content: "▼"; }

.tbe-resizable-th{
  padding-right: 24px !important;
}

.tbe-col-resizer:after{
  left: 7px;
  background: rgba(100,116,139,0.28);
}

.tbe-resizable-th:hover .tbe-col-resizer:after,
.tbe-sort-active .tbe-col-resizer:after{
  background: rgba(37,99,235,0.35);
}


/* Header polish and sort usability */
.tbe-table-scroll-wrapper th,
.responsive-table-wrapper th,
table.wp-list-table th,
table.widefat th,
table.striped th,
table.table th{
  text-align: left !important;
}

.tbe-sortable-th{
  padding-right: 34px !important;
}

.tbe-sortable-th span[onclick*="sortTable"],
.tbe-sortable-th span[onclick*="sortTableBy"]{
  vertical-align: middle;
}

.tbe-sortable-th:focus{
  outline: 2px solid rgba(37,99,235,0.28);
  outline-offset: -2px;
}

.tbe-table-scroll-wrapper tbody tr:nth-child(even),
.responsive-table-wrapper tbody tr:nth-child(even),
table.wp-list-table tbody tr:nth-child(even),
table.widefat tbody tr:nth-child(even),
table.striped tbody tr:nth-child(even),
table.table tbody tr:nth-child(even){
  background: #fbfdff;
}

.tbe-table-scroll-wrapper tbody tr:hover,
.responsive-table-wrapper tbody tr:hover,
table.wp-list-table tbody tr:hover,
table.widefat tbody tr:hover,
table.striped tbody tr:hover,
table.table tbody tr:hover{
  background: #f3f8ff;
}


/* CRM invoice / service-document tables should wrap so narrow columns remain usable */
.appointment-list-table th,
.appointment-list-table td,
.responsive-table-wrapper .appointment-list-table th,
.responsive-table-wrapper .appointment-list-table td,
.tbe-table-scroll-wrapper .appointment-list-table th,
.tbe-table-scroll-wrapper .appointment-list-table td{
  white-space: normal !important;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.appointment-list-table td:first-child,
.appointment-list-table th:first-child{
  width: 52px;
  min-width: 52px;
  text-align: center;
}

.agcrm-select-all-wrap{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:100%;
}

.agcrm-select-all-checkbox,
.appointment-list-table .row-checkbox{
  width:18px;
  height:18px;
  cursor:pointer;
}


/* Visible center drag bar for wide tables */
.tbe-table-scrollbar{
  gap: 8px;
}
.tbe-table-scroll-top{
  min-width: 110px;
  border-radius: 999px;
  background: linear-gradient(180deg,#eef2f6 0%,#dde5ee 100%);
  border: 1px solid #cfd8e3;
}
.tbe-scroll-thumb-track{
  flex: 0 0 clamp(140px, 22vw, 280px);
  height: 16px;
  border-radius: 999px;
  position: relative;
  background: linear-gradient(180deg,#eef2f6 0%,#dbe4ee 100%);
  border: 1px solid #c7d1dc;
  box-shadow: inset 0 1px 2px rgba(15,23,42,0.08);
}
.tbe-scroll-thumb{
  position: absolute;
  left: 0;
  top: 1px;
  height: 12px;
  min-width: 44px;
  border-radius: 999px;
  background: linear-gradient(180deg,#ffffff 0%,#c9d7e8 100%);
  border: 1px solid #8aa1bb;
  box-shadow: 0 1px 2px rgba(15,23,42,0.18);
  cursor: grab;
  transition: box-shadow .15s ease, background .15s ease;
}
.tbe-scroll-thumb:hover{
  background: linear-gradient(180deg,#ffffff 0%,#b8cae0 100%);
}
.tbe-scroll-thumb.is-dragging{
  cursor: grabbing;
  box-shadow: 0 2px 6px rgba(15,23,42,0.22);
}
.tbe-table-scroll-wrapper table.inventory-table td,
.tbe-table-scroll-wrapper table.inventory-table th{
  white-space: normal !important;
}
.tbe-table-scroll-wrapper table.inventory-table .inventory-part-images{
  min-width: 110px;
}


/* Stage 18.1 bulk action toolbar */
.agcrm-bulk-actions-stage18{
  display:flex;
  align-items:center;
  gap:10px;
  justify-content:flex-end;
  flex-wrap:wrap;
}
.agcrm-bulk-action-select{
  min-width:220px;
  max-width:320px;
}
.agcrm-bulk-apply-btn{
  min-width:100px;
}
.multi-action .multi-status-button,
.multi-action .multi-delete-button,
.multi-action .multi-hide-button,
.multi-action .multi-unhide-button,
.multi-action .multi-paid-button,
.multi-action .multi-un-paid-button{
  display:none !important;
}
