.loader-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9); /* Light overlay */
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  transition: opacity 0.3s ease-in-out;
  opacity: 1;
}

#loader {
  width: 4.8px;
  height: 4.8px;
  display: block;
  margin: 20px auto;
  position: relative;
  border-radius: 4px;
  color: #115109;
  background: currentColor;
  box-sizing: border-box;
  animation: animloader 0.3s 0.3s linear infinite alternate;
}
#loader::after,
#loader::before {
  content: "";
  box-sizing: border-box;
  width: 4.8px;
  height: 4.8px;
  border-radius: 4px;
  background: currentColor;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 15px;
  animation: animloader 0.3s 0.45s linear infinite alternate;
}
#loader::after {
  top: -15px;
  animation-delay: 0s;
}

@keyframes animloader {
  0% {
    width: 4.8px;
  }
  100% {
    width: 48px;
  }
}

.custom-bg-sidebar {
  background-color: #4e73df;
  background-image: linear-gradient(180deg, #4e73df 10%, #224abe 100%);
  background-size: cover;
}

.custom-bg-sidebar-header {
  background-color: #4e73df;
  background-size: cover;
}

/* Toast */
.colored-toast.swal2-icon-success {
  background-color: #a5dc86 !important;
}

.colored-toast.swal2-icon-error {
  background-color: #f27474 !important;
}

.colored-toast.swal2-icon-warning {
  background-color: #f8bb86 !important;
}

.colored-toast.swal2-icon-info {
  background-color: #0dcaf0 !important;
}

.colored-toast.swal2-icon-question {
  background-color: #87adbd !important;
}

.colored-toast .swal2-title {
  color: white;
}

.colored-toast .swal2-close {
  color: white;
}

.colored-toast .swal2-html-container {
  color: white;
}

/* Toast end */

.long-button {
  width: 800px; /* or a percentage like 80% */
  max-width: 100%; /* Ensures responsiveness */
  height: 35px;
  font-size: 14px;
  border-radius: 8px; /* Optional for rounded edges */
}

/* Datatable page entry text */
div .dt-length .dt-input {
  margin-right: 5px !important;
}

/* Navbar alingment */
/* Ensure Navigation Items Wrap */
.nav-item {
  display: block; /* Ensure items are treated as block elements */
  padding: 10px 15px;
}

.nav-item a {
  display: flex;
  align-items: center;
  width: 100%;
  text-decoration: none;
  overflow: hidden; /* Prevent horizontal scrolling */
}

.nav-item p {
  display: block; /* Ensure the title behaves like a block element */
  margin: 0;
  white-space: normal; /* Allow text to wrap */
  word-break: break-word; /* Break long words */
  overflow: visible; /* Allow content to expand */
  line-height: 1.2; /* Adjust spacing for readability */
  font-size: 14px;
}

/* Fix for Collapsible Items */
.collapse {
  margin-left: 15px; /* Optional slight indent for collapsed items */
}

.collapse.show p {
  white-space: normal; /* Ensure expanded items wrap */
}

/* Submenu Styles */
.submenu {
  padding-left: 20px; /* Indent submenu items */
}

.submenu p {
  font-size: 12px; /* Smaller font size for submenus */
  white-space: normal; /* Allow wrapping in submenus */
  word-break: break-word; /* Handle long submenu titles */
}
.nav-item p {
  max-width: 250px; /* Set a reasonable width for wrapping */
  width: 100%; /* Ensure it takes full space */
}
.nav-item a,
.nav-item p {
  white-space: normal !important; /* Force wrapping, overriding Bootstrap styles */
  word-break: break-word !important; /* Force breaking long words */
  overflow: visible !important; /* Ensure visibility of wrapped text */
}
/* Navbar alingment END*/

/* Success Alert */
.custom-alert-success {
  background-color: #d1e7dd;
  color: #0f5132;
}
.custom-notice-icon-success {
  color: #0f5132;
}

/* Info Alert */
.custom-alert-info {
  background-color: #cfe2ff;
  color: #084298;
}
.custom-notice-icon-info {
  color: #084298;
}

/* Warning Alert */
.custom-alert-warning {
  background-color: #fff3cd;
  color: #664d03;
}
.custom-notice-icon-warning {
  color: #664d03;
}

/* Danger Alert */
.custom-alert-danger {
  background-color: #f8d7da;
  color: #842029;
}
.custom-notice-icon-danger {
  color: #842029;
}

/* tabs */
.nav-tabs .nav-link {
  margin-right: 10px !important; /* Updated margin-right */
}

/* datatable fix columns */
th,
td {
  white-space: nowrap;
}

/* use this instead of readonly or disabled */
.custom_disabled {
  pointer-events: none; /* Prevents clicking/focus */
  background-color: #e9ecef; /* Typically a disabled/readonly color */
}

/* Wrapping and See More Button for DataTable Actions */
.wrap-actions {
  min-width: 260px;
  max-width: 500px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3; /* Limit to 3 lines */
  line-clamp: 3; /* Standard property for compatibility */
  -webkit-box-orient: vertical;
}

.wrap-actions.expanded {
  -webkit-line-clamp: unset; /* Remove line limit */
  line-clamp: unset; /* Standard property for compatibility */
}

.see-more-btn {
  color: blue;
  cursor: pointer;
  font-size: 12px;
  display: inline-block;
  margin-top: 2px;
}

/* Scope ul and li to wrap-actions to avoid global overrides */
.wrap-actions ul {
  padding-left: 1rem;
  margin: 0;
}

.wrap-actions li {
  margin-bottom: 2px;
  white-space: normal;
  overflow-wrap: break-word;
}

/*
  Modal Scrolling Fix
  - Forces the modal body to be the scrollable container when its content
    (like many routes or error messages) exceeds the viewport height.
*/
#forward_modal .modal-body {
    max-height: calc(100vh - 210px); /* 100vh = viewport height. 210px = approximate header/footer/margin height */
    overflow-y: auto;
}

/* Password Change */
.password-requirements {
  background-color: #f8f9fa;
  border-radius: 0.375rem;
  padding: 0.75rem;
  border: 1px solid #dee2e6;
}

.requirement {
  margin-bottom: 0.25rem;
  transition: color 0.2s ease;
}

.requirement.valid {
  color: #198754;
}

.requirement.valid i {
  color: #198754 !important;
}

.requirement.invalid {
  color: #6c757d;
}

.requirement.invalid i {
  color: #6c757d !important;
}

.btn-loading {
  display: none;
}

.btn-loading.d-none {
  display: none !important;
}

.btn-loading:not(.d-none) {
  display: inline-block !important;
}

.btn-text.d-none {
  display: none !important;
}

.input-group .form-control:focus {
  z-index: 3;
}

.input-group .btn:focus {
  z-index: 4;
}

  .dt-details{
    padding:.75rem 1rem;
    background:#fafafa;
    border-top:1px solid #eee;
  }
  .dt-details__grid{
    display:grid;
    gap:.75rem;
    grid-template-columns: 1fr; /* phones */
  }
  @media (min-width: 768px){
    .dt-details__grid{ grid-template-columns: 1fr 1fr; } /* md+ */
  }
  .dt-details__item{ min-width:0 }
  .dt-details__label{
    font-size:.75rem; color:#6c757d;
    text-transform:uppercase; letter-spacing:.02em;
    margin-bottom:.15rem;
  }
  .dt-details__value{ word-break:break-word; }
  /* Optional: nicer “See more” */
  .wrap-actions-container .see-more-btn{
    cursor:pointer; display:inline-block; margin-top:.25rem;
    font-size:.85rem; color:#0d6efd;
  }
  .wrap-actions.expanded ul{ max-height:none; }
  .wrap-actions ul{
    margin:0; padding-left:1.2rem; list-style:disc;
    max-height:5.5em; overflow:hidden;
  }

  /* Let the DataTables child cell wrap text */
#receive_doc_dt td.child {
  white-space: normal !important;
}

/* Make the two grid columns shrink instead of overflowing */
@media (min-width:768px){
  .dt-details__grid{
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  }
}

/* Ensure items can actually shrink & wrap */
.dt-details__item,
.dt-details__label,
.dt-details__value {
  min-width: 0;
}

.dt-details__value{
  overflow-wrap: anywhere;   /* break long words/URLs */
  word-break: break-word;    /* fallback */
  hyphens: auto;
}

/* Just in case any utility added nowrap to labels */
.dt-details__label { white-space: normal; }

.dataTables_wrapper .dataTables_scrollBody #receive_doc_dt tr.child td.child {
  white-space: normal !important;
}

/* two shrinkable columns on md+ */
@media (min-width:768px){
  .dt-details__grid{
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  }
}

/* allow contents to shrink & wrap */
.dt-details__item,
.dt-details__label,
.dt-details__value{
  min-width: 0;
}

.dt-details__value{
  overflow-wrap:anywhere;  /* break long words/URLs */
  word-break:break-word;   /* fallback */
  hyphens:auto;
  white-space:normal;
}

/* safety: ensure labels don’t inherit nowrap from anywhere */
.dt-details__label{ white-space: normal; }

/* (optional) make the container block-level and full width */
.dataTables_wrapper .dataTables_scrollBody #receive_doc_dt tr.child td.child > .dt-details{
  display:block;
  width:100%;
  box-sizing:border-box;
}
  #receive_doc_dt .form-check-input[type="checkbox"] {
  border: 2px solid black;   /* black border */
  width: 18px;
  height: 18px;
  cursor: pointer;
  }

  /* Keep the black border even when checked */
  #receive_doc_dt .form-check-input[type="checkbox"]:checked {
    background-color: #007bff; /* your blue fill */
    border-color: black;       /* force black border */
  }
