/* Dropdowns: the styled <select> replacement (pf-select.js) and the same look for select2. */

.pfs { position: relative; display: block; width: 100%; }
.pfs--inline { display: inline-block; width: auto; vertical-align: middle; }
.pfs__native { position: absolute !important; left: 0; bottom: 0; width: 100%; height: 1px; margin: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; overflow: hidden; }

.pfs__button { display: flex; align-items: center; gap: 0.7rem; width: 100%; min-height: var(--pfs-height, 44px); padding: 0.35rem 0.9rem; border-radius: 12px; border: 1px solid var(--surface-border, rgba(255, 255, 255, 0.12)); background: var(--bg-card, #171220); color: var(--text-primary, #f8f9fa); font: inherit; font-size: 0.95rem; font-weight: 600; line-height: 1.3; text-align: left; cursor: pointer; }
.pfs--sm .pfs__button { padding: 0.2rem 0.7rem; font-size: 0.85rem; border-radius: 10px; }
.pfs__button:hover:not(:disabled) { background: var(--bg-hover, #21182d); }
.pfs__button:focus-visible { outline: 2px solid var(--accent-secondary, #d998ff); outline-offset: 2px; }
.pfs__button[aria-expanded="true"] { border-color: var(--accent-primary, #8f5cff); }
.pfs__button:disabled { opacity: 0.55; cursor: not-allowed; }
.pfs__button.is-placeholder .pfs__text { color: var(--text-muted, #8c9ab0); font-weight: 500; }
.pfs__button.is-invalid { border-color: #fb7185; }
.pfs.is-invalid ~ .invalid-feedback, .pfs.is-invalid ~ .text-danger { display: block; }
.pfs__text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfs__chev { flex: none; color: var(--text-muted, #8c9ab0); font-size: 0.75rem; transition: transform 0.15s ease; }
.pfs__button[aria-expanded="true"] .pfs__chev { transform: rotate(180deg); }

/* the list */
.pfs__panel { position: fixed; z-index: 2100; display: flex; flex-direction: column; box-sizing: border-box; padding: 0.35rem; border-radius: 14px; border: 1px solid var(--accent-primary, #8f5cff); background: var(--bg-card, #171220); box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55); }
.pfs__search { flex: none; display: block; width: 100%; min-height: 44px; margin: 0 0 0.35rem; padding: 0 0.8rem; border-radius: 10px; border: 1px solid var(--surface-border, rgba(255, 255, 255, 0.12)); background: var(--bg-dark, #110d18); color: var(--text-primary, #f8f9fa); font: inherit; font-size: 0.95rem; }
.pfs__search:focus { outline: 2px solid var(--accent-secondary, #d998ff); outline-offset: 0; border-color: transparent; }
.pfs__list { flex: 1 1 auto; margin: 0; padding: 0; list-style: none; overflow-y: auto; overscroll-behavior: contain; outline: none; }
.pfs__item { display: flex; align-items: center; gap: 0.6rem; min-height: 42px; padding: 0.35rem 0.75rem; border-radius: 10px; color: var(--text-secondary, #c4d1e3); font-size: 0.95rem; cursor: pointer; }
.pfs__item.is-active { background: var(--bg-hover, #21182d); color: #fff; }
.pfs__item.is-selected { background: #2a1c52; color: #fff; }
.pfs__item.is-empty { color: var(--text-muted, #8c9ab0); }
.pfs__item.is-disabled { opacity: 0.45; cursor: not-allowed; }
.pfs__name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfs__tick { flex: none; color: #4ade80; }
.pfs__group { padding: 0.6rem 0.75rem 0.25rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted, #8c9ab0); }
.pfs__none { padding: 0.8rem; color: var(--text-muted, #8c9ab0); font-size: 0.9rem; }

/* select2 (archetype and card search): the same look */
body .select2-container--default .select2-selection--single { display: flex; align-items: center; min-height: 44px; padding: 0.2rem 0.5rem; border-radius: 12px; border: 1px solid var(--surface-border, rgba(255, 255, 255, 0.12)); background: var(--bg-card, #171220); }
body .select2-container--default .select2-selection--single .select2-selection__rendered { flex: 1 1 auto; padding: 0 1.6rem 0 0.4rem; color: var(--text-primary, #f8f9fa); font-size: 0.95rem; font-weight: 600; line-height: 1.3; }
body .select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--text-muted, #8c9ab0); font-weight: 500; }
body .select2-container--default .select2-selection--single .select2-selection__arrow { top: 0; right: 0.55rem; height: 100%; }
body .select2-container--default .select2-selection--single .select2-selection__arrow b { border-color: var(--text-muted, #8c9ab0) transparent transparent; }
body .select2-container--default .select2-selection--single .select2-selection__clear { color: var(--text-muted, #8c9ab0); font-size: 1.2rem; margin-right: 0.4rem; }
body .select2-container--default.select2-container--open .select2-selection--single,
body .select2-container--default.select2-container--focus .select2-selection--single { border-color: var(--accent-primary, #8f5cff); outline: 0; }
body .select2-container--default.select2-container--disabled .select2-selection--single { opacity: 0.55; }
body .select2-dropdown { margin-top: 6px; padding: 0.35rem; border-radius: 14px; border: 1px solid var(--accent-primary, #8f5cff); background: var(--bg-card, #171220); box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55); overflow: hidden; }
body .select2-container--default .select2-search--dropdown { padding: 0 0 0.35rem; }
body .select2-container--default .select2-search--dropdown .select2-search__field { min-height: 44px; padding: 0 0.8rem; border-radius: 10px; border: 1px solid var(--surface-border, rgba(255, 255, 255, 0.12)); background: var(--bg-dark, #110d18); color: var(--text-primary, #f8f9fa); font-size: 0.95rem; }
body .select2-container--default .select2-search--dropdown .select2-search__field:focus { outline: 2px solid var(--accent-secondary, #d998ff); outline-offset: 0; border-color: transparent; }
body .select2-container--default .select2-results > .select2-results__options { max-height: 300px; }
body .select2-container--default .select2-results__option { min-height: 42px; display: flex; align-items: center; padding: 0.35rem 0.75rem; border-radius: 10px; color: var(--text-secondary, #c4d1e3); font-size: 0.95rem; }
body .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable,
body .select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--bg-hover, #21182d); color: #fff; }
body .select2-container--default .select2-results__option--selected,
body .select2-container--default .select2-results__option[aria-selected="true"] { background: #2a1c52; color: #fff; }
body .select2-container--default .select2-results__option--disabled { opacity: 0.45; }

/* Date fields: the calendar dropdown (pf-date.js) */
.pfd { position: relative; display: block; width: 100%; }
.pfd__native { position: absolute !important; left: 0; bottom: 0; width: 100%; height: 1px; margin: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; overflow: hidden; }
.pfd__button { display: flex; align-items: center; gap: 0.7rem; width: 100%; min-height: var(--pfd-height, 44px); padding: 0.35rem 0.9rem; border-radius: 12px; border: 1px solid var(--surface-border, rgba(255, 255, 255, 0.12)); background: var(--bg-dark, #110d18); color: var(--text-primary, #f8f9fa); font: inherit; font-size: 0.95rem; font-weight: 600; line-height: 1.3; text-align: left; cursor: pointer; }
.pfd--sm .pfd__button { padding: 0.2rem 0.7rem; font-size: 0.85rem; border-radius: 10px; }
.pfd__button:hover:not(:disabled) { background: var(--bg-hover, #21182d); }
.pfd__button:focus-visible { outline: 2px solid var(--accent-secondary, #d998ff); outline-offset: 2px; }
.pfd__button[aria-expanded="true"] { border-color: var(--accent-primary, #8f5cff); }
.pfd__button:disabled { opacity: 0.55; cursor: not-allowed; }
.pfd__button.is-placeholder .pfd__text { color: var(--text-muted, #8c9ab0); font-weight: 500; }
.pfd__button.is-invalid { border-color: #fb7185; }
.pfd__text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfd__icon { flex: none; color: var(--text-muted, #8c9ab0); font-size: 0.9rem; }

.pfd__panel { position: fixed; z-index: 2100; display: flex; flex-direction: column; gap: 0.5rem; box-sizing: border-box; padding: 0.7rem; border-radius: 16px; border: 1px solid var(--accent-primary, #8f5cff); background: var(--bg-card, #171220); box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55); color: var(--text-primary, #f8f9fa); overflow-y: auto; }
.pfd__head { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; }
.pfd__title { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; flex: 1; min-height: 40px; padding: 0 0.6rem; border: 0; border-radius: 10px; background: transparent; color: #fff; font: inherit; font-size: 0.98rem; font-weight: 700; cursor: pointer; }
.pfd__title:hover { background: var(--bg-hover, #21182d); }
.pfd__chev { font-size: 0.65rem; color: var(--text-muted, #8c9ab0); }
.pfd__nav { flex: none; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--text-secondary, #c4d1e3); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.pfd__nav:hover { background: var(--bg-hover, #21182d); color: #fff; }
.pfd__title:focus-visible, .pfd__nav:focus-visible, .pfd__day:focus-visible, .pfd__month:focus-visible, .pfd__link:focus-visible { outline: 2px solid var(--accent-secondary, #d998ff); outline-offset: 1px; }
.pfd__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.pfd__dow { display: grid; place-items: center; height: 30px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted, #8c9ab0); }
.pfd__day { display: grid; place-items: center; aspect-ratio: 1; min-height: 38px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--text-primary, #f8f9fa); font: inherit; font-size: 0.9rem; font-weight: 500; cursor: pointer; }
.pfd__day:hover:not(:disabled):not(.is-selected) { background: var(--bg-hover, #21182d); }
.pfd__day.is-out { color: var(--text-muted, #8c9ab0); opacity: 0.6; }
.pfd__day.is-today { box-shadow: inset 0 0 0 1px var(--accent-secondary, #d998ff); }
.pfd__day.is-selected { background: #7a42ee; color: #fff; font-weight: 700; opacity: 1; }
.pfd__day:disabled { opacity: 0.3; cursor: not-allowed; }
.pfd__months { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; padding: 0.3rem 0; }
.pfd__month { min-height: 48px; border: 0; border-radius: 10px; background: var(--bg-dark, #110d18); color: var(--text-secondary, #c4d1e3); font: inherit; font-size: 0.92rem; font-weight: 600; cursor: pointer; }
.pfd__month:hover { background: var(--bg-hover, #21182d); color: #fff; }
.pfd__month.is-selected { background: #7a42ee; color: #fff; }
.pfd__foot { display: flex; justify-content: space-between; gap: 0.5rem; padding-top: 0.4rem; border-top: 1px solid var(--surface-border-soft, rgba(255, 255, 255, 0.08)); }
.pfd__link { min-height: 40px; padding: 0 0.8rem; border: 0; border-radius: 10px; background: transparent; color: var(--accent-secondary, #d998ff); font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer; }
.pfd__link:hover:not(:disabled) { background: var(--bg-hover, #21182d); }
.pfd__link:disabled { opacity: 0.35; cursor: default; }
