/* Doppioni / merge anagrafica clienti */
.ddm-dup-panel {
    margin: 12px 0 18px;
    padding: 14px 16px;
    border: 1px solid #fde68a;
    border-radius: 10px;
    background: #fffbeb;
}

.ddm-dup-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.ddm-dup-panel-head h3 {
    margin: 0 0 4px;
    font-size: 16px;
    color: #92400e;
}

.ddm-dup-panel-head p {
    margin: 0;
    font-size: 13px;
    color: #a16207;
}

.ddm-dup-panel-actions button {
    cursor: pointer;
    border: 1px solid #f59e0b;
    background: #fff;
    color: #92400e;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 700;
}

.ddm-dup-list {
    display: grid;
    gap: 10px;
    max-height: 360px;
    overflow: auto;
}

.ddm-dup-empty {
    margin: 0;
    font-size: 13px;
    color: #78716c;
}

.ddm-dup-group {
    background: #fff;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 10px 12px;
}

.ddm-dup-group header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.ddm-dup-group h4 {
    margin: 0;
    font-size: 14px;
    color: #0f172a;
}

.ddm-dup-group header span {
    font-size: 12px;
    color: #78716c;
}

.ddm-dup-group ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 4px;
}

.ddm-dup-group li {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) auto minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    color: #334155;
    padding: 4px 0;
    border-top: 1px dashed #fef3c7;
}

.ddm-dup-row-actions {
    justify-self: end;
}

.ddm-dup-del-btn {
    cursor: pointer;
    border: 1px solid #fca5a5;
    background: #fef2f2;
    color: #b91c1c;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.ddm-dup-del-btn:hover {
    background: #fee2e2;
}

.ddm-dup-del-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.ddm-dup-group li.senza-tel em {
    color: #b45309;
    font-style: normal;
    font-weight: 600;
}

.ddm-dup-group li.con-tel span:nth-child(3) {
    color: #166534;
    font-weight: 600;
}

.ddm-dup-merge-btn {
    cursor: pointer;
    border: none;
    border-radius: 6px;
    padding: 7px 12px;
    background: #d97706;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.ddm-merge-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 10060;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 36px 16px;
    overflow: auto;
}

.ddm-merge-dialog {
    width: min(640px, 100%);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
    overflow: hidden;
}

.ddm-merge-dialog-head,
.ddm-merge-dialog-foot {
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.ddm-merge-dialog-foot {
    border-bottom: none;
    border-top: 1px solid #e2e8f0;
}

.ddm-merge-dialog-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.ddm-merge-dialog-head h3 {
    margin: 0 0 4px;
    font-size: 18px;
}

.ddm-merge-dialog-head p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

.ddm-merge-close {
    border: none;
    background: #f1f5f9;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
}

.ddm-merge-dialog-body {
    padding: 12px 16px;
    display: grid;
    gap: 8px;
    max-height: 50vh;
    overflow: auto;
}

.ddm-merge-card {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    background: #f8fafc;
}

.ddm-merge-card.suggested {
    border-color: #86efac;
    background: #f0fdf4;
}

.ddm-merge-card-main {
    display: grid;
    gap: 2px;
    flex: 1;
}

.ddm-merge-meta {
    font-size: 12px;
    color: #64748b;
}

.ddm-merge-badge {
    display: inline-block;
    margin-top: 4px;
    width: fit-content;
    padding: 2px 8px;
    border-radius: 999px;
    background: #16a34a;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.ddm-merge-hint {
    margin: 0 0 10px;
    font-size: 12px;
    color: #64748b;
}

.ddm-merge-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.ddm-merge-actions button {
    cursor: pointer;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 9px 14px;
    background: #f8fafc;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.ddm-merge-actions button.primary {
    border: none;
    background: #2563eb;
    color: #fff;
}

.ddm-merge-actions button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.ddm-merge-msg {
    margin: 10px 0 0;
    font-size: 13px;
    color: #334155;
}

.ddm-merge-msg.ok { color: #166534; }
.ddm-merge-msg.err { color: #b91c1c; }

.ddm-cli-open-conflitto-merge {
    cursor: pointer;
    border: 1px solid #f59e0b;
    background: #fffbeb;
    color: #92400e;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .ddm-dup-group li {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}
