/*
 * Custom Select (cb-cs) — JDCore.upgradeSelect()
 * Source unique : chargé globalement depuis page_start.php
 */

.cb-cs { position: relative; display: inline-flex; flex-shrink: 0; }
.cb-cs-trigger {
    display: flex; align-items: center; justify-content: space-between; gap: 4px;
    width: 100%; padding: 5px 8px; font-size: 12px; font-family: inherit;
    background: white; border: 1px solid #dee2e6; border-radius: 6px;
    cursor: pointer; color: #212529; text-align: left; transition: border-color 0.2s; white-space: nowrap;
}
.cb-cs-trigger:hover { border-color: #adb5bd; }
.cb-cs.cb-cs-open .cb-cs-trigger { border-color: #003D7A; box-shadow: 0 0 0 2px rgba(0,61,122,0.1); }
.cb-cs-label { flex: 1; overflow: hidden; text-overflow: ellipsis; color: #9ca3af; }
.cb-cs-label:not(:empty) { color: #212529; }
.cb-cs-trigger-label { flex: 1; overflow: hidden; text-overflow: ellipsis; color: #9ca3af; }
.cb-cs-trigger-label:not(:empty) { color: #212529; }
.cb-cs-chevron { flex-shrink: 0; color: #9ca3af; transition: transform 0.18s; }
.cb-cs.cb-cs-open .cb-cs-chevron { transform: rotate(180deg); }
.cb-cs-dropdown {
    display: none; position: fixed; z-index: 9999; width: max-content; max-width: 320px;
    background: white; border: 1px solid #dee2e6; border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12); flex-direction: column; max-height: 240px; overflow: hidden;
}
.cb-cs.cb-cs-open .cb-cs-dropdown { display: flex; }
.cb-cs-search { padding: 5px; border-bottom: 1px solid #f0f0f0; flex-shrink: 0; }
.cb-cs-search input {
    width: 100%; border: 1px solid #dee2e6; border-radius: 4px;
    padding: 3px 7px; font-size: 11px; font-family: inherit; outline: none; box-sizing: border-box;
}
.cb-cs-search input:focus { border-color: #003D7A; }
.cb-cs-options { overflow-y: auto; flex: 1; }
.cb-cs-options::-webkit-scrollbar { width: 3px; }
.cb-cs-options::-webkit-scrollbar-thumb { background: #dee2e6; border-radius: 3px; }
.cb-cs-grp-label { padding: 5px 10px 2px; font-size: 10px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.5px; }
.cb-cs-grp-items .cb-cs-opt { padding-left: 16px; }
.cb-cs-opt { padding: 5px 10px; font-size: 12px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background 0.1s; }
.cb-cs-opt:hover { background: #f0f2f5; }
.cb-cs-opt.cb-cs-active { background: #e8eef8; color: #003D7A; font-weight: 600; }
.cb-cs-opt.cb-cs-placeholder { color: #9ca3af; font-style: italic; }
.cb-cs-empty { padding: 8px 10px; font-size: 12px; color: #adb5bd; font-style: italic; }
.cb-cs.cb-cs-disabled .cb-cs-trigger { background: #f8f9fa; color: #adb5bd; cursor: not-allowed; border-color: #e9ecef; }
.cb-cs.cb-cs-disabled .cb-cs-chevron { opacity: 0.4; }

/* Pleine largeur dans une modal */
.cv-modal .cb-cs, .jd-modal .cb-cs { display: flex; width: 100%; }
.cv-modal .cb-cs-trigger, .jd-modal .cb-cs-trigger { font-size: 13px; padding: 8px 11px; }
