/**
 * Green Theme Override
 * Changes primary blue colors to green while keeping white backgrounds and button colors
 */

:root {
  --primary: #4a7c2a;
  --blue: #4a7c2a;
}

/* Sidebar brand color */
.sidebar-brand h4 {
  color: #4a7c2a !important;
}

/* Header center brand - BPMS */
.header .container-fluid .header-brand-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 1;
  pointer-events: none;
  width: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Ensure BPMS stays centered when sidebar is collapsed/expanded */
.header.sidebar-collapsed .container-fluid .header-brand-center,
.header .container-fluid .header-brand-center {
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
}

.header-brand-title {
  font-size: 2rem;
  font-weight: 700;
  color: #4a7c2a !important;
  letter-spacing: 0.05em;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  text-transform: uppercase;
  line-height: 1.2;
  margin: 0;
  display: block;
}

.header-brand-subtitle {
  font-size: 0.75rem;
  color: #6c757d !important;
  font-weight: 400;
  line-height: 1.2;
  margin-top: 0.125rem;
  text-transform: none;
  letter-spacing: 0.02em;
  display: block;
}

/* Ensure header container allows absolute positioning */
.header {
  position: relative;
}

/* Sidebar active/hover states */
.sidebar .nav-link.active,
.sidebar .nav-link:hover,
.sidebar-menu > li.active > a,
.sidebar-menu > li > a:hover {
  background-color: #4a7c2a !important;
  color: #fff !important;
  border-left-color: #4a7c2a !important;
}

.sidebar-nav .nav-link:hover {
  background-color: #e8f5e3 !important;
  color: #4a7c2a !important;
  border-left-color: #4a7c2a !important;
}

.sidebar-nav .nav-item.active > .nav-link {
  background-color: #d4edda !important;
  color: #155724 !important;
  border-left-color: #4a7c2a !important;
  border-left-width: 3px !important;
}

.sidebar .nav-link.active::before {
  background-color: #4a7c2a !important;
}

/* Sidebar focus states - remove blue outline */
.sidebar .nav-link:focus,
.sidebar-nav .nav-link:focus {
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(139, 195, 74, 0.2) !important;
  background-color: #fafcf9 !important;
  color: #4a7c2a !important;
}

.sidebar-nav .nav-link:focus {
  border-left-color: #4a7c2a !important;
}

/* Sidebar submenu active */
.sidebar .nav-subitem.active > a,
.sidebar .nav-subitem > a:hover,
.treeview-menu > li.active > a,
.treeview-menu > li > a:hover,
.nav-submenu a:hover,
.nav-submenu a.active {
  background-color: #d4edda !important;
  color: #155724 !important;
  border-left-color: #4a7c2a !important;
}

.nav-submenu a.active {
  background-color: #c3e6cb !important;
  color: #155724 !important;
  border-left: 3px solid #4a7c2a !important;
  font-weight: 500 !important;
}

.nav-submenu a:focus {
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(74, 124, 42, 0.25) !important;
}

/* Page Header Background - White */
.header {
  background: #fff !important;
  background-color: #fff !important;
  border-bottom-color: rgba(0, 40, 100, 0.12) !important;
}

/* Sidebar Header - White - HIGH PRIORITY */
.sidebar-header,
.sidebar .sidebar-header,
aside.sidebar .sidebar-header,
#sidebar .sidebar-header {
  background: #fff !important;
  background-color: #fff !important;
  border-bottom-color: rgba(0, 40, 100, 0.12) !important;
}

/* Sidebar Brand Text */
.sidebar-brand {
  margin-left: 0 !important;
  padding-left: 10px !important;
}

.sidebar-brand-text {
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  color: #4a7c2a !important;
  letter-spacing: 0.05em !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
  text-transform: uppercase !important;
  margin-top: 0 !important;
  align-self: center !important;
  margin-left: 0 !important;
}

/* Add gap below sidebar header */
.sidebar-header {
  margin-bottom: 10px !important;
}

.sidebar-body {
  margin-top: 10px !important;
  padding-top: 0.5rem !important;
}

/* Header/Brand colors */
.header .navbar-brand,
.header .nav-link {
  color: #2d5016 !important;
}

.header .nav-link:hover {
  color: #4a7c2a !important;
}

/* Sidebar toggle button */
.sidebar-toggle-btn:hover {
  color: #4a7c2a !important;
}

.sidebar-toggle-btn:focus {
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(74, 124, 42, 0.25) !important;
}

.sidebar-toggle-btn:active,
.sidebar-toggle-btn:focus:active {
  outline: none !important;
  box-shadow: none !important;
}

/* Remove focus outline after mouse click (not keyboard navigation) */
.sidebar-toggle-btn:focus:not(:focus-visible) {
  outline: none !important;
  box-shadow: none !important;
}

/* Sidebar close button focus */
.sidebar-close-btn:focus {
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(74, 124, 42, 0.25) !important;
}

/* Card headers and accents */
.card-header {
  border-bottom-color: #e8f5e3 !important;
}

/* Links and text accents */
a {
  color: #4a7c2a;
}

a:hover {
  color: #2d5016;
}

/* Badge primary (but keep other badge colors) */
.badge-primary {
  background-color: #4a7c2a !important;
}

/* Stamp/icon backgrounds */
.stamp.bg-blue {
  background-color: #4a7c2a !important;
}

/* Table row hover */
.table-hover tbody tr:hover {
  background-color: #f0f7ed !important;
}

/* Active pagination */
.pagination .page-item.active .page-link {
  background-color: #4a7c2a;
  border-color: #4a7c2a;
}

.pagination .page-link:hover {
  color: #4a7c2a;
}

/* Breadcrumb active */
.breadcrumb-item.active {
  color: #4a7c2a;
}

/* Dropdown active/hover */
.dropdown-item.active,
.dropdown-item:hover {
  background-color: #f0f7ed;
  color: #2d5016;
}

/* Progress bars (primary) */
.progress-bar {
  background-color: #4a7c2a;
}

/* Form controls focus */
.form-control:focus,
.form-select:focus {
  border-color: #4a7c2a;
  box-shadow: 0 0 0 0.2rem rgba(74, 124, 42, 0.25);
}

/* DataTables search input focus - light gray */
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper input[type="search"]:focus,
#payrollSearchInput:focus,
#attendanceSearchInput:focus,
#profileSearchInput:focus,
#overtimeSearchInput:focus,
#advanceSearchInput:focus,
#deductionSearchInput:focus,
#userSearchInput:focus,
#positionSearchInput:focus,
#onTimeSearchInput:focus,
#lateSearchInput:focus,
#absentSearchInput:focus,
#monthlyLogsSearchInput:focus {
  border-color: #adb5bd !important;
  outline: none !important;
  box-shadow: 0 0 0 0.2rem rgba(173, 181, 189, 0.25) !important;
}

/* DataTables length menu (Show entries) - remove green outline on focus */
.dataTables_wrapper .dataTables_length select:focus,
.dataTables_wrapper .dataTables_length select:active {
  outline: none !important;
  border-color: #adb5bd !important;
  box-shadow: 0 0 0 0.2rem rgba(173, 181, 189, 0.25) !important;
}

/* DataTables length menu dropdown options - light green hover/selection */
/* Using multiple approaches to override browser defaults */
.dataTables_wrapper .dataTables_length select {
  accent-color: #4a7c2a;
  -webkit-appearance: menulist;
  -moz-appearance: menulist;
  appearance: menulist;
}

.dataTables_wrapper .dataTables_length select option {
  background-color: #ffffff !important;
  background: #ffffff !important;
  color: #000000 !important;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.dataTables_wrapper .dataTables_length select option:hover,
.dataTables_wrapper .dataTables_length select option:focus,
.dataTables_wrapper .dataTables_length select option:active {
  background-color: #d4edda !important;
  background: #d4edda !important;
  color: #155724 !important;
}

.dataTables_wrapper .dataTables_length select option:checked,
.dataTables_wrapper .dataTables_length select option[selected] {
  background-color: #d4edda !important;
  background: #d4edda !important;
  color: #155724 !important;
}

/* Additional override for when select is open */
.dataTables_wrapper .dataTables_length select:focus option:hover,
.dataTables_wrapper .dataTables_length select:active option:hover,
.dataTables_wrapper .dataTables_length select:focus option:focus,
.dataTables_wrapper .dataTables_length select:active option:focus {
  background-color: #d4edda !important;
  background: #d4edda !important;
  color: #155724 !important;
}

/* Force light green on all option states */
.dataTables_wrapper .dataTables_length select option:not(:disabled):hover {
  background: linear-gradient(to bottom, #d4edda, #d4edda) !important;
  background-color: #d4edda !important;
  color: #155724 !important;
}

/* Checkbox/Radio primary */
.custom-control-input:checked ~ .custom-control-label::before {
  background-color: #4a7c2a;
  border-color: #4a7c2a;
}

/* DataTables pagination - green theme */
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover,
.dataTables_wrapper .dataTables_paginate .page-item.active .page-link,
.dataTables_wrapper .dataTables_paginate .page-item.active .page-link:hover {
  background: #d4edda !important;
  background-color: #d4edda !important;
  border-color: #c3e6cb !important;
  color: #155724 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover,
.dataTables_wrapper .dataTables_paginate .page-link:hover {
  color: #4a7c2a !important;
  border-color: #4a7c2a !important;
}

/* Style pagination buttons */
.dataTables_wrapper .dataTables_paginate .paginate_button,
.dataTables_wrapper .dataTables_paginate .page-link {
  color: #495057;
  border-color: #dee2e6;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,
.dataTables_wrapper .dataTables_paginate .page-item.disabled .page-link {
  color: #6c757d !important;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Nav tabs active */
.nav-tabs .nav-link.active {
  color: #4a7c2a;
  border-bottom-color: #4a7c2a;
}

.nav-tabs .nav-link:hover {
  color: #4a7c2a;
}

/* Modal header accents */
.modal-header {
  border-bottom-color: #e8f5e3;
}

/* Keep button colors as they are - only change primary blue references */
.btn-primary {
  background-color: #4a7c2a;
  border-color: #4a7c2a;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #2d5016;
  border-color: #2d5016;
}

/* Keep other button colors unchanged - no overrides needed */

/* Text colors for primary */
.text-primary {
  color: #4a7c2a !important;
}

/* Background colors for primary */
.bg-primary {
  background-color: #4a7c2a !important;
}

/* Border colors for primary */
.border-primary {
  border-color: #4a7c2a !important;
}

/* Profile dropdown hover - green theme - HIGH SPECIFICITY */
#userProfileDropdown > a.nav-link:hover,
#userProfileDropdown > a.nav-link:focus,
#userProfileDropdown > a.nav-link:active,
#userProfileDropdown.show > a.nav-link {
  background-color: #fafcf9 !important;
  color: #4a7c2a !important;
}

#userProfileDropdown > a.nav-link:hover .text-default,
#userProfileDropdown > a.nav-link:focus .text-default,
#userProfileDropdown > a.nav-link:hover small,
#userProfileDropdown > a.nav-link:focus small {
  color: #4a7c2a !important;
}

#userProfileDropdown > a.nav-link:hover .avatar,
#userProfileDropdown > a.nav-link:focus .avatar {
  border-color: #6ba644 !important;
}

#userProfileDropdown > a.nav-link:hover i,
#userProfileDropdown > a.nav-link:focus i {
  color: #4a7c2a !important;
}

/* Profile picture border - darker green */
#userProfileDropdown .avatar {
  border-color: #4a7c2a !important;
}

/* Override any header nav-link hover that might set white background */
.header .nav-link:hover,
.header #userProfileDropdown > a.nav-link:hover,
.header .d-flex .nav-link:hover,
.header .dropdown .nav-link:hover {
  background-color: #fafcf9 !important;
  color: #4a7c2a !important;
}

/* Prevent white background on profile dropdown hover - override all possible selectors */
.header .ml-auto .dropdown .nav-link:hover,
.header .ml-auto .dropdown .nav-link:focus,
.header .ml-auto .dropdown .nav-link:active,
.header .ml-auto .dropdown.show .nav-link {
  background-color: #fafcf9 !important;
  color: #4a7c2a !important;
}

/* Keep white backgrounds */
body,
.card,
.modal-content,
.table,
.form-control {
  background-color: #fff;
}

/* Add harder shadows to cards and items for depth */
.card {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35) !important;
}

/* Table card - bigger with no inner shadow */
.card .table-responsive {
  box-shadow: none !important;
  border-radius: 0 !important;
}

.card .table {
  box-shadow: none !important;
}

.card-body {
  padding: 2.5rem !important;
}

/* Remove inner shadows from card body */
.card-body .table,
.card-body .table-responsive {
  box-shadow: none !important;
}

/* Make table card bigger */
.card:has(.table),
.card:has(.table-responsive) {
  margin-bottom: 2rem;
}

/* Alternative selector for browsers that don't support :has() */
.card .table-responsive {
  margin: 0;
}

/* Remove shadows from table cells - only outer container has shadow */
.table {
  box-shadow: none !important;
}

.table td,
.table th,
.table tbody tr,
.table thead tr {
  box-shadow: none !important;
}

.table-responsive {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
  border-radius: 0.25rem;
}

/* Remove shadows from DataTables wrapper inner elements */
.dataTables_wrapper .table {
  box-shadow: none !important;
}

.dataTables_wrapper .table td,
.dataTables_wrapper .table th,
.dataTables_wrapper .table tbody tr,
.dataTables_wrapper .table thead tr {
  box-shadow: none !important;
}

/* DataTables layout - info on left, pagination on right */
.dataTables_wrapper .dataTables_info {
  float: left;
  padding-top: 0.85em;
}

.dataTables_wrapper .dataTables_paginate {
  float: right;
  text-align: right;
  padding-top: 0.25em;
  margin-right: 1rem;
}

/* Reset entries picker to default */

/* Reset pagination to default */

/* Ensure proper spacing */
.dataTables_wrapper .row:first-child {
  margin-bottom: 1rem;
}

.dataTables_wrapper .row:last-child {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.dataTables_wrapper .row:last-child > div {
  padding-left: 0;
  padding-right: 0;
}

.btn {
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2) !important;
}

.btn:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3) !important;
}

.form-control,
.form-select {
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18) !important;
}

.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 0.2rem rgba(74, 124, 42, 0.25), 0 5px 15px rgba(0, 0, 0, 0.25) !important;
}

/* Sidebar background stays white/light */
.sidebar {
  background-color: #fff;
}

/* Header background stays white/light */
.header {
  background-color: #fff;
}

/* Main content area padding */
.page-main {
  padding-top: 100px !important;
  padding-left: 2rem !important;
  padding-right: 2rem !important;
  padding-bottom: 2rem !important;
}

.page-content {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* CRITICAL: Override profile dropdown hover - must be at end for highest priority */
.header .d-flex.align-items-center .dropdown#userProfileDropdown > a.nav-link:hover,
.header .d-flex.align-items-center .dropdown#userProfileDropdown > a.nav-link:focus,
.header .d-flex.align-items-center .dropdown#userProfileDropdown > a.nav-link:active,
.header .d-flex.align-items-center .dropdown#userProfileDropdown.show > a.nav-link,
.header .ml-auto .dropdown#userProfileDropdown > a.nav-link:hover,
.header .ml-auto .dropdown#userProfileDropdown > a.nav-link:focus,
.header .ml-auto .dropdown#userProfileDropdown > a.nav-link:active,
.header .ml-auto .dropdown#userProfileDropdown.show > a.nav-link,
.header .profile-dropdown-link:hover,
.header .profile-dropdown-link:focus,
.header .profile-dropdown-link:active,
.profile-dropdown-link:hover,
.profile-dropdown-link:focus,
.profile-dropdown-link:active,
a.profile-dropdown-link:hover,
a.profile-dropdown-link:focus,
a.profile-dropdown-link:active {
  background-color: #fafcf9 !important;
  background: #fafcf9 !important;
  background-image: none !important;
  color: #4a7c2a !important;
}

.header .d-flex.align-items-center .dropdown#userProfileDropdown > a.nav-link:hover .text-default,
.header .d-flex.align-items-center .dropdown#userProfileDropdown > a.nav-link:focus .text-default,
.header .d-flex.align-items-center .dropdown#userProfileDropdown > a.nav-link:hover small,
.header .d-flex.align-items-center .dropdown#userProfileDropdown > a.nav-link:focus small,
.header .ml-auto .dropdown#userProfileDropdown > a.nav-link:hover .text-default,
.header .ml-auto .dropdown#userProfileDropdown > a.nav-link:focus .text-default,
.header .ml-auto .dropdown#userProfileDropdown > a.nav-link:hover small,
.header .ml-auto .dropdown#userProfileDropdown > a.nav-link:focus small,
.profile-dropdown-link:hover .text-default,
.profile-dropdown-link:focus .text-default,
.profile-dropdown-link:hover small,
.profile-dropdown-link:focus small {
  color: #4a7c2a !important;
}

.header .d-flex.align-items-center .dropdown#userProfileDropdown > a.nav-link:hover .avatar,
.header .d-flex.align-items-center .dropdown#userProfileDropdown > a.nav-link:focus .avatar,
.header .ml-auto .dropdown#userProfileDropdown > a.nav-link:hover .avatar,
.header .ml-auto .dropdown#userProfileDropdown > a.nav-link:focus .avatar,
.profile-dropdown-link:hover .avatar,
.profile-dropdown-link:focus .avatar {
  border-color: #6ba644 !important;
}

.header .d-flex.align-items-center .dropdown#userProfileDropdown > a.nav-link:hover i,
.header .d-flex.align-items-center .dropdown#userProfileDropdown > a.nav-link:focus i,
.header .ml-auto .dropdown#userProfileDropdown > a.nav-link:hover i,
.header .ml-auto .dropdown#userProfileDropdown > a.nav-link:focus i,
.profile-dropdown-link:hover i,
.profile-dropdown-link:focus i {
  color: #4a7c2a !important;
}

/* Prevent any white background on header nav-links */
.header .nav-link:hover,
.header .nav-link:focus,
.header .nav-link:active,
.header a.nav-link:hover,
.header a.nav-link:focus,
.header a.nav-link:active {
  background-color: #fafcf9 !important;
  background: #fafcf9 !important;
  background-image: none !important;
}

/* Override any potential white background from dashboard.css */
.header .d-flex .nav-link:hover,
.header .d-flex .nav-link:focus,
.header .ml-auto .nav-link:hover,
.header .ml-auto .nav-link:focus {
  background-color: #fafcf9 !important;
  background: #fafcf9 !important;
  background-image: none !important;
}

/* Notification dropdown hover - green theme */
#notificationDropdown > a.nav-link:hover,
#notificationDropdown > a.nav-link:focus,
#notificationDropdown > a.nav-link:active,
#notificationDropdown.show > a.nav-link,
#notificationDropdown > a.notification-dropdown-link:hover,
#notificationDropdown > a.notification-dropdown-link:focus,
#notificationDropdown > a.notification-dropdown-link:active,
.header .dropdown#notificationDropdown > a.nav-link:hover,
.header .dropdown#notificationDropdown > a.nav-link:focus,
.header .dropdown#notificationDropdown > a.nav-link:active,
.header .dropdown#notificationDropdown.show > a.nav-link,
.notification-dropdown-link:hover,
.notification-dropdown-link:focus,
.notification-dropdown-link:active,
a.notification-dropdown-link:hover,
a.notification-dropdown-link:focus,
a.notification-dropdown-link:active {
  background-color: #fafcf9 !important;
  background: #fafcf9 !important;
  background-image: none !important;
  color: #4a7c2a !important;
}

.notification-dropdown-link:hover i,
.notification-dropdown-link:focus i,
#notificationDropdown > a.nav-link:hover i,
#notificationDropdown > a.nav-link:focus i,
.header .dropdown#notificationDropdown > a.nav-link:hover i,
.header .dropdown#notificationDropdown > a.nav-link:focus i {
  color: #4a7c2a !important;
}

/* Custom DataTables Length Menu Dropdown - Global Styles */
.custom-length-dropdown {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  z-index: 1;
}

.custom-dropdown-button {
  position: relative;
  padding: 0.375rem 1.5rem 0.375rem 0.5rem;
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  cursor: pointer;
  user-select: none;
  min-width: 50px;
  width: auto;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #495057;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  pointer-events: auto;
  z-index: 1;
}

.custom-dropdown-button:hover {
  border-color: #adb5bd;
}

.custom-dropdown-button:focus {
  outline: none;
  border-color: #adb5bd;
  box-shadow: 0 0 0 0.2rem rgba(173, 181, 189, 0.25);
}

.custom-dropdown-button .dropdown-arrow {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #6c757d;
  pointer-events: none;
}

.custom-dropdown-menu {
  position: fixed;
  z-index: 1050;
  display: none;
  min-width: 80px;
  padding: 0.25rem 0;
  margin: 0;
  background-color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 0.25rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  max-height: 200px;
  overflow-y: auto;
}

.custom-length-dropdown.open .custom-dropdown-menu {
  display: block !important;
}

.custom-dropdown-item {
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: #212529;
  transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.custom-dropdown-item:hover {
  background-color: #d4edda !important;
  color: #155724 !important;
}

.custom-dropdown-item.selected {
  background-color: #d4edda;
  color: #155724;
  font-weight: 500;
}

/* Hide native select but keep it functional */
.dataTables_wrapper .dataTables_length select {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}

/* Ensure custom dropdown is positioned correctly */
.dataTables_wrapper .dataTables_length {
  position: relative;
  overflow: visible !important;
}

/* Prevent clipping of dropdown menu - aggressive fixes */
.dataTables_wrapper {
  overflow: visible !important;
}

.dataTables_wrapper .row:first-child {
  overflow: visible !important;
}

.dataTables_wrapper .row:first-child > div {
  overflow: visible !important;
}

/* Ensure table-responsive doesn't clip dropdown in length menu area */
/* Only apply overflow visible to the length menu row, not the entire table */
.table-responsive .dataTables_wrapper .row:first-child,
.table-responsive .dataTables_wrapper .row:first-child > div {
  overflow: visible !important;
  position: relative !important;
}

.table-responsive .dataTables_wrapper {
  overflow: visible !important;
}

.table-responsive .dataTables_wrapper .row:first-child {
  overflow: visible !important;
}

/* Ensure card doesn't clip dropdown in length menu area */
.card {
  overflow: visible !important;
}

.card .dataTables_wrapper {
  overflow: visible !important;
}

.card .dataTables_wrapper .row:first-child {
  overflow: visible !important;
}

.card-body {
  overflow: visible !important;
}

.card-body .dataTables_wrapper {
  overflow: visible !important;
}

.card-body .dataTables_wrapper .row:first-child {
  overflow: visible !important;
}

/* Ensure page containers don't clip */
.page-main {
  overflow: visible !important;
}

.container-fluid {
  overflow: visible !important;
}

/* When modal is open, ensure dropdown is below modal backdrop */
body.modal-open .custom-dropdown-menu {
  z-index: 1040 !important;
}

/* Close dropdown when modal opens */
body.modal-open .custom-length-dropdown {
  z-index: 1 !important;
}

body.modal-open .custom-length-dropdown.open .custom-dropdown-menu {
  display: none !important;
}

/* Make sure label text is visible */
.dataTables_wrapper .dataTables_length label {
  margin-right: 0.5rem;
}

/* Fix duplicate close icon in ALL modals - Global Fix */
.modal .close::before,
.modal .close::after {
  display: none !important;
  content: none !important;
}

.modal .close span {
  display: inline-block !important;
}

.modal .close {
  font-size: 1.5rem !important;
  line-height: 1 !important;
  font-weight: 700 !important;
}

/* Fix duplicate close icon in ALL alert boxes - Global Fix */
.alert .close::before,
.alert .close::after {
  display: none !important;
  content: none !important;
}

.alert .close span {
  display: inline-block !important;
}

.alert .close {
  font-size: 1.5rem !important;
  line-height: 1 !important;
  font-weight: 700 !important;
}
