/*
 * Rogue VIP DataTables Theme
 * Clean replacement for the old bundled DataTables CSS.
 *
 * IMPORTANT:
 * This file intentionally does NOT include:
 * - Bootstrap 3
 * - Normalize.css
 * - Global body styles
 * - Global navbar styles
 * - Global container/row/column styles
 *
 * It only styles DataTables-related elements.
 */

/* ================= DATATABLES WRAPPER ================= */

.dataTables_wrapper,
.rsTableWrap {
  width: 100%;
  color: var(--rs-text);
}

.dataTables_wrapper {
  margin-top: 10px;
  font-family: "Poppins", sans-serif;
}

.dataTables_wrapper::after {
  display: block;
  clear: both;
  content: "";
}

/* ================= TABLE BASE ================= */

.rsContentBody .table,
.rsContentBody table.dataTable,
.rsContentBody #example,
table.dataTable,
.dataTable {
  --bs-table-bg: #171717 !important;
  --bs-table-color: var(--rs-text) !important;
  --bs-table-striped-bg: #1b1b1b !important;
  --bs-table-striped-color: var(--rs-text) !important;
  --bs-table-hover-bg: #242424 !important;
  --bs-table-hover-color: #fff !important;
  --bs-table-border-color: var(--rs-border) !important;

  width: 100% !important;
  margin: 0 !important;
  color: var(--rs-text) !important;
  background: #171717 !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border: 1px solid var(--rs-border) !important;
  border-radius: var(--radius);
  overflow: hidden;
}

.rsContentBody table.dataTable,
table.dataTable {
  box-sizing: border-box;
}

.rsContentBody table.dataTable.no-footer,
table.dataTable.no-footer {
  border-bottom: 1px solid var(--rs-border) !important;
}

/* ================= TABLE HEAD ================= */

.rsContentBody table.dataTable thead th,
.rsContentBody #example thead th,
table.dataTable thead th,
.dataTable thead th {
  background: #101010 !important;
  color: #fff !important;
  border-top: 0 !important;
  border-bottom: 2px solid var(--rs-red) !important;
  padding: 13px 14px !important;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.25;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: none !important;
}

.rsContentBody table.dataTable thead td,
table.dataTable thead td {
  border-bottom: 2px solid var(--rs-red) !important;
}

/* ================= TABLE BODY ================= */

.rsContentBody table.dataTable tbody td,
.rsContentBody table.dataTable tbody th,
.rsContentBody #example tbody td,
.rsContentBody #example tbody th,
table.dataTable tbody td,
table.dataTable tbody th,
.dataTable tbody td,
.dataTable tbody th {
  background-color: var(--bs-table-bg) !important;
  color: var(--bs-table-color) !important;
  border-top: 1px solid var(--rs-border) !important;
  border-bottom: 0 !important;
  padding: 12px 14px !important;
  vertical-align: middle;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: none !important;
}

.rsContentBody table.dataTable tbody tr,
table.dataTable tbody tr {
  background-color: transparent !important;
}

/* ================= STRIPED / HOVER ================= */

.rsContentBody #example.table-striped > tbody > tr:nth-of-type(odd) > *,
table.dataTable.display tbody tr.odd > *,
table.dataTable.stripe tbody tr.odd > *,
table.dataTable tbody tr.odd > * {
  background-color: var(--bs-table-striped-bg) !important;
  color: var(--bs-table-striped-color) !important;
}

.rsContentBody #example.table-hover > tbody > tr:hover > *,
table.dataTable.hover tbody tr:hover > *,
table.dataTable.display tbody tr:hover > *,
table.dataTable tbody tr:hover > * {
  background-color: var(--bs-table-hover-bg) !important;
  color: var(--bs-table-hover-color) !important;
}

/* ================= SORTING COLUMNS ================= */

table.dataTable tbody tr > .sorting_1,
table.dataTable tbody tr > .sorting_2,
table.dataTable tbody tr > .sorting_3,
.rsContentBody #example tbody tr > .sorting_1,
.rsContentBody #example tbody tr > .sorting_2,
.rsContentBody #example tbody tr > .sorting_3 {
  background-color: inherit !important;
  color: #fff !important;
  box-shadow: none !important;
}

/* ================= SORTING ICONS ================= */

table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc,
table.dataTable thead .sorting_asc_disabled,
table.dataTable thead .sorting_desc_disabled {
  cursor: pointer;
  position: relative;
  padding-right: 28px !important;
}

table.dataTable thead .sorting::before,
table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::before,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::before,
table.dataTable thead .sorting_desc::after,
table.dataTable thead .sorting_asc_disabled::before,
table.dataTable thead .sorting_asc_disabled::after,
table.dataTable thead .sorting_desc_disabled::before,
table.dataTable thead .sorting_desc_disabled::after {
  position: absolute;
  right: 10px;
  display: block;
  color: var(--rs-muted-dark);
  font-size: 10px;
  line-height: 1;
  opacity: 0.6;
}

table.dataTable thead .sorting::before,
table.dataTable thead .sorting_asc::before,
table.dataTable thead .sorting_desc::before,
table.dataTable thead .sorting_asc_disabled::before,
table.dataTable thead .sorting_desc_disabled::before {
  content: "▲";
  top: 11px;
}

table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::after,
table.dataTable thead .sorting_asc_disabled::after,
table.dataTable thead .sorting_desc_disabled::after {
  content: "▼";
  top: 23px;
}

table.dataTable thead .sorting_asc::before,
table.dataTable thead .sorting_desc::after {
  color: var(--rs-red-bright);
  opacity: 1;
}

table.dataTable thead .sorting_asc_disabled::before,
table.dataTable thead .sorting_desc_disabled::after {
  opacity: 0.2;
}

/* ================= SELECT CHECKBOX COLUMN ================= */

table.dataTable td.select-checkbox,
table.dataTable th.select-checkbox {
  width: 42px !important;
  text-align: center;
}

table.dataTable tbody td.select-checkbox,
table.dataTable tbody th.select-checkbox {
  position: relative;
}

table.dataTable tbody td.select-checkbox::before,
table.dataTable tbody th.select-checkbox::before {
  content: "";
  display: inline-block;
  width: 15px;
  height: 15px;
  background: #101010;
  border: 1px solid var(--rs-border);
  border-radius: 4px;
  vertical-align: middle;
}

table.dataTable tbody tr.selected td.select-checkbox::after,
table.dataTable tbody tr.selected th.select-checkbox::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  transform: translate(-50%, -50%);
}

table.dataTable tbody tr.selected > *,
table.dataTable tbody tr.selected:hover > * {
  background: rgba(189, 0, 0, 0.32) !important;
  color: #fff !important;
}

/* ================= LENGTH / FILTER / INFO ================= */

.dataTables_length,
.dataTables_filter,
.dataTables_info,
.dataTables_paginate {
  color: var(--rs-muted) !important;
  font-size: 13px;
  font-weight: 600;
}

.dataTables_length,
.dataTables_filter {
  margin-bottom: 12px;
}

.dataTables_length label,
.dataTables_filter label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--rs-muted) !important;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
}

.dataTables_length select,
.dataTables_filter input {
  min-height: 38px;
  margin: 0 6px;
  padding: 8px 10px !important;
  background: #171717 !important;
  border: 1px solid var(--rs-border) !important;
  border-radius: var(--radius) !important;
  color: var(--rs-text) !important;
  font-family: "Poppins", sans-serif;
  font-size: 13px;
  outline: none !important;
  box-shadow: none !important;
}

.dataTables_filter input {
  min-width: 240px;
}

.dataTables_filter input:focus,
.dataTables_length select:focus {
  border-color: var(--rs-red-bright) !important;
  box-shadow: 0 0 0 3px rgba(189, 0, 0, 0.22) !important;
  outline: none !important;
}

.dataTables_info {
  padding-top: 14px !important;
}

/* ================= BUTTONS ================= */

.dataTables_wrapper .dt-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.dataTables_wrapper .dt-buttons .dt-button,
.dataTables_wrapper .dt-buttons button.dt-button,
.dataTables_wrapper .dt-buttons div.dt-button,
.dataTables_wrapper .dt-buttons a.dt-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin: 0 !important;
  padding: 8px 12px !important;
  background: #171717 !important;
  border: 1px solid var(--rs-border) !important;
  border-radius: var(--radius) !important;
  color: var(--rs-muted) !important;
  font-family: "Poppins", sans-serif;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
  text-decoration: none !important;
  letter-spacing: 0.04em;
  box-shadow: none !important;
}

.dataTables_wrapper .dt-buttons .dt-button:hover,
.dataTables_wrapper .dt-buttons button.dt-button:hover,
.dataTables_wrapper .dt-buttons div.dt-button:hover,
.dataTables_wrapper .dt-buttons a.dt-button:hover,
.dataTables_wrapper .dt-buttons .dt-button:focus,
.dataTables_wrapper .dt-buttons button.dt-button:focus,
.dataTables_wrapper .dt-buttons div.dt-button:focus,
.dataTables_wrapper .dt-buttons a.dt-button:focus {
  background: #242424 !important;
  border-color: var(--rs-border-red) !important;
  color: #fff !important;
  box-shadow: none !important;
}

/* ================= PAGINATION ================= */

.dataTables_wrapper .dataTables_paginate {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  float: none !important;
  margin-top: 12px;
  padding-top: 0 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  min-width: 36px;
  margin: 0 !important;
  padding: 8px 11px !important;
  background: #171717 !important;
  border: 1px solid var(--rs-border) !important;
  border-radius: var(--radius) !important;
  color: var(--rs-muted) !important;
  font-size: 13px;
  font-weight: 800;
  line-height: 1 !important;
  text-decoration: none !important;
  cursor: pointer;
  box-shadow: none !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.previous,
.dataTables_wrapper .dataTables_paginate .paginate_button.next {
  min-width: 88px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button:focus {
  background: #242424 !important;
  border-color: var(--rs-border-red) !important;
  color: #fff !important;
  box-shadow: none !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:focus {
  background: linear-gradient(180deg, var(--rs-red), var(--rs-red-dark)) !important;
  border-color: var(--rs-red-bright) !important;
  color: #fff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:focus {
  background: #111 !important;
  border-color: var(--rs-border) !important;
  color: var(--rs-muted-dark) !important;
  cursor: not-allowed !important;
}

/* ================= PROCESSING ================= */

.dataTables_wrapper .dataTables_processing {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 20;
  width: auto;
  min-width: 220px;
  margin: 0;
  padding: 14px 18px;
  background: rgba(23, 23, 23, 0.96);
  border: 1px solid var(--rs-border-red);
  border-radius: var(--radius);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  box-shadow: var(--shadow);
  transform: translate(-50%, -50%);
}

/* ================= RESPONSIVE DATATABLES ================= */

table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control {
  position: relative;
  padding-left: 42px !important;
  cursor: pointer;
}

table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control::before {
  content: "+";
  position: absolute;
  top: 50%;
  left: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  background: linear-gradient(180deg, var(--rs-red), var(--rs-red-dark));
  border: 1px solid var(--rs-red-bright);
  border-radius: 999px;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td.dtr-control::before,
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > th.dtr-control::before {
  content: "−";
}

table.dataTable > tbody > tr.child {
  background: #121212 !important;
}

table.dataTable > tbody > tr.child:hover {
  background: #121212 !important;
}

table.dataTable > tbody > tr.child ul.dtr-details {
  display: block;
  margin: 0;
  padding: 8px 0;
  list-style: none;
}

table.dataTable > tbody > tr.child ul.dtr-details > li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--rs-border);
  color: var(--rs-muted);
  font-size: 13px;
}

table.dataTable > tbody > tr.child ul.dtr-details > li:last-child {
  border-bottom: 0;
}

table.dataTable > tbody > tr.child span.dtr-title {
  color: #fff;
  font-weight: 800;
}

/* ================= SCROLLER ================= */

div.dataTables_scrollBody {
  border-bottom: 1px solid var(--rs-border) !important;
}

div.dataTables_scrollBody > table.dataTable {
  border-top: 0 !important;
}

div.dataTables_scrollHead table.dataTable {
  margin-bottom: 0 !important;
}

div.dataTables_scrollFoot table.dataTable {
  margin-top: 0 !important;
}

/* ================= BOOTSTRAP 5 COMPATIBILITY ================= */

div.dataTables_wrapper div.dataTables_length select {
  width: auto;
  display: inline-block;
}

div.dataTables_wrapper div.dataTables_filter {
  text-align: right;
}

div.dataTables_wrapper div.dataTables_filter input {
  width: auto;
  display: inline-block;
}

div.dataTables_wrapper div.dataTables_info {
  white-space: normal;
}

div.dataTables_wrapper div.dataTables_paginate {
  white-space: nowrap;
}

/* ================= MOBILE ================= */

@media (max-width: 767.98px) {
  .dataTables_wrapper {
    overflow-x: auto;
  }

  table.dataTable {
    min-width: 760px;
  }

  .dataTables_length,
  .dataTables_filter {
    float: none !important;
    width: 100%;
    text-align: left !important;
  }

  .dataTables_length label,
  .dataTables_filter label {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
  }

  .dataTables_length select,
  .dataTables_filter input,
  .dataTables_wrapper div.dataTables_filter input {
    width: 100%;
    min-width: 0;
    margin: 0;
  }

  .dataTables_wrapper .dt-buttons {
    width: 100%;
  }

  .dataTables_wrapper .dt-buttons .dt-button,
  .dataTables_wrapper .dt-buttons button.dt-button,
  .dataTables_wrapper .dt-buttons div.dt-button,
  .dataTables_wrapper .dt-buttons a.dt-button {
    width: 100%;
  }

  .dataTables_wrapper .dataTables_info,
  .dataTables_wrapper .dataTables_paginate {
    width: 100%;
    text-align: left !important;
  }

  .dataTables_wrapper .dataTables_paginate {
    justify-content: center;
    flex-wrap: wrap;
  }

  .dataTables_wrapper .dataTables_paginate .paginate_button.previous,
  .dataTables_wrapper .dataTables_paginate .paginate_button.next {
    min-width: 100px;
  }
}