/* Fenêtre « CV chez le client sans réponse » (case-liberation-poller.js) */

.clb-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    padding: 16px;
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(2px);
    animation: clb-fade .18s ease-out;
    overflow-y: auto;
}

.clb-overlay.is-leaving {
    opacity: 0;
    transition: opacity .18s;
}

@keyframes clb-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes clb-in {
    from { opacity: 0; transform: translateY(12px) scale(.97); }
    to { opacity: 1; transform: none; }
}

.clb-modal {
    width: 100%;
    max-width: 680px;
    margin: auto;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .3), 0 2px 8px rgba(15, 23, 42, .08);
    animation: clb-in .22s cubic-bezier(.2, .9, .3, 1.2);
    font-size: 13.5px;
    color: #0f172a;
}

.clb-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px 22px 18px;
    background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
    border-bottom: 1px solid #e0e7ff;
}

.clb-icon {
    flex: 0 0 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    box-shadow: 0 6px 16px rgba(99, 102, 241, .35);
}

.clb-titles {
    flex: 1;
    min-width: 0;
}

.clb-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    font-weight: 700;
    color: #3730a3;
    letter-spacing: -.01em;
}

.clb-count {
    min-width: 24px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: #fff;
    font-size: 12px;
}

.clb-subtitle {
    margin-top: 4px;
    color: #475569;
    line-height: 1.45;
}

.clb-close {
    flex: 0 0 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    font-size: 15px;
    cursor: pointer;
}

.clb-close:hover {
    background: rgba(15, 23, 42, .06);
    color: #0f172a;
}

.clb-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 22px;
    max-height: 60vh;
    overflow-y: auto;
}

.clb-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 14px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #6366f1;
    border-radius: 10px;
    background: #fff;
    transition: border-color .15s, box-shadow .15s, opacity .15s, background .2s;
}

.clb-item:hover {
    box-shadow: 0 4px 14px rgba(15, 23, 42, .07);
}

.clb-item.is-busy {
    opacity: .6;
}

.clb-item.is-extended {
    border-left-color: #22c55e;
    background: #f0fdf4;
}

.clb-item.is-released {
    border-left-color: #f97316;
    background: #fff7ed;
}

.clb-item-main {
    flex: 1 1 300px;
    min-width: 0;
}

.clb-item-top {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.clb-num {
    flex: 0 0 auto;
    font-size: 11.5px;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 6px;
    padding: 1px 6px;
}

.clb-name {
    font-weight: 600;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clb-name:hover {
    color: #4f46e5;
    text-decoration: none;
}

.clb-account {
    margin-top: 3px;
    font-size: 12px;
    color: #64748b;
}

.clb-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.clb-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.6;
    background: #f1f5f9;
    color: #334155;
}

.clb-pill .fas {
    font-size: 9.5px;
    opacity: .75;
}

.clb-pill.is-info { background: #e0f2fe; color: #0369a1; }
.clb-pill.is-danger { background: #fee2e2; color: #b91c1c; }

.clb-item-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.clb-item-done {
    flex: 1 1 100%;
    font-weight: 600;
    color: #15803d;
}

.clb-item.is-released .clb-item-done {
    color: #c2410c;
}

.clb-btn {
    border: 0;
    border-radius: 9px;
    padding: 8px 14px;
    font-weight: 600;
    font-size: 12.5px;
    cursor: pointer;
    white-space: nowrap;
    transition: box-shadow .15s, background .15s, transform .1s;
}

.clb-btn:active {
    transform: scale(.98);
}

.clb-btn:disabled {
    cursor: default;
    opacity: .7;
}

.clb-btn-extend {
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    box-shadow: 0 4px 12px rgba(99, 102, 241, .3);
}

.clb-btn-release {
    color: #c2410c;
    background: #fff;
    box-shadow: inset 0 0 0 1px #fdba74;
}

.clb-btn-release:hover {
    background: #fff7ed;
}

.clb-btn-ghost {
    background: #fff;
    color: #334155;
    box-shadow: inset 0 0 0 1px #cbd5e1;
}

.clb-btn-ghost:hover {
    background: #f1f5f9;
}

.clb-foot {
    display: flex;
    justify-content: flex-end;
    padding: 14px 22px 16px;
    background: #f8fafc;
    border-top: 1px solid #eef2f7;
}

/* Modale paramètres (réutilise le style .cvt-ap) : large et horizontale — Nouveau | En cours | CV —,
   en-tête et pied fixes, corps défilant si l'écran est trop bas. */

.clb-settings-dialog .modal-dialog {
    max-width: 1140px;
    width: calc(100% - 32px);
    margin-top: 4vh;
}

.clb-settings {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 8vh - 16px);
}

.clb-settings-head {
    flex: 0 0 auto;
    background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
    border-bottom-color: #e0e7ff;
}

.clb-settings-icon {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    box-shadow: 0 6px 16px rgba(99, 102, 241, .35);
}

.clb-settings-title {
    color: #3730a3;
}

.clb-settings-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 22px;
    background: #f8fafc;
}

.clb-settings-foot {
    flex: 0 0 auto;
    margin-top: 0;
}

.clb-settings-loading {
    grid-column: 1 / -1;
    padding: 24px 0;
    text-align: center;
    color: #64748b;
}

/* Besoins (2 colonnes) | CV (1 colonne) */
.clb-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
}

.clb-sec {
    min-width: 0;
    padding: 14px 16px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
}

.clb-sec-body {
    transition: opacity .15s;
}

.clb-sec.is-off .clb-sec-body {
    opacity: .45;
}

.clb-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.clb-col {
    min-width: 0;
}

.clb-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    color: #1e293b;
}

.clb-toggle input {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.clb-toggle input:focus-visible + .clb-toggle-track {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .25);
}

.clb-toggle-track {
    position: relative;
    flex: 0 0 38px;
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background .15s;
}

.clb-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    transition: transform .15s;
}

.clb-toggle input:checked + .clb-toggle-track {
    background: #6366f1;
}

.clb-toggle input:checked + .clb-toggle-track .clb-toggle-thumb {
    transform: translateX(16px);
}

.clb-group-title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 8px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #64748b;
}

.clb-group-title .fas {
    color: #6366f1;
}

.clb-rows {
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

/* Un délai = une ligne : icône | titre + aide | saisie */
.clb-field {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px 9px 12px;
    background: #fff;
}

.clb-field + .clb-field {
    border-top: 1px solid #f1f5f9;
}

.clb-field-icon {
    flex: 0 0 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 12.5px;
}

.clb-field-text {
    flex: 1 1 auto;
    min-width: 0;
}

.clb-field-title {
    font-weight: 600;
    line-height: 1.3;
}

.clb-field-help {
    margin-top: 1px;
    font-size: 11.5px;
    color: #64748b;
    line-height: 1.35;
}

.clb-field-input {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin: 0;
    color: #94a3b8;
    font-size: 10.5px;
    font-weight: 500;
    white-space: nowrap;
}

.clb-field-input input {
    width: 58px;
    padding: 5px 6px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    color: #0f172a;
}

.clb-field-input input:focus,
.clb-team-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
}

.clb-field-input input.is-invalid {
    border-color: #ef4444;
}

/* Destinataires de l'alerte « Besoin Nouveau » : une ligne sous les deux colonnes (texte | type | choix) */
.clb-recipient {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto minmax(160px, 220px);
    align-items: center;
    gap: 10px 14px;
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px dashed #c7d2fe;
    border-radius: 10px;
    background: #f5f7ff;
}

.clb-recipient.is-invalid {
    border-color: #ef4444;
    background: #fef2f2;
}

.clb-recipient .clb-field-title .fas {
    margin-right: 4px;
    color: #6366f1;
}

.clb-recipient-text {
    min-width: 0;
}

.clb-seg {
    display: flex;
    padding: 3px;
    border-radius: 9px;
    background: #e0e7ff;
}

.clb-seg-btn {
    flex: 1;
    border: 0;
    border-radius: 7px;
    padding: 5px 10px;
    background: transparent;
    color: #4338ca;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s, box-shadow .15s;
}

.clb-seg-btn.is-active {
    background: #fff;
    color: #312e81;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}

.clb-team-select.form-control {
    height: 34px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13px;
}

.clb-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.clb-user-btn:hover {
    border-color: #a5b4fc;
}

.clb-user-btn.is-empty {
    color: #64748b;
    font-weight: 500;
}

.clb-user-btn .fas:first-child {
    color: #6366f1;
}

.clb-user-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clb-user-caret {
    font-size: 10px;
    color: #94a3b8;
}

.clb-btn-save {
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    box-shadow: 0 4px 12px rgba(99, 102, 241, .3);
}

/* Écran moyen : Besoins sur toute la largeur (2 colonnes), CV en dessous (2 colonnes de lignes) */
@media (max-width: 1080px) {
    .clb-layout {
        grid-template-columns: 1fr;
    }

    .clb-sec-cv .clb-rows {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .clb-sec-cv .clb-field + .clb-field {
        border-top: 0;
    }

    .clb-sec-cv .clb-field:nth-child(n + 3) {
        border-top: 1px solid #f1f5f9;
    }

    .clb-sec-cv .clb-field:nth-child(even) {
        border-left: 1px solid #f1f5f9;
    }
}

@media (max-width: 760px) {
    .clb-recipient {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .clb-cols,
    .clb-sec-cv .clb-rows {
        grid-template-columns: 1fr;
    }

    .clb-sec-cv .clb-field:nth-child(even) {
        border-left: 0;
    }

    .clb-sec-cv .clb-field + .clb-field {
        border-top: 1px solid #f1f5f9;
    }
}

@media (max-width: 560px) {
    .clb-item-actions {
        width: 100%;
    }

    .clb-item-actions .clb-btn {
        flex: 1;
    }

    .clb-settings-dialog .modal-dialog {
        width: calc(100% - 16px);
        margin: 8px auto;
    }

    .clb-settings {
        max-height: calc(100vh - 16px);
    }

    .clb-settings-head {
        padding: 14px 14px 12px;
        gap: 10px;
    }

    .clb-settings-head .cvt-ap-icon {
        flex-basis: 36px;
        height: 36px;
        font-size: 15px;
    }

    .clb-settings-head .cvt-ap-subtitle {
        font-size: 12.5px;
    }

    .clb-settings-body {
        padding: 12px 10px;
    }

    .clb-sec {
        padding: 12px 10px;
    }

    .clb-settings-foot {
        padding: 12px 14px 14px;
    }

    .clb-settings-foot .cvt-ap-question {
        font-size: 12px;
    }
}
.clb-candidate { display: inline-flex; align-items: center; gap: 5px; margin-right: 8px; font-weight: 700; color: #0f172a; }
.clb-candidate .fas { font-size: 11px; color: #64748b; }
.clb-pill.is-warn { background: #fef3e2; color: #b45309; border-color: #f6d9a6; }
.clb-item.is-treatment { border-left: 3px solid #f59e0b; }
.clb-item.is-nouveau { border-left: 3px solid #ef4444; }
/* Le bouton flottant « + » passait au-dessus du pied de la modale paramètres (petits écrans) */
body:has(.clb-settings-dialog) #support-bubble { display: none; }
