html {
  font-size: 14px;
  height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* Global Table Scroll & Container Isolation */
.table-responsive,
.card-body.table-responsive,
.table-scroll-container {
  max-height: 60vh;
  min-height: 280px;
  overflow-y: auto !important;
  overflow-x: auto !important;
  position: relative;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f8fafc;
  border-radius: 0 0 8px 8px;
  -webkit-overflow-scrolling: touch;
}

/* Modern sleek scrollbar for table containers */
.table-responsive::-webkit-scrollbar,
.card-body.table-responsive::-webkit-scrollbar,
.table-scroll-container::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
.table-responsive::-webkit-scrollbar-track,
.card-body.table-responsive::-webkit-scrollbar-track,
.table-scroll-container::-webkit-scrollbar-track {
  background: #f8fafc;
  border-radius: 4px;
}
.table-responsive::-webkit-scrollbar-thumb,
.card-body.table-responsive::-webkit-scrollbar-thumb,
.table-scroll-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.table-responsive::-webkit-scrollbar-thumb:hover,
.card-body.table-responsive::-webkit-scrollbar-thumb:hover,
.table-scroll-container::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Sticky Table Headers */
.table-responsive > .table > thead,
.table-responsive > .table > thead > tr > th,
.card-body.table-responsive > .table > thead,
.card-body.table-responsive > .table > thead > tr > th,
.table-scroll-container > .table > thead,
.table-scroll-container > .table > thead > tr > th {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #f8fafc !important;
  box-shadow: inset 0 -2px 0 #e2e8f0;
}

.table-responsive > .table > thead.table-dark > tr > th,
.card-body.table-responsive > .table > thead.table-dark > tr > th,
.table-scroll-container > .table > thead.table-dark > tr > th {
  background-color: #1e293b !important;
  color: #ffffff !important;
  box-shadow: inset 0 -2px 0 #334155;
}

.table-responsive > .table > thead.table-light > tr > th,
.card-body.table-responsive > .table > thead.table-light > tr > th,
.table-scroll-container > .table > thead.table-light > tr > th {
  background-color: #f1f5f9 !important;
  box-shadow: inset 0 -2px 0 #cbd5e1;
}

.table-responsive > .table > thead > tr > th[style*="left:"],
.card-body.table-responsive > .table > thead > tr > th[style*="left:"] {
  z-index: 20 !important;
}

.card:has(.table-responsive) {
  overflow: hidden;
}

@media (max-width: 768px) {
  .table-responsive,
  .card-body.table-responsive {
    max-height: 500px;
  }
}