/* Shared UI table system for Checker. Page styles keep only domain-specific layouts. */
:root {
  --checker-table-header-top: 50px;
  --checker-table-border: #d7e5ee;
  --checker-table-heading: #eaf5fb;
  --checker-table-text: #435b6b;
  --checker-table-accent: #3483aa;
}
.table { color: var(--checker-table-text); background: #fff; }
.dataTables_scrollHeadInner > table, .dataTables_scrollBody > table { margin-top: 0 !important; }
.dataTables_scroll table.table { border: 0; }
.dataTables_scrollBody > table.table { margin-left: 0 !important; margin-right: 0 !important; }
.dataTables_scrollBody > table.table:not(.checker-sized-table) { min-width: 100%; }
.dataTables_scrollBody,
.dataTables_wrapper.no-footer .dataTables_scrollBody {
  border-bottom: 0;
  height: var(--checker-table-body-height, 50vh) !important;
  max-height: var(--checker-table-body-height, 50vh) !important;
  overflow: auto !important;
}
/* Checker table system: palette, controls, pagination and sizing. */
table.checker-sized-table th,
table.checker-sized-table td {
  box-sizing: border-box;
}
.dataTables_scrollHead table.table th,
.dataTables_scrollHead table.table td {
  box-sizing: border-box;
}
.table-responsive:not(.defecttable_mobile) {
  border: 1px solid var(--checker-table-border);
  border-radius: 10px;
}
.dataTables_wrapper .dataTables_scroll {
  border: 1px solid var(--checker-table-border);
  border-radius: 10px;
}
table.table > thead > tr > th,
table.table > thead > tr > td,
.tableAdmin > thead > tr > th {
  padding: 10px 8px;
  text-align: center;
  vertical-align: middle;
  border-color: var(--checker-table-border);
  background: var(--checker-table-heading);
  color: #2c607c;
  font-size: 14px;
  font-weight: 600;
}
table.table > thead > tr:first-child:not(:last-child) > th,
table.table > thead > tr:first-child:not(:last-child) > td {
  background: #f5f9fc;
}
table.table > tbody > tr > td,
table.table > tbody > tr > th {
  padding: 8px 10px;
  vertical-align: middle;
  border-color: #e4ebf0;
  color: var(--checker-table-text);
  font-size: 14px;
}
table.table-striped > tbody > tr:nth-child(odd) {
  background: #fff;
}
table.table-striped > tbody > tr:nth-child(even) {
  background: #f8fbfd;
}
table.table-hover > tbody > tr:hover {
  background: #edf7fc;
}
.dataTables_wrapper .dataTables_scrollBody table.table > thead > tr > th,
.dataTables_wrapper .dataTables_scrollBody table.table > thead > tr > td {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-top-width: 0 !important;
  border-bottom-width: 0 !important;
}
.select2-container--default .checker-table-dropdown {
  border-color: #cfdfe9;
  border-radius: 6px;
  color: #4f6879;
  font-size: 14px;
  box-shadow: 0 5px 16px rgba(36, 77, 101, .12);
}
.select2-container--default .checker-table-dropdown .select2-search__field {
  margin: 0;
  padding: 6px 10px;
  border: 1px solid #cfdfe9;
  border-radius: 5px;
  font: inherit;
}
.select2-container--default .checker-table-dropdown .select2-results__option {
  padding: 8px 10px;
}
.select2-container--default .checker-table-dropdown .select2-results__option--highlighted[aria-selected] {
  background: var(--checker-table-accent);
  color: #fff;
}
table.table > thead .form-control,
.dataTables_wrapper .dataTables_scrollHead .form-control,
.dataTables_wrapper .dataTables_scrollHead .select2-selection--single,
.dataTables_wrapper .dataTables_length .select2-selection--single {
  height: 36px;
  min-height: 36px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid #cfdfe9;
  border-radius: 6px;
  background: #fff;
  color: #4f6879;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 22px;
  box-shadow: none;
}
.dataTables_wrapper .select2-selection--single .select2-selection__rendered {
  padding: 0 16px 0 0;
  color: inherit;
  font: inherit;
}
.dataTables_wrapper .select2-selection--single .select2-selection__arrow {
  top: 0;
  height: 100%;
}
.dataTables_wrapper .dataTables_scrollHead .form-control:focus,
.dataTables_wrapper .select2-container--open .select2-selection--single {
  border-color: #398eb8;
  outline: none;
  box-shadow: 0 0 0 2px rgba(57, 142, 184, .1);
}
table.table .btn-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  border: 1px solid #c9dfed;
  border-radius: 8px;
  background: #e8f3fa;
  color: #357da4;
  box-shadow: none;
  font-size: 14px;
}
table.table .btn-circle.btn-warning {
  border-color: #eadab6;
  background: #fff5df;
  color: #9b752b;
}
table.table .btn-circle.btn-danger {
  border-color: #ebcdd4;
  background: #fceef1;
  color: #b94c63;
}
table.table .btn-circle.btn-success {
  border-color: #cde5d9;
  background: #edf8f2;
  color: #388565;
}
table.table .btn {
  border-radius: 7px;
  box-shadow: none;
  font-size: 13px;
}
/* Split actions share one height and only round the outside corners. */
table.table .btn-group > .btn.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  margin-top: 0;
  margin-bottom: 0;
  padding: 0 10px;
  border: 1px solid #eadab6;
  border-radius: 0;
  font-size: 13px;
  line-height: 20px;
  text-shadow: none;
  box-shadow: none;
}
table.table .btn-group > .btn.btn-sm:first-child {
  border-radius: 7px 0 0 7px;
}
table.table .btn-group > .btn.btn-sm:last-of-type {
  border-radius: 0 7px 7px 0;
}
table.table .btn-group > .btn.btn-sm.dropdown-toggle {
  width: 30px;
  padding: 0;
}
table.table .btn-group > .btn.btn-sm.btn-warning {
  border-color: #eadab6;
  background: #fff5df;
  color: #916c25;
}
table.table .btn-group > .btn.btn-sm.btn-warning:hover,
table.table .btn-group.open > .btn.btn-sm.btn-warning.dropdown-toggle {
  background: #f7e8c6;
  color: #79581b;
}
table.table .btn:not(.btn-link):not(.menubackbtn):not(.btn-login):not(.not-icon-left) > i:first-child,
table.table .btn-group > .btn:not(.btn-link):not(.menubackbtn):not(.btn-login):not(.not-icon-left).btn-sm > i:first-child {
  margin: 0 6px 0 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-size: 14px;
  line-height: inherit;
}
table.table .btn-circle:disabled {
  opacity: .5;
  cursor: not-allowed;
}
table.table .btn-circle:hover {
  filter: brightness(.96);
}
table.table button:focus-visible {
  outline: 2px solid #338bb6;
  outline-offset: 2px;
}
.btnfilter_checker > .btn {
  border-color: var(--checker-table-accent);
  border-radius: 8px;
  background: var(--checker-table-accent);
  color: #fff;
  box-shadow: none;
}
.btnfilter_checker > .btn > i:first-child {
  margin: 0 6px 0 0;
  padding: 0;
  background: transparent;
  line-height: inherit;
}
.dataTables_wrapper .table-grid-footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-top: 12px;
  border: 1px solid #dce7ee;
  border-radius: 10px;
  background: #f8fbfd;
  color: #627b8b;
  font-size: 12px;
}
.dataTables_wrapper .dataTables_length label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-weight: 400;
  white-space: nowrap;
}
.dataTables_wrapper .dataTables_length .select2-container {
  flex: 0 0 72px;
  width: 72px !important;
  min-width: 72px;
}
.dataTables_wrapper .dataTables_length select:not(.select2-hidden-accessible) {
  width: 72px;
  height: 36px;
  border: 1px solid #cfdfe9;
  border-radius: 6px;
  background: #fff;
  color: #4f6879;
}
.dataTables_wrapper .dataTables_info {
  padding: 0 !important;
  text-align: center;
  white-space: normal;
}
.dataTables_wrapper .dataTables_paginate {
  float: none;
  padding: 0 !important;
  margin: 0 !important;
}
.dataTables_wrapper .dataTables_paginate > ul.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  margin: 0;
}
.dataTables_wrapper .dataTables_paginate > ul.pagination > li.paginate_button {
  padding: 0 !important;
  margin: 0;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none;
}
.dataTables_wrapper .pagination > li > a {
  display: flex;
  align-items: center;
  justify-content: center;
  float: none;
  min-width: 36px;
  height: 36px;
  padding: 4px 7px;
  margin: 0;
  border: 1px solid #d3e2ec;
  border-radius: 7px;
  background: #fff;
  color: #427b9b;
  font-size: 13px;
}
.dataTables_wrapper .pagination > li.active > a {
  border-color: var(--checker-table-accent);
  background: var(--checker-table-accent);
  color: #fff;
  font-weight: 600;
}
.dataTables_wrapper .pagination > li.disabled > a {
  border-color: #e3ebf0;
  background: #f4f7f9;
  color: #a5b4bd;
}
.dataTables_wrapper .pagination > li:not(.active):not(.disabled) > a:hover {
  border-color: #aacddd;
  background: var(--checker-table-heading);
  color: #286b8f;
}
@media (max-width: 767px) {
  .dataTables_wrapper .table-grid-footer {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 10px;
    padding: 12px 0;
  }
  .dataTables_wrapper .table-grid-page-size {
    grid-row: 1;
  }
  .dataTables_wrapper .table-grid-pagination {
    grid-row: 2;
    max-width: 100%;
  }
  .dataTables_wrapper .table-grid-info {
    grid-row: 3;
    padding: 0 8px;
  }
  .dataTables_wrapper .dataTables_paginate > ul.pagination {
    justify-content: center;
  }
  .select2-container--default .checker-table-dropdown { font-size: 16px; }
  table.table > thead .form-control,
  .dataTables_wrapper .dataTables_scrollHead .form-control,
  .dataTables_wrapper .dataTables_scrollHead .select2-selection--single {
    font-size: 16px;
  }
}
table.checker-sized-table,
.dataTables_scrollHeadInner table.table.checker-sized-table,
.dataTables_scrollBody table.table.checker-sized-table {
  table-layout: fixed;
  min-width: var(--checker-table-min-width, 500px) !important;
  border: 0 !important;
}
table.checker-sized-table > tbody > tr > td {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  vertical-align: middle;
  overflow-wrap: break-word;
}
table.checker-sized-table th.table-col-index,
table.checker-sized-table th.table-col-action,
table.checker-sized-table td.table-col-index,
table.checker-sized-table td.table-col-action {
  box-sizing: border-box;
  width: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
  padding-left: 6px;
  padding-right: 6px;
  text-align: center !important;
  white-space: nowrap;
}
table.checker-sized-table th.table-col-media,
table.checker-sized-table td.table-col-media {
  box-sizing: border-box;
  width: 104px !important;
  min-width: 104px !important;
  max-width: 104px !important;
  text-align: center !important;
}
table.checker-sized-table td.table-col-media img {
  max-width: 88px;
  max-height: 70px;
  object-fit: contain;
}
table.checker-sized-table th.table-col-count,
table.checker-sized-table td.table-col-count {
  box-sizing: border-box;
  width: 80px !important;
  min-width: 80px !important;
  max-width: 80px !important;
  text-align: center !important;
}
table.checker-sized-table .searchColumn {
  min-width: 0;
  max-width: 100%;
}

/* The header and footer stay outside the fixed-height scrolling body. */
.dataTables_scroll > .dataTables_scrollHead {
  position: relative !important;
  top: 0;
  z-index: 2;
  border-radius: 9px 9px 0 0;
  background: var(--checker-table-heading);
}
.dataTables_scroll > .dataTables_scrollBody { border-radius: 0 0 9px 9px; }
.table:not(.dataTable) > thead { position: -webkit-sticky; position: sticky; top: var(--checker-table-header-top); z-index: 10; }
.table-responsive:not(.defecttable_mobile) { max-height: calc(100vh - var(--checker-table-header-top) - 24px); overflow: auto; }
.table-responsive:not(.defecttable_mobile) > .table > thead { top: 0; }
.checker-native-scroll {
  height: var(--checker-table-body-height, 50vh);
  max-height: var(--checker-table-body-height, 50vh);
  overflow: auto;
  border: 1px solid var(--checker-table-border);
  border-radius: 10px;
}
.checker-native-scroll > .table > thead { position: sticky; top: 0; z-index: 2; }
.checker-native-scroll > .table { margin-bottom: 0; border: 0; }
/* Page-scrolling tables must not use a nested overflow container for sticky headers. */
@media (min-width: 768px) {
  .table-responsive.checker-page-scroll { overflow: visible; max-height: none; }
  .checker-page-scroll > .table:not(.dataTable) > thead {
    top: calc(var(--checker-table-header-top) + var(--defect-filter-height, 0px));
  }
}

.table-responsive .dropdown-menu { z-index: 12; }

.table-grid-toolbar:empty { display: none; }
.table-filter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.table-filter-field {
  flex: 1;
  min-width: 0;
}
.table-filter-actions > .btnfilter_checker {
  flex: 0 0 auto;
  margin: 0;
}
.table-filter-actions .input-group,
.table-filter-actions .form-control {
  margin-bottom: 0;
}
.booking-table-actions .booking-date-range {
  max-width: 555px;
}
@media (max-width: 575px) {
  .booking-table-actions { flex-wrap: wrap; }
  .booking-table-actions .table-filter-field { flex-basis: 100%; max-width: none; }
  .booking-table-actions .btnfilter_checker { margin-left: auto; }
}
.table-grid-toolbar .dataTables_filter { padding: 0 0 10px; }
.table-grid-toolbar .dataTables_filter input { height: 36px; border: 1px solid #cfdfe9; border-radius: 6px; padding: 6px 10px; box-shadow: none; }
.modal { --checker-table-header-top: 0px; }
@media print {
  .dataTables_scrollBody, .checker-native-scroll { height: auto !important; max-height: none !important; overflow: visible !important; }
  .table:not(.dataTable) > thead { position: static; }
}
