.select2-container { max-width: 100%; position: relative; }
.select2-container .selection { display: block; pointer-events: auto; }
.select2-container--default .select2-selection { cursor: pointer; }
.select2-container--default.select2-container--disabled .select2-selection { cursor: not-allowed; opacity: .72; background: #f2f4f7; }
.select2-container .select2-selection--single { min-height: 38px; border-color: #e1e4e8; border-radius: .375rem; }
.select2-container .select2-selection--single .select2-selection__rendered { padding: .45rem 2.25rem .45rem .75rem; line-height: 1.35rem; }
.select2-container .select2-selection--single .select2-selection__arrow { top: 6px; right: 6px; }
.select2-container .select2-selection--multiple { min-height: 38px; padding: .18rem .4rem; border-color: #e1e4e8; border-radius: .375rem; }
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single { border-color: #303f9f; box-shadow: 0 0 0 .2rem rgba(48, 63, 159, .09); }
.select2-dropdown { z-index: 2060; border-color: #d9deea; box-shadow: 0 .75rem 2rem rgba(27, 39, 80, .14); }
.select2-container--open { z-index: 2000; }
.select2-results__option { padding: .55rem .75rem; }
.select2-search--dropdown { padding: .55rem; }
.select2-search--dropdown .select2-search__field { min-height: 36px; border-color: #d9deea !important; border-radius: .375rem; }
.input-group > .select2-container { flex: 1 1 auto; width: 1% !important; }
.modal .select2-container, .offcanvas .select2-container { width: 100% !important; }
.modal .select2-search__field, .offcanvas .select2-search__field { pointer-events: auto; }
.crm-global-search-results { position: absolute; top: calc(100% + 8px); left: 0; width: min(420px, 80vw); z-index: 2050; padding: .45rem; border: 1px solid #e0e5ef; border-radius: .65rem; background: #fff; box-shadow: 0 18px 40px rgba(20, 34, 77, .18); }
.crm-global-search-option { display: flex; align-items: center; gap: .65rem; padding: .7rem .8rem; border-radius: .45rem; color: #16213e; font-weight: 500; }
.crm-global-search-option:hover, .crm-global-search-option.is-active { color: #303f9f; background: #eef1ff; }
.crm-global-search-option i { color: #667085; }
.crm-global-search-empty { color: #667085; padding: .8rem; font-size: .875rem; }
.crm-navbar-header .profile-dropdown:not(.crm-auth-profile) {
    display: none !important;
}

/* CRM work is form-heavy: keep every Bootstrap popup almost full-screen while
   preserving fixed headers/footers and an independently scrolling body. */
body.crm-layout .modal .modal-dialog {
    width: 98vw;
    max-width: 98vw;
    height: 98vh;
    height: 98dvh;
    margin: 1vh auto;
    margin: 1dvh auto;
}
body.crm-layout .modal .modal-dialog-centered {
    min-height: 98vh;
    min-height: 98dvh;
}
body.crm-layout .modal .modal-content,
body.crm-layout .modal .modal-dialog-scrollable .modal-content {
    height: 98vh;
    height: 98dvh;
    max-height: 98vh;
    max-height: 98dvh;
}
body.crm-layout .modal .modal-body {
    min-height: 0;
    overflow-y: auto;
}

/* CRM readability baseline -------------------------------------------------
   The theme's 12-14px defaults are too small for sustained front-desk and
   clinical data entry. Scope the larger type to CRM pages so compact icons,
   public pages and the authentication layout keep their intended proportions. */
body.crm-layout {
    color: #344054;
    font-size: 1rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
body.crm-layout .page-wrapper .content,
body.crm-layout .card-body,
body.crm-layout .card-footer,
body.crm-layout .modal-body,
body.crm-layout .offcanvas-body { font-size: 1rem; }
body.crm-layout h1,
body.crm-layout h2,
body.crm-layout h3,
body.crm-layout h4,
body.crm-layout h5,
body.crm-layout h6,
body.crm-layout .card-title { color: #101828; line-height: 1.3; }
body.crm-layout label,
body.crm-layout .form-label,
body.crm-layout .table thead th { color: #1d2939; font-weight: 600; }
body.crm-layout .table { color: #344054; font-size: .9375rem; }
body.crm-layout .table > :not(caption) > * > * { line-height: 1.45; vertical-align: middle; }
body.crm-layout .table thead th { font-size: .9375rem; line-height: 1.35; }
body.crm-layout .form-control,
body.crm-layout .form-select,
body.crm-layout .input-group-text,
body.crm-layout .select2-container .select2-selection--single .select2-selection__rendered,
body.crm-layout .select2-container .select2-selection--multiple .select2-selection__rendered,
body.crm-layout .select2-results__option,
body.crm-layout .dropdown-item,
body.crm-layout .dropdown-menu { font-size: .9375rem; }
body.crm-layout .btn { font-size: .9375rem; line-height: 1.35; }
body.crm-layout .btn-sm,
body.crm-layout .form-control-sm,
body.crm-layout .form-select-sm { font-size: .875rem; }
body.crm-layout small,
body.crm-layout .small,
body.crm-layout .text-muted { font-size: .875rem; line-height: 1.45; }
body.crm-layout .text-muted { color: #667085 !important; }
body.crm-layout .badge { font-size: .8125rem; line-height: 1.2; }
body.crm-layout .pagination { align-items: center; gap: .25rem; }
body.crm-layout .pagination .page-link {
    align-items: center;
    display: inline-flex;
    font-size: .875rem;
    justify-content: center;
    min-height: 2.25rem;
    min-width: 2.25rem;
}
/* Defensive guard for cached or custom paginator markup. */
body.crm-layout .pagination svg { display: block; height: 1rem !important; width: 1rem !important; }
