/**
 * Ion Web App - DataTables skin.
 * Mendukung DataTables 1.x, DataTables 2, Bootstrap 4, Buttons, dan Responsive.
 */

body.ion-body table.table,
body.ion-body .dataTables_wrapper,
body.ion-body .dt-container {
  background: var(--ion-surface, #fff);
  border: 1px solid var(--ion-line, #dfe8ed);
  border-radius: 20px;
  box-shadow: 0 14px 38px rgba(38, 54, 61, .07);
  color: var(--ion-ink, #26363d);
  margin-bottom: 24px;
  overflow: hidden;
  padding: 18px;
  width: 100%;
}

/* Filter tambahan di luar DataTables: cabang, kelas, tahun, dan tombol aksi. */
body.ion-body .ion-table-filters {
  align-items: end;
  background: rgba(255, 255, 255, .82);
  border: 1px solid var(--ion-line, #dfe8ed);
  border-radius: 18px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto auto;
  margin-bottom: 14px;
  padding: 13px;
}

body.ion-body .ion-table-filters label,
body.ion-body .lm-filter label {
  color: var(--ion-muted, #71818b);
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin: 0;
}

body.ion-body .ion-table-filters input,
body.ion-body .ion-table-filters select,
body.ion-body .dataTables_wrapper .dataTables_filter input,
body.ion-body .dataTables_wrapper .dataTables_length select,
body.ion-body .dt-container .dt-input,
body.ion-body .dt-container select.dt-input,
body.ion-body .lm-filter input,
body.ion-body .lm-filter select {
  appearance: auto;
  background-color: #f8fbfc;
  border: 1px solid var(--ion-line, #dfe8ed);
  border-radius: 11px;
  box-shadow: none;
  color: var(--ion-ink, #26363d);
  font-size: 12px;
  min-height: 40px;
  outline: 0;
  padding: 7px 11px;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

body.ion-body .ion-table-filters input,
body.ion-body .ion-table-filters select,
body.ion-body .lm-filter input,
body.ion-body .lm-filter select {
  margin-top: 5px;
  width: 100%;
}

body.ion-body .ion-table-filters input:focus,
body.ion-body .ion-table-filters select:focus,
body.ion-body .dataTables_wrapper .dataTables_filter input:focus,
body.ion-body .dataTables_wrapper .dataTables_length select:focus,
body.ion-body .dt-container .dt-input:focus {
  background-color: #fff;
  border-color: var(--ion-primary, #078fcb);
  box-shadow: 0 0 0 4px rgba(7, 143, 203, .11);
}

body.ion-body .ion-table-filter-submit,
body.ion-body .ion-table-filter-reset,
body.ion-body .dataTables_wrapper .dt-button,
body.ion-body .dataTables_wrapper .buttons-html5,
body.ion-body .dataTables_wrapper .buttons-print,
body.ion-body .dt-container .dt-button {
  align-items: center;
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  transition: box-shadow .18s ease, transform .18s ease, filter .18s ease;
  white-space: nowrap;
}

body.ion-body .ion-table-filter-submit,
body.ion-body .dataTables_wrapper .dt-button,
body.ion-body .dataTables_wrapper .buttons-html5,
body.ion-body .dataTables_wrapper .buttons-print,
body.ion-body .dt-container .dt-button {
  background: linear-gradient(135deg, var(--ion-primary, #078fcb), var(--ion-sidebar-to, #087eae));
  box-shadow: 0 8px 18px rgba(7, 143, 203, .18);
  color: #fff;
}

body.ion-body .ion-table-filter-reset {
  background: rgba(231, 51, 45, .08);
  color: var(--ion-accent, #e7332d);
}

body.ion-body .ion-table-filter-submit:hover,
body.ion-body .ion-table-filter-reset:hover,
body.ion-body .dataTables_wrapper .dt-button:hover,
body.ion-body .dt-container .dt-button:hover {
  filter: saturate(1.08);
  transform: translateY(-1px);
}

/* Toolbar DataTables klasik dan DataTables 2. */
body.ion-body .dataTables_wrapper>.row:first-child,
body.ion-body .dt-container>.dt-layout-row:first-child {
  align-items: center;
  border-bottom: 1px solid var(--ion-line, #dfe8ed);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin: -18px -18px 14px;
  padding: 13px 18px;
}

body.ion-body .dt-container .dt-layout-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin: 0;
}

body.ion-body .dataTables_wrapper .dataTables_length,
body.ion-body .dataTables_wrapper .dataTables_filter,
body.ion-body .dt-container .dt-length,
body.ion-body .dt-container .dt-search {
  color: var(--ion-muted, #71818b);
  font-size: 12px;
  margin: 0;
  text-align: left;
}

body.ion-body .dataTables_wrapper .dataTables_filter label,
body.ion-body .dataTables_wrapper .dataTables_length label,
body.ion-body .dt-container .dt-search label,
body.ion-body .dt-container .dt-length label {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  margin: 0;
}

body.ion-body .dataTables_wrapper .dataTables_filter input,
body.ion-body .dt-container .dt-search input {
  margin-left: 0;
  min-width: min(260px, 34vw);
}

body.ion-body .dataTables_wrapper .dataTables_length select,
body.ion-body .dt-container .dt-length select {
  margin: 0 4px;
  min-width: 70px;
}

body.ion-body .dataTables_wrapper .dt-buttons,
body.ion-body .dt-container .dt-buttons {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
}

body.ion-body .dataTables_wrapper .dt-buttons .dt-button,
body.ion-body .dt-container .dt-buttons .dt-button {
  margin: 0;
}

/* Area tabel. */
body.ion-body .dataTables_wrapper .dataTables_scroll,
body.ion-body .dataTables_wrapper .table-responsive,
body.ion-body .dt-container .dt-scroll,
body.ion-body .dt-container .table-responsive {
  border: 1px solid var(--ion-line, #dfe8ed);
  border-radius: 15px;
  overflow: auto;
}

body.ion-body table.dataTable,
body.ion-body table.table.dataTable {
  border-collapse: separate !important;
  border-spacing: 0;
  border: 0;
  color: var(--ion-ink, #26363d);
  margin: 0 !important;
  width: 100% !important;
}

body.ion-body table.dataTable.no-footer {
  border-bottom: 0;
}

body.ion-body table.table thead th,
body.ion-body table.dataTable thead th,
body.ion-body table.dataTable thead td,
body.ion-body table.table.dataTable thead th {
  background-color: #edf6f9;
  border-bottom: 1px solid #dce8ed !important;
  border-top: 0;
  color: #52636c;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .45px;
  padding: 14px 13px;
  text-transform: uppercase;
  vertical-align: middle;
  white-space: nowrap;
}

body.ion-body table.table thead th:first-child,
body.ion-body table.dataTable thead th:first-child {
  border-top-left-radius: 14px;
}

body.ion-body table.dataTable thead th:last-child {
  border-top-right-radius: 14px;
}

body.ion-body table.dataTable tbody td,
body.ion-body table.dataTable tbody th,
body.ion-body table.table.dataTable tbody td {
  background: transparent;
  border-bottom: 1px solid #e8eef1;
  border-top: 0;
  color: #36474f;
  font-size: 12px;
  padding: 14px 13px;
  vertical-align: middle;
}

body.ion-body table.dataTable.stripe>tbody>tr.odd>*,
body.ion-body table.dataTable.display>tbody>tr.odd>*,
body.ion-body table.dataTable tbody tr:nth-child(odd)>* {
  box-shadow: none;
}

body.ion-body table.dataTable tbody tr {
  background: #fff;
  transition: background-color .16s ease, box-shadow .16s ease;
}

body.ion-body table.dataTable tbody tr:hover,
body.ion-body table.dataTable.hover>tbody>tr:hover>*,
body.ion-body table.dataTable.display>tbody>tr:hover>* {
  background: #f7fbfc;
  box-shadow: none;
}

body.ion-body table.dataTable tbody tr.selected>* {
  background: rgba(7, 143, 203, .09);
  color: var(--ion-ink, #26363d);
}

body.ion-body table.dataTable td.dataTables_empty,
body.ion-body table.dataTable td.dt-empty {
  color: var(--ion-muted, #71818b);
  padding: 34px 18px;
  text-align: center;
}

/* Sorting: pertahankan logic DataTables, gunakan warna theme. */
body.ion-body table.dataTable thead .sorting,
body.ion-body table.dataTable thead .sorting_asc,
body.ion-body table.dataTable thead .sorting_desc,
body.ion-body table.dataTable thead .dt-orderable-asc,
body.ion-body table.dataTable thead .dt-orderable-desc {
  cursor: pointer;
}

body.ion-body table.dataTable thead .sorting_asc,
body.ion-body table.dataTable thead .sorting_desc,
body.ion-body table.dataTable thead th.dt-ordering-asc,
body.ion-body table.dataTable thead th.dt-ordering-desc {
  color: var(--ion-primary, #078fcb);
}

/* Tombol plus/minus milik DataTables Responsive. */
body.ion-body table.dataTable.dtr-inline.collapsed>tbody>tr>td.dtr-control::before,
body.ion-body table.dataTable.dtr-inline.collapsed>tbody>tr>th.dtr-control::before,
body.ion-body table.dataTable.collapsed>tbody>tr>td.control::before,
body.ion-body table.dataTable.collapsed>tbody>tr>th.control::before {
  align-items: center;
  background: linear-gradient(135deg, var(--ion-primary, #078fcb), var(--ion-sidebar-to, #087eae));
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(7, 143, 203, .22);
  color: #fff;
  content: "+";
  display: inline-flex;
  font-family: Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  height: 25px;
  justify-content: center;
  left: 8px;
  line-height: 1;
  margin: 0;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 25px;
}

body.ion-body table.dataTable.dtr-inline.collapsed>tbody>tr.parent>td.dtr-control::before,
body.ion-body table.dataTable.dtr-inline.collapsed>tbody>tr.parent>th.dtr-control::before,
body.ion-body table.dataTable.collapsed>tbody>tr.parent>td.control::before {
  background: var(--ion-accent, #e7332d);
  content: "−";
}

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

/* Isi detail responsive menjadi grid informasi yang mudah dipindai. */
body.ion-body table.dataTable>tbody>tr.child,
body.ion-body table.dataTable>tbody>tr.dtr-expanded+tr.child {
  background: #f6fafb;
}

body.ion-body table.dataTable>tbody>tr.child:hover>* {
  background: #f6fafb;
}

body.ion-body table.dataTable>tbody>tr.child td.child {
  padding: 12px 14px 16px;
}

body.ion-body table.dataTable>tbody>tr.child ul.dtr-details,
body.ion-body table.dataTable>tbody>tr.child .dtr-details {
  display: grid;
  gap: 8px 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

body.ion-body table.dataTable>tbody>tr.child ul.dtr-details>li,
body.ion-body table.dataTable>tbody>tr.child .dtr-details>li {
  background: #fff;
  border: 1px solid #e1eaee;
  border-radius: 11px;
  display: block;
  min-width: 0;
  padding: 9px 10px;
}

body.ion-body table.dataTable>tbody>tr.child .dtr-title {
  color: #87969d;
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .4px;
  margin-bottom: 3px;
  text-transform: uppercase;
}

body.ion-body table.dataTable>tbody>tr.child .dtr-data {
  color: var(--ion-ink, #26363d);
  display: block;
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* Info dan pagination. */
body.ion-body .dataTables_wrapper .dataTables_info,
body.ion-body .dt-container .dt-info {
  color: var(--ion-muted, #71818b);
  font-size: 11px;
  padding-top: 14px;
}

body.ion-body .dataTables_wrapper .dataTables_paginate,
body.ion-body .dt-container .dt-paging {
  padding-top: 12px;
}

body.ion-body .dataTables_wrapper .dataTables_paginate .paginate_button,
body.ion-body .dt-container .dt-paging .dt-paging-button,
body.ion-body .dataTables_wrapper .pagination .page-link {
  align-items: center;
  background: #fff !important;
  border: 1px solid var(--ion-line, #dfe8ed) !important;
  border-radius: 9px !important;
  box-shadow: none !important;
  color: #64757d !important;
  display: inline-flex;
  font-size: 11px;
  height: 32px;
  justify-content: center;
  margin: 0 2px;
  min-width: 32px;
  padding: 0 8px !important;
}

body.ion-body .dataTables_wrapper .dataTables_paginate .paginate_button.current,
body.ion-body .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover,
body.ion-body .dt-container .dt-paging .dt-paging-button.current,
body.ion-body .dataTables_wrapper .pagination .page-item.active .page-link {
  background: linear-gradient(135deg, var(--ion-primary, #078fcb), var(--ion-sidebar-to, #087eae)) !important;
  border-color: transparent !important;
  color: #fff !important;
}

body.ion-body .dataTables_wrapper .dataTables_paginate .paginate_button:hover,
body.ion-body .dt-container .dt-paging .dt-paging-button:hover,
body.ion-body .dataTables_wrapper .pagination .page-link:hover {
  background: rgba(7, 143, 203, .08) !important;
  border-color: rgba(7, 143, 203, .24) !important;
  color: var(--ion-primary, #078fcb) !important;
}

body.ion-body .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
body.ion-body .dt-container .dt-paging .dt-paging-button.disabled,
body.ion-body .dataTables_wrapper .pagination .page-item.disabled .page-link {
  cursor: default;
  opacity: .45;
}

/* Processing overlay. */
body.ion-body .dataTables_wrapper .dataTables_processing,
body.ion-body .dt-container .dt-processing {
  background: rgba(255, 255, 255, .95);
  border: 1px solid var(--ion-line, #dfe8ed);
  border-radius: 13px;
  box-shadow: 0 12px 30px rgba(38, 54, 61, .12);
  color: var(--ion-primary, #078fcb);
  font-size: 12px;
  font-weight: 700;
  min-height: 44px;
  padding: 12px 18px;
}

@media (max-width: 991.98px) {
  body.ion-body .ion-table-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.ion-body .ion-table-filter-submit,
  body.ion-body .ion-table-filter-reset {
    width: 100%;
  }
}

@media (max-width: 767.98px) {

  body.ion-body .dataTables_wrapper,
  body.ion-body .dt-container {
    border-radius: 17px;
    padding: 12px;
  }

  body.ion-body .ion-table-filters {
    border-radius: 15px;
    gap: 8px;
    grid-template-columns: 1fr;
    padding: 11px;
  }

  body.ion-body .dataTables_wrapper>.row:first-child,
  body.ion-body .dt-container>.dt-layout-row:first-child {
    align-items: stretch;
    flex-direction: column;
    margin: -12px -12px 12px;
    padding: 12px;
  }

  body.ion-body .dataTables_wrapper>.row:first-child>[class*="col-"],
  body.ion-body .dt-container>.dt-layout-row:first-child>.dt-layout-cell {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
  }

  body.ion-body .dataTables_wrapper .dataTables_filter,
  body.ion-body .dataTables_wrapper .dataTables_length,
  body.ion-body .dt-container .dt-search,
  body.ion-body .dt-container .dt-length {
    float: none;
    width: 100%;
  }

  body.ion-body .dataTables_wrapper .dataTables_filter label,
  body.ion-body .dt-container .dt-search label {
    align-items: stretch;
    flex-direction: column;
    gap: 5px;
    width: 100%;
  }

  body.ion-body .dataTables_wrapper .dataTables_filter input,
  body.ion-body .dt-container .dt-search input {
    margin: 0;
    min-width: 0;
    width: 100%;
  }

  body.ion-body .dataTables_wrapper .dt-buttons,
  body.ion-body .dt-container .dt-buttons {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    width: 100%;
  }

  body.ion-body .dataTables_wrapper .dt-buttons::-webkit-scrollbar,
  body.ion-body .dt-container .dt-buttons::-webkit-scrollbar {
    display: none;
  }

  body.ion-body .dataTables_wrapper .dt-buttons .dt-button,
  body.ion-body .dt-container .dt-buttons .dt-button {
    flex: 0 0 auto;
  }

  body.ion-body table.dataTable thead th,
  body.ion-body table.dataTable thead td,
  body.ion-body table.table.dataTable thead th {
    font-size: 10px;
    padding: 12px 10px;
  }

  body.ion-body table.dataTable tbody td,
  body.ion-body table.dataTable tbody th,
  body.ion-body table.table.dataTable tbody td {
    font-size: 11px;
    padding: 13px 10px;
  }

  body.ion-body table.dataTable.dtr-inline.collapsed>tbody>tr>td.dtr-control,
  body.ion-body table.dataTable.dtr-inline.collapsed>tbody>tr>th.dtr-control,
  body.ion-body table.dataTable.collapsed>tbody>tr>td.control {
    padding-left: 39px;
  }

  body.ion-body table.dataTable>tbody>tr.child ul.dtr-details,
  body.ion-body table.dataTable>tbody>tr.child .dtr-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.ion-body .dataTables_wrapper .dataTables_info,
  body.ion-body .dataTables_wrapper .dataTables_paginate,
  body.ion-body .dt-container .dt-info,
  body.ion-body .dt-container .dt-paging {
    float: none;
    text-align: center;
    width: 100%;
  }
}

@media (max-width: 479.98px) {

  body.ion-body table.dataTable>tbody>tr.child ul.dtr-details,
  body.ion-body table.dataTable>tbody>tr.child .dtr-details {
    grid-template-columns: 1fr;
  }

  body.ion-body .dataTables_wrapper .dataTables_paginate .paginate_button,
  body.ion-body .dt-container .dt-paging .dt-paging-button,
  body.ion-body .dataTables_wrapper .pagination .page-link {
    height: 30px;
    margin: 0 1px;
    min-width: 30px;
    padding: 0 6px !important;
  }
}

@media (prefers-reduced-motion: reduce) {

  body.ion-body .dataTables_wrapper *,
  body.ion-body .dt-container *,
  body.ion-body .ion-table-filters * {
    transition-duration: .01ms !important;
  }
}