



  .select2-container {
    width: 100% !important;
    z-index: 1050 !important;
  }
  
  .select2-container--default .select2-selection--single {
    height: 38px !important;
    border: 1px solid #ced4da !important;
    border-radius: 0.375rem !important;
    padding: 0 !important;
    background-color: #fff !important;
    box-shadow: none !important;
  }
  
  .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 36px !important;
    padding-left: 12px !important;
    padding-right: 20px !important;
    color: #212529 !important;
    font-size: 14px !important;
  }
  
  .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #6c757d !important;
    font-style: italic !important;
  }
  
  .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
    right: 8px !important;
    top: 0 !important;
  }
  
  .select2-container--default .select2-selection--single .select2-selection__clear {
    color: #6c757d !important;
    right: 25px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
  }
  
  .select2-container--default .select2-dropdown {
    border: 1px solid #ced4da !important;
    border-radius: 0.375rem !important;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
    z-index: 1051 !important;
  }
  
  .select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #ced4da !important;
    border-radius: 0.25rem !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 14px !important;
    width: calc(100% - 20px) !important;
    margin: 5px 10px !important;
  }
  
  .select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25) !important;
    outline: none !important;
  }
  
  .select2-container--default .select2-results__option {
    padding: 0.5rem 0.75rem !important;
    font-size: 14px !important;
  }
  
  .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #0d6efd !important;
    color: white !important;
  }
  
  .select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #e9ecef !important;
    color: #495057 !important;
  }
  

  
  /* Override any conflicting styles */
  .form-control.select2-dropdown {
    display: none !important;
  }
  

  
  /* Custom Select2 with search in placeholder */
  .custom-select2-container {
    position: relative;
    width: 100%;
  }

  /* ============================================================================ */
  /* Width helpers for custom-select2 dropdowns.                                   */
  /* Use these instead of inline style="width: 11.25rem"/"width: 10rem"/etc.,      */
  /* so every filter row across v2 sticks to the same three widths.               */
  /*   cs2-w-sm  → 10 rem (~160px) — compact selectors (e.g. small sales-rep box) */
  /*   cs2-w-md  → 11.25 rem (~180px) — default for filter rows                   */
  /*   cs2-w-lg  → 15.625 rem (~250px) — long-label dropdowns (state, manager…)   */
  /* Specificity is two classes, so the helper wins over the base 100% width      */
  /* without needing !important. Override per-page only if truly necessary.       */
  /* ============================================================================ */
  .custom-select2-container.cs2-w-sm { width: 10rem; }
  .custom-select2-container.cs2-w-md { width: 11.25rem; }
  .custom-select2-container.cs2-w-lg { width: 15.625rem; }
  
  .custom-select2-input {
    width: 100% !important;
    height: 2.313rem !important;
    border: 1px solid #ced4da !important;
    border-radius: 0.375rem !important;
    padding-left: 8px !important; /* Always left padding */
    padding-right: 50px !important;
    font-size: 0.75rem !important;
    background-color: #fff !important;
    cursor: pointer;
    text-align: left !important; /* Force left alignment always */
    direction: ltr !important;
    box-sizing: border-box !important;
    position: relative;
    color: transparent !important; /* Hide the input text */
    caret-color: #212529 !important; /* Show cursor when typing */
  }
  
  /* Show text only when typing (searching) and keep it left-aligned */
  .custom-select2-input:focus {
    color: #212529 !important; /* Show text when focused/typing */
    text-align: left !important; /* Force left alignment when typing */
    padding-left: 8px !important; /* Ensure left padding when focused */
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25) !important;
    outline: none !important;
  }
  
  /* Add a wrapper for the text content - positioned exactly at the left edge */
  .custom-select2-text-wrapper {
    position: absolute;
    left: 8px; /* Same as input padding */
    right: 50px;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    pointer-events: none;
    z-index: 1;
  }
  
  .custom-select2-text-content {
    width: 100%;
    text-align: left !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    color: #495057 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 0 !important; /* Remove any padding */
    margin-left: 0 !important; /* Remove any margin */
  }
  
  .custom-select2-input::placeholder {
    color: #495057 !important;
    /* font-style: italic; */
    text-align: left !important; /* Left align placeholder */
    padding-left: 0 !important; /* Remove placeholder padding */
  }
  
  .custom-select2-clear {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    cursor: pointer;
    font-size: 12px;
    padding: 2px;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
  }
  
  .custom-select2-clear:hover {
    background-color: #f8f9fa;
    color: #dc3545;
  }
  
  .custom-select2-arrow {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 12px;
    pointer-events: none;
    transition: transform 0.2s ease;
    z-index: 2;
  }
  
  .custom-select2-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    z-index: 1050;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 2px;
    /* Stop wheel/touch scrolls from bubbling up to the page when the user reaches the
       top/bottom edge of the dropdown options. Without this, scrolling a long option
       list (e.g. customer groups, sales reps) drags the underlying section ("Move All
       Customers in New Group", filter rows in modals, etc.) along with it. */
    overscroll-behavior: contain;
  }
  
  .custom-select2-option {
    padding: 0.2rem 0.75rem;
    cursor: pointer;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.75rem;
    border-bottom: 1px solid #f8f9fa;
    text-align: left !important;
  }
  
  .custom-select2-option:hover {
    background-color: #f8f9fa;
  }
  
  .custom-select2-option.selected {
    background-color: #0d6efd;
    color: white;
  }
  
  .custom-select2-option.no-results {
    color: #6c757d;
    font-style: italic;
    text-align: center;
  }
  
  .custom-select2-container.open .custom-select2-arrow {
    transform: translateY(-50%) rotate(180deg);
  }
  

  
  /* Ensure text is always left-aligned in all states */
  .custom-select2-input[type="text"] {
    text-align: left !important;
    direction: ltr !important;
    padding-left: 8px !important; /* Match text wrapper position */
  }
  
  /* Force left alignment for all input states */
  .custom-select2-input:not(:placeholder-shown) {
    text-align: left !important;
    padding-left: 8px !important;
  }
  
  .custom-select2-input:placeholder-shown {
    text-align: left !important;
    padding-left: 8px !important;
  }
  
  /* Additional overrides to ensure left alignment */
  .custom-select2-input * {
    text-align: left !important;
  }
  
  /* Ensure no centering or right alignment */
  .custom-select2-container * {
    text-align: left !important;
  }
  
  /* Force left alignment for all text input states */
  .custom-select2-input:focus,
  .custom-select2-input:active,
  .custom-select2-input:not(:focus) {
    text-align: left !important;
    padding-left: 8px !important;
    text-indent: 0 !important;
  }
  
  /* Override any inherited text alignment */
  .custom-select2-input {
    text-indent: 0 !important;
    text-align: left !important;
    padding-left: 8px !important;
    height: 2.31rem !important;
  }

  /* Open above the input when there is more room above (set by custom-select2.js). */
  .custom-select2-dropdown.custom-select2-dropdown--above {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 2px;
  }

  /* ============================================================================ */
  /* Mobile / tablet: stretch every custom-select2 to the full width of its parent */
  /* so fixed cs2-w-sm | cs2-w-md | cs2-w-lg helpers do not leave narrow ~180px   */
  /* controls in Bootstrap filter rows. Aligns with base.css .v2-filter-field @768. */
  /* min-width:0 lets flex/grid children shrink instead of overflowing horizontally.*/
  /* ============================================================================ */
  @media (max-width: 768px) {
    .custom-select2-container,
    .custom-select2-container.cs2-w-sm,
    .custom-select2-container.cs2-w-md,
    .custom-select2-container.cs2-w-lg {
      width: 100%;
      max-width: 100%;
      min-width: 0;
    }

    /* Flex filter rows (attendance, visit, reports): parent must span the row so
       width:100% on the dropdown actually fills the screen, not ~180px. */
    .filter-group:has(> .custom-select2-container),
    .form-group:has(> .custom-select2-container) {
      width: 100%;
      flex: 1 1 100%;
      min-width: 0;
    }
  }