/* ───────────────────────── Z-INDEX FIXES (keep on top of file) ───────────────────────── */
:root{
  --zindex-sidenav:           1030;  /* below modal */
  --zindex-modal-backdrop:    1050;  /* below modal */
  --zindex-modal:             1055;  /* above backdrop */
  --zindex-swal:              2000;  /* above everything */
}

/* Side nav (Material Dashboard uses aside.sidenav / .navbar-vertical) */
aside.sidenav,
.navbar-vertical{
  z-index: var(--zindex-sidenav) !important;
}

/* Modal & Backdrop */
.modal{
  z-index: var(--zindex-modal) !important;
}
.modal-backdrop{
  z-index: var(--zindex-modal-backdrop) !important;
}

/* SweetAlert2 on top */
.swal2-container{
  z-index: var(--zindex-swal) !important;
}
.swal2-container.swal2-top-end,
.swal2-container.swal2-top-start,
.swal2-container.swal2-top,
.swal2-container.swal2-center,
.swal2-container.swal2-bottom,
.swal2-container.swal2-bottom-end,
.swal2-container.swal2-bottom-start{
  z-index: var(--zindex-swal) !important;
}
/* ───────────────────────── END Z-INDEX FIXES ───────────────────────── */


.animate__animated {
    animation-duration: 0.5s !important;
    /* Makes animations superfast */
}

.card .card-header {
    padding: 0.5em 1.5rem;
    border-bottom: 1px dashed;
}

#rolePermissionTabs {
    border-radius: 12px;
    ;
}

.form-outline {
    position: relative;
}

.form-outline label {
    position: absolute;
    top: 50%;
    left: 0.75rem;
    /* Ensure it is inside the border */
    transform: translateY(-50%);
    background: transparent;
    /* Transparent initially */
    padding: 0 0.25rem;
    color: #6c757d;
    transition: all 0.2s ease-in-out;
    font-size: 0.875rem;
    z-index: 1;
}

.form-outline input:focus+label,
.form-outline textarea:focus+label,
.form-outline select:focus+label,
.form-outline input:not(:placeholder-shown)+label,
.form-outline textarea:not(:placeholder-shown)+label,
.form-outline select:not([value=""])+label {
    top: 0px;
    /* Move above the field */
    left: 0.5rem;
    /* Slightly adjust to fit inside the border */
    font-size: 0.75rem;
    color: #686868;
    /* Highlighted color */
    background: white;
    /* Add a white background when label moves up */
    padding: 0 0.25rem;
    /* Add padding to avoid label text touching border */
}

.form-outline input,
.form-outline textarea,
.form-outline select {
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    width: 100%;
    font-size: 1rem;
    padding: 1.25rem 0.75rem 0.375rem;
    /* Add padding for select to match other inputs */
    background-color: white;
}

.form-outline input:focus,
.form-outline textarea:focus,
.form-outline select:focus {
    border-color: #0d6efd;
    /* Highlighted border on focus */
    outline: none;
}

.form-outline select {
    appearance: none;
    /* Remove default dropdown arrow for consistency */
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%230d6efd" class="bi bi-caret-down-fill" viewBox="0 0 16 16"><path d="M7.247 11.14l-4.796-5.481A1 1 0 0 1 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.481a1 1 0 0 1-1.506 0z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.ui-autocomplete {
    z-index: 1055 !important;
}

 /* For Chrome, Edge, Safari */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.dropdown-item:hover {
            cursor: pointer;
        }
/* For Firefox */
input[type="number"] {
    -moz-appearance: textfield;
}

.bootstrap-tagsinput {
    display: block;
    width: 100%;
    padding: 0.5rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.bootstrap-tagsinput .tag {
    margin-right: 0.2rem;
    color: #fff;
    background-color: #007bff;
    border-radius: 0.25rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.875rem;
}

.bootstrap-tagsinput .tag [data-role="remove"] {
    margin-left: 0.5rem;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    vertical-align: middle;
}

.bootstrap-tagsinput input {
    border: none;
    outline: none;
    box-shadow: none;
    width: auto;
    max-width: inherit;
}

.tt-menu {
    width: 100%;
    background-color: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1050;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
}

.tt-suggestion {
    padding: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #333333;
}

.tt-suggestion.tt-cursor {
    background-color: #007bff;
    color: #ffffff;
}

.tt-suggestion-item {
    font-weight: 500;
}

.dropdown:not(.dropdown-hover) .dropdown-menu {
    margin-top: 5px !important;
}

aside {
    overflow: scroll;
    /* Enables scrolling */
    scrollbar-width: none;
    /* Hides scrollbar for Firefox */
    -ms-overflow-style: none;
    /* Hides scrollbar for Internet Explorer and Edge */
}

aside::-webkit-scrollbar {
    display: none;
    /* Hides scrollbar for Chrome, Safari, and Edge */
}

.select-with-transition {
    margin-bottom: 0;
}

ul.dropdown-menu {
    border: 1px solid #ccc;
}

.bootstrap-select .dropdown-menu.show {
    display: block !important;
}

.bootstrap-select .dropdown-menu:not(.show) {
    display: none !important;
}
.form-control{
    box-shadow: 1px 1px 4px #ccc !important;
}
.navbar-vertical .navbar-nav .nav-item .collapse .nav .nav-item .nav-link.active, .navbar-vertical .navbar-nav .nav-item .collapsing .nav .nav-item .nav-link.active {
    background: #efefef;
    margin-top: 4px;
}
.navbar-vertical .navbar-nav .nav-item .collapse .nav .nav-item .nav-link, .navbar-vertical .navbar-nav .nav-item .collapsing .nav .nav-item .nav-link{
    color: rgba(33, 37, 41, 1) !important;
}
.navbar-vertical .navbar-nav .nav-link{
    color: rgba(33, 37, 41, 1) !important;

}
 /* Ensure proper z-index for Bootstrap select dropdown */
 .bootstrap-select .dropdown-menu {
    z-index: 1050 !important;
    /* Default Bootstrap z-index for modals */
}

/* Optional: Force dropdown menu to be hidden when not active */
.bootstrap-select .dropdown-menu.show {
    display: block !important;
}

.bootstrap-select .dropdown-menu:not(.show) {
    display: none !important;
}
/* .form-control{
    box-shadow: 1px 1px 4px #ccc !important;
} */
.form-control{
    box-shadow: unset !important;
}
.dropdown.bootstrap-select .dropdown-toggle{
    border: 1px solid #d2d6da;
}
.bootstrap-select .dropdown-toggle {
    box-shadow: none !important;
}

/* Ensure the tags input container fits the form styling */
.bootstrap-tagsinput {
    width: 100%;
    min-height: 38px;
    border: 1px solid #ced4da;
    border-radius: .25rem;
    padding: .375rem .75rem;
    background-color: #fff;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
}

/* Style individual tags for a pill-like look */
.bootstrap-tagsinput .tag {
    background-color: #005764;
    padding: 0.25rem 0.5rem;
    border-radius: .2rem;
    margin-right: 2px;
    color: #fff;
}

/* Remove the default input border from the inner input field */
.bootstrap-tagsinput input {
    border: none;
    outline: none;
    box-shadow: none;
}
.input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback){
    border: 1px solid #d2d6da !important;
    border-radius: 0 0.5rem 0.5rem 0 !important;
    padding-left: 1em;
}
/* .table tbody tr:last-child td {
    border-width: thin !important;
}  */
.modal{
    z-index: var(--zindex-modal) !important; /* corrected from 9999 to 1055 */
}
/* keep your 100% max-width */
.bootstrap-select .dropdown-menu {
    max-width: 100% !important;
  }
  .bootstrap-select .dropdown-menu .inner li a,
  .bootstrap-select .dropdown-menu .dropdown-item {
    white-space: normal !important;
    word-wrap: break-word !important;
    /* word-break: break-word !important; */
  }
  .wrap-text {
    white-space: normal !important;
    word-wrap: break-word !important;
}
body.g-sidenav-hidden .profileFullname {
    display: none !important;
  }
  
  /* otherwise, make sure it’s visible */
  body:not(.g-sidenav-hidden) .profileFullname {
    display: block;
  }
  .simple-datatables .dataTable-pagination {
  white-space: nowrap;
}

/* ─── Table Container ─── */
table.dataTable {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0;
  background-color: #ffffff;
  border-radius: 10px;
  /* overflow: hidden; */
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  position: relative;
  isolation: isolate;
}
.dataTables_scrollBody{
    overflow: visible !important;
}
/* ─── Header with Glass Morphism Effect ─── */
table.dataTable thead th {
  background: rgba(52, 71, 103, 0.98) !important;
  backdrop-filter: blur(6px);
  color: #ffffff !important;
  font-weight: 600;
  padding: 1rem 1.25rem;
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  /* position: sticky; */
  top: 0;
  z-index: 10;
  transition: all 0.3s ease;
  border-bottom: none;
}

table.dataTable thead th:not(:last-child) {
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

table.dataTable thead th:hover {
  background: rgba(42, 61, 93, 0.98) !important;
}

/* ─── Sorting Indicators ─── */
table.dataTable thead th.sorting:after,
table.dataTable thead th.sorting_asc:after,
table.dataTable thead th.sorting_desc:after {
  content: "";
  font-family: "Font Awesome 6 Pro";
  font-weight: 900;
  margin-left: 8px;
  display: inline-block;
  vertical-align: middle;
  opacity: 0.7;
  transition: all 0.2s ease;
}

table.dataTable thead th.sorting:after {
  content: "\f0dc";
  color: rgba(255, 255, 255, 0.5);
}

table.dataTable thead th.sorting_asc:after {
  content: "\f0de";
  color: #ffffff;
}

table.dataTable thead th.sorting_desc:after {
  content: "\f0dd";
  color: #ffffff;
}

/* ─── Body Cells with Subtle Transitions ─── */
table.dataTable tbody td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  font-size: 0.9rem;
  color: #444444;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

/* ─── Zebra Striping with Soft Colors ─── */
table.dataTable tbody tr:nth-child(even) {
  background-color: rgba(250, 250, 250, 0.7);
}

/* ─── Elegant Row Hover Effect ─── */
table.dataTable tbody tr {
  transition: all 0.3s ease;
}

table.dataTable tbody tr:hover {
  background-color: rgba(251, 99, 64, 0.03);
  /* transform: translateX(2px); */
}

table.dataTable tbody tr:hover td {
  color: #344767;
}

table.dataTable tbody tr:hover td:first-child {
  border-left: 3px solid #fb6340;
  padding-left: 1.1rem;
}

/* ─── Search & Length Controls ─── */
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length {
  margin-bottom: 1.5rem;
}

.dataTables_wrapper .dataTables_filter {
  float: right;
}

.dataTables_wrapper .dataTables_filter input {
  height: 2.5rem;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background-color: #fff;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 1rem center;
  background-size: 1rem;
  width: 280px;
}

.dataTables_wrapper .dataTables_filter input:focus {
  border-color: #fb6340;
  box-shadow: 0 2px 12px rgba(251, 99, 64, 0.15);
  outline: none;
}

.dataTables_wrapper .dataTables_length select {
  height: 2.5rem;
  padding: 0.5rem 2rem 0.5rem 1rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background-color: #fff;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}

.dataTables_wrapper .dataTables_length select:focus {
  border-color: #fb6340;
  box-shadow: 0 2px 12px rgba(251, 99, 64, 0.15);
  outline: none;
}

/* ─── Info Text with Modern Typography ─── */
.dataTables_wrapper .dataTables_info {
  font-size: 0.85rem;
  color: #666;
  padding: 0.75rem 0;
  font-feature-settings: "tnum";
}

/* ─── Premium Pagination ─── */
.dataTables_wrapper .dataTables_paginate {
  margin-top: 1.5rem;
  text-align: right;
}

.dataTables_wrapper .paginate_button {
  background: #ffffff !important;
  color: #555 !important;
  /* border: 1px solid rgba(0, 0, 0, 0.08) !important; */
  border-radius: 8px !important;
  padding: 0.6rem 0 !important;
  margin: 0 0.25rem !important;
  min-width: 40px;
  height: 40px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.dataTables_wrapper .paginate_button:hover {
  background-color: rgba(251, 99, 64, 0.1) !important;
  color: #fb6340 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  border-color: transparent !important;
}

.dataTables_wrapper .paginate_button.current {
  background: linear-gradient(135deg, #fb6340 0%, #fbb140 100%) !important;
  box-shadow: 0 4px 12px rgba(251, 99, 64, 0.25) !important;
  color: #fff !important;
  border: none !important;
  transform: translateY(-1px);
}

.dataTables_wrapper .paginate_button.current:hover {
  opacity: 0.9;
}

.dataTables_wrapper .paginate_button.disabled,
.dataTables_wrapper .paginate_button.disabled:hover {
  background: rgba(0, 0, 0, 0.02) !important;
  color: #ccc !important;
  cursor: default;
  transform: none;
  box-shadow: none;
  border-color: rgba(0, 0, 0, 0.05) !important;
}

/* ─── Responsive Wrapper with Custom Scrollbar ─── */
.table-responsive {
  overflow-x: auto;
  border-radius: 10px;
  padding: 2px;
}

@media (min-width: 768px) {
  .table-responsive::-webkit-scrollbar {
    height: 8px;
  }
  
  .table-responsive::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 4px;
  }
  
  .table-responsive::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
  }
  
  .table-responsive::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
  }
}

/* ─── Empty State Design ─── */
.dataTables_empty {
  padding: 3rem;
  text-align: center;
  color: #999;
  font-size: 0.95rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 24 24' fill='none' stroke='%23eee' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'%3E%3C/path%3E%3C/svg%3E") no-repeat center 2rem;
  background-size: 64px;
  padding-top: 8rem;
}

/* ─── Loading Overlay ─── */
.dataTables_processing {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  padding: 1.5rem 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.05);
  z-index: 100;
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  color: #fb6340;
  font-weight: 500;
}

.dataTables_processing:after {
  content: "";
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(251, 99, 64, 0.2);
  border-radius: 50%;
  border-top-color: #fb6340;
  margin-left: 0.75rem;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
/* .table-bordered > :not(caption) > * > * {
    border-width: 0;
} */
.navbar-vertical.navbar-expand-xs .navbar-collapse{
    overflow: hidden;
}
/* Fix Bootstrap Select background color */
.bootstrap-select .dropdown-toggle {
    background-color: #fff !important;
    color: #344767;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    box-shadow: none !important;
}

/* Hover & focus state fix */
.bootstrap-select .dropdown-toggle:hover,
.bootstrap-select .dropdown-toggle:focus {
    background-color: #f8f9fa !important;
    border-color: #86b7fe;
}
.input-group .bootstrap-select.form-control .dropdown-toggle{
      margin-bottom: 0;  
}
.btn.dropdown-toggle{
    height: 3em;
}
.input-group .dropdown{
   max-width: 7em;
}
.dataTables_filter, .dataTables_length, .dt-buttons .btn{
    margin-bottom: 0 !important;
}

.btn.dropdown-toggle{
    margin-bottom: 0;
}

.swal2-actions.swal2-actions-gap {
  display: flex;           
  gap: 0.5rem;        
  padding: 0 .25rem;    
}

.swal2-actions.swal2-actions-gap .swal2-confirm,
.swal2-actions.swal2-actions-gap .swal2-cancel {
  margin: 0 .25rem;
}

/* Force scrollbar to be always visible */
.sidenav {
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: #666 #f1f1f1; /* Firefox */
}

/* WebKit browsers (Chrome, Safari, Edge) */
.sidenav::-webkit-scrollbar {
    width: 8px !important;
    display: block !important;
}

.sidenav::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
    border-radius: 4px;
}

.sidenav::-webkit-scrollbar-thumb {
    background: #666 !important;
    border-radius: 4px;
}

.sidenav::-webkit-scrollbar-thumb:hover {
    background: #555 !important;
}

/* Ensure proper overflow settings */
.sidenav {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: 100vh !important;
}

/* Specifically target the navbar-collapse for menu items */
.sidenav .navbar-collapse {
    overflow-y: auto !important;
    max-height: calc(100vh - 100px) !important;
}