/* Ensure the sidebar takes full height of the viewport */
#sidebar-wrapper {
  height: 100vh; /* Full viewport height */
  overflow: hidden; /* Prevent overflow */
  flex: 0 0 auto;   /* size from content, no flex-grow */
  flex-shrink: 0;   /* prevent sidebar wrapper from shrinking */
}

#sidebar {
  height: 100%; /* Make sure sidebar takes the full height of its wrapper */
  overflow-y: auto; /* Allows scrolling if content exceeds viewport height */
}

body, html {
  height: 100%; /* Ensure the body and html elements also take full height */
  margin: 0;
}

#app {
  display: flex;
  min-height: 100vh; /* Ensures the app takes the full height of the viewport */
}

.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden; /* Good practice to prevent horizontal overflow */
  height: 100vh; /* Ensure the main content also takes full height */
  padding-left: 0; /* Ensures content doesn't shift due to sidebar */
  min-width: 0; /* Allow main content to shrink without pushing sidebar */
}

#main-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1rem;
  height: calc(100vh - 60px); /* Fill remaining height, subtract topbar height */
  scrollbar-gutter: stable; /* Prevent layout jump when scrollbar appears */
}

.sidebar {
  width: 240px;
  background-color: #1f2937;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0; /* Prevents the sidebar from shrinking */
  transition: none; /* disable generic transition */
}

.sidebar.collapsed,
.sidebar:not(.collapsed) {
  transition: width 0.2s ease; /* animate only width toggle */
}

.sidebar.collapsed {
  width: 60px;
}

.sidebar .sidebar-header {
  padding: 1rem 0.5rem;
  text-align: left;
  white-space: nowrap;
}

.sidebar .logo {
  width: 32px;
  height: 32px;
}

.brand-title {
  font-size: 1.2rem;
  font-weight: 600;
}

.sidebar.collapsed .brand-title {
  display: none;
}

.sidebar .nav-link {
  color: #cbd5e0;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  font-size: 15px;
}

.sidebar .nav-link.active,
.sidebar .nav-link:hover {
  background-color: #374151;
  color: #fff;
}

.sidebar .link-text {
  display: inline;
}

.sidebar.collapsed .link-text {
  display: none;
}

.topbar {
  background-color: #fff;
  height: 60px;
  border-bottom: 1px solid #dee2e6;
}

/* Additional styles to make the layout responsive */
.filter-component {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 38px;
}

.filter-component label {
  white-space: nowrap;
  width: 120px; /* Increased width */
  flex-shrink: 0;
  margin-bottom: 0;
  margin-right: 0.3rem; /* Ensures space from input */
}

.filter-component .form-control,
.filter-component select,
.filter-component .choices {
  min-width: 220px;
  min-height: 36px;
}

.choices {
  min-width: 220px;
  max-width: 100%;
}

.choices__inner {
  display: flex;
  align-items: center;
  min-height: 36px !important;
  padding-top: 0.5rem;
  line-height: normal;
  white-space: nowrap;
  overflow-x: auto;
  background-color: #fff;
  border-radius: 0.375rem;
  border: 1px solid #ced4da;
}

.choices__placeholder {
  white-space: nowrap;
}

.choices__list--multiple .choices__item {
  font-size: 0.875rem;
  padding: 2px 6px;
  margin-right: 4px;
  margin-bottom: 2px;
}

.choices[data-type*="select-multiple"] .choices__button {
  margin-left: 4px;
}

.choices__heading {
  display: none;
}

.choices__list--dropdown .choices__item--selectable {
  padding-right: 0.5rem !important;
}

.choices__list--dropdown .choices__item--selectable::after {
  display: none !important;
  content: none !important;
}

.choices__list--dropdown {
  padding: 0.25rem 0.5rem !important;
}

.choices__list--dropdown .choices__item {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-filter-action {
  height: 38px;
  padding: 0 12px;
  font-size: 0.9rem;
  border: 1px solid #ced4da;
  background-color: #fff;
  color: #212529;
  border-radius: 0.375rem;
  white-space: nowrap;
}

.btn-filter-action:hover {
  background-color: #f8f9fa;
  border-color: #adb5bd;
}

.filter-panel {
  transition: all 0.2s ease;
}

