/* ==========================================================================
   .modal-card : carte d'édition générique injectée dans customModal
   (header icône + titre + sous-titre + croix, body label + champ + compteur,
   footer action destructive + annuler/valider). Réutilisable hors pilotage.
   ========================================================================== */
.modal--overlay:has(.modal-card) {
    background-color: rgba(15, 42, 51, 0.36);
    backdrop-filter: blur(4px);
}

.modal--content:has(.modal-card) {
    overflow: hidden;
    width: 480px;
    max-width: calc(100vw - 32px);
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(16, 35, 42, 0.24);
    font-family: 'ubunturegular', sans-serif;
}

.modal--content:has(.modal-card--history) {
    width: 680px;
}

.modal--content:has(.modal-card) > .modal--close.close {
    display: none;
}

.modal-card__header {
    display: flex;
    align-items: center;
    min-height: 70px;
    padding: 18px 20px 15px 21px;
    border-bottom: 1px solid #e2e8ec;
}

.modal-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    margin-right: 13px;
    border-radius: 8px;
    background: #e5f7fb;
    color: #00a6c7;
    font-size: 15px;
}

.modal-card__heading {
    min-width: 0;
    flex: 1 1 auto;
}

.modal--content:has(.modal-card) .modal-card__title {
    margin: 0;
    color: #16303b;
    font-size: 16px;
    font-weight: 700;
    line-height: 18px;
    letter-spacing: normal;
}

.modal--content:has(.modal-card) .modal-card__subtitle {
    overflow: hidden;
    margin: 3px 0 0;
    color: #8a98a3;
    font-size: 12px;
    line-height: 16px;
    letter-spacing: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal--content:has(.modal-card) .modal-card__close {
    position: static;
    width: auto;
    height: auto;
    margin: 0 6px 0 14px;
    color: #788993;
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
    opacity: 1;
    text-shadow: none;
    transform: none;
}

.modal--content:has(.modal-card) .modal-card__close:hover {
    color: #16303b;
    opacity: 1;
}

.modal-card__body {
    padding: 19px 20px 17px;
    background: #fbfcfd;
}

.modal--content:has(.modal-card) .modal-card__body label.modal-card__label:not(.label--file):not(.radio-inline):not(.checkbox-inline):not(.retour-card) {
    display: block;
    margin: 0 0 7px;
    color: #778794;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 13px;
    text-transform: uppercase;
}

.modal-card__field {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 96px;
    padding: 13px 15px;
    border: 1px solid #05aeca;
    border-radius: 9px;
    background: #fff;
    color: #1c2f39;
    font-size: 14px;
    line-height: 20px;
    outline: none;
    resize: none;
    box-shadow: inset 0 0 0 1px rgba(5, 174, 202, 0.1), 0 0 0 2px rgba(5, 174, 202, 0.11);
}

.modal-card__field:focus {
    border-color: #05aeca;
    box-shadow: inset 0 0 0 1px rgba(5, 174, 202, 0.14), 0 0 0 2px rgba(5, 174, 202, 0.16);
}

.modal-card__counter {
    margin-top: 6px;
    color: #83919c;
    font-size: 12px;
    line-height: 14px;
    text-align: right;
}

.modal-card__history-list {
    display: grid;
    gap: 10px;
    max-height: min(55vh, 480px);
    overflow-y: auto;
}

.modal-card__history-item {
    padding: 13px 15px;
    border: 1px solid #e2e8ec;
    border-radius: 9px;
    background: #fff;
}

.modal-card__history-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 7px;
    color: #788993;
    font-size: 12px;
    line-height: 16px;
}

.modal-card__history-meta strong {
    color: #16303b;
    font-weight: 700;
}

.modal-card__history-meta time {
    flex: 0 0 auto;
}

.modal-card__history-comment {
    color: #1c2f39;
    font-size: 14px;
    line-height: 20px;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.modal-card__history-empty {
    margin: 0;
    padding: 20px;
    border: 1px dashed #d5e0e5;
    border-radius: 9px;
    color: #788993;
    text-align: center;
}

.modal-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 67px;
    padding: 14px 21px 15px;
    border-top: 1px solid #e2e8ec;
    background: #fff;
}

.modal-card__footer-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.modal--content .modal-card__footer .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    margin: 0;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
}

.modal--content .modal-card__footer .btn i {
    margin-right: 8px;
    font-size: 13px;
}

.modal--content .modal-card__footer .btn-link {
    height: 38px;
    padding: 0 16px;
    border: 0;
    background: transparent;
    color: #df4637 !important;
}

.modal--content .modal-card__footer .btn-link:hover,
.modal--content .modal-card__footer .btn-link:focus {
    background: rgba(223, 70, 55, 0.06);
    color: #c63327 !important;
    text-decoration: none;
}

.modal--content .modal-card__footer .btn-default {
    min-width: 81px;
    padding: 0 17px;
    border: 1px solid #dbe4ea;
    background: #fff;
    color: #4f6571;
    box-shadow: none;
}

.modal--content .modal-card__footer .btn-default:hover,
.modal--content .modal-card__footer .btn-default:focus {
    border-color: #cbd7de;
    background: #f8fafb;
    color: #16303b;
}

.modal--content .modal-card__footer .btn-success {
    min-width: 126px;
    padding: 0 18px;
    border: 1px solid #00a6c0;
    background: #00a6c0;
    color: #fff;
    box-shadow: none;
}

.modal--content .modal-card__footer .btn-success:hover,
.modal--content .modal-card__footer .btn-success:focus {
    border-color: #008fa8;
    background: #008fa8;
    color: #fff;
}
