/* WUTLU — Dispatch UI (modales, listes prestataires, devis) */

/* ===== MODALES ===== */
.wd-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    padding: 16px;
}
.wd-modal.is-open { display: flex; }

.wd-modal-card {
    background: #fff;
    border-radius: 16px;
    max-width: 720px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.wd-modal-head {
    padding: 20px 24px;
    border-bottom: 1px solid #F1F5F9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
}
.wd-modal-head h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: #0F172A;
}
.wd-modal-close {
    background: transparent;
    border: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: #94A3B8;
    font-size: 18px;
    cursor: pointer;
    transition: all .15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.wd-modal-close:hover {
    background: #FEE2E2;
    color: #DC2626;
}

.wd-modal-body { padding: 20px 24px; }
.wd-modal-actions {
    padding: 16px 24px;
    border-top: 1px solid #F1F5F9;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    position: sticky;
    bottom: 0;
    background: #fff;
}

/* ===== FILTRES ===== */
.wd-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}
.wd-toolbar-label {
    font-size: 12.5px;
    color: #64748B;
    font-weight: 600;
    margin-right: 4px;
}
.wd-chip {
    padding: 6px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1.5px solid #E2E8F0;
    font-size: 12px;
    font-weight: 600;
    color: #4B5563;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
}
.wd-chip:hover { border-color: #FDBA74; color: #C2410C; }
.wd-chip.active {
    background: #C2410C;
    color: #fff;
    border-color: #C2410C;
}

/* ===== LISTE PRESTATAIRES ===== */
.wd-providers {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wd-provider {
    display: flex;
    gap: 14px;
    padding: 16px;
    background: #fff;
    border: 1.5px solid #E2E8F0;
    border-radius: 14px;
    cursor: pointer;
    transition: all .15s;
    position: relative;
}
.wd-provider:hover {
    border-color: #FDBA74;
    background: #FFF7ED;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(194,65,12,.08);
}
.wd-provider.selected {
    border-color: #C2410C;
    background: #FFF7ED;
    box-shadow: 0 0 0 3px rgba(194,65,12,.12);
}

.wd-provider-avatar {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    border-radius: 12px;
    background: linear-gradient(135deg, #FFF7ED, #FED7AA);
    color: #C2410C;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 800;
    overflow: hidden;
    position: relative;
}
.wd-provider-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wd-provider-main { flex: 1; min-width: 0; }

.wd-provider-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}
.wd-provider-name {
    font-size: 15px;
    font-weight: 800;
    color: #0F172A;
    margin: 0;
}

.wd-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: #fff;
}

.wd-provider-desc {
    font-size: 13px;
    color: #64748B;
    line-height: 1.5;
    margin: 4px 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wd-provider-stats {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: #64748B;
    flex-wrap: wrap;
}
.wd-provider-stats strong {
    color: #0F172A;
    font-weight: 700;
}
.wd-provider-stats i {
    color: #C2410C;
    margin-right: 3px;
}

.wd-provider-price {
    text-align: right;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}
.wd-provider-price-value {
    font-size: 18px;
    font-weight: 800;
    color: #C2410C;
    white-space: nowrap;
}
.wd-provider-price-label {
    font-size: 10.5px;
    color: #94A3B8;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: .3px;
}

.wd-servicemen {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #E2E8F0;
    font-size: 12px;
    color: #64748B;
}
.wd-servicemen-list {
    display: flex;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap;
}
.wd-serviceman-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #F1F5F9;
    border-radius: 6px;
    font-size: 11.5px;
    color: #475569;
    font-weight: 600;
}
.wd-serviceman-chip.wutlu {
    background: #FFF7ED;
    color: #C2410C;
    border: 1px solid #FDBA74;
}

/* ===== FORM DEVIS ===== */
.wd-form-field {
    margin-bottom: 14px;
}
.wd-form-field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 6px;
}
.wd-form-field input,
.wd-form-field textarea,
.wd-form-field select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #E2E8F0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    transition: all .15s;
    box-sizing: border-box;
}
.wd-form-field input:focus,
.wd-form-field textarea:focus,
.wd-form-field select:focus {
    outline: none;
    border-color: #C2410C;
    box-shadow: 0 0 0 3px rgba(194,65,12,.1);
}
.wd-form-field small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #94A3B8;
}

/* ===== OFFRES ===== */
.wd-offer {
    padding: 16px;
    background: #fff;
    border: 1.5px solid #E2E8F0;
    border-radius: 14px;
    margin-bottom: 12px;
    transition: all .15s;
}
.wd-offer:hover {
    border-color: #FDBA74;
    box-shadow: 0 4px 14px rgba(194,65,12,.08);
}
.wd-offer-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}
.wd-offer-provider {
    display: flex;
    gap: 10px;
    align-items: center;
}
.wd-offer-avatar {
    width: 42px; height: 42px;
    border-radius: 10px;
    background: #FFF7ED;
    color: #C2410C;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 16px;
    flex: 0 0 42px;
}
.wd-offer-price {
    font-size: 20px;
    font-weight: 800;
    color: #C2410C;
    white-space: nowrap;
}
.wd-offer-msg {
    padding: 10px 12px;
    background: #F8FAFC;
    border-radius: 8px;
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 12px;
}
.wd-offer-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ===== BOUTONS ===== */
.wd-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13.5px;
    cursor: pointer;
    border: 0;
    font-family: inherit;
    transition: all .15s;
    text-decoration: none;
}
.wd-btn-primary {
    background: #C2410C;
    color: #fff;
}
.wd-btn-primary:hover {
    background: #9A3412;
    transform: translateY(-1px);
}
.wd-btn-ghost {
    background: #fff;
    color: #4B5563;
    border: 1.5px solid #E2E8F0;
}
.wd-btn-ghost:hover {
    background: #FFF7ED;
    color: #C2410C;
    border-color: #FDBA74;
}
.wd-btn-success {
    background: #059669;
    color: #fff;
}
.wd-btn-success:hover {
    background: #047857;
}
.wd-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}
.wd-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.wd-loading {
    text-align: center;
    padding: 40px 20px;
    color: #94A3B8;
    font-size: 14px;
}
.wd-empty {
    text-align: center;
    padding: 40px 20px;
    color: #94A3B8;
    font-size: 14px;
}
.wd-empty i {
    display: block;
    font-size: 42px;
    margin-bottom: 12px;
    opacity: .3;
}

@media (max-width: 640px) {
    .wd-provider {
        flex-direction: column;
        align-items: stretch;
    }
    .wd-provider-price {
        align-items: flex-start;
        text-align: left;
        margin-top: 8px;
    }
}
/* ===== PHOTO ZONE ===== */
.wd-photo-zone {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.wd-photo-add {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100px;
    height: 100px;
    border: 2px dashed #E2E8F0;
    border-radius: 12px;
    cursor: pointer;
    color: #94A3B8;
    font-size: 11.5px;
    font-weight: 600;
    transition: all .15s;
    text-align: center;
    padding: 8px;
    background: #F8FAFC;
}
.wd-photo-add:hover {
    border-color: #FDBA74;
    color: #C2410C;
    background: #FFF7ED;
}
.wd-photo-add i {
    font-size: 22px;
    margin-bottom: 2px;
}
.wd-photo-preview {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.wd-photo-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
}
.wd-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.wd-photo-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(220,38,38,.9);
    color: #fff;
    border: 0;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* ===== SIGNATURE PAD ===== */
.wd-signature-wrap {
    border: 2px dashed #E2E8F0;
    border-radius: 12px;
    background: #F8FAFC;
    padding: 6px;
    position: relative;
}
.wd-signature-pad {
    width: 100%;
    height: 160px;
    background: #fff;
    border-radius: 8px;
    touch-action: none;
    cursor: crosshair;
    display: block;
}
.wd-signature-clear {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #64748B;
    cursor: pointer;
    font-family: inherit;
}

/* ===== ALERTE CASH ===== */
.wd-cash-alert {
    padding: 16px 18px;
    border-radius: 12px;
    background: #FEF3C7;
    color: #92400E;
    border-left: 4px solid #D97706;
    font-size: 13.5px;
    line-height: 1.5;
    margin-bottom: 16px;
}
.wd-cash-alert strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
    color: #7C2D12;
}
/* ===== CHOIX PRESTATAIRE OBLIGATOIRE ===== */
.wd-provider-choice {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 560px) {
    .wd-provider-choice { grid-template-columns: 1fr; }
}
.wd-choice-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: #fff;
    border: 2px solid #E2E8F0;
    border-radius: 14px;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
    min-height: 90px;
}
.wd-choice-btn:hover {
    border-color: #FDBA74;
    background: #FFF7ED;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(194,65,12,.08);
}
.wd-choice-btn.selected {
    border-color: #C2410C;
    background: #FFF7ED;
    box-shadow: 0 0 0 3px rgba(194,65,12,.12);
}
.wd-choice-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 12px;
    background: #FFF7ED;
    color: #C2410C;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.wd-choice-btn.selected .wd-choice-icon {
    background: #C2410C;
    color: #fff;
}
.wd-choice-text {
    flex: 1;
    min-width: 0;
}
.wd-choice-text strong {
    display: block;
    font-size: 14.5px;
    font-weight: 800;
    color: #0F172A;
    margin-bottom: 3px;
}
.wd-choice-text small {
    display: block;
    font-size: 12.5px;
    color: #64748B;
    line-height: 1.4;
}