/**
 * Sticky viewport horizontal scrollbar for wide tables.
 * Paired with sticky-table-hscroll.js
 */
.nsc-sticky-hscroll {
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 1040;
  height: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  display: none;
  background: color-mix(in srgb, var(--surface-color, #fff) 92%, #e2e8f0);
  border-top: 1px solid var(--border-color, #e2e8f0);
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.12);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: auto;
  scrollbar-color: #64748b #e2e8f0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-sizing: content-box;
}

.nsc-sticky-hscroll.is-visible {
  display: block;
}

.nsc-sticky-hscroll__inner {
  height: 1px;
  pointer-events: none;
}

.nsc-sticky-hscroll::-webkit-scrollbar {
  height: 14px;
}

.nsc-sticky-hscroll::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.nsc-sticky-hscroll::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 999px;
  border: 2px solid #f1f5f9;
}

.nsc-sticky-hscroll::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Keep table containers horizontally scrollable */
.table-responsive,
.admin-mgmt-table-wrap,
.dataTables_scrollBody {
  -webkit-overflow-scrolling: touch;
}

.admin-mgmt-card .dataTables_scrollHead table,
.admin-mgmt-card .dataTables_scrollBody table {
  min-width: 1080px !important;
}

.nsc-sticky-hscroll {
  z-index: 1080;
}

/* Builder / admin mobile: use full content width */
@media (max-width: 767.98px) {
  .main-content {
    padding-left: 0.4rem !important;
    padding-right: 0.4rem !important;
  }

  .main-content > .container-fluid {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    max-width: 100%;
  }

  .admin-mgmt-page {
    padding-left: 0;
    padding-right: 0;
  }

  .admin-mgmt-card > .card-body {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  .admin-mgmt-table-wrap,
  .admin-mgmt-card .table-responsive {
    margin-left: -0.35rem;
    margin-right: -0.35rem;
    width: calc(100% + 0.7rem);
    max-width: none;
  }

  .ld-hero {
    margin-left: 0;
    margin-right: 0;
    border-radius: 0.5rem;
  }

  .ld-hero.p-3,
  .ld-hero.p-md-4 {
    padding: 0.75rem !important;
  }

  /* Lead desk / enquiry tables: edge-to-edge on phone */
  .card .table-responsive {
    margin-left: -0.65rem;
    margin-right: -0.65rem;
    width: calc(100% + 1.3rem);
    padding-bottom: 0.25rem;
  }

  .card > .card-body {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  .nsc-sticky-hscroll {
    height: 18px;
  }
}
