/* Ensure header search dropdown is hidden until opened (prevents Tailwind/theme overrides) */
#kt_header_search .menu-sub-dropdown:not(.show) {
  display: none !important;
}

/* Sticky header/sidebar: lock viewport height so only main content scrolls */
html,
body {
  height: 100%;
}

.app-root {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.app-page,
.app-wrapper,
.app-main {
  min-height: 0;
  flex: 1 1 0;
}

.app-main {
  display: flex;
  flex-direction: column !important;
}

.app-main > .app-footer,
.app-content-wrapper > .app-footer {
  flex-shrink: 0;
  width: 100%;
}

.app-content-wrapper {
  min-height: 0;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#kt_app_content.app-content {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.btn .ki-duotone,
.btn [class^="ki-"] {
  flex-shrink: 0;
  line-height: 1;
}

.dropdown-item {
  display: flex;
  align-items: center;
}

.dropdown-item .ki-duotone,
.dropdown-item [class^="ki-"] {
  flex-shrink: 0;
}

/* DataTables: space between search bar and table on all index pages */
.dataTables_wrapper > .row {
  margin-bottom: 1rem !important;
}
.dataTables_wrapper > .table-responsive {
  margin-top: 1rem !important;
}
[id$="_wrapper"].dataTables_wrapper > .row {
  margin-bottom: 1rem !important;
}
[id$="_wrapper"].dataTables_wrapper > .table-responsive {
  margin-top: 1rem !important;
}

/* DataTables: search input at half width */
.dataTables_wrapper .dataTables_filter input {
  max-width: 50%;
  width: 50%;
}
