/* ============================================
   Custom Styling
   ============================================ */

/* ===== General ===== */

:root {
    --primary-blue: #1A1B2E;
    --border-radius: 8px !important;
    --text-link-hover-color: #596882 !important;
    --fc-small-font-size: .85em;
    --fc-page-bg-color: #fff;
    --fc-neutral-bg-color: hsla(0,0%,82%,.3);
    --fc-neutral-text-color: grey;
    --fc-border-color: #ddd;
    --fc-button-text-color: #000;
    --fc-button-bg-color: #cdd4e0;
    --fc-button-border-color: var(--fc-button-bg-color);
    --fc-button-hover-bg-color: #d5dae5;
    --fc-button-hover-border-color: var(--fc-button-hover-bg-color);
    --fc-button-active-bg-color: #bfc6d4;
    --fc-button-active-border-color: var(--fc-button-active-bg-color);
    --fc-event-bg-color: #a2c6ff;
    --fc-event-border-color: var(--fc-event-bg-color);
    --fc-event-text-color: #000;
    --fc-event-selected-overlay-color: rgba(0,0,0,.25);
    --fc-more-link-bg-color: #d0d0d0;
    --fc-more-link-text-color: inherit;
    --fc-event-resizer-thickness: 8px;
    --fc-event-resizer-dot-total-width: 8px;
    --fc-event-resizer-dot-border-width: 1px;
    --fc-non-business-color: hsla(0,0%,84%,.3);
    --fc-bg-event-color: #8fdf82;
    --fc-bg-event-opacity: 0.3;
    --fc-highlight-color: rgb(196 203 214 / 30%);
    --fc-today-bg-color: transparent;
    --fc-now-indicator-color: #dc3545;
}

.icon-before-text {
    margin-right: 4px;
}

.fc .fc-button-primary:focus,
.fc .fc-button:focus,
.fc .fc-button-primary:not(:disabled):active:focus,
.fc .fc-button-primary:not(:disabled).fc-button-active:focus {
  box-shadow: none;
}

/* ============================================
   Custom Buttons
   ============================================ */

/* Base button reset for custom buttons */
.primary-btn,
.secondary-btn,
.danger-btn,
.primary-btn-outline,
.secondary-btn-outline,
.danger-btn-outline {
  display: inline-block;
  padding: 7px 17px;
  border-radius: var(--border-radius);
  font-weight: 400;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 575.98px) {
  /* Styles for extra small screens (<576px) */
  .primary-btn,
  .secondary-btn,
  .danger-btn,
  .primary-btn-outline,
  .secondary-btn-outline,
  .danger-btn-outline {
    padding: 7px 12px;
  }
}

/* Primary */
.primary-btn {
  background-color: var(--primary-blue);
  color: #fff;
}

.primary-btn:hover,
.primary-btn:focus {
  background-color: #2e304d;
  color: #fff;
}

/* Make active state slightly different from hover for solid primary */
.primary-btn:active {
  background-color: #1f2238; /* darker than hover for clear click feedback */
  color: #fff;
}

/* Disabled state for primary button */
.primary-btn:disabled,
.primary-btn.disabled {
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none;
  background-color: var(--primary-blue);
  color: #fff;
}

.primary-btn-outline {
  background-color: transparent;
  color: var(--primary-blue);
  border-color: var(--primary-blue);
}

.primary-btn-outline:hover {
  background-color: var(--primary-blue);
  color: #fff;
  border-color: var(--primary-blue);
}

/* Secondary */
.secondary-btn {
  background-color: #cdd4e0;
  color: #000;
}

.secondary-btn:hover,
.secondary-btn:focus {
  background-color: #d5dae5;
  color: #000;
}

.secondary-btn:active {
  background-color: #bfc6d4; /* darker than base for click feedback */
  color: #000;
}

.secondary-btn-outline {
  background-color: transparent;
  color: #6c757d;
  border-color: #cdd4e0;
}

.secondary-btn-outline:hover {
  background-color: #cdd4e0;
  color: #000;
  border-color: #cdd4e0;
}

/* .primary-btn i,
.secondary-btn i,
.danger-btn i,
.primary-btn-outline i,
.secondary-btn-outline i,
.danger-btn-outline i {
  margin-right: 4px;
} */
 
/* Danger */
.danger-btn {
  background-color: #dc3545;
  color: #fff;
}

.danger-btn:hover,
.danger-btn:focus {
  background-color: #bb2d3b;
  color: #fff;
}

.danger-btn:active {
  background-color: #a52834; /* darker than hover for click feedback */
  color: #fff;
}

.danger-btn-outline {
  background-color: transparent;
  color: #dc3545;
  border-color: #dc3545;
}

.danger-btn-outline:hover {
  background-color: #dc3545;
  color: #fff;
  border-color: #dc3545;
}

/* Focus-visible rings for accessibility/clarity */
.primary-btn:focus-visible,
.primary-btn-outline:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(26, 27, 46, 0.25);
}

.secondary-btn:focus-visible,
.secondary-btn-outline:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(205, 212, 224, 0.6);
}

.danger-btn:focus-visible,
.danger-btn-outline:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.35);
}

/* ============================================
   Sub Search Styling
   ============================================ */

.sub-search-input {
  border-color: #e3e7ed;
  border-width: 2px;
  height: 37px;
  padding-right: 40px;
  font-size: 13px;
  min-width: 225px;
}

.sub-search-input:focus {
  border-color: #b4bdce;
}

.sub-search-icon {
  position: absolute;
  top: 6px;
  right: 0;
  background-color: transparent;
  color: #b4bdce;
  font-size: 16px;
  padding-right: 13px;
  border: none;
}

/* ============================================
   Bootstrap Overrides/Fixes
   ============================================ */

/* ===== Forms ===== */

.form-group {
    margin-bottom: 0.65rem;
}

.form-label {
  margin-bottom: 2px;
}

.form-select {
  height: 38px;
}

.form-select:focus {
  border-color: #97a3b9;
  box-shadow: none;
}

.text-link {
  transition: color 0.1s ease-in-out;
}

.text-link:hover {
  color: var(--text-link-hover-color) !important;
}

.white-space-nowrap {
  white-space: nowrap !important;
}

/* ============================================
   Choices.js Custom Styling
   ============================================ */

/* Match Choices.js container with form-select styling */
.choices.form-select-wrapper {
  height: 38px;
  margin-bottom: 0;
}

.choices.form-select-wrapper .choices__inner {
  height: 38px;
  min-height: 38px;
  padding-left: 0.75rem;
  padding-top: 0.5rem;
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
  display: flex;
  align-items: center;
}

.choices.form-select-wrapper.is-focused .choices__inner {
  border-color: #97a3b9;
  box-shadow: none;
}

.choices.form-select-wrapper.is-open .choices__inner {
  border-color: #97a3b9;
  box-shadow: none;
  border-radius: 0.5rem 0.5rem 0 0;
}

/* Dropdown list styling */
.choices__list--dropdown,
.choices__list[aria-expanded] {
  border-color: #ced4da;
  border-radius: 0 0 0.5rem 0.5rem;
  box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.15);
  margin-top: -1px; /* Pull up to overlap with select border */
  z-index: 1050 !important; /* Ensure dropdown appears above error messages and other elements */
}

/* Ensure Choices.js container and dropdown are above error messages */
.choices.form-select-wrapper {
  position: relative;
  z-index: 1;
}

.choices.form-select-wrapper.is-open {
  z-index: 1051;
}

.choices.form-select-wrapper .choices__list--dropdown,
.choices.form-select-wrapper .choices__list[aria-expanded] {
  position: absolute;
  z-index: 1050 !important;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted,
.choices__list[aria-expanded] .choices__item--selectable.is-highlighted {
  background-color: #f8f9fa;
}

/* Search input styling */
.choices__input--cloned {
  border: none;
  padding: 8px 10px;
  font-size: 1rem;
}

.choices__input--cloned:focus {
  outline: none;
}

/* Ensure the selected item (choices__list--single) is properly aligned */
.choices.form-select-wrapper .choices__list--single {
  display: inline-block;
  padding: 0;
  width: 100%;
  overflow: hidden;
}

.choices.form-select-wrapper .choices__item.choices__item--selectable {
  display: block;
}

/* Disabled Choices.js styling to match disabled inputs */
.choices.is-disabled .choices__inner,
.choices.is-disabled .choices__input {
  background-color: #e3e7ed !important;
  cursor: default !important;
}

.choices.is-disabled .choices__item {
  cursor: default !important;
}

/* Prevent word breaking in the middle of words for Choices.js dropdown items */
.choices__list--dropdown .choices__item,
.choices__list[aria-expanded] .choices__item {
  word-break: normal !important;
  overflow-wrap: break-word !important;
  white-space: normal !important;
  hyphens: none !important;
}

/* Selected value display: truncate with ellipsis instead of wrapping */
.choices__list--single .choices__item {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  word-break: normal !important;
  padding-right: 20px !important; /* Space for dropdown arrow */
  max-width: 100%;
}

/* ============================================
   Azia Template Overrides/Fixes
   ============================================ */

/* ===== Forms ===== */

.az-content-dashboard-nine .az-content-header .nav-link:last-child,
.az-content-dashboard-nine .az-content-header .nav-link:nth-child(5), .az-content-dashboard-nine .az-content-header .nav-link:last-child {
  font-weight: 500;
}

.az-content-dashboard-nine .az-content-header .nav-link:nth-child(5) {
  margin-left: 25px;
}

.card-title {
  display: inline;
  font-size: 16px !important;
}

.az-profile-menu .dropdown-item i {
  font-size: 19px;
}

.az-profile-menu {
  margin-left: 0 !important;
}

/* Mobile Search Menu */
.az-search-menu {
  position: relative;
  margin-right: 12px;
}

.az-search-menu .az-search-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: #7987a1;
  text-decoration: none;
  transition: color 0.15s ease;
  outline: none;
}

.az-search-menu > .az-search-icon::before {
  content: "";
  position: absolute;
  bottom: -33px;
  left: 50%;
  margin-left: -7px;
  width: 14px;
  height: 14px;
  border: 2px solid transparent;
  border-top-color: #cdd4e0;
  border-left-color: #cdd4e0;
  transform: rotate(45deg);
  background-color: #fff;
  z-index: 901;
  display: none;
}

.az-search-menu .az-search-icon:hover,
.az-search-menu .az-search-icon:focus {
  color: #1c273c;
  text-decoration: none;
}

.az-search-menu .az-search-icon i {
  font-size: 23px;
}

.az-search-menu .dropdown-menu {
  background-color: #fff;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 15px 20px;
  border-width: 0;
  margin-top: 0;
  z-index: 900;
  border-radius: 0;
}

@media (min-width: 576px) {
  .az-search-menu .dropdown-menu {
    padding-top: 20px;
    position: absolute;
    top: 56px;
    left: auto;
    right: -10px;
    bottom: auto;
    width: 280px;
    border-color: #cdd4e0;
    border-width: 2px;
    border-radius: 8px;
  }
}

.az-search-menu .mobile-search-form {
  margin: 0;
}

.az-search-menu .mobile-search-form .position-relative {
  position: relative;
}

.az-search-menu .mobile-search-form .form-control {
  border-color: #e3e7ed;
  border-width: 2px;
  background-color: #fcfcfc;
  transition: none;
  height: 40px;
  padding-right: 45px;
}

.az-search-menu .mobile-search-form .form-control:focus {
  background-color: #fff;
  border-color: #b4bdce;
  box-shadow: none !important;
}

.az-search-menu .mobile-search-form .form-control:focus + .btn {
  color: #7987a1;
}

.az-search-menu .mobile-search-form .btn {
  position: absolute;
  top: 0;
  right: 0;
  background-color: transparent;
  height: 40px;
  color: #b4bdce;
  transition: none;
  font-size: 16px;
  padding-right: 13px;
  border: none;
}

.az-search-menu .mobile-search-form .btn:hover,
.az-search-menu .mobile-search-form .btn:focus {
  color: #1c273c;
}

@media (min-width: 576px) {
  .az-search-menu.show > .az-search-icon::before {
    display: block;
  }
}

.az-search-menu.show .dropdown-menu {
  display: block;
}

@media (min-width: 992px) {
  .az-search-menu > .az-search-icon::before {
    bottom: -30px;
  }
  
  .az-search-menu .dropdown-menu {
    top: 53px;
    right: -10px;
    left: auto;
  }
}

.az-header-dashboard-nine, .az-header {
  box-shadow: none !important;
  border-bottom: none !important;
}

@media (min-width: 992px) {
  .az-profile-menu > .az-img-user::before {
    bottom: -30px;
  }
  
  .az-profile-menu .dropdown-menu {
    top: 53px;
  }
  
  .az-header-notification > a::after {
    top: 44px;
  }
  
  .az-header-notification .dropdown-menu {
    top: 49px;
  }
}

/* Show az-header-center on medium screens and smaller for logo display */
@media (max-width: 991.98px) {
  .az-header-center {
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: 0;
  }
  
  .az-header-center .az-header-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
  }
  
  .az-header-center .header-logo {
    max-height: 34px;
    width: auto;
    height: auto;
    object-fit: contain;
  }
}

.az-content-dashboard-nine .az-content-title {
  font-size: 22px;
  letter-spacing: -0.3px;
}

.was-validated .form-select:invalid:focus,
.form-select.is-invalid:focus,
.input-form-select.parsley-error:focus,
.textarea-form-select.parsley-error:focus {
  box-shadow: none;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  background: none !important;
  border-radius: var(--border-radius) !important;
  background-color: #cdd4e0 !important;
  /* No border on base state to avoid visual borders */
  border: none !important;
  padding: 0 !important;
  min-width: 32px !important;
  min-height: 32px !important;
  align-content: center !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled, .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover, .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active {
  background-color: #eceff3 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current, .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background-color: var(--primary-blue) !important;
  color: rgba(255, 255, 255, 0.9) !important;
}

/* Force hovered pages and current page to use primary blue, remove borders and gradients */
.dataTables_wrapper .dataTables_paginate .paginate_button:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button:active {
  background-color: var(--primary-blue) !important;
  background-image: none !important;
  border: none !important;
  color: rgba(255, 255, 255, 0.9) !important;
  box-shadow: none !important;
}

/* Keep disabled buttons muted even on hover */
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:focus {
  background-color: #eceff3 !important;
  color: #6c757d !important;
  border: #eceff3 !important;
}

/* Global override for DataTables paginate buttons: ensure white text for current & hover */
body .dataTables_wrapper .dataTables_paginate .paginate_button.current,
body .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background-color: var(--primary-blue) !important;
  background-image: none !important;
  border: none !important;
  color: rgba(255, 255, 255, 0.9) !important;
}

body .dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.disabled):not(.current) {
  background-color: var(--primary-blue) !important;
  background-image: none !important;
  border: none !important;
  color: rgba(255, 255, 255, 0.9) !important;
}

.dropdown-item.active, .dropdown-item:active {
  background-color: #e2e2e2 !important;
  color: inherit !important;
}

.dropdown-menu-padding-fix {
  padding-top: 7px !important;
  padding-bottom: 7px !important;
}

.table-header-text {
  color: #7987a1 !important;
  font-weight: 700 !important;
  font-size: 0.8rem !important;
  letter-spacing: 0.5px !important;
  text-transform: uppercase !important;
  padding-bottom: 5px !important;
}

/* ============================================
   Header Height Override
   ============================================ */

@media (min-width: 992px) {
  .az-header {
    height: 54px !important;
  }
  
  .az-content-dashboard-nine {
    margin-top: 54px !important; /* Override Azia template default */
  }
}

/* ============================================
   Navigation Styling
   ============================================ */

/* ===== Logo ===== */

.main-logo {
  width: 250px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* Rounded boxes for logo previews/upload areas */
.logo-box-rounded {
  border-radius: var(--border-radius) !important;
  overflow: hidden;
}

.az-sidebar-header {
    padding: 10px 20px 0 20px;
}

/* ===== Navigation icon alignment ===== */
.az-sidebar .nav-link i {
    width: 20px;
    text-align: center;
    display: inline-block;
    margin-right: 12px;
    font-size: 17px;
}
/* ===== Profile Dropdown ===== */
.az-header-profile {
  padding: 0 0 20px 0;
}

/* ===== User Initial Avatar ===== */
.user-initial-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: var(--primary-blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  text-transform: uppercase;
}

.user-initial-avatar.large {
  width: 60px;
  height: 60px;
  font-size: 24px;
}

.az-header-profile .az-img-user {
  margin-bottom: 0;
  display: flex;
  justify-content: center;
  width: 70px;
  height: 85px;
}

/* ===== Fix for medium screen sidebar toggle ===== */
@media (min-width: 768px) and (max-width: 991.98px) {
  .az-sidebar-show {
    overflow: hidden;
  }
  .az-sidebar-show .az-sidebar {
    display: flex;
    overflow-y: auto;
    transform: translateX(0);
    visibility: visible;
    z-index: 1000;
  }
  .az-sidebar-show .az-content {
    transform: translateX(240px);
  }
  .az-sidebar-show .az-navbar-backdrop {
    visibility: visible;
    opacity: 1;
  }
}

/* ============================================
   History Tabs Styling
   ============================================ */

/* ===== History Toolbar ===== */

/* Hide history toolbar on small screens */
@media (max-width: 991.98px) {
  .history-toolbar {
    display: none !important;
  }
}

@media (min-width: 992px) {
  .history-toolbar {
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 4px 8px 8px 5px;
    margin-bottom: 0;
    position: fixed;
    top: 54px; /* Height of az-header */
    left: 220px; /* Account for sidebar width */
    right: 0;
    z-index: 99; /* Lower than header but above content */
    box-shadow: 0 0 15px rgba(28, 39, 60, 0.1);
  }
  
  /* When sidebar is hidden, move history toolbar to left edge */
  .az-sidebar-hide .history-toolbar {
    left: 0;
  }
}

@media (min-width: 1200px) {
  .history-toolbar {
    left: 240px; /* Account for wider sidebar */
  }
  
  /* When sidebar is hidden, move history toolbar to left edge */
  .az-sidebar-hide .history-toolbar {
    left: 0;
  }
}

.history-tabs-container {
  display: flex;
  align-items: end;
  gap: 8px;
  overflow-x: auto;
  padding: 0 15px;
  scrollbar-width: thin;
  scrollbar-color: #6c757d #f8f9fa;
}

.history-tabs-container::-webkit-scrollbar {
  height: 4px;
}

.history-tabs-container::-webkit-scrollbar-track {
  background: #f8f9fa;
}

.history-tabs-container::-webkit-scrollbar-thumb {
  background: #6c757d;
  border-radius: 2px;
}

.history-tabs-container::-webkit-scrollbar-thumb:hover {
  background: #495057;
}

.history-tab {
  display: inline-flex;
  align-items: center;
  background-color: #cdd4e0;
  border-radius: var(--border-radius);
  padding: 5px 10px;
  text-decoration: none;
  color: #000;
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
  transition: all 0.2s ease;
  position: relative;
  min-width: 0;
  flex-shrink: 0;
}

/* Hide tabs that don't fit within available width */
.history-tab.hidden {
  display: none !important;
}

.history-tab:hover {
  background-color: #d5dae5;
}

.history-tab i.fa-solid {
  margin-right: 5px;
  font-size: 12px;
}

.history-tab .dismiss-btn {
  margin-left: 6px;
  background: none;
  border: none;
  color: #000;
  font-size: 12px;
  padding: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.history-tab .dismiss-btn:hover {
  background-color: #eeeeee;
  color: #000;
  padding: 5px;
  border-radius: 50%;
}

.history-tabs-empty {
  color: #6c757d;
  font-size: 13px;
  font-style: italic;
  padding: 0 15px;
}


/* ===== Dynamic Content Margin Adjustment ===== */

.az-content-dashboard-nine {
  transition: margin-top 0.3s ease;
}

@media (min-width: 992px) {
  .az-content-dashboard-nine.with-history-toolbar {
    margin-top: 94px !important; /* 54px (header) + 40px (toolbar) */
  }
}

@media (max-width: 991.98px) {
  .az-content-dashboard-nine.with-history-toolbar {
    margin-top: 40px; /* Just toolbar height on mobile */
  }
}

/* ============================================
   Authentication Styling
   ============================================ */

/* ===== Login page ===== */

.az-card-signin {
    height: fit-content;
}

/* ============================================
   Search Inputs: hide native clear (X) buttons
   ============================================ */

/* WebKit/Blink (Chrome, Safari, Edge Chromium, Opera) */
input[type="search"] {
  -webkit-appearance: none;
          appearance: none;
}

input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
          appearance: none;
}

/* Legacy Edge/IE */
input[type="search"]::-ms-clear,
input[type="search"]::-ms-reveal {
  display: none;
  width: 0;
  height: 0;
}

/* ============================================
   Auto-expanding Textarea
   ============================================ */

.auto-expand-textarea {
  resize: none;
  overflow: hidden;
  min-height: calc(1.5em * 5 + 0.75rem + 2px); /* 5 rows default */
}

.auto-expand-textarea:focus {
  outline: none;
  box-shadow: none;
}

/* ============================================
   DataTables Table Header Styling
   ============================================ */

/* Make table header border thicker */
.dataTables_wrapper table.dataTable thead th,
.dataTables_wrapper table.dataTable thead td {
  border-bottom: 2px solid #cecece !important;
}

/* Ensure consistent styling for all table headers */
table.dataTable thead th,
table.dataTable thead td {
  border-bottom: 2px solid #cecece !important;
}

/* Remove DataTables sorting arrows (::before and ::after pseudo-elements) */
.dataTables_wrapper table.dataTable thead th.sorting::before,
.dataTables_wrapper table.dataTable thead th.sorting::after,
.dataTables_wrapper table.dataTable thead th.sorting_asc::before,
.dataTables_wrapper table.dataTable thead th.sorting_asc::after,
.dataTables_wrapper table.dataTable thead th.sorting_desc::before,
.dataTables_wrapper table.dataTable thead th.sorting_desc::after,
table.dataTable thead th.sorting::before,
table.dataTable thead th.sorting::after,
table.dataTable thead th.sorting_asc::before,
table.dataTable thead th.sorting_asc::after,
table.dataTable thead th.sorting_desc::before,
table.dataTable thead th.sorting_desc::after {
  display: none !important;
}

/* Set padding-right to 10px for sorting columns (arrows removed, but padding was left) */
table.dataTable thead > tr > th.sorting,
table.dataTable thead > tr > th.sorting_asc,
table.dataTable thead > tr > th.sorting_desc,
table.dataTable thead > tr > th.sorting_asc_disabled,
table.dataTable thead > tr > th.sorting_desc_disabled,
table.dataTable thead > tr > td.sorting,
table.dataTable thead > tr > td.sorting_asc,
table.dataTable thead > tr > td.sorting_desc,
table.dataTable thead > tr > td.sorting_asc_disabled,
table.dataTable thead > tr > td.sorting_desc_disabled {
  padding-right: 10px !important;
}

/* ============================================
   Active Navigation Styling
   ============================================ */

/* Override Azia's active navigation styling for indigo-dark theme */
.az-sidebar-indigo-dark .az-sidebar-body .nav-item.active::before {
  background-color: rgba(255, 255, 255, 0.15) !important;
  pointer-events: none; /* allow clicks to pass through overlay */
  z-index: 0; /* place overlay behind link */
}

/* Remove top border for active navigation items */
.az-sidebar-indigo-dark .az-sidebar-body .nav-item.active::before,
.az-sidebar-indigo-dark .az-sidebar-body .nav-item.active + .nav-item::before {
  border-top-color: transparent !important;
}

/* Ensure the clickable link sits above the active overlay */
.az-sidebar-indigo-dark .az-sidebar-body .nav-item.active > .nav-link {
  position: relative;
  z-index: 1;
}

.az-sidebar-indigo-dark .az-sidebar-body .nav-item.active .nav-link,
.az-sidebar-indigo-dark .az-sidebar-body .nav-item.active .nav-link:hover,
.az-sidebar-indigo-dark .az-sidebar-body .nav-item.active .nav-link:focus {
  font-weight: 500 !important;
  color: #ffffff !important;
}

.az-sidebar-indigo-dark .az-sidebar-body .nav-item.active .nav-link i,
.az-sidebar-indigo-dark .az-sidebar-body .nav-item.active .nav-link:hover i,
.az-sidebar-indigo-dark .az-sidebar-body .nav-item.active .nav-link:focus i {
  color: #ffffff !important;
}

/* Sub-menu expansion for active items */
.az-sidebar-indigo-dark .az-sidebar-body .nav-item.active.show > .nav-sub {
  display: block !important;
}

/* Sub-menu links keep their original styling when parent is active */

/* Ensure sub-menu is visible when parent is active */
.az-sidebar-indigo-dark .az-sidebar-body .nav-item.active .nav-sub {
  max-height: none !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Disable transitions on navigation items for immediate color changes */
.az-sidebar-indigo-dark .az-sidebar-body .nav-item,
.az-sidebar-indigo-dark .az-sidebar-body .nav-item::before,
.az-sidebar-indigo-dark .az-sidebar-body .nav-link,
.az-sidebar-indigo-dark .az-sidebar-body .nav-link i {
  transition: none !important;
}

/* ============================================
   Toggle Switcher Styling
   ============================================ */

.az-toggle {
  border-radius: var(--border-radius) !important;
  cursor: pointer !important;
}

.az-toggle span {
  width: 17px !important;
  height: 17px !important;
  border-radius: var(--border-radius) !important;
  top: 4px !important;
  bottom: auto !important;
  left: 4px !important; /* More spacing from left edge */
}

.az-toggle.on span {
  left: 39px !important; /* More spacing from right edge (60px container - 2px right padding - 17px span - 2px margin = 39px) */
}

/* Change toggle text from "on"/"off" to "Ja"/"Nee" */
.az-toggle span::before {
  content: "Ja" !important;
}

.az-toggle span::after {
  content: "Nee" !important;
}

/* ============================================
   Form Section Styling
   ============================================ */

.page-header {
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #2c3e50;
  display: flex;
  align-items: center;
}

.section-wrapper {
  background: #ffffff;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0px 2px 9px 0px rgb(0 0 0 / 10%);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.section-header-wrapper {
  padding: 0.8rem 1.25rem;
  border-bottom: 1px solid #e9ecef;
}

/* Remove border-bottom from the last section-header-wrapper in a section-wrapper */
.section-wrapper > .section-header-wrapper:last-child {
  border-bottom: none;
  /* Set padding-bottom to 16px so active tab border (at bottom: -16px) touches the bottom edge */
  padding-bottom: 16px;
}

/* Reduce gap between nav text and active tab border */
.section-wrapper > .section-header-wrapper:last-child .az-nav-line .nav-link.active::before {
  bottom: -16px;
  /* Ensure border shows at bottom on all screen sizes, not left */
  top: auto;
  left: 0;
  right: 0;
  width: auto;
  height: 2px;
}

.section-header {
  padding-bottom: 0;
  margin-bottom: 0;
}

.section-body {
  padding: 1.25rem;
  flex: 1;
}

.section-header .d-flex {
  width: 100%;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1c273c;
  flex: 1;
  min-width: 0;
  line-height: 1.4 !important;
}

.section-title-icon {
  margin-bottom: 0.15rem;
  margin-right: 0.3rem;
}

.section-header-actions {
  flex-shrink: 0;
}

.btn-sm {
  padding: 5px 11px !important;
  font-size: 0.85rem !important;
}

@media (max-width: 575.98px) {
  .section-header-actions {
    width: 100%;
  }
  
  .section-header-actions .secondary-btn {
    width: 100%;
  }
  
  /* Override full-width for inline actions when using flex-nowrap */
  .d-flex.flex-nowrap .section-header-actions {
    width: auto !important;
  }
  
  .d-flex.flex-nowrap .section-header-actions .secondary-btn,
  .d-flex.flex-nowrap .section-header-actions button.secondary-btn {
    width: auto !important;
  }
}

@media (max-width: 575.98px) {
  .section-header-wrapper {
    padding: 0.8rem 1rem;
  }
  
  .section-body {
    padding: 1rem;
  }
}

/* Nav wrapper within section header */
.section-header-wrapper .nav-wrapper {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: nowrap;
}

.section-header-wrapper .nav-wrapper .nav {
  margin: 0;
  padding: 0;
}

/* Override az-nav-line nav-link spacing */
.az-nav-line .nav-link + .nav-link {
  margin-left: 20px !important;
}

/* Prevent nav tabs from wrapping - tabs that don't fit will be moved to dropdown */
.section-header-wrapper .nav-wrapper .nav.az-nav-line {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  flex: 1;
  min-width: 0; /* Allow flex item to shrink */
}

/* Keep margin-left spacing for nav links (don't override) */
.section-header-wrapper .nav-wrapper .nav.az-nav-line .nav-link {
  margin-top: 0;
  margin-bottom: 0;
  margin-right: 0;
  white-space: nowrap;
}

/* Hidden nav link state - for tabs moved to dropdown */
.section-header-wrapper .nav-wrapper .nav.az-nav-line .nav-link.nav-link-hidden {
  display: none !important;
}

/* Nav dropdown wrapper - positioned as a nav tab */
.section-header-wrapper .nav-wrapper .nav-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

/* Nav link styled as dropdown toggle - looks like a nav tab */
.section-header-wrapper .nav-wrapper .nav-link-dropdown-toggle {
  cursor: pointer;
  white-space: nowrap;
  margin-left: 20px !important;
}

/* Prevent active state styling on dropdown toggle */
.section-header-wrapper .nav-wrapper .nav-link-dropdown-toggle.active,
.section-header-wrapper .nav-wrapper .nav-link-dropdown-toggle:hover,
.section-header-wrapper .nav-wrapper .nav-link-dropdown-toggle:focus {
  background-color: transparent;
  border-bottom: none;
}

.section-header-wrapper .nav-wrapper .nav-link-dropdown-toggle.active::before {
  display: none;
}

/* Dropdown items in nav dropdown */
.section-header-wrapper .nav-wrapper .nav-dropdown-wrapper .dropdown-menu .nav-dropdown-item {
  display: none;
}

.section-header-wrapper .nav-wrapper .nav-dropdown-wrapper .dropdown-menu .nav-dropdown-item.nav-dropdown-item-visible {
  display: block;
}

/* Active state for dropdown items */
.section-header-wrapper .nav-wrapper .nav-dropdown-wrapper .dropdown-menu .nav-dropdown-item.active {
  background-color: #e2e2e2;
  color: inherit;
}

/* Content header wrapper to match az-content-body padding */
.content-header-wrapper {
  padding: 20px 20px 0 20px;
}

/* ============================================
   Form Check Styling
   ============================================ */

.form-check-label {
  color: #596882;
}

.form-check-input:checked {
  background-color: #596882;
  border-color: #596882;
}

/* ============================================
   Modal Footer Override
   ============================================ */

.modal-footer {
  justify-content: flex-start !important;
}

/* ============================================
   Contact Item Form Controls - Allow Height Adjustment
   ============================================ */

/* Allow form-control elements used for contact items to adjust height when text wraps */
.email-item.form-control,
.telephone-item.form-control,
.address-item.form-control,
.chip-item.form-control,
.stamboeknummer-item.form-control {
  min-height: 38px;
  height: auto !important;
}

/* ============================================
   Real-time Search Styling
   ============================================ */

/* Desktop Search Dropdown */
@media (min-width: 992px) {
  .az-search-wrapper {
    width: 498px;
  }
  
  .az-search-wrapper > .position-relative {
    width: 100%;
  }
  
  .az-search-wrapper #desktop-search-input {
    width: 100%;
  }
}

.az-search-wrapper > .position-relative {
  display: flex;
  align-items: center;
}

.az-search-wrapper #desktop-search-input {
  padding-right: 45px;
}

.az-search-wrapper #desktop-search-btn {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  border: none;
  background: transparent;
  color: #596882;
  padding: 0 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  cursor: default;
}

.az-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 5px;
  background: #fff;
  border: 1px solid #cdd4e0;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1050;
  max-height: 500px;
  overflow-y: auto;
}

.az-search-dropdown-content {
  padding: 0;
}

.az-search-section {
  border-bottom: 1px solid #e3e7ed;
}

.az-search-section:last-child {
  border-bottom: none;
}

.az-search-section-header {
  padding: 10px 15px;
  font-weight: 600;
  font-size: 13px;
  color: #1c273c;
  background-color: #f4f5f8;
  border-bottom: 1px solid #e3e7ed;
  display: flex;
  align-items: center;
}

.az-search-section-items {
  padding: 5px 0;
}

.az-search-item {
  display: block;
  padding: 10px 15px;
  text-decoration: none;
  color: #596882;
  transition: background-color 0.2s;
  border-bottom: 1px solid #f4f5f8;
}

.az-search-item:last-child {
  border-bottom: none;
}

.az-search-item:hover {
  background-color: #f4f5f8;
  color: #1c273c;
  text-decoration: none;
}

.az-search-item-name {
  font-size: 14px;
  line-height: 1.5;
}

.az-search-more {
  font-weight: 500;
  color: #1A1B2E;
  font-size: 13px;
}

.az-search-more:hover {
  background-color: #e3e7ed;
}

.az-search-loading {
  padding: 20px;
  text-align: center;
}

/* Mobile Search Offcanvas */
#mobile-search-offcanvas {
  height: 100vh !important;
  max-height: 100vh !important;
}

#mobile-search-offcanvas .offcanvas-body {
  padding: 20px;
}

#mobile-search-offcanvas .position-relative {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

#mobile-search-offcanvas #mobile-search-input {
  padding-right: 45px;
  border-width: 2px;
}

#mobile-search-offcanvas #mobile-search-btn {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  border: none;
  background: transparent;
  color: #596882;
  padding: 0 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  cursor: default;
}

.az-search-section-mobile h6 {
  font-weight: 600;
  color: #1c273c;
  font-size: 16px;
  margin-bottom: 10px;
}

.az-search-section-mobile .text-link {
  color: #596882;
  text-decoration: none;
  font-size: 14px;
}

.az-search-section-mobile .text-link:hover {
  color: #1c273c;
  text-decoration: underline;
}

.az-search-loading-mobile {
  text-align: center;
  padding: 20px;
}

/* Ensure search dropdown appears above other elements */
@media (min-width: 992px) {
  .az-search-dropdown {
    z-index: 1055;
  }
}

/* Invoice detail: totals amount column lines up vertically */
.invoice-total-amount {
  min-width: 6rem;
}

/* Invoice detail: Betalingen en Creditnota's table use body text color */
.invoice-transactions-table > :not(caption) > * > * {
  color: var(--bs-body-color);
}