.entity-picker { position: relative; min-width: 0; order: 2; }
.entity-picker > .form-control.entity-picker-code { padding-right: 74px; }
.entity-picker-tools { position: absolute; top: 1px; right: 1px; display: flex; align-items: center; gap: 3px; height: calc(var(--entity-picker-height, 40px) - 2px); }
.entity-picker-tools button, .entity-picker-close { display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 3px; }
.entity-picker-clear { width: 27px; height: 27px; background: transparent; color: #687a91; }
.entity-picker-clear:hover { background: #eaf1fb; color: #0d2b52; }
.entity-picker-refresh { width: 35px; height: 100%; background: #0d2b52; color: #fff; border-radius: 0 4px 4px 0 !important; font-size: 18px; }
.entity-picker-refresh:hover { background: #1b4e96; }
.entity-picker-tools button:focus-visible, .entity-picker-close:focus-visible { outline: 2px solid #1b4e96; outline-offset: 2px; }
.entity-picker-tools button:disabled { opacity: .5; cursor: not-allowed; }
.entity-picker-refresh.is-loading i { animation: entity-picker-spin .8s linear infinite; }
.entity-picker-error { display: block; margin-top: 3px; color: #b42318; font-size: 12px; line-height: 1.4; }
.entity-picker-error:empty { display: none; }
.entity-picker-panel { position: fixed; z-index: 1080; display: flex; flex-direction: column; background: #fff; color: #0d2b52; border: 1px solid #cbd4e0; border-radius: 0 0 3px 3px; box-shadow: 0 3px 8px #0d2b5214; overflow: hidden; }
.entity-picker [hidden], .entity-picker-panel [hidden], .entity-picker-panel[hidden] { display: none !important; }
.entity-picker-heading { display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; gap: 8px; min-height: 27px; padding: 2px 6px 2px 10px; background: #e7ebf0; color: #53657e; font-size: 12px; }
.entity-picker-heading > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.entity-picker-close { flex-shrink: 0; width: 22px; height: 22px; background: transparent; color: #53657e; font-size: 11px; }
.entity-picker-close:hover { background: #d6dfeb; }
.entity-picker-results { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.entity-picker-result { display: block; width: 100%; min-height: 54px; padding: 8px 10px; border: 0; border-bottom: 1px dashed #e0e5ec; background: #fff; color: #0d2b52; text-align: left; }
.entity-picker-result:last-child { border-bottom: 0; }
.entity-picker-result:hover, .entity-picker-result[aria-selected="true"] { background: #eaf1fb; box-shadow: inset 2px 0 #1b4e96; }
.entity-picker-result:focus-visible { outline: 2px solid #1b4e96; outline-offset: -2px; }
.entity-picker-result-name { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
.entity-picker-result-detail { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 6px; color: #62768f; font-size: 11px; overflow-wrap: anywhere; }
.entity-picker-result-code { display: inline-flex; align-items: center; gap: 4px; color: #1b4e96; }
.entity-picker-result-badge { padding: 0 4px; border: 1px solid #c4d3e6; border-radius: 3px; background: #f2f6fc; color: #365a88; font-size: 10px; line-height: 1.4; }
.entity-picker-result-phone { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; white-space: nowrap; }
.entity-picker-result-phone i { color: #238454; }
.entity-picker-result-legacy { font-size: 10px; color: #62768f; }
.entity-picker-status { flex: 0 0 auto; padding: 8px 10px; font-size: 12px; color: #53657e; background: #f7f9fc; }
.entity-picker-status.is-error { color: #b42318; background: #fff3f2; }
.entity-picker-status.is-compact { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@keyframes entity-picker-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .entity-picker-refresh.is-loading i { animation-duration: 1.5s; } }

/* Filters keep the input in the original grid position. */
.entity-picker.entity-picker-filter { order: 0; width: 100%; min-width: 0; }
.payment-search > .entity-picker-filter, .sale-filter > .entity-picker-filter,
.sponsor-line-search-wrapper > .entity-picker-filter { flex: 1 1 240px; }
.entity-picker-filter > .entity-picker-code { width: 100%; }
@media (max-width: 700px) {
  .payment-page .payment-search > .entity-picker-filter { grid-column: 1 / -1; }
}
