/*
 * Burket Dashboard Custom Bootstrap 5 Theme
 * Primary Color: #15527a (matching logo)
 * Features: Light/Dark mode support with smooth transitions
 */

/* ===== CUSTOM PRIMARY COLOR SYSTEM ===== */
:root {
  /* Custom primary color (client requirement) */
  --bs-primary: #15527a;
  --bs-primary-rgb: 21, 82, 122;
  
  /* Generated primary color palette */
  --bs-primary-100: #e8eef4;
  --bs-primary-200: #c6d8e4;
  --bs-primary-300: #9dbfcf;
  --bs-primary-400: #5c8ca9;
  --bs-primary-500: #15527a; /* Main primary */
  --bs-primary-600: #124767;
  --bs-primary-700: #0f3c55;
  --bs-primary-800: #0c3244;
  --bs-primary-900: #092838;
  
  /* Theme-aware backgrounds */
  --bs-body-bg-dark: #0d1117;
  --bs-surface-bg-dark: #161b22;
  --bs-border-color-dark: #30363d;
  --bs-body-bg-light: #f8f9fa;
  --bs-surface-bg-light: #ffffff;
  --bs-border-color-light: #dee2e6;
  
  /* Dashboard specific variables */
  --sidebar-width: 250px;
  --header-height: 60px;
  --border-radius-lg: 12px;
  --box-shadow-primary: 0 4px 12px rgba(21, 82, 122, 0.15);
  --transition-theme: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

/* ===== LIGHT THEME (DEFAULT) ===== */
[data-bs-theme="dark"] {
  --bs-body-bg: var(--bs-body-bg-dark);
  --bs-tertiary-bg: var(--bs-surface-bg-dark);
  --bs-border-color: var(--bs-border-color-dark);
}

[data-bs-theme="light"] {
  --bs-body-bg: var(--bs-body-bg-light);
  --bs-tertiary-bg: var(--bs-surface-bg-light);
  --bs-border-color: var(--bs-border-color-light);
}

body {
  background-color: var(--bs-body-bg);
  overflow-x: hidden;
}

/* ===== MODERN DASHBOARD LAYOUT ===== */
#wrapper {
  display: flex;
  transition: all 0.3s ease;
}

#sidebar-wrapper {
  min-height: 100vh;
  width: 250px;
  margin-left: 0;
  transition: margin 0.3s ease, background-color 0.3s ease;
  border-right: 1px solid var(--bs-border-color);
  position: relative;
  z-index: 1000;
}

[data-bs-theme="dark"] #sidebar-wrapper {
   background: linear-gradient(180deg, #1a232f 0%, #161b22 100%);
}

[data-bs-theme="light"] #sidebar-wrapper {
   background: linear-gradient(180deg, #ffffff 0%, #f1f3f5 100%);
}

#page-content-wrapper {
  width: calc(100% - 250px);
  transition: width 0.3s ease;
  min-height: 100vh;
}

/* Toggle states with higher specificity */
#wrapper.toggled #sidebar-wrapper {
  margin-left: -250px !important;
}

#wrapper.toggled #page-content-wrapper {
  width: 100% !important;
}

@media (max-width: 768px) {
  #sidebar-wrapper {
    margin-left: -250px !important;
  }
  #page-content-wrapper {
    width: 100% !important;
  }
  #wrapper.toggled #sidebar-wrapper {
    margin-left: 0 !important;
  }
  #wrapper.toggled #page-content-wrapper {
    width: 100% !important;
  }
}

/* ===== SIDEBAR NAVIGATION STYLING ===== */
.sidebar-nav .nav-link {
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-left: 3px solid transparent;
  color: #495057;
  text-decoration: none;
  display: block;
  transition: all 0.3s ease;
}

[data-bs-theme="dark"] .sidebar-nav .nav-link { 
  color: #adb5bd; 
}

[data-bs-theme="light"] .sidebar-nav .nav-link { 
  color: #495057; 
}

.sidebar-nav .nav-link:hover {
  color: #fff;
  background-color: rgba(var(--bs-primary-rgb), 0.1);
  border-left-color: rgba(var(--bs-primary-rgb), 0.5);
  text-decoration: none;
}

[data-bs-theme="light"] .sidebar-nav .nav-link:hover {
  color: #000;
}

.sidebar-nav .nav-link.active {
  color: #fff;
  background-color: rgba(var(--bs-primary-rgb), 0.25);
  border-left-color: rgb(var(--bs-primary-rgb));
}

[data-bs-theme="light"] .sidebar-nav .nav-link.active {
  background-color: rgb(var(--bs-primary-rgb));
  color: #fff;
}

.sidebar-nav .nav-link .fa-arrow {
   transition: transform 0.2s ease-in-out;
}

.sidebar-nav .nav-link[aria-expanded="true"] .fa-arrow {
  transform: rotate(90deg);
}

.sidebar-nav .submenu-link {
  padding: 0.5rem 1.5rem 0.5rem 3rem;
  font-size: 0.9rem;
  color: #6c757d;
  text-decoration: none;
  display: block;
  transition: all 0.3s ease;
}

[data-bs-theme="dark"] .sidebar-nav .submenu-link { 
  color: #8d97a2; 
}

[data-bs-theme="light"] .sidebar-nav .submenu-link { 
  color: #6c757d; 
}

.sidebar-nav .submenu-link:hover {
  color: #fff;
  background-color: transparent;
  border-left-color: transparent;
  text-decoration: none;
}

[data-bs-theme="light"] .sidebar-nav .submenu-link:hover {
  color: #000;
}

/* Logo styling */
.logo-theme-aware {
  height: 30px;
  transition: filter 0.3s ease-in-out;
}

[data-bs-theme="light"] .logo-theme-aware {
  filter: invert(27%) sepia(23%) saturate(3073%) hue-rotate(167deg) brightness(92%) contrast(92%);
}

/* ===== CARDS AND CHARTS STYLING ===== */
.profile-card {
  border-radius: 12px;
  min-width: 280px;
}

.stat-card {
  border: 1px solid var(--bs-border-color);
  border-radius: .75rem;
  background-color: var(--bs-tertiary-bg);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  transition: all 0.3s ease;
}

.stat-card:hover {
  box-shadow: 0 8px 16px -4px rgba(21, 82, 122, 0.15), 0 4px 8px -2px rgba(21, 82, 122, 0.1);
  transform: translateY(-2px);
}

.chart-container {
  border: 1px solid var(--bs-border-color);
  border-radius: .75rem;
  background-color: var(--bs-tertiary-bg);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
}

/* Avatar styling for stat cards */
.avatar-sm {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-title {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

/* Enhanced button styling */
.btn-primary {
  background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-primary-600) 100%);
  border: none;
  box-shadow: 0 2px 4px rgba(21, 82, 122, 0.2);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--bs-primary-600) 0%, var(--bs-primary-700) 100%);
  box-shadow: 0 4px 8px rgba(21, 82, 122, 0.3);
  transform: translateY(-1px);
}

.btn-outline-secondary {
  border-color: var(--bs-border-color);
  color: var(--bs-body-color);
  transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
  background-color: rgba(var(--bs-primary-rgb), 0.1);
  border-color: rgba(var(--bs-primary-rgb), 0.3);
  color: var(--bs-primary);
}

/* ===== TABLE STYLING ===== */
.table {
  color: var(--bs-body-color);
}

.table-hover tbody tr:hover {
  background-color: rgba(var(--bs-primary-rgb), 0.05);
}

/* ===== UTILITIES ===== */
.text-primary {
  color: var(--bs-primary) !important;
}

/* Responsive adjustments */
@media (max-width: 576px) {
  .stat-card .card-body {
    padding: 1rem;
  }
  
  .stat-card h3 {
    font-size: 1.5rem;
  }
}

/* Print styles */
@media print {
  #sidebar-wrapper,
  .navbar {
    display: none !important;
  }
  
  #page-content-wrapper {
    width: 100% !important;
    margin: 0 !important;
  }
}

/* ===== ACCESSIBILITY AND RESPONSIVENESS ===== */

/* High contrast mode support */
@media (prefers-contrast: high) {
  .card,
  .stat-card {
    border-width: 2px;
  }
  
  .nav-link:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* Main navigation styles with enhanced colors */
#side-menu {
  padding: 0.5rem 0;
}

#side-menu .nav-item {
  margin-bottom: 0.25rem;
}

#side-menu .nav-link {
  color: var(--burket-sidebar-text);
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  margin: 0 0.5rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  text-decoration: none;
  position: relative;
  border-left: 3px solid transparent;
}

#side-menu .nav-link:hover {
  background: linear-gradient(135deg, var(--bs-primary-50) 0%, rgba(21, 82, 122, 0.1) 100%);
  color: var(--bs-primary);
  transform: translateX(4px);
  border-left-color: var(--bs-primary);
  box-shadow: 0 2px 8px rgba(21, 82, 122, 0.15);
}

#side-menu .nav-link.active {
  background: linear-gradient(135deg, var(--bs-primary) 0%, #1a5a82 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(21, 82, 122, 0.3);
  border-left-color: #ffffff;
}

#side-menu .nav-link.active::before {
  content: '';
  position: absolute;
  left: -0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  background-color: #ffffff;
  border-radius: 2px;
}

/* Submenu styles */
#side-menu .collapse .nav-link {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  margin-left: 1rem;
}

#side-menu .collapse .nav-link:before {
  content: "•";
  margin-right: 0.5rem;
  color: var(--bs-secondary);
}

/* Enhanced submenu styling */
.submenu-link {
  display: block;
  padding: 0.6rem 1rem 0.6rem 2.5rem !important;
  color: var(--burket-sidebar-text);
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.3s ease;
  border-radius: 0.5rem;
  margin: 0.15rem 0.75rem;
  position: relative;
  border-left: 2px solid transparent;
  background: transparent;
}

.submenu-link:before {
  content: "▸";
  position: absolute;
  left: 1.25rem;
  color: var(--bs-primary);
  font-size: 0.75rem;
  transition: all 0.3s ease;
}

.submenu-link:hover {
  background: linear-gradient(135deg, rgba(21, 82, 122, 0.08) 0%, rgba(21, 82, 122, 0.15) 100%);
  color: var(--bs-primary);
  transform: translateX(2px);
  border-left-color: var(--bs-primary);
}

.submenu-link:hover:before {
  transform: translateX(2px);
  color: var(--bs-primary);
}

.submenu-link.active {
  background: rgba(21, 82, 122, 0.2);
  color: var(--bs-primary);
  border-left-color: var(--bs-primary);
  font-weight: 500;
}

/* Remove default list styling and fix collapse positioning */
#side-menu .collapse {
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 0 0 0.5rem 0.5rem;
  margin-top: -0.25rem;
}

/* Prevent flashing during transitions */
#side-menu .collapse {
  transition: height 0.35s ease, background-color 0.3s ease;
}

#side-menu .collapsing {
  transition: height 0.35s ease;
}

/* Arrow rotation for collapsible menus */
.fa-arrow {
  transition: transform 0.3s ease;
}

.nav-link[aria-expanded="true"] .fa-arrow {
  transform: rotate(90deg);
}

/* Sidebar icons */
#side-menu .nav-link i:first-child {
  width: 1.5rem;
  margin-right: 0.75rem;
  text-align: center;
}

/* Minimize sidebar animation */
.mini-navbar .navbar-static-side {
  width: 70px;
}

.mini-navbar #page-wrapper {
  margin-left: 70px;
}

.mini-navbar .nav-label {
  display: none;
}

.mini-navbar .fa-arrow {
  display: none;
}

/* Top navigation bar - Bootstrap 5 with bg-body-tertiary */
.navbar-expand-lg {
  padding: 0.5rem 1rem;
}

.navbar.bg-body-tertiary {
  background-color: var(--bs-tertiary-bg) !important;
  border-bottom: 1px solid var(--bs-border-color);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Navbar layout fixes */
.navbar .container-fluid {
  justify-content: space-between;
}

/* Navbar minimalize button */
.navbar-minimalize {
  color: #ffffff !important;
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: var(--bs-border-radius);
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.navbar-minimalize:hover {
  background-color: var(--bs-primary-600) !important;
  color: #ffffff !important;
  transform: scale(1.05);
}

/* Theme toggle button */
#theme-toggle {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

/* Ensure proper spacing in navbar right section */
.navbar .d-flex {
  gap: 0.5rem;
}

/* Login partial styling */
.navbar .btn-link.nav-link {
  color: var(--bs-body-color);
  border: none;
  background: none;
  padding: 0.375rem 0.5rem;
  text-decoration: none;
}

.navbar .btn-link.nav-link:hover {
  color: var(--bs-primary);
  background-color: var(--bs-gray-100);
  border-radius: var(--bs-border-radius);
}

.navbar .navbar-text {
  color: var(--bs-body-color);
  font-weight: 500;
}

/* Page heading styling */
.page-heading {
  background-color: var(--bs-surface-bg);
  color: var(--bs-body-color);
  padding: 1rem 0;
  border-bottom: 1px solid var(--bs-border-color);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .navbar-static-side {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    z-index: 1050;
    transition: left 0.3s ease;
  }
  
  .navbar-static-side.show {
    left: 0;
  }
  
  #page-wrapper {
    margin-left: 0;
  }
  
  .navbar-minimalize {
    display: block !important;
  }
}

/* Table styling */
.table {
  --bs-table-bg: var(--bs-card-bg);
  background-color: var(--bs-table-bg);
  color: var(--bs-body-color);
}

/* Form styling */
.form-control {
  background-color: var(--bs-surface-bg);
  border-color: var(--bs-border-color);
  color: var(--bs-body-color);
}

.form-control:focus {
  background-color: var(--bs-surface-bg);
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.25rem rgba(21, 82, 122, 0.25);
  color: var(--bs-body-color);
}

/* Logo theme awareness with enhanced visibility */
.logo-theme-aware {
  transition: all 0.3s ease;
}

/* Fix white logo visibility in light mode */
[data-bs-theme="light"] .logo-theme-aware {
  filter: brightness(0) saturate(100%) invert(27%) sepia(51%) saturate(2878%) hue-rotate(202deg) brightness(93%) contrast(87%);
}

[data-bs-theme="dark"] .logo-theme-aware {
  filter: none;
}

/* Enhanced sidebar with more accent colors */
.sidebar-collapse {
  background: linear-gradient(135deg, var(--bs-sidebar-bg) 0%, rgba(21, 82, 122, 0.05) 100%);
  color: var(--burket-sidebar-text);
  border-right: 1px solid var(--bs-border-color);
  height: 100vh;
  overflow-y: auto;
  transition: var(--transition-theme);
  box-shadow: 2px 0 10px rgba(21, 82, 122, 0.1);
}

.nav-header {
  border-bottom: 2px solid var(--bs-primary);
  padding: 1.5rem 1rem;
  background: linear-gradient(135deg, rgba(21, 82, 122, 0.1) 0%, transparent 100%);
}

/* ===== DASHBOARD SPECIFIC STYLING ===== */

/* iBox component (legacy compatibility) */
.ibox {
  background-color: var(--bs-card-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  box-shadow: var(--burket-card-shadow);
  margin-bottom: 1.5rem;
}

.ibox-title {
  background-color: var(--bs-surface-bg);
  border-bottom: 1px solid var(--bs-border-color);
  padding: 0.75rem 1rem;
  border-radius: var(--bs-border-radius) var(--bs-border-radius) 0 0;
}

.ibox-content {
  padding: 1rem;
  background-color: var(--bs-card-bg);
  border-radius: 0 0 var(--bs-border-radius) var(--bs-border-radius);
}

/* Page wrapper styling */
#page-wrapper {
  background-color: var(--bs-body-bg);
  min-height: 100vh;
  transition: var(--transition-theme);
}

/* Border styling */
.border-bottom {
  border-bottom: 1px solid var(--bs-border-color) !important;
}

/* Page heading */
.page-heading {
  background-color: var(--bs-surface-bg);
  color: var(--bs-body-color);
  padding: 1rem 0;
}

/* Footer styling */
footer {
  background-color: var(--bs-surface-bg);
  color: var(--bs-body-color);
  border-top: 1px solid var(--bs-border-color);
  padding: 1rem 0;
  margin-top: 2rem;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .sidebar-collapse {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    z-index: 1050;
    transition: left 0.3s ease;
  }
  
  .sidebar-collapse.show {
    left: 0;
  }
  
  #page-wrapper {
    margin-left: 0;
  }
  
  .navbar-minimalize {
    display: block !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .card,
  .ibox {
    border-width: 2px;
  }
  
  .nav-link:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ===== SELECT2 BOOTSTRAP 5 THEME ===== */
/* Select2 Bootstrap 5 compatibility styles */
.select2-container {
  width: 100% !important;
}

.select2-container--bootstrap-5 .select2-selection {
  min-height: calc(1.5em + 0.75rem + 2px);
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--bs-body-color);
  background-color: var(--bs-body-bg);
  background-image: none;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.select2-container--bootstrap-5 .select2-selection:focus-within {
  color: var(--bs-body-color);
  background-color: var(--bs-body-bg);
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.select2-container--bootstrap-5 .select2-selection--single {
  height: calc(1.5em + 0.75rem + 2px);
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
  padding-left: 0;
  padding-right: 0;
  height: auto;
  margin-top: -1px;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
  height: calc(1.5em + 0.75rem);
  right: 0.75rem;
}

.select2-container--bootstrap-5 .select2-selection--multiple {
  min-height: calc(1.5em + 0.75rem + 2px);
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
  background-color: var(--bs-primary);
  border: 1px solid var(--bs-primary);
  border-radius: 0.375rem;
  color: #fff;
  font-size: 0.875rem;
  padding: 0 0.5rem;
  margin-right: 0.375rem;
  margin-top: 0.3rem;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove {
  color: rgba(255, 255, 255, 0.8);
  float: right;
  margin-left: 0.375rem;
  margin-right: -0.1875rem;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove:hover {
  color: #fff;
}

/* Dropdown styles */
.select2-container--bootstrap-5 .select2-dropdown {
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  background-color: var(--bs-body-bg);
}

.select2-container--bootstrap-5 .select2-results__option {
  padding: 0.375rem 0.75rem;
  color: var(--bs-body-color);
}

.select2-container--bootstrap-5 .select2-results__option--highlighted {
  background-color: var(--bs-primary);
  color: #fff;
}

.select2-container--bootstrap-5 .select2-results__option--selected {
  background-color: var(--bs-gray-100);
  color: var(--bs-body-color);
}

/* Dark mode support */
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection {
  background-color: var(--bs-surface-bg-dark);
  border-color: var(--bs-border-color-dark);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection:focus-within {
  background-color: var(--bs-surface-bg-dark);
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.25rem rgba(21, 82, 122, 0.25);
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-dropdown {
  background-color: var(--bs-surface-bg-dark);
  border-color: var(--bs-border-color-dark);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-results__option {
  color: var(--bs-body-color);
  background-color: transparent;
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-results__option:hover,
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-results__option--highlighted {
  background-color: var(--bs-primary);
  color: #fff;
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-results__option--selected {
  background-color: rgba(21, 82, 122, 0.2);
  color: var(--bs-primary);
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
  color: #fff;
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--single .select2-selection__placeholder,
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--multiple .select2-search__field {
  color: var(--bs-secondary-color);
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-search__field {
  background-color: var(--bs-surface-bg-dark);
  border-color: var(--bs-border-color-dark);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .select2-container--bootstrap-5.select2-container--focus .select2-selection {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.25rem rgba(21, 82, 122, 0.25);
}

/* Fix Select2 search field size for better usability */
.select2-container--bootstrap-5 .select2-search__field {
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
}

/* Force Select2 search field to take full width - override inline styles */
.select2-container--bootstrap-5 .select2-selection--multiple .select2-search--inline .select2-search__field {
  min-width: 150px !important;
  width: calc(100% - 0.75rem) !important;
  max-width: none !important;
}

.select2-container--bootstrap-5 .select2-dropdown .select2-search {
  padding: 0.5rem;
}

.select2-container--bootstrap-5 .select2-dropdown .select2-search .select2-search__field {
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  min-width: auto !important;
  width: 100% !important;
}

/* Loading spinner for Select2 AJAX */
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__placeholder {
  color: var(--bs-secondary-color);
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}
