/* ============================================
   Table Header & Filter Row Styling
============================================ */

/* Prevent DataTables wrapper from overflowing its container */
div.dt-container,
div.dataTables_wrapper {
  max-width: 98%;
  margin: 0 auto;
}

.BSsrgTable thead > tr:first-child > th {
  background-color: transparent !important;
  border: none;
}

.BSsrgTable > thead > tr > th {
  text-align: center !important;
  vertical-align: middle;
}

/* ============================================
   Table Row Highlighting
============================================ */

table.table.dataTable > tbody > tr:nth-of-type(odd) {
  background-color:  var(--table-highlight);
}

.table{
  --bs-table-bg: unset !important;
}

/* Grey hover effect */
table.dataTable.BSsrgTable.table-hover > tbody > tr:hover > * {
  box-shadow: inset 0 0 0 9999px #EBEBEB !important;
}

/* ============================================
   Caption Bar Styling (Top and Bottom)
============================================ */

.BSsrgTableCaption1,
.BSsrgTableCaption3 {
  display: flex;
  justify-content: space-between;
  padding-left: 10px;
  min-height: 40px;
  border-radius: 5px;
}

.BSsrgTableCaption1 {
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
}

.BSsrgTableCaption3 {
  color: white;
  height: 40px;
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
}

.BSsrgTableCaption1 > .btn-group {
  margin-right: 10px;
}

.BSsrgTableCaption1 > .btn-group > .btn {
  margin-top: 5px;
}

.BSsrgTableCaption1 > .btn-group > .buttons-showhide,
.BSsrgTableCaption1 > .btn-group > .buttons-reset {
  width: 100px !important;
}

.BSsrgTableCaption1 > .btn-group > .buttons-showhide {
  margin-right: 20px;
}

.BSsrgTableCaption3 > *,
.dataTables_length {
  margin: auto 0;
}

.BSsrgTableCaption3 .page-item:last-child .page-link {
  margin-right: 20px;
}

.BSsrgTableCaption3 .row > * {
  width: unset;
}

/* Dropdown styling */
.dt-length select {
  border-radius: 50rem !important;
}

/* Reduce font size in compact dropdowns */
.dataTables_length .form-select-sm {
  font-size: 0.65rem;
}

/* ============================================
   Fixed Column Header Styling
============================================ */

.BSsrgTable > thead > tr > .dtfc-fixed-left,
.BSsrgTable > thead > tr > .dtfc-fixed-right {
  background-color: var(--srg-blue) !important;
}

/* ============================================
   Custom Components
============================================ */

.BSsrgTable .checkbox-bg {
  padding: 8px;
  margin-top: 0;
}

.re-toast-container {
  width: 50%;
  z-index: 2;
}

.re-radio .form-check {
  padding-left: 0;
  margin-bottom: 0;
  min-height: unset;
}

.re-radio .form-check-inline {
  margin-right: 5px;
}


.re-radio .btn-check:checked+.btn,
.btn-check:checked+.btn{
        background-color: white !important; /*  #CDEAAE; d7eebe*/
        border-color: var(--srg-cerulean) !important;
        color: var(--srg-cerulean) !important;
        border-width: 3px;      /* thicker border */
        font-weight: bold;      /* bold text */

}

/* Hide spinners in number inputs (WebKit + Firefox) */
.BSsrgTable input[type="number"]::-webkit-inner-spin-button,
.BSsrgTable input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.BSsrgTable input[type="number"] {
  -moz-appearance: textfield;
}

/* Prevent unwanted table spacing */
.BSsrgTable,
.table,
table.dataTable {
  margin-bottom: 0 !important;
}

/* ============================================
   Mobile Responsiveness
============================================ */

@media screen and (max-width: 992px) {
  .re-toast-container {
    width: 99%;
  }

  .re-radio {
    justify-content: center;
    vertical-align: middle;
  }

  .re-radio .btn-sm {
    height: 32px;
    padding-top: 4px;
  }

  .re-radio label.btn.btn-sm.btn-xs.btn-primary {
    padding-top: 0.5rem;
  }

  .dataTables_info,
  .dataTables_length {
    text-align: unset !important;
  }
}

/* ============================================
   Utility
============================================ */

.dt-buttons .hide {
  display: none;
}


/* =============================================================================
   DataTable Edits
   ========================================================================== */

/* ============================================
 Buttons
 ============================================== */
.dt-buttons > .btn-secondary,
.dt-buttons > .btn-group > .btn-secondary {
  font-size: 12px;
  font-weight: normal;
  height: 30px;
  margin-top: 5px;
  padding-top: 5px;
  background-color: var(--srg-cerulean);
  border-color: var(--srg-cerulean);
  margin-right: 3px;
}

.dt-buttons > .btn-group > .btn-secondary {
  width: 100px;
}

.dt-button-down-arrow {
  display: none !important;
}

.btn-group > .btn {
  margin-right: 3px;
  border-radius: 2rem !important;

}

/* ============================================
 Dropdown Menu
 ============================================== */
div.dt-button-collection {
  border-top: 0;
  padding: 0;
}

.dt-button-collection .dropdown-item.active,
.dt-button-collection .dropdown-item:active {
  color: white;
  text-decoration: none;
}

.dt-button-collection .dropdown-item:hover,
.dt-button-collection .dropdown-item.hover {
  background-color: var(--srg-teal);
}

div.dt-buttons div.dropdown-menu {
  margin-top: 0;
}

/* Round all buttons fully */
.dt-buttons > .btn-secondary,
.dt-buttons > .btn-group > .btn-secondary,
.dt-buttons .btn {
  border-radius: 2rem !important;
}

/* ============================================
 Pagination
 ============================================== */
.active > .page-link,
.page-link.active {
  z-index: 3;
  color: var(--black) !important;
  background-color: var(--srg-grey) !important;
  border-color: var(--srg-grey) !important;
}

.page-link {
  color: var(--black) !important;
  font-size: 11px;
}

.paginate_button .page-item .first,
.paginate_button .page-item .previous,
.paginate_button .page-item .next,
.paginate_button .page-item .last {
  color: var(--srg-blue);
}

.dt-paging.paging_full_numbers {
  display: flex;
  justify-content: flex-end;
  text-align: right;
}

/* ============================================
 Caption Sections
 ============================================== */
.BSsrgTableCaption2 .dataTables_filter {
  text-align: unset !important;
}

.BSsrgTableCaption3 ul.pagination {
  justify-content: end !important;
}

/* ============================================
 Date Columns
============================================ */
td.dt-type-date {
  text-align: center !important;
}

table.dataTable th.dt-type-date .dt-column-header {
  display: flex;
  justify-content: center;
  position: relative;
}

 table.dataTable th.dt-type-numeric div.dt-column-header,
 table.dataTable th.dt-type-numeric div.dt-column-footer,
 table.dataTable th.dt-type-date div.dt-column-header,
 table.dataTable th.dt-type-date div.dt-column-footer,
 table.dataTable td.dt-type-numeric div.dt-column-header,
 table.dataTable td.dt-type-numeric div.dt-column-footer,
 table.dataTable td.dt-type-date div.dt-column-header,
 table.dataTable td.dt-type-date div.dt-column-footer{
        flex-direction: initial;
}
/* ============================================
 Child Rows
 ============================================== */
.BSsrgTable > tbody > tr + .child > * {
  text-align: left !important;
}

.dtr-data {
  font-size: 12px;
}

/* ============================================
 Floating Headers (Disabled)
 ============================================== */
.dtfh-floatingparent,
.dtfh-floatingparenthead {
  display: none;
}

/* ============================================
 Inputs / Selects
 ============================================== */
.input-group-sm > .btn,
.input-group-sm > .form-control,
.input-group-sm > .form-select,
.input-group-sm > .input-group-text {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  border-radius: 50rem !important;
}

/* ============================================
 Sort Icons Alignment
 ============================================== */
th.sorting::after,
th.sorting_asc::after,
th.sorting_desc::after {
  position: absolute !important;
  right: 0.5em !important;
  top: 50%;
  transform: translateY(-50%) !important;
}

/* ============================================
 DataTable Wrapper Info Sizing
 ============================================== */
div.dataTables_wrapper div.dataTables_info {
  width: max-content;
  max-width: 70vw;
}

/* ============================================
 Responsive Search Alignment
 ============================================== */
@media screen and (min-width: 768px) {
  .dt-search {
    text-align: left !important;
    justify-content: flex-start !important;
  }
}

/* ============================================
 Info Cell on Very Small Screens
 ============================================== */
@media (min-width: 280px) {
  .dt-info {
    width: 60vw;
    box-sizing: border-box;
  }
}

/* =============================================================================
  Bootstrap Small Table - Cleaned
  ========================================================================== */

.smTable {
  font-size: 13px;
}

.smTable thead {
  display: none;
}

.smTable tbody {
  display: block;
}

.smTable tr {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}

.smTable td {
  text-align: right !important;
}

.smTable td:first-child {
  color: black !important;
  padding: 15px 20px;
}

.smTable td:before {
  content: attr(data-header);
  font-weight: bold;
  float: left;
}

.smTable td *:not(.BSsrgTable_mobile_header) {
  float: right;
}

.smTable .BSsrgTable_mobile_header {
  font-weight: bold;
  float: left;
}

.smTable .page-header {
  text-align: center;
}

/* Accordion icon styles */
.smTable .BSsrgTable_collapse_symbol {
  margin-left: 10px;
  color: black !important;
}



/* Table search placeholder */
#dt-search-0::placeholder {
  color: gray;
}

/* Facebook link color */
.smTable .smTable_FB_link > a {
  color: var(--srg-cerulean) !important;
}

/* Accordion functionality */
.accordion-content {
  display: none;
}

/* Responsive: mobile spacing and inputs */
@media screen and (max-width: 992px) {
  .BSsrgTable.smTable {
    border-collapse: separate;
    border-spacing: 0 20px !important;
  }

  .BSsrgTable.smTable tbody > tr > td {
    padding: 10px;
  }

  .BSsrgTable.smTable td:first-child {
    padding: 15px 20px;
  }

  .smTable .form-control,
  .smTable .form-select {
    margin-top: 5px;
  }
}

/* Full-width on small screens */
@media (max-width: 768px) {
  .BSsrgTable .w-sm-100 {
    width: 100%;
  }
}

/* Print: hide certain elements */
@media print {
  .no-print {
    opacity: 0;
  }
}

/* DataTables child row styling */
.dtr-data {
  float: right;
  font-size: 12px;
}

.dtr-details {
  width: 100%;
  box-sizing: border-box;
}
