/* ═══════════════════════════════════════════════════════════
   DTISoft — Contact Detail Popup
   ═══════════════════════════════════════════════════════════ */

.cd-overlay {
    position: fixed; inset: 0; z-index: 8500;
    background: rgba(0,0,0,.35);
    display: flex; align-items: center; justify-content: center;
}
.cd-panel {
    background: var(--white); border-radius: 6px;
    box-shadow: 0 8px 32px rgba(0,0,0,.25);
    width: 780px; max-height: 90vh;
    display: flex; flex-direction: column;
    font-size: 13px;
}

/* Header */
.cd-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px;
    background: var(--gray-100); border-bottom: 1px solid var(--gray-300);
    border-radius: 6px 6px 0 0;
    font-weight: 700; font-size: 14px; color: var(--gray-700);
}
.cd-save-btn {
    margin-left: auto; margin-right: 8px;
    padding: 4px 12px; font-size: 12px; font-weight: 600;
    border: 1px solid #1e1e1e; border-radius: 3px;
    background: #1e1e1e; color: var(--white);
    cursor: pointer; font-family: inherit;
}
.cd-save-btn:hover { opacity: .85; background: #333; }
.cd-save-btn i { margin-right: 4px; }
.cd-close {
    background: none; border: none; cursor: pointer;
    font-size: 16px; color: var(--gray-500); padding: 2px 6px;
}
.cd-close:hover { color: var(--gray-800); }

/* Body */
.cd-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.cd-two-col { display: flex; gap: 20px; }
.cd-col-left { flex: 1; min-width: 0; }
.cd-col-right { flex: 0 0 250px; }

/* Fields */
.cd-fld {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 5px;
}
.cd-fld > label:first-child {
    flex: 0 0 110px; text-align: right;
    font-size: 12px; color: var(--gray-600); white-space: nowrap;
}
.cd-fld input[type="text"],
.cd-fld input[type="password"],
.cd-fld select {
    flex: 1; min-width: 0;
    font-size: 13px; padding: 3px 6px; height: 25px;
    border: 1px solid var(--gray-300); border-radius: 2px;
    background: var(--white); color: var(--gray-800); font-family: inherit;
}
.cd-fld input:focus, .cd-fld select:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary);
}
.cd-fld input[readonly] { background: var(--gray-50); color: var(--gray-500); }
.cd-fld input:disabled { background: var(--gray-50); color: var(--gray-400); }
.cd-duo { display: flex; align-items: center; flex: 1; min-width: 0; gap: 4px; }
.cd-search-wrap { position: relative; flex: 1; min-width: 0; display: flex; }
.cd-search-icon {
    position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
    font-size: 11px; color: var(--gray-400); pointer-events: none;
}
.cd-search-inp { padding-left: 22px !important; width: 100%; }

/* Autocomplete dropdown */
.cd-ac-list {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    z-index: 100; background: var(--white);
    border: 1px solid var(--gray-300); border-top: none;
    border-radius: 0 0 3px 3px;
    max-height: 180px; overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.cd-ac-item {
    padding: 5px 8px; font-size: 12px; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cd-ac-item:hover { background: var(--blue-pale); }
.cd-ac-nom { color: var(--gray-400); }

/* Checkbox */
.cd-fld-chk > label:first-child { flex: 0 0 110px; }
.cd-chk {
    display: flex; align-items: center; gap: 5px;
    font-size: 12px; color: var(--gray-700); cursor: pointer;
}
.cd-chk input[type="checkbox"] { cursor: pointer; width: 14px; height: 14px; }

/* Separator */
.cd-sep { border-top: 1px solid var(--gray-200); margin: 8px 0; }

/* Section title */
.cd-section-title {
    font-weight: 600; font-size: 12px; color: var(--gray-500);
    margin: 6px 0 4px; text-transform: uppercase; letter-spacing: .03em;
}

/* Photo placeholder */
.cd-photo {
    width: 80px; height: 80px; border: 1px solid var(--gray-300);
    border-radius: 4px; display: flex; align-items: center; justify-content: center;
    margin: 0 0 10px auto;
    background: var(--gray-50);
}
.cd-photo-placeholder { font-size: 48px; color: var(--gray-300); }

/* Notes */
.cd-notes {
    width: 100%; padding: 6px 8px; font-size: 12px;
    border: 1px solid var(--gray-300); border-radius: 2px;
    font-family: inherit; resize: vertical; color: var(--gray-700);
}
.cd-notes:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }

/* ── Bloc « Réception Email » ─────────────────────────────── */
.cd-recept {
    margin-top: 14px;
    border-top: 1px solid var(--gray-200);
    padding-top: 10px;
}
.cd-recept-title {
    font-weight: 600; font-size: 12px; color: var(--gray-600);
    text-transform: uppercase; letter-spacing: .03em; margin-bottom: 8px;
}
.cd-recept-title i { color: var(--primary); margin-right: 4px; }
.cd-recept-hint {
    text-transform: none; letter-spacing: normal; font-weight: 400;
    color: var(--gray-400); font-size: 11px;
}
.cd-recept-groups { display: flex; gap: 14px; align-items: flex-start; }
.cd-recept-group {
    flex: 1; min-width: 0;
    border: 1px solid var(--gray-300); border-radius: 4px; overflow: hidden;
}
.cd-recept-head {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 8px; background: var(--gray-50);
}
.cd-recept-toggle {
    background: none; border: none; cursor: pointer; padding: 2px 4px;
    color: var(--gray-500); font-size: 12px; flex: 0 0 auto;
    transition: transform .12s ease;
}
.cd-recept-group.cd-recept-open .cd-recept-toggle { transform: rotate(90deg); }
.cd-recept-masterlbl { font-weight: 600; color: var(--gray-700); flex: 1; min-width: 0; }
.cd-recept-count { color: var(--gray-400); font-weight: 400; font-size: 11px; }
.cd-recept-list {
    padding: 6px 8px; max-height: 220px; overflow-y: auto;
    border-top: 1px solid var(--gray-200);
    display: flex; flex-direction: column; gap: 3px;
}
.cd-recept-jou { font-size: 12px; }
.cd-recept-jou b { color: var(--gray-800); }
.cd-recept-jlib { color: var(--gray-500); }
.cd-recept-empty { color: var(--gray-400); font-size: 12px; font-style: italic; }

/* Footer */
.cd-footer {
    display: flex; justify-content: space-between;
    padding: 8px 16px;
    background: var(--gray-100); border-top: 1px solid var(--gray-300);
    border-radius: 0 0 6px 6px;
    font-size: 11px; color: var(--gray-500);
}
