/* Ein einheitlicher, großzügiger Dialog statt der kleinen Inline-Formulare. */
.sd-customer-modal {
    width: min(780px, calc(100vw - 36px));
    max-width: 780px;
    max-height: min(90dvh, 920px);
    padding: 0;
    border: 1px solid var(--border, #344054);
    border-radius: 20px;
    background: var(--panel, #111827);
    color: var(--text, #fff);
    box-shadow: 0 24px 84px rgba(0, 0, 0, .5);
    overflow: auto;
    overscroll-behavior: contain;
}
.sd-customer-modal::backdrop {
    background: rgba(3, 8, 19, .72);
    backdrop-filter: blur(7px);
}
.sd-customer-modal-shell {min-width: 0;}
.sd-customer-modal-header {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 22px 26px 18px;
    border-bottom: 1px solid var(--border, #344054);
    background: var(--panel, #111827);
}
.sd-customer-modal-caption {
    display: block;
    margin-bottom: 4px;
    color: var(--muted, #9ca3af);
    font-size: 12px;
    font-weight: 650;
}
.sd-customer-modal-title {margin: 0; font-size: 22px; line-height: 1.25;}
.sd-customer-modal-x {
    width: 38px;
    height: 38px;
    min-width: 38px;
    padding: 0;
    border: 1px solid var(--border, #344054);
    border-radius: 10px;
    background: transparent;
    color: var(--text, #fff);
    font-size: 26px;
    cursor: pointer;
}
.sd-customer-modal-body {display: grid; gap: 16px; padding: 24px 26px 28px; min-width: 0;}
.sd-customer-modal-body > form, .sd-customer-modal-body > div {width: 100%; min-width: 0;}
.sd-customer-modal-body form.inline-create-form,
.sd-customer-modal-body form.edit-inline-form,
.sd-customer-modal-body form.customer-detail-alias-form,
.sd-customer-modal-body form.dropzone-form,
.sd-customer-modal-body form.contact-photo-form,
.sd-customer-modal-body form.contact-phonebook-visibility {
    display: grid !important;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}
.sd-customer-modal-body form > input:not([type=hidden]),
.sd-customer-modal-body form > select,
.sd-customer-modal-body form > textarea,
.sd-customer-modal-body form > label,
.sd-customer-modal-body form > .dropzone-label,
.sd-customer-modal-body form > .dropzone-selected,
.sd-customer-modal-body form > .form-actions,
.sd-customer-modal-body form > .custom-entry-fields,
.sd-customer-modal-body form > .custom-data-entry-topline,
.sd-customer-modal-body form > .rt-field {width: 100%; min-width: 0; max-width: 100%;}
.sd-customer-modal-body form > .form-actions,
.sd-customer-modal-body form > .dropzone-selected,
.sd-customer-modal-body form > .custom-entry-fields,
.sd-customer-modal-body form > .rt-field,
.sd-customer-modal-body form > .custom-data-entry-topline,
.sd-customer-modal-body form > textarea,
.sd-customer-modal-body form > .contact-photo-controls {grid-column: 1 / -1;}
.sd-customer-modal-body form > input, .sd-customer-modal-body form > select,
.sd-customer-modal-body form > textarea {min-height: 44px; box-sizing: border-box;}
.sd-customer-modal-body .form-actions {display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 12px;}
.sd-customer-modal-body .form-actions > button {min-height: 40px;}
.sd-customer-modal-body .contact-photo-controls {
    display: grid;
    grid-template-columns: minmax(0,1fr);
    gap: 12px;
    padding: 15px;
    border: 1px solid var(--border, #344054);
    border-radius: 14px;
}
.sd-customer-modal-body .contact-photo-controls form {width: 100%; display: grid; gap: 9px;}
.sd-customer-modal-body .contact-phonebook-visibility {padding: 12px 0 !important; border-block: 1px solid var(--border, #344054) !important;}
.sd-customer-modal-body .customer-detail-alias-form input {width: 100%;}
.sd-customer-modal-body .rt-field {width: 100%;}
.sd-customer-modal-body .rt-editor {min-height: 310px; max-height: 60vh; overflow-y: auto;}
.sd-customer-modal-body .hidden-delete-form {display: none !important;}
.sd-customer-master-staged {display:none !important;}
.sd-customer-master-edit {margin-top: 8px; font-size: 12px; padding: 6px 12px;}
.sd-customer-modal-body :is(input, select, textarea, button):focus-visible {
    outline: 2px solid var(--primary, #3489ff);
    outline-offset: 2px;
}
@media (max-width: 650px) {
    .sd-customer-modal {width: 100vw; max-width: 100vw; max-height: 96dvh; margin: auto 0 0; border-radius: 20px 20px 0 0;}
    .sd-customer-modal-header {padding: 15px 18px;}
    .sd-customer-modal-body {padding: 18px;}
    .sd-customer-modal-body form.inline-create-form,
    .sd-customer-modal-body form.edit-inline-form,
    .sd-customer-modal-body form.customer-detail-alias-form,
    .sd-customer-modal-body form.dropzone-form,
    .sd-customer-modal-body form.contact-photo-form,
    .sd-customer-modal-body form.contact-phonebook-visibility {grid-template-columns: minmax(0, 1fr);}
    .sd-customer-modal-body form > * {grid-column: 1 / -1;}
    .sd-customer-modal-title {font-size: 19px;}
}
