/* HR list tables: Patients Show/Search chrome + single-row actions */

.table-container td.actions-cell,
.table-container td.actions-cell .d-flex,
.table-container .crm-contract-row-actions {
  flex-wrap: nowrap !important;
  flex-direction: row !important;
  align-items: center;
  white-space: nowrap;
}

.table-container td.actions-cell {
  width: 1%;
  white-space: nowrap;
  vertical-align: middle;
}

.table-container td.actions-cell .btn,
.table-container .crm-contract-row-actions .btn {
  flex: 0 0 auto;
  width: auto !important;
  white-space: nowrap;
}

/* Hide DataTables' Bootstrap length/filter; custom .table-controls replace them. */
.table-container .dataTables_wrapper .dataTables_length,
.table-container .dataTables_wrapper .dataTables_filter {
  display: none !important;
}

.table-container .dataTables_wrapper > .row:has(.dataTables_length),
.table-container .dataTables_wrapper > .row:has(.dataTables_filter) {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.table-container > .hr-dt-table-controls,
.table-container .hr-dt-table-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.table-container .hr-dt-table-controls .show-entries {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #8b95a5;
  font-size: 14px;
}

.table-container .hr-dt-table-controls .show-entries select {
  background-color: #162639;
  border: 1px solid #2a3f5f;
  color: #d1d9e6;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  width: auto !important;
  min-width: 0;
  max-width: none;
  height: auto;
  min-height: 0;
  line-height: 1.3;
  box-shadow: none !important;
  background-image: none !important;
  -webkit-appearance: auto;
  -moz-appearance: auto;
  appearance: auto;
  display: inline-block;
}

.table-container .hr-dt-table-controls .show-entries select:focus {
  outline: none;
  border-color: #3a5a7f;
  box-shadow: none !important;
}

.table-container .hr-dt-table-controls .search-box,
.employee-filter-toolbar .search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #8b95a5;
  font-size: 14px;
}

.table-container .hr-dt-table-controls .search-box input,
.employee-filter-toolbar .search-box input {
  background-color: #162639;
  color: #d1d9e6;
  padding: 6px 14px;
  border-radius: 4px;
  width: 220px !important;
  max-width: 220px;
  font-size: 14px;
  border: none !important;
  outline: none !important;
  box-shadow: 0 0 10px 5px #023d9625, 0 2px 10px 0 #023e9600 !important;
  height: auto;
  min-height: 0;
  line-height: 1.3;
}

.table-container .hr-dt-table-controls .search-box input:focus,
.employee-filter-toolbar .search-box input:focus {
  outline: none !important;
  border: none !important;
  box-shadow: 0 0 10px 5px #023d9625, 0 2px 10px 0 #023e9600 !important;
}

[data-bs-theme="light"] .table-container .hr-dt-table-controls .show-entries,
[data-bs-theme="light"] .table-container .hr-dt-table-controls .search-box,
[data-bs-theme="light"] .employee-filter-toolbar .search-box {
  color: #6b7280;
}

[data-bs-theme="light"] .table-container .hr-dt-table-controls .show-entries select {
  background-color: #ffffff;
  border: 1px solid #e5eaf0;
  color: #1f2937;
}

[data-bs-theme="light"] .table-container .hr-dt-table-controls .show-entries select:focus {
  border-color: #2563eb;
}

[data-bs-theme="light"] .table-container .hr-dt-table-controls .search-box input,
[data-bs-theme="light"] .employee-filter-toolbar .search-box input {
  background-color: #ffffff;
  color: #1f2937;
  border: none !important;
  outline: none !important;
  box-shadow: 0 0 10px 5px #26262825, 0 2px 10px 0 #023e9600 !important;
}

[data-bs-theme="light"] .table-container .hr-dt-table-controls .search-box input:focus,
[data-bs-theme="light"] .employee-filter-toolbar .search-box input:focus {
  border: none !important;
  outline: none !important;
  box-shadow: 0 0 10px 5px #023d9625, 0 2px 10px 0 #023e9600 !important;
}

/* Employee date filters stay on their own row; Show/Search sit together below. */
#employeeTableContainer .employee-filter-toolbar {
  grid-column: 1 / -1;
  border-bottom: none !important;
}

#employeeTableContainer > .hr-dt-table-controls {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-content: space-between;
  margin: 8px 0 !important;
}

#employeeTable_wrapper > .row.mb-3:has(.dataTables_length),
#employeeTable_wrapper > .row.mb-3:has(.dataTables_filter),
#employeeTable_wrapper .dataTables_length,
#employeeTable_wrapper .dataTables_filter {
  display: none !important;
}

@media (max-width: 767.98px) {
  .table-container td.actions-cell .d-flex,
  .table-container .crm-contract-row-actions {
    flex-wrap: wrap !important;
    white-space: normal;
  }

  .table-container td.actions-cell {
    width: auto;
    white-space: normal;
  }

  .table-container > .hr-dt-table-controls,
  .table-container .hr-dt-table-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 16px;
  }

  .table-container .hr-dt-table-controls .search-box,
  .table-container .hr-dt-table-controls .search-box input,
  .employee-filter-toolbar .search-box,
  .employee-filter-toolbar .search-box input {
    width: 100% !important;
    max-width: none;
  }

  #employeeTableContainer > .hr-dt-table-controls {
    margin: 8px 0 !important;
  }
}
