/* ============================================================
   Modern legördülő lista (pretty select)
   A natív <select> megnyíló listáját az operációs rendszer rajzolja,
   ezért CSS-sel nem formázható. Ez a komponens a natív elemet a
   helyén hagyja (érték, űrlapküldés, validáció változatlan), és egy
   saját gombot + panelt tesz fölé.
   ============================================================ */

.ps-wrap {
    position: relative;
    display: block;
    width: 100%;
}

/* A natív select a helyén marad, csak láthatatlan: így az űrlapküldés,
   a JS-ből olvasott .value és a böngésző validációja is működik. */
.ps-wrap > select.ps-native {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
}

.ps-button {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 36px 9px 13px;
    border: 1px solid #dfe4ec;
    border-radius: 8px;
    background: #fbfcfe;
    color: #263B6A;
    font-size: .95rem;
    font-family: inherit;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.ps-button:hover { background: #fff; border-color: #c8d3e4; }

.ps-button:focus-visible,
.ps-wrap.ps-open .ps-button {
    outline: none;
    background: #fff;
    border-color: #406093;
    box-shadow: 0 0 0 3px rgba(64, 96, 147, .15);
}

.ps-wrap.ps-disabled .ps-button {
    background: #f1f3f7;
    color: #9aa4b5;
    cursor: not-allowed;
}

.ps-label {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ps-label.ps-placeholder { color: #98a2b3; }

.ps-caret {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #406093;
    transition: transform .18s ease;
}

.ps-wrap.ps-open .ps-caret { transform: translateY(-50%) rotate(180deg); }

/* --------------------------
   Legördülő panel
--------------------------- */
.ps-panel {
    /* Fix pozíció: így a legördülő panel nem vágódik le a görgethető
       konténerekben és a táblázatok overflow:auto sávjaiban sem. */
    position: fixed;
    z-index: 1080;
    background: #fff;
    border: 1px solid #dfe4ec;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(38, 59, 106, .16);
    padding: 6px;
    display: none;
    animation: ps-fade .12s ease-out;
}

.ps-wrap.ps-open .ps-panel { display: block; }

@keyframes ps-fade {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
}

.ps-search-wrap { padding: 4px 4px 8px; }

.ps-search {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dfe4ec;
    border-radius: 7px;
    font-size: .9rem;
    color: #263B6A;
    background: #f8fafc;
}

.ps-search:focus {
    outline: none;
    background: #fff;
    border-color: #406093;
    box-shadow: 0 0 0 3px rgba(64, 96, 147, .12);
}

.ps-list {
    max-height: 260px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.ps-group {
    padding: 8px 12px 4px;
    font-size: .72rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #98a2b3;
    font-weight: 600;
}

.ps-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 7px;
    color: #263B6A;
    font-size: .93rem;
    cursor: pointer;
    user-select: none;
}

.ps-option:hover,
.ps-option.ps-active {
    background: #eef3fa;
}

.ps-option.ps-selected {
    background: #263B6A;
    color: #fff;
    font-weight: 500;
}

.ps-option.ps-selected.ps-active { background: #1c2d53; }

.ps-option.ps-disabled {
    color: #b6bece;
    cursor: not-allowed;
    background: none;
}

.ps-option-text {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ps-option .ps-check {
    flex: 0 0 auto;
    opacity: 0;
    font-size: .85rem;
}

.ps-option.ps-selected .ps-check { opacity: 1; }

.ps-empty {
    padding: 14px 12px;
    color: #98a2b3;
    font-size: .88rem;
    text-align: center;
}

/* Sötétebb hátterű kártyákon is olvasható maradjon a görgetősáv */
.ps-list::-webkit-scrollbar { width: 10px; }
.ps-list::-webkit-scrollbar-thumb {
    background: #d8dfea;
    border-radius: 8px;
    border: 3px solid #fff;
}
.ps-list::-webkit-scrollbar-thumb:hover { background: #c2ccdc; }

/* Kompakt változat (táblázatos szerkesztők, szűk sávok) */
.ps-wrap.ps-sm .ps-button {
    padding: 5px 30px 5px 10px;
    font-size: .87rem;
    border-radius: 6px;
}

.ps-wrap.ps-sm .ps-option {
    padding: 7px 10px;
    font-size: .87rem;
}
