/* Fenêtre « Sélectionner un profil » (CVthèque, Réponse besoin) */

.cvt-sx-dialog .modal-dialog {
    width: min(1040px, calc(100% - 32px));
    max-width: none;
    margin-top: 5vh;
}

.cvt-sx-dialog .modal-content {
    border: 0;
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 28px 70px rgba(15, 23, 42, .30), 0 2px 8px rgba(15, 23, 42, .08);
    animation: cvt-sx-in .22s cubic-bezier(.2, .9, .3, 1.15);
}

.cvt-sx-dialog .modal-header,
.cvt-sx-dialog .modal-footer,
.cvt-sx-dialog .modal-content > header,
.cvt-sx-dialog .modal-content > footer {
    display: none !important;
}

.cvt-sx-dialog .modal-body {
    padding: 0 !important;
    max-height: none !important;
}

@keyframes cvt-sx-in {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to { opacity: 1; transform: none; }
}

.cvt-sx {
    display: flex;
    flex-direction: column;
    max-height: 88vh;
    font-size: 13.5px;
    color: #0f172a;
}

/* En-tête */
.cvt-sx-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 22px 14px;
}

.cvt-sx-icon {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    font-size: 17px;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .35);
}

.cvt-sx-titles {
    flex: 1 1 auto;
    min-width: 0;
}

.cvt-sx-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.01em;
}

.cvt-sx-subtitle {
    margin-top: 2px;
    font-size: 12.5px;
    color: #64748b;
}

.cvt-sx-subtitle [data-name="sel-count"] {
    font-weight: 600;
    color: #334155;
}

.cvt-sx-close {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.cvt-sx-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Barre de recherche */
.cvt-sx-toolbar {
    padding: 0 22px 14px;
    border-bottom: 1px solid #eef2f7;
}

.cvt-sx-search {
    position: relative;
}

.cvt-sx-search-ico {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 15px;
    pointer-events: none;
}

.cvt-sx-search input {
    width: 100%;
    height: 48px;
    padding: 0 44px 0 44px;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    font-size: 15px;
    color: #0f172a;
    outline: none;
    transition: border-color .15s, background .15s, box-shadow .15s;
}

.cvt-sx-search input::placeholder {
    color: #94a3b8;
}

.cvt-sx-search input:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.cvt-sx-search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: none;
    color: #94a3b8;
    font-size: 16px;
    cursor: pointer;
}

.cvt-sx-search-clear:hover {
    color: #475569;
}

.cvt-sx-search-clear.hidden {
    display: none;
}

.cvt-sx-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.cvt-sx-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 14px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}

.cvt-sx-pill .fas {
    color: #64748b;
    font-size: 12px;
}

.cvt-sx-pill:hover {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.cvt-sx-pill:hover .fas {
    color: #2563eb;
}

.cvt-sx-pill.is-toggle.is-on {
    border-color: #86efac;
    background: #dcfce7;
    color: #15803d;
}

.cvt-sx-pill.is-toggle.is-on .fas {
    color: #16a34a;
}

/* Filtres appliqués (étiquettes générées par le hub) */
.cvt-sx-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

.cvt-sx-chips:empty {
    display: none;
}

.cvt-sx-chips .cvt-super-filter-tag,
.cvt-sx-chips .cvt-hub-adv-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px 4px 12px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 600;
}

.cvt-sx-chips .cvt-super-filter-tag a,
.cvt-sx-chips .cvt-hub-adv-filter-tag a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(55, 48, 163, .12);
    color: #3730a3;
    text-decoration: none;
}

.cvt-sx-chips .cvt-super-filter-clear {
    font-size: 12px;
    color: #64748b;
    text-decoration: underline;
}

/* Liste */
.cvt-sx-list {
    flex: 1 1 auto;
    min-height: 220px;
    max-height: 58vh;
    overflow-y: auto;
    padding: 10px 14px;
    background: #f8fafc;
    transition: opacity .15s;
}

.cvt-sx-list.is-loading {
    opacity: .55;
    pointer-events: none;
}

.cvt-sx-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    margin-bottom: 8px;
    border: 1px solid #e8edf3;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    outline: none;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}

.cvt-sx-row:last-child {
    margin-bottom: 0;
}

.cvt-sx-row:hover,
.cvt-sx-row:focus {
    border-color: #bfdbfe;
    box-shadow: 0 6px 18px rgba(37, 99, 235, .10);
    transform: translateY(-1px);
}

.cvt-sx-av {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .02em;
}

.cvt-sx-main {
    flex: 1 1 auto;
    min-width: 0;
}

.cvt-sx-name {
    font-size: 14.5px;
    font-weight: 700;
    color: #0f172a;
}

.cvt-sx-role {
    margin-top: 1px;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cvt-sx-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin-top: 4px;
    font-size: 12px;
    color: #64748b;
}

.cvt-sx-meta .fas {
    margin-right: 3px;
    color: #94a3b8;
    font-size: 11px;
}

.cvt-sx-side {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    max-width: 42%;
}

.cvt-sx-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
}

.cvt-sx-meta.is-people {
    justify-content: flex-end;
    margin-top: 0;
}

.cvt-sx-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.cvt-sx-tag.is-ok {
    background: #dcfce7;
    color: #15803d;
}

.cvt-sx-tag.is-warn {
    background: #fef3c7;
    color: #b45309;
}

.cvt-sx-tag.is-contrat {
    background: #e0f2fe;
    color: #0369a1;
}

.cvt-sx-tag.is-st {
    margin-left: 4px;
    background: #dcfce7;
    color: #15803d;
    vertical-align: middle;
}

.cvt-sx-go {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #2563eb;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity .15s, transform .15s;
}

.cvt-sx-row:hover .cvt-sx-go,
.cvt-sx-row:focus .cvt-sx-go {
    opacity: 1;
    transform: none;
}

/* États */
.cvt-sx-empty {
    padding: 48px 16px;
    text-align: center;
    color: #94a3b8;
}

.cvt-sx-empty > .fas {
    font-size: 30px;
    margin-bottom: 10px;
    color: #cbd5e1;
}

.cvt-sx-empty p {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}

.cvt-sx-skel {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    margin-bottom: 8px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #eef2f7;
}

.cvt-sx-skel-av,
.cvt-sx-skel-lines i {
    background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 50%, #eef2f7 75%);
    background-size: 200% 100%;
    animation: cvt-sx-shimmer 1.2s infinite linear;
}

.cvt-sx-skel-av {
    width: 42px;
    height: 42px;
    border-radius: 50%;
}

.cvt-sx-skel-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cvt-sx-skel-lines i {
    display: block;
    height: 10px;
    border-radius: 6px;
    width: 45%;
}

.cvt-sx-skel-lines i + i {
    width: 70%;
}

@keyframes cvt-sx-shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

/* Pied */
.cvt-sx-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 22px;
    border-top: 1px solid #eef2f7;
    background: #fff;
}

.cvt-sx-hint {
    font-size: 12px;
    color: #94a3b8;
}

.cvt-sx-hint kbd {
    padding: 1px 6px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
    box-shadow: none;
}

.cvt-sx-pager {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cvt-sx-page {
    width: 34px;
    height: 34px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    color: #334155;
    cursor: pointer;
    transition: all .15s;
}

.cvt-sx-page:hover:not(:disabled) {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.cvt-sx-page:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.cvt-sx-page-info {
    font-size: 12.5px;
    font-weight: 600;
    color: #475569;
}

@media (max-width: 720px) {
    .cvt-sx-row {
        flex-wrap: wrap;
    }

    .cvt-sx-side {
        max-width: none;
        width: 100%;
        align-items: flex-start;
    }

    .cvt-sx-tags,
    .cvt-sx-meta.is-people {
        justify-content: flex-start;
    }

    .cvt-sx-go,
    .cvt-sx-hint {
        display: none;
    }
}
